Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
Loading...
Searching...
No Matches
projectoptionsmanager.cpp
Go to the documentation of this file.
2
4{
5 ui = UI_Window;
7
8 QObject::connect(ui->ExcludeFromProjectList, SIGNAL(checkStateChanged(Qt::CheckState)), this, SLOT(SetExcludeProjectList(Qt::CheckState)));
9 QObject::connect(ui->ControlDocAccess, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetControlDocAccess(Qt::CheckState)));
10 QObject::connect(ui->OnlyInfoPage, SIGNAL(toggled(bool)), this, SLOT(SetOnlyDefaultPage(bool)));
11 QObject::connect(ui->LimitToAssoc, SIGNAL(toggled(bool)), this, SLOT(SetGroupAccessOnly(bool)));
12 QObject::connect(ui->EnableDoxyOptions, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetEnableCustomDoxygen(Qt::CheckState)));
13 QObject::connect(ui->CaveatLector, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetCaveatLector(Qt::CheckState)));
14 QObject::connect(ui->PossiblyHazardous, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetPotentialHazard(Qt::CheckState)));
15 QObject::connect(ui->AssistanceWelcome, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetAssistanceWelcome(Qt::CheckState)));
16 QObject::connect(ui->DonationsWelcome, SIGNAL(checkStateChanged(Qt::CheckState)), this, SLOT(SetDonationsWelcome(Qt::CheckState)));
17 QObject::connect(ui->OfferPaypal, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetOfferPaypalDonation(Qt::CheckState)));
18 QObject::connect(ui->CreateSourceArchive, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetCreateSourceArchive(Qt::CheckState)));
19 QObject::connect(ui->UpdateGitRevision, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetUpdateGitRevision(Qt::CheckState)));
20 QObject::connect(ui->AutomaticInstall, SIGNAL(checkStateChanged(Qt::CheckState )), this, SLOT(SetAllowAutomaticInstall(Qt::CheckState)));
21}
22
24{
25 bool state = (bool)State;
26 uint mask = EXCLUDE_PROJECT_LIST;
27
28 SetOption(state, mask);
29}
30
32{
33 bool state = (bool)State;
34 uint mask = ONLY_DEFAULT_PAGE;
35
36 SetOption(state, mask);
37}
38
40{
41 bool state = (bool)State;
42 uint mask = CONTROL_DOC_ACCESS;
43
44 SetOption(state, mask);
45 if (!state)
46 {
47 ui->OnlyInfoPage->setCheckable(true);
48 }
49}
50
52{
53 bool state = (bool)State;
54 uint mask = GROUP_ACCESS_ONLY;
55
56 SetOption(state, mask);
57}
58
60{
61 bool state = (bool)State;
62 uint mask = ENABLE_CUSTOM_DOXYGEN;
63
64 SetOption(state, mask);
65}
66
68{
69 bool state = (bool)State;
70 uint mask = CAVEAT_LECTOR;
71
72 SetOption(state, mask);
73}
74
76{
77 bool state = (bool)State;
78 uint mask = POTENTIAL_HAZARD;
79
80 SetOption(state, mask);
81}
82
84{
85 bool state = (bool)State;
86 uint mask = ASSISTANCE_WELCOME;
87
88 SetOption(state, mask);
89}
90
92{
93 bool state = (bool)State;
94 uint mask = DONATIONS_WELCOME;
95
96 SetOption(state, mask);
97 if (!state)
98 {
99 ui->OfferPaypal->setChecked(false);
100 SetOfferPaypalDonation(Qt::Unchecked);
101 }
102}
103
105{
106 bool state = (bool)State;
107 uint mask = OFFER_PAYPAL_DONATION;
108 SetOption(state, mask);
109}
110
112{
113 bool state = (bool)State;
114 uint mask = CREATE_SOURCE_ARCHIVE;
115 SetOption(state, mask);
116}
117
119{
120 bool state = (bool)State;
121 uint mask = UPDATE_GIT_REVISION;
122 SetOption(state, mask);
123}
124
126{
127 bool state = (bool)State;
128 uint mask = ALLOW_AUTOMATIC_INSTALL;
129 SetOption(state, mask);
130}
131
132
133void ProjectOptionsManager::SetOption(bool State, int Mask)
134{
135 if (State) project_options |= Mask; else project_options &= ~Mask;
137}
138
140{
141 ui->ExcludeFromProjectList->setChecked(false);
142 ui->ControlDocAccess->setChecked(false);
143 ui->OnlyInfoPage->setChecked(true);
144 ui->EnableDoxyOptions->setChecked(false);
145 ui->CaveatLector->setChecked(false);
146 ui->PossiblyHazardous->setChecked(false);
147 ui->AssistanceWelcome->setChecked(false);
148 ui->DonationsWelcome->setChecked(false);
149 ui->OfferPaypal->setChecked(false);
150 ui->CreateSourceArchive->setChecked(false);
151 ui->AutomaticInstall->setChecked(false);
152 project_options = 0;
153
154 LogAdd(LOG_DEBUG, MODE_OPERATOR , "Cleared the Project Options on the Display");
155}
156
158{
159 REMOTE_LOG_ENTRY log_entry;
160 log_entry.Severity = Severity;
161 log_entry.Mode = Mode;
162 log_entry.Message = Message;
163 emit SendLogEntry(log_entry);
164}
165
170
172{
173 ui->ExcludeFromProjectList->setChecked(OptionState & EXCLUDE_PROJECT_LIST);
174 ui->ControlDocAccess->setChecked(OptionState & CONTROL_DOC_ACCESS);
175 ui->OnlyInfoPage->setChecked(OptionState & ONLY_DEFAULT_PAGE);
176 ui->LimitToAssoc->setChecked(OptionState & GROUP_ACCESS_ONLY);
177 ui->EnableDoxyOptions->setChecked(OptionState & ENABLE_CUSTOM_DOXYGEN);
178 ui->CaveatLector->setChecked(OptionState & CAVEAT_LECTOR);
179 ui->PossiblyHazardous->setChecked(OptionState & POTENTIAL_HAZARD);
180 ui->AssistanceWelcome->setChecked(OptionState & ASSISTANCE_WELCOME);
181 ui->DonationsWelcome->setChecked(OptionState & DONATIONS_WELCOME);
182 ui->OfferPaypal->setChecked(OptionState & OFFER_PAYPAL_DONATION);
183 ui->CreateSourceArchive->setChecked(OptionState & CREATE_SOURCE_ARCHIVE);
184 ui->AutomaticInstall->setChecked(OptionState & ALLOW_AUTOMATIC_INSTALL);
185
186 LogAdd(LOG_DEBUG, MODE_OPERATOR, "User Interface loaded with Project's State of Options");
187}
188
190{
191 uint option_state = 0;
192
193 if (ui->ExcludeFromProjectList->isChecked()) option_state |= EXCLUDE_PROJECT_LIST;
194 if (ui->ControlDocAccess->isChecked()) option_state |= CONTROL_DOC_ACCESS;
195 if (ui->OnlyInfoPage->isChecked()) option_state |= ONLY_DEFAULT_PAGE;
196 if (ui->LimitToAssoc->isChecked()) option_state |= GROUP_ACCESS_ONLY;
197 if (ui->EnableDoxyOptions->isChecked()) option_state |= ENABLE_CUSTOM_DOXYGEN;
198 if (ui->CaveatLector->isChecked()) option_state |= CAVEAT_LECTOR;
199 if (ui->PossiblyHazardous->isChecked()) option_state |= POTENTIAL_HAZARD;
200 if (ui->AssistanceWelcome->isChecked()) option_state |= ASSISTANCE_WELCOME;
201 if (ui->DonationsWelcome->isChecked()) option_state|= DONATIONS_WELCOME;
202 if (ui->OfferPaypal->isChecked()) option_state |= OFFER_PAYPAL_DONATION;
203 if (ui->CreateSourceArchive->isChecked()) option_state |= CREATE_SOURCE_ARCHIVE;
204 if (ui->AutomaticInstall->isChecked()) option_state |= ALLOW_AUTOMATIC_INSTALL;
205
206 LogAdd(LOG_DEBUG, MODE_OPERATOR, "Project's Encoded Options loaded into display");
207
208 return(option_state);
209}
210
212{
213 return(OptionState & EXCLUDE_PROJECT_LIST);
214}
215
217{
218 return(OptionState & GROUP_ACCESS_ONLY);
219}
220
222{
223 return(OptionState & ONLY_DEFAULT_PAGE);
224}
225
227{
228 return(OptionState & GROUP_ACCESS_ONLY);
229}
230
232{
233 return(OptionState & ENABLE_CUSTOM_DOXYGEN);
234}
235
237{
238 return(OptionState & CAVEAT_LECTOR);
239}
240
242{
243 return(OptionState & POTENTIAL_HAZARD);
244}
245
247{
248 return(OptionState & ASSISTANCE_WELCOME);
249}
251{
252 return(OptionState & DONATIONS_WELCOME);
253}
254
256{
257 return(OptionState & OFFER_PAYPAL_DONATION);
258}
259
261{
262 return(OptionState & CREATE_SOURCE_ARCHIVE);
263}
264
266{
267 return(OptionState & ALLOW_AUTOMATIC_INSTALL);
268}
269
271{
272 return(OptionState & UPDATE_GIT_REVISION);
273}
void SetCaveatLector(Qt::CheckState State)
Set Caveat Lector Option to desired State.
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
Add a Log Entry.
bool CheckGroupAccessOnly(uint Options)
Check if Group Access Only \Options Encoded List of Options.
void SetDonationsWelcome(Qt::CheckState State)
Set Donations Welcome Option to desired State.
void SetCreateSourceArchive(Qt::CheckState State)
bool CheckPotentialHazard(uint Options)
Check if Potential Hazard warning needed \Options Encoded List of Options.
void SetEnableCustomDoxygen(Qt::CheckState State)
Set Enable Custom Doxygen Option to desired State.
void SetPotentialHazard(Qt::CheckState State)
bool CheckCreateSourceArchive(uint OptionState)
Check if Source Archive is required \Options Encoded List of Options.
void SetAllowAutomaticInstall(Qt::CheckState State)
Set Allow Automatic Installation Option to desired State.
void SetUpdateGitRevision(Qt::CheckState State)
Set the Update Git Revision Option to desired state.
void ReadOptionState(uint OptionState)
Read & Decode the Options, and set ser Interface.
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
Send Log Entry to the Log \LogEntry Structure holding Log information.
void SendOptionState(uint ProjectOptions)
Set the Project's Options State.
bool CheckOnlyDefaultPage(uint Options)
Check if make Only Default Page \Options Encoded List of Options.
void SetControlDocAccess(Qt::CheckState State)
Set Doc Access Option to desired State.
bool CheckAutomaticGit(uint OptionState)
void SetOfferPaypalDonation(Qt::CheckState State)
Set Paypal Donation Option to desired State.
bool CheckExcludeProjectList(uint Options)
Check if Project is Excluded from List \Options Encoded List of Options.
void SetOnlyDefaultPage(bool State)
Set Only Default Page Option to desired State.
void ReadProjectId(PROJECT_INFORMATION *ProjectInfo)
Read Project's Options from Database & set User Interface.
ProjectOptionsManager(Ui::MainWindow *UI_Window)
ProjectOptionsManager Constructor.
bool ChecktDonationsWelcome(uint Options)
Check if Donations Welcome message needed \Options Encoded List of Options.
bool CheckCaveatLector(uint Options)
Check if Caveat Emptor warning needed \Options Encoded List of Options.
void SetExcludeProjectList(Qt::CheckState State)
Set Exclude Project Option to desired State.
void SetGroupAccessOnly(bool State)
bool CheckAssistanceWelcome(uint Options)
Check if Assistance Welcome message needed \Options Encoded List of Options.
uint project_options
Encoded Project Options Storage.
bool CheckOfferPaypalDonation(uint Options)
Check if Paypal Donations available message needed \Options Encoded List of Options.
void DoClear(void)
Clear All Options in User Interface.
bool CheckControlDocAccess(uint Options)
Check if Document Access Control is Enabled \Options Encoded List of Options.
uint WriteOptionState(void)
Get the Options Encoded from User Interface.
void SetAssistanceWelcome(Qt::CheckState State)
Set Assistance Welcom Option to desired State.
bool CheckEnableCustomDoxygen(uint Options)
Check if Custom Doxygen Settings Enabled \Options Encoded List of Options.
void SetOption(bool State, int Mask)
Set the Project's Selected Option to the Required State.
bool CheckAutomaticInstall(uint OptionState)
Check if Auto Install script is required \Options Encoded List of Options.
#define ENABLE_CUSTOM_DOXYGEN
Enable Custom Doxygen Definitions Mask.
#define CAVEAT_LECTOR
Display User Warning Mask.
#define ALLOW_AUTOMATIC_INSTALL
#define UPDATE_GIT_REVISION
#define EXCLUDE_PROJECT_LIST
Exclude Project from Public List Mask.
#define DONATIONS_WELCOME
Display Donations Welcome Mask.
#define OFFER_PAYPAL_DONATION
Display Paypal Available Mask.
#define CONTROL_DOC_ACCESS
Control Document Access to Public Mask.
#define POTENTIAL_HAZARD
Display Potential Harzard Mask.
#define ASSISTANCE_WELCOME
Display Assistance Welcome Mask.
#define ONLY_DEFAULT_PAGE
Only Display Default Page to Public Mask.
#define GROUP_ACCESS_ONLY
restrict Public Access Mask
#define CREATE_SOURCE_ARCHIVE
Create a SOurce Archive when Documentation Generated.
LOGGING_SEVERITY
Log Severity allow the selection of logging events based on Severity.
Definition logger.h:48
@ LOG_DEBUG
Definition logger.h:56
LOGGING_MODE
Log Severity allow the selection of logging events based on the mode.
Definition logger.h:21
@ MODE_OPERATOR
Definition logger.h:34
Class Controlling the Database Creation.
Project Information Passed Between Functions.
PROJECT_DESCRIPTION ProjectDesc
Definition logger.h:60
LOGGING_MODE Mode
Definition logger.h:61
QString Message
Definition logger.h:63
LOGGING_SEVERITY Severity
Definition logger.h:62