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 QObject::connect (ui->CreatePublishList,
22 SIGNAL (checkStateChanged (Qt::CheckState)), this,
23 SLOT (SetCreatePublishList (Qt::CheckState)));
24}
25
27{
28 bool state = (bool)State;
29 uint mask = EXCLUDE_PROJECT_LIST;
30
31 SetOption(state, mask);
32}
33
35{
36 bool state = (bool)State;
37 uint mask = ONLY_DEFAULT_PAGE;
38
39 SetOption(state, mask);
40}
41
43{
44 bool state = (bool)State;
45 uint mask = CONTROL_DOC_ACCESS;
46
47 SetOption(state, mask);
48 if (!state)
49 {
50 ui->OnlyInfoPage->setCheckable(true);
51 }
52}
53
55{
56 bool state = (bool)State;
57 uint mask = GROUP_ACCESS_ONLY;
58
59 SetOption(state, mask);
60}
61
63{
64 bool state = (bool)State;
65 uint mask = ENABLE_CUSTOM_DOXYGEN;
66
67 SetOption(state, mask);
68}
69
71{
72 bool state = (bool)State;
73 uint mask = CAVEAT_LECTOR;
74
75 SetOption(state, mask);
76}
77
79{
80 bool state = (bool)State;
81 uint mask = POTENTIAL_HAZARD;
82
83 SetOption(state, mask);
84}
85
87{
88 bool state = (bool)State;
89 uint mask = ASSISTANCE_WELCOME;
90
91 SetOption(state, mask);
92}
93
95{
96 bool state = (bool)State;
97 uint mask = DONATIONS_WELCOME;
98
99 SetOption(state, mask);
100 if (!state)
101 {
102 ui->OfferPaypal->setChecked(false);
103 SetOfferPaypalDonation(Qt::Unchecked);
104 }
105}
106
108{
109 bool state = (bool)State;
110 uint mask = OFFER_PAYPAL_DONATION;
111 SetOption(state, mask);
112}
113
115{
116 bool state = (bool)State;
117 uint mask = CREATE_SOURCE_ARCHIVE;
118 SetOption(state, mask);
119}
120
122{
123 bool state = (bool)State;
124 uint mask = UPDATE_GIT_REVISION;
125 SetOption(state, mask);
126}
127
129{
130 bool state = (bool)State;
131 uint mask = ALLOW_AUTOMATIC_INSTALL;
132 SetOption(state, mask);
133}
134
135
136void ProjectOptionsManager::SetOption(bool State, int Mask)
137{
138 if (State) project_options |= Mask; else project_options &= ~Mask;
140}
141
143{
144 ui->ExcludeFromProjectList->setChecked(false);
145 ui->ControlDocAccess->setChecked(false);
146 ui->OnlyInfoPage->setChecked(true);
147 ui->EnableDoxyOptions->setChecked(false);
148 ui->CaveatLector->setChecked(false);
149 ui->PossiblyHazardous->setChecked(false);
150 ui->AssistanceWelcome->setChecked(false);
151 ui->DonationsWelcome->setChecked(false);
152 ui->OfferPaypal->setChecked(false);
153 ui->CreateSourceArchive->setChecked(false);
154 ui->AutomaticInstall->setChecked(false);
155 project_options = 0;
156
157 LogAdd(LOG_DEBUG, MODE_OPERATOR , "Cleared the Project Options on the Display");
158}
159
161{
162 REMOTE_LOG_ENTRY log_entry;
163 log_entry.Severity = Severity;
164 log_entry.Mode = Mode;
165 log_entry.Message = Message;
166 emit SendLogEntry(log_entry);
167}
168
173
175{
176 ui->ExcludeFromProjectList->setChecked(OptionState & EXCLUDE_PROJECT_LIST);
177 ui->ControlDocAccess->setChecked(OptionState & CONTROL_DOC_ACCESS);
178 ui->OnlyInfoPage->setChecked(OptionState & ONLY_DEFAULT_PAGE);
179 ui->LimitToAssoc->setChecked(OptionState & GROUP_ACCESS_ONLY);
180 ui->EnableDoxyOptions->setChecked(OptionState & ENABLE_CUSTOM_DOXYGEN);
181 ui->CaveatLector->setChecked(OptionState & CAVEAT_LECTOR);
182 ui->PossiblyHazardous->setChecked(OptionState & POTENTIAL_HAZARD);
183 ui->AssistanceWelcome->setChecked(OptionState & ASSISTANCE_WELCOME);
184 ui->DonationsWelcome->setChecked(OptionState & DONATIONS_WELCOME);
185 ui->OfferPaypal->setChecked(OptionState & OFFER_PAYPAL_DONATION);
186 ui->CreateSourceArchive->setChecked(OptionState & CREATE_SOURCE_ARCHIVE);
187 ui->AutomaticInstall->setChecked(OptionState & ALLOW_AUTOMATIC_INSTALL);
188
189 LogAdd(LOG_DEBUG, MODE_OPERATOR, "User Interface loaded with Project's State of Options");
190}
191
193{
194 uint option_state = 0;
195
196 if (ui->ExcludeFromProjectList->isChecked()) option_state |= EXCLUDE_PROJECT_LIST;
197 if (ui->ControlDocAccess->isChecked()) option_state |= CONTROL_DOC_ACCESS;
198 if (ui->OnlyInfoPage->isChecked()) option_state |= ONLY_DEFAULT_PAGE;
199 if (ui->LimitToAssoc->isChecked()) option_state |= GROUP_ACCESS_ONLY;
200 if (ui->EnableDoxyOptions->isChecked()) option_state |= ENABLE_CUSTOM_DOXYGEN;
201 if (ui->CaveatLector->isChecked()) option_state |= CAVEAT_LECTOR;
202 if (ui->PossiblyHazardous->isChecked()) option_state |= POTENTIAL_HAZARD;
203 if (ui->AssistanceWelcome->isChecked()) option_state |= ASSISTANCE_WELCOME;
204 if (ui->DonationsWelcome->isChecked()) option_state|= DONATIONS_WELCOME;
205 if (ui->OfferPaypal->isChecked()) option_state |= OFFER_PAYPAL_DONATION;
206 if (ui->CreateSourceArchive->isChecked()) option_state |= CREATE_SOURCE_ARCHIVE;
207 if (ui->AutomaticInstall->isChecked()) option_state |= ALLOW_AUTOMATIC_INSTALL;
208
209 LogAdd(LOG_DEBUG, MODE_OPERATOR, "Project's Encoded Options loaded into display");
210
211 return(option_state);
212}
213
215{
216 return(OptionState & EXCLUDE_PROJECT_LIST);
217}
218
220{
221 return(OptionState & GROUP_ACCESS_ONLY);
222}
223
225{
226 return(OptionState & ONLY_DEFAULT_PAGE);
227}
228
230{
231 return(OptionState & GROUP_ACCESS_ONLY);
232}
233
235{
236 return(OptionState & ENABLE_CUSTOM_DOXYGEN);
237}
238
240{
241 return(OptionState & CAVEAT_LECTOR);
242}
243
245{
246 return(OptionState & POTENTIAL_HAZARD);
247}
248
250{
251 return(OptionState & ASSISTANCE_WELCOME);
252}
254{
255 return(OptionState & DONATIONS_WELCOME);
256}
257
259{
260 return(OptionState & OFFER_PAYPAL_DONATION);
261}
262
264{
265 return(OptionState & CREATE_SOURCE_ARCHIVE);
266}
267
268bool
270{
271 return (OptionState & CREATE_PUBLISH_LIST);
272}
273
275{
276 return(OptionState & ALLOW_AUTOMATIC_INSTALL);
277}
278
280{
281 return(OptionState & UPDATE_GIT_REVISION);
282}
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.
bool CheckCreatePublishList(uint OptionState)
Check if Automatic Publish List is required \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 CREATE_PUBLISH_LIST
Create a SOurce Archive when Documentation Generated.
#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