Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
Loading...
Searching...
No Matches
projectlistmanager.cpp
Go to the documentation of this file.
3#include "doxygenmanager.h"
4#include "readprojectinfo.h"
5#include "projectsubstitute.h"
6#include "logger.h"
7
8#include <QHBoxLayout>
9
14
16{
17 ProjectList.clear();
18 ui = UI_Window;
19 QObject::connect(ui->AutoInstallOff, SIGNAL(pressed()), this, SLOT(PressedInstallOff()));
20 QObject::connect(ui->AutoInstallOn, SIGNAL(pressed()), this, SLOT(PressedInstallOn()));
21
22 QObject::connect(ui->AutoArchiveOff, SIGNAL(pressed()), this, SLOT(PressedArchiveOff()));
23 QObject::connect(ui->AutoArchiveOn, SIGNAL(pressed()), this, SLOT(PressedArchiveOn()));
24
25 base_project_query = QString("select project_index from project where project_index != 1");
26
27 ui->ProjectTableWidget->setColumnCount( TABLE_COLUMN_COUNT );
29
30 ui->ProjectTableWidget->setHorizontalHeaderLabels( QStringList( {"Proj. Ident", "Proj. Name", "Target", "Status", "Proj. Contact", "Brief Desc.", "Dev. Family", "Comp. Lang.", "Assoc Group",
31 "S/W Licence", "H/W Licence", "Doc Licence", "Inst", "Arch", "Publish"} ));
32
33 ui->ProjectTableWidget->setColumnWidth( PROJECT_IDENT_COLUMN, PROJECT_IDENT_SIZE );
34 ui->ProjectTableWidget->setColumnWidth( PROJECT_NAME_COLUMN, PROJECT_NAME_SIZE );
35 ui->ProjectTableWidget->setColumnWidth( TARGET_FAMILY_COLUMN, TARGET_FAMILY_SIZE );
36 ui->ProjectTableWidget->setColumnWidth( PROJECT_CONTACT_COLUMN, PROJECT_CONTACT_SIZE );
37 ui->ProjectTableWidget->setColumnWidth( PROJECT_STATUS_COLUMN, PROJECT_STATUS_SIZE);
38 ui->ProjectTableWidget->setColumnWidth( BRIEF_DESC_COLUMN, BRIEF_DESC_SIZE );
39 ui->ProjectTableWidget->setColumnWidth( DEV_FAMILY_COLUMN, DEV_FAMILY_SIZE );
40 ui->ProjectTableWidget->setColumnWidth( COMPILER_FAMILY_COLUMN, COMPILER_FAMILY_SIZE );
41 ui->ProjectTableWidget->setColumnWidth( ASSOCIATION_COLUMN, ASSOCIATION_SIZE );
42 ui->ProjectTableWidget->setColumnWidth( SOFTWARE_LICENCE_COLUMN, SOFTWARE_LICENCE_SIZE );
43 ui->ProjectTableWidget->setColumnWidth( HARDWARE_LICENCE_COLUMN, HARDWARE_LICENCE_SIZE );
44 ui->ProjectTableWidget->setColumnWidth( DOC_LICENCE_COLUMN, DOC_LICENCE_SIZE );
45 ui->ProjectTableWidget->setColumnWidth( ARCHIVE_BUTTON_COLUMN, ARCHIVE_BUTTON_SIZE );
46 ui->ProjectTableWidget->setColumnWidth( INSTALL_BUTTON_COLUMN, INSTALL_BUTTON_SIZE );
47 ui->ProjectTableWidget->setColumnWidth( PUBLISH_BUTTON_COLUMN, PUBLISH_BUTTON_SIZE );
48}
49
50
55
56
58{
59 QString list_table_string;
60
61 switch( Index )
62 {
64 break;
65
68 list_table_string = MakeHTMLProjectPage(ui->ProjectListHeaderFile->text(), ui->ProjectListFooterFile->text(), ui->ProjectListLineFile->text(), true);
69 WriteTextFile(ui->PrimaryWebsiteDirectory->text() + "/projects/" + ui->ProjectListWebTableFile->text(), list_table_string);
70 list_table_string = MakeOSProjectPage();
71 WriteTextFile(ui->PrimaryWebsiteDirectory->text() + "/projects/" + ui->ProjectOSListName->text(), list_table_string);
72 break;
73
75 break;
76
77 case LOG_TAB:
78 break;
79
80 case LICENCE_ACK_TAB:
81 break;
82 }
83}
84
89
91{
92 ProjectList.clear();
94 QString sort_type;
95 sort_type = QString(" order by project_ident desc");
96 QString query_string = base_project_query + sort_type;
97
98 // Clear the Table Widget before Starting to Add Projects
99 ui->ProjectTableWidget->clearContents();
100 ui->ProjectTableWidget->setEnabled(true);
101
102 // Search for the Project List
103 QSqlQuery project_query(query_string);
104
105 int row = 0;
106 while( project_query.next())
107 {
108 PROJECT_INFORMATION* project_file_info = new PROJECT_INFORMATION;
109
110 // Load all of the Data about this Project
111 read_project_info->LoadProjectInfo(project_file_info, project_query.value(0).toInt(), ui->ProjectPrefix->currentIndex() + 1);
112 project_subs_manager->LoadFileSubsList(project_file_info);
113 ProjectList.append(project_file_info);
114
115 // Make A Table Widget for the Project Identifier and Insert
116 QTableWidgetItem *new_project_ident = new QTableWidgetItem(project_file_info->ProjectDesc.ProjectIdent);
117 new_project_ident->setFlags(new_project_ident->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
118 ui->ProjectTableWidget->setItem( row, PROJECT_IDENT_COLUMN, new_project_ident );
119 PrStateChange (project_file_info);
120
121 // Make A Table Widget for the Project Name and Insert
122 QTableWidgetItem *new_project_name = new QTableWidgetItem(project_file_info->ProjectDesc.ProjectName);
123 new_project_name->setFlags(new_project_name->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
124 ui->ProjectTableWidget->setItem( row, PROJECT_NAME_COLUMN, new_project_name );
125
126 // Make A Table Widget for the Target System and Insert
127 QTableWidgetItem *new_target_system = new QTableWidgetItem(project_file_info->TargetFamilyInfo.ShortName);
128 new_target_system->setFlags(new_target_system->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
129 ui->ProjectTableWidget->setItem( row, TARGET_FAMILY_COLUMN, new_target_system );
130
131 // Get the DEveloper Name, Create Table Widget and Insert in Table
132 QTableWidgetItem *new_project_contact = new QTableWidgetItem(project_file_info->Developer.Name);
133 new_project_contact->setFlags(new_project_contact->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
134 ui->ProjectTableWidget->setItem( row, PROJECT_CONTACT_COLUMN, new_project_contact );
135
136 // Get the Project Status Name, Create Table Widget and Insert in Table
137 QTableWidgetItem *new_project_status = new QTableWidgetItem(project_file_info->StatusInfo.StatusName);
138 new_project_status->setFlags(new_project_status->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
139 ui->ProjectTableWidget->setItem( row, PROJECT_STATUS_COLUMN, new_project_status );
140
141 // Get the Brief Description, Create Table Widget and Insert in Table
142 QTableWidgetItem *new_brief_desc = new QTableWidgetItem(project_file_info->ProjectDesc.BriefDescription);
143 new_brief_desc->setFlags(new_project_ident->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
144 ui->ProjectTableWidget->setItem( row, BRIEF_DESC_COLUMN, new_brief_desc );
145
146 // Get the Development Family, Create Table Widget and Insert in Table
147 QTableWidgetItem *new_dev_family = new QTableWidgetItem(project_file_info->DevFamilyInfo.ShortName);
148 new_dev_family->setFlags(new_dev_family->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
149 ui->ProjectTableWidget->setItem( row, DEV_FAMILY_COLUMN, new_dev_family );
150
151 // Get the Compiler Family, Create Table Widget and Insert in Table
152 QTableWidgetItem *new_comp_family = new QTableWidgetItem(project_file_info->LangFamilyInfo.ShortName);
153 new_comp_family->setFlags(new_comp_family->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
154 ui->ProjectTableWidget->setItem( row, COMPILER_FAMILY_COLUMN, new_comp_family );
155
156 // Get the Association Family, Create Table Widget and Insert in Table
157 QTableWidgetItem *new_assoc_family = new QTableWidgetItem(project_file_info->InAssocInfo.ShortName);
158 new_assoc_family->setFlags(new_assoc_family->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
159 ui->ProjectTableWidget->setItem( row, ASSOCIATION_COLUMN, new_assoc_family );
160
161 // Get the Software Licence, Create Table Widget and Insert in Table
162 QTableWidgetItem *new_software_licence = new QTableWidgetItem(project_file_info->SoftwareLicence.ShortName);
163 new_software_licence->setFlags(new_software_licence->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
164 ui->ProjectTableWidget->setItem( row, SOFTWARE_LICENCE_COLUMN, new_software_licence );
165
166 // Get the Software Licence, Create Table Widget and Insert in Table
167 QTableWidgetItem *new_hardware_licence = new QTableWidgetItem(project_file_info->HardwareLicence.ShortName);
168 new_hardware_licence->setFlags(new_hardware_licence->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
169 ui->ProjectTableWidget->setItem( row, HARDWARE_LICENCE_COLUMN, new_hardware_licence );
170
171 // Get the Documentation Licence, Create Table Widget and Insert in Table
172 QTableWidgetItem *new_doc_licence = new QTableWidgetItem(project_file_info->DocLicence.ShortName);
173 new_doc_licence->setFlags(new_doc_licence->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
174 ui->ProjectTableWidget->setItem( row, DOC_LICENCE_COLUMN, new_doc_licence );
175 QWidget *check_box_widget1 = new QWidget();
176 QCheckBox *install_button = new QCheckBox();
177 install_button->setText("");
178 install_button->setChecked((project_file_info->ProjectDesc.ProjectOptions & ALLOW_AUTOMATIC_INSTALL));
179 install_button->setCheckable((project_file_info->ProjectDesc.ProjectOptions & ALLOW_AUTOMATIC_INSTALL));
180 QHBoxLayout *layout_check_box1 = new QHBoxLayout( check_box_widget1 );
181 layout_check_box1->addWidget(install_button); //add QCheckBox to layout
182 layout_check_box1->setAlignment(Qt::AlignCenter); //set Alignment layout
183 layout_check_box1->setContentsMargins(0,0,0,0);
184 ui->ProjectTableWidget->setCellWidget( row, INSTALL_BUTTON_COLUMN, check_box_widget1);
185
186 QWidget *check_box_widget2 = new QWidget();
187 QCheckBox *archive_button = new QCheckBox();
188 archive_button->setText("");
189 archive_button->setChecked((project_file_info->ProjectDesc.ProjectOptions & CREATE_SOURCE_ARCHIVE));
190 archive_button->setCheckable((project_file_info->ProjectDesc.ProjectOptions & CREATE_SOURCE_ARCHIVE));
191 QHBoxLayout *layout_check_box2 = new QHBoxLayout( check_box_widget2 );
192 layout_check_box2->addWidget(archive_button); //add QCheckBox to layout
193 layout_check_box2->setAlignment(Qt::AlignCenter); //set Alignment layout
194 layout_check_box2->setContentsMargins(0,0,0,0);
195 ui->ProjectTableWidget->setCellWidget( row, ARCHIVE_BUTTON_COLUMN, check_box_widget2);
196
197 QWidget *check_box_widget3 = new QWidget();
198 QCheckBox *publish_button = new QCheckBox();
199 archive_button->setText("");
200 QHBoxLayout *layout_check_box3 = new QHBoxLayout( check_box_widget3 );
201 layout_check_box3->addWidget(publish_button); //add QCheckBox to layout
202 layout_check_box3->setAlignment(Qt::AlignCenter); //set Alignment layout
203 layout_check_box3->setContentsMargins(0,0,0,0);
204 ui->ProjectTableWidget->setCellWidget( row, PUBLISH_BUTTON_COLUMN, check_box_widget3);
205
206 // Next Row
207 row++;
208 }
209 ui->ProjectTableWidget->setEnabled(true);
210}
211
213{
214 int current_row_count = ui->ProjectTableWidget->rowCount();
215 int project_count = 0;
216
217 QString count_query = "select count(*) from project";
218 QSqlQuery project_counter(count_query);
219 while (project_counter.next())
220 {
221 project_count = project_counter.value(0).toInt();
222 }
223 int increased_project_count = project_count - 1;
224 if (current_row_count < increased_project_count) ui->ProjectTableWidget->setRowCount(increased_project_count);
225}
226
228{
229 int index = ui->ProjectTableWidget->currentRow();
230 if ((index > 1) && (ui->ProjectTableWidget->item (index, 0) != nullptr)
231 && (ui->ProjectTableWidget->item (index, 0)->text () != ""))
232 {
233 ProjectList[index]->ProjectDesc.ProjectSelections = FindSelections(index);
234 doxy_manager->ProcessProject (ProjectList[index]);
235 }
236}
237
239{
240 int selections = 0;
241
242 QCheckBox* check_widget = (QCheckBox*)ui->ProjectTableWidget->cellWidget(index, ARCHIVE_BUTTON_COLUMN);
243 if (check_widget->isChecked())
244 {
245 selections |= CREATE_SOURCE_ARCHIVE;
246 }
247
248 check_widget = (QCheckBox*)ui->ProjectTableWidget->cellWidget(index, INSTALL_BUTTON_COLUMN);
249 if (check_widget->isChecked())
250 {
251 selections |= INSTALL_SCRIPT_MASK;
252 }
253
254 check_widget = (QCheckBox*)ui->ProjectTableWidget->cellWidget(index, PUBLISH_BUTTON_COLUMN);
255 if (check_widget->isChecked())
256 {
257 selections |= INSTALL_SCRIPT_MASK;
258 }
259
260
261 return(selections);
262}
263
265{
266 int row_count = ui->ProjectTableWidget->rowCount();
267 for ( int index = 0; (index < row_count) && ( ui->ProjectTableWidget->item( index, 0 ) != nullptr) ; ++index )
268 {
269 if ( ( ui->ProjectTableWidget->item( index, 0 ) != nullptr) && ( ui->ProjectTableWidget->item( index, 0 )->text() != "") )
270 {
271 doxy_manager->ProcessProject(ProjectList[index]);
272 }
273 }
274}
275
276void ProjectListManager::LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
277{
278 REMOTE_LOG_ENTRY log_entry;
279 log_entry.Severity = Severity;
280 log_entry.Mode = Mode;
281 log_entry.Message = Message;
282 emit SendLogEntry(log_entry);
283}
284
286{
287 QString project_line;
288 QString project_table_opensim;
289
290 // Retreive the List of Projects
291 QString query_string = base_project_query;
292 QSqlQuery project_query(query_string + " order by project_name");
293
294 // Step Through the List of Projects
295 while( project_query.next())
296 {
297 PROJECT_INFORMATION* project_info = new PROJECT_INFORMATION;
298 read_project_info->LoadProjectInfo(project_info, project_query.value(0).toInt(), ui->ProjectPrefix->currentIndex() + 1);
299
300 uint options = project_info->ProjectDesc.ProjectOptions;
301 if ((options & (1 <<EXCLUDE_PROJECT_LIST_BIT)) == 0)
302 {
303 QString project_address = project_info->ProgramInformation.SiteURL + "/project_dynamic/" + project_info->ProjectDesc.ProjectIdent + "/html/index.html";
304 QString project_logo = project_info->ProgramInformation.SiteURL + "/project_dynamic/" + project_info->ProjectDesc.ProjectIdent + "/images/os_logo.png";
305 project_line = project_info->ProjectDesc.ProjectName + "=" + project_address + "=" + project_logo + "\r\n";
306 project_table_opensim += project_line;
307 }
308 delete project_info;
309 }
310 return(project_table_opensim);
311}
312
313QString ProjectListManager::MakeHTMLProjectPage(QString HeaderTemplateFile, QString FooterTemplateFile, QString LineTemplateFile, bool TableOnly)
314{
315 QString project_html_header;
316 QString project_html_line;
317 QString project_html_footer;
318
319 QString project_line;
320 QString project_table_html;
321
322 // Substitution Strings
323 QString p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, pa, pb, pc;
324
325
326 if (QFileInfo::exists(HeaderTemplateFile) && !TableOnly)
327 {
328 project_html_line = ReadTableTemplate(HeaderTemplateFile);
329 LogAdd(LOG_DEBUG, MODE_FILE, QString("Read Project List Header Template %1.").arg(HeaderTemplateFile));
330 }
331 else
332 {
333 // Initialise the HTML Table Header Template with Default
334 if (!TableOnly)
335 {
336 project_html_header =
337 QString("<!doctype html><html lang=\"en-au\">") +
338 QString("<head><meta charset=\"utf-8\">") +
339 QString("<title>Brigadoon Project List</title>") +
340 QString("<meta name=\"author\" content=\"RiverPirate\">") +
341 QString("<meta name=\"robots\" content=\"index, follow\">") +
342 QString("<meta name=\"revisit-after\" content=\"30 days\">") +
343 QString("<meta name=\"generator\" content=\"ProjectManager\">") +
344 QString("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">") +
345 QString("</head>") +
346 QString("<body>");
347 }
348 project_html_header +=
349 QString("<div Class=\"Title\">") +
350 QString("<span style=\"color:#000000;font-family:Arial;font-size:100px;\">BRIGADOON</span>") +
351 QString("</div>") +
352 QString("<DIV CLASS=\"ProjListTable\">") +
353 QString("<TABLE WIDTH=\"100%\" BORDER=\"1\"><TR>") +
354 QString("<TH>Prj. Ident.</TH><TH>Prj. Name</TH><TH>Target</TH><TH>Stat.</TH><TH>Contact</TH><TH>Brief Description</TH>") +
355 QString("<TH>Dev. Fam.</TH><TH>Comp. Lang.</TH><TH>Assoc. Grp.</TH>") +
356 QString("<TH>S/W Lic.</TH><TH>H/W Lic.</TH><TH>Doc.Lic.</TH>") +
357 QString("</TR>");
358
359 LogAdd(LOG_INFO, MODE_FILE, QString("Unable to Read Project List Header Template %1, using Default Template.").arg(HeaderTemplateFile));
360 }
361
362 if (QFileInfo::exists(LineTemplateFile))
363 {
364 project_html_line = ReadTableTemplate(LineTemplateFile);
365 LogAdd(LOG_DEBUG, MODE_FILE, QString("Read Project List Line Template %1.").arg(LineTemplateFile));
366 }
367 else
368 {
369 project_html_line =
370 QString("<TR>") +
371 QString("<TD>%1</TD><TD>%2</TD><TD>%3</TD><TD>%4</TD>") +
372 QString("<TD>%5</TD><TD>%6</TD><TD>%7</TD><TD>%8</TD>") +
373 QString("<TD>%9</TD><TD>%10</TD><TD>%11</TD><TD>%12</TD>") +
374 QString("</TR>");
375 LogAdd(LOG_INFO, MODE_FILE, QString("Unable to Read Project List Line Template %1, using Default Template.").arg(LineTemplateFile));
376 }
377
378 if (QFileInfo::exists(FooterTemplateFile))
379 {
380 project_html_line = ReadTableTemplate(FooterTemplateFile);
381 LogAdd(LOG_DEBUG, MODE_FILE, QString("Read Project List Footer Template %1.").arg(FooterTemplateFile));
382 }
383 else
384 {
385 project_html_footer = QString("</TABLE></DIV>");
386 if (!TableOnly) project_html_footer += "</BODY></HTML>";
387
388 LogAdd(LOG_INFO, MODE_FILE, QString("Unable to Read Project List Footer Template %1, using Default Template.").arg(FooterTemplateFile));
389 }
390
391 // Start Creating table
392 project_table_html = project_html_header;
393
394 // Retreive the List of Projects
395 QString query_string = base_project_query;
396 QSqlQuery project_query(query_string + " order by project_index desc");
397
398 // Step Through the List of Projects
399 while( project_query.next())
400 {
401 PROJECT_INFORMATION* project_info = new PROJECT_INFORMATION;
402
403 // Load all of the Data about this Project
404 read_project_info->LoadProjectInfo(project_info, project_query.value(0).toInt(), ui->ProjectPrefix->currentIndex() + 1);
405
406 if (!(project_info->ProjectDesc.ProjectOptions & EXCLUDE_PROJECT_LIST))
407 {
408
409 // Get the Project's URL and Project Identifier
410 pa = project_info->ProgramInformation.SiteURL + "/project_dynamic/" + project_info->ProjectDesc.ProjectIdent + "/html/index.html";
411 pb = project_info->ProjectDesc.ProjectIdent;
412 p1 = QString("<A HREF=\"")+pa + "\">" + pb + "</A>";
413
414 // Make A Table Widget for the Project Name and Insert
415 p2 = project_info->ProjectDesc.ProjectName;
416
417 // Get the Name of the target System
418 p3 = project_info->TargetFamilyInfo.ShortName;
419
420 // Get the Project Status Name, Create Table Widget and Insert in Table
421 p4 = project_info->StatusInfo.StatusName;
422
423 // Get the Developer Name, Create Table Widget and Insert in Table
424 pa = project_info->Developer.Email;
425 pb = project_info->Developer.Handle;
426 pc = project_info->ProjectDesc.ProjectIdent;
427 p5 = QString("<A HREF=\"mailto:") + pa +"?subject=re: " + pc + " Project.\">" + pb + "</A>";
428
429 // Get the Brief Description, Create Table Widget and Insert in Table
430 p6 = project_info->ProjectDesc.BriefDescription;
431
432 // Get the Development Family, Create Table Widget and Insert in Table
433 p7 = project_info->DevFamilyInfo.ShortName;
434
435 // Get the Language Family, Create Table Widget and Insert in Table
436 p8 = project_info->LangFamilyInfo.ShortName;
437
438 // Get the Association Family, Create Table Widget and Insert in Table
439 pa = project_info->InAssocInfo.ShortName;
440 if (project_info->InAssocInfo.InAssociationIndex != 0)
441 {
442 pb = project_info->InAssocInfo.AssociationURL;
443 p9 = QString("<A HREF=\"")+ pb + QString("\" target=\"_blank\">") + pa + "</A>";
444 }
445 else
446 {
447 p9 = pa;
448 }
449
450 // Get the Software Licence, Create Table Widget and Insert in Table
451 pa = project_info->SoftwareLicence.ShortName;
452 if( project_info->SoftwareLicence.LicenceIndex != 14)
453 {
454 pb = project_info->SoftwareLicence.LicenceURL;
455 p10 = QString("<A HREF=\"")+ pb + QString("\" target=\"_blank\">") + pa + "</A>";
456 }
457 else
458 {
459 p10 = pa;
460 }
461
462 // Get the Hardware Licence, Create Table Widget and Insert in Table
463 pa = project_info->HardwareLicence.ShortName;
464 if( project_info->HardwareLicence.LicenceIndex != 14)
465 {
466 pb = project_info->HardwareLicence.LicenceURL;
467 p11 = QString("<A HREF=\"")+ pb + QString("\" target=\"_blank\">") + pa + "</A>";
468 }
469 else
470 {
471 p11 = pa;
472 }
473
474 // Get the Documentation Licence, Create Table Widget and Insert in Table
475 pa = project_info->DocLicence.ShortName;
476 if( project_info->DocLicence.LicenceIndex != 14)
477 {
478 pb = project_info->DocLicence.LicenceURL;
479 p12 = QString("<A HREF=\"")+ pb + QString("\" target=\"_blank\">") + pa + "</A>";
480 }
481 else
482 {
483 p12 = pa;
484 }
485
486 project_line = project_html_line.arg(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
487 project_table_html += project_line;
488 }
489 }
490 project_table_html += project_html_footer;
491
492 // Write the Table Out to a File
493
494
495 return(project_table_html);
496}
497
498QString ProjectListManager::ReadTableTemplate(QString TemplateFile)
499{
500 QString text_result;
501 QFile file(TemplateFile);
502 if (file.open(QIODevice::ReadOnly | QIODevice::Text))
503 {
504 QTextStream in(&file);
505 while(!in.atEnd())
506 {
507 text_result += in.readLine();
508 }
509 }
510 return(text_result);
511}
512
513bool ProjectListManager::WriteTextFile(QString FileName, QString Contents)
514{
515 bool result = false;
516 QFile file(FileName);
517 if (file.open(QIODevice::WriteOnly | QIODevice::Text))
518 {
519 QTextStream out(&file);
520 out << Contents;
521 result = true;
522 LogAdd(LOG_DEBUG, MODE_FILE, QString("Wrote Project List File %1 ").arg(FileName));
523 }
524 else
525 {
526 LogAdd(LOG_ERROR, MODE_FILE, QString("Unable to write Project List File %1 ").arg(FileName));
527
528 }
529 return(result);
530}
531
533{
534 // Find the Line with this Project Ident
535 QList<QTableWidgetItem *> item_list = ui->ProjectTableWidget->findItems (
536 Project->ProjectDesc.ProjectIdent, Qt::MatchExactly);
537 if (item_list.count () != 1)
538 {
540 QString ("Error Finding Project %1 in the Table Widget. ")
541 .arg (Project->ProjectDesc.ProjectIdent));
542 }
543 else
544 {
545 if (!Project->ProjectLock)
546 {
547 item_list[0]->setForeground (QBrush (QColor (INACTIVE_COLOUR)));
548 }
549 else
550 {
551 if (Project->ProjectQueued)
552 item_list[0]->setForeground (QBrush (QColor (QUEUED_COLOUR)));
553 else
554 item_list[0]->setForeground (QBrush (QColor (LOCK_COLOUR)));
555 }
556 ui->ProjectTableWidget->repaint ();
557 }
558}
559
564
570
575
580
581void ProjectListManager::SetCheckState(int column, bool CheckState)
582{
583 int row_count = ui->ProjectTableWidget->rowCount();
584 for (int row = 0; row < row_count; row++)
585 {
586 QCheckBox* checkBox = nullptr;
587
588 if (QWidget* w = ui->ProjectTableWidget->cellWidget(row, column))
589 {
590 if (QLayout* layout = w->layout())
591 {
592 if (QLayoutItem* layoutItem = layout->itemAt(0))
593 {
594 if (QWidgetItem* widgetItem = dynamic_cast<QWidgetItem*>(layoutItem))
595 {
596 checkBox = qobject_cast<QCheckBox*>(widgetItem->widget());
597 checkBox->setChecked(CheckState);
598 }
599 }
600 }
601 }
602 }
603}
Class for utilising the Doxygen tool.
void SetMaximumProjects(void)
Set the Initial Line Count in the Project List table.
~ProjectListManager()
Project List Manager Class Destructor.
bool WriteTextFile(QString FileName, QString Contents)
Write a String to a File.
void PressedInstallOff(void)
Turn all Install Check boxes off in List table.
void SendLogEntry(REMOTE_LOG_ENTRY log_entry)
void LoadProjectTable(void)
Clear and Reload the Project table, Sort by Selected Button \SortButton Button pressed to sort the Ta...
void SetCheckState(int column, bool InstallState)
Set the State of all Project Selection in Table List.
QString MakeOSProjectPage(void)
QList< PROJECT_INFORMATION * > ProjectList
A list of Projects to be processed.
QString ReadTableTemplate(QString TemplateFile)
Read an HTML template from a File.
int FindSelections(int index)
Read and Encode selected options for a Project.
QString base_project_query
Basic SQL Query for listing Projects.
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
Send Message to the Log.
void ProcessFullList(void)
Add all Projects for Documentation Creation.
void InitaliseProjectTable(void)
Clear and Load the Project List Table.
QString MakeHTMLProjectPage(QString HeaderTemplateFile, QString FooterTemplateFile, QString LineTemplateFile, bool TableOnly=true)
ProjectListManager(Ui::MainWindow *UI_Window)
Project List Manager Class Constructor.
void PressedArchiveOn(void)
Turn all Archive Check boxes on in List table.
void PressedArchiveOff(void)
Turn all Archive Check boxes off in List table.
void PressedInstallOn(void)
Turn all Install Check boxes on in List table.
void ProjectTabChanged(int Index)
Process the Change in Window Tab.
void ProcessSelection(void)
Add th Selected Project for Documentation Creation.
void PrStateChange(PROJECT_INFORMATION *Project)
Update the Lock/Queued Status of Project in the Project List Table.
#define TABLE_COLUMN_COUNT
Number of Columns in the Project List Table.
@ EXCLUDE_PROJECT_LIST_BIT
#define ALLOW_AUTOMATIC_INSTALL
#define QUEUED_COLOUR
@ DOC_LICENCE_COLUMN
@ SOFTWARE_LICENCE_COLUMN
@ PROJECT_CONTACT_COLUMN
@ TARGET_FAMILY_COLUMN
@ PUBLISH_BUTTON_COLUMN
@ PROJECT_STATUS_COLUMN
@ ASSOCIATION_COLUMN
@ INSTALL_BUTTON_COLUMN
@ COMPILER_FAMILY_COLUMN
@ ARCHIVE_BUTTON_COLUMN
@ HARDWARE_LICENCE_COLUMN
@ DEV_FAMILY_COLUMN
@ PROJECT_IDENT_COLUMN
@ PROJECT_NAME_COLUMN
@ BRIEF_DESC_COLUMN
#define EXCLUDE_PROJECT_LIST
Exclude Project from Public List Mask.
#define INACTIVE_COLOUR
The Text colour indicating an unlocked and unqueued Project.
#define INSTALL_SCRIPT_MASK
Bit Mask for the Install Script.
#define LOCK_COLOUR
The Text colour indicating a Locked Project.
#define CREATE_SOURCE_ARCHIVE
Create a SOurce Archive when Documentation Generated.
ReadProjectInfo * read_project_info
Doxygen Defintitions.
LOGGING_SEVERITY
Log Severity allow the selection of logging events based on Severity.
Definition logger.h:48
@ LOG_ERROR
Definition logger.h:52
@ LOG_INFO
Definition logger.h:55
@ 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_QT
Definition logger.h:23
@ MODE_FILE
Definition logger.h:32
ProjectOptionsManager * project_opts_manager
DoxygenManager * doxy_manager
ProjectSubstitute * project_subs_manager
Project List Manager Class.
#define ASSOCIATION_SIZE
The width of the Association Column.
#define PROJECT_CONTACT_SIZE
The width of the Project Contact Column.
#define COMPILER_FAMILY_SIZE
The width of the Compiler Family Column.
#define DEV_FAMILY_SIZE
#define PROJECT_NAME_SIZE
The width of the Project Name Column.
#define PROJECT_IDENT_SIZE
The width of the Project Ident Column.
#define BRIEF_DESC_SIZE
The width of the Brief Description Column.
#define ARCHIVE_BUTTON_SIZE
The width of the Archive Button Column.
#define SOFTWARE_LICENCE_SIZE
The width of the Software Licence Column.
#define HARDWARE_LICENCE_SIZE
#define INSTALL_BUTTON_SIZE
The width of the Install Button Column.
#define PUBLISH_BUTTON_SIZE
The width of the Publish Button Column.
#define TARGET_FAMILY_SIZE
The width of the Target Family Column.
@ LICENCE_ACK_TAB
@ CREATE_UPDATE_TAB
@ UPDATE_PROJECTS_TAB
@ PROGRAM_SETUP_TAB
@ LOG_TAB
#define PROJECT_STATUS_SIZE
The width of the Project Status Column.
#define DOC_LICENCE_SIZE
The width of the Documentation Licence Column.
Class Controlling the Database Creation.
Class Controlling Text Substitution.
Class for Reading Projects.
Project Information Passed Between Functions.
PROGRAM_INFORMATION ProgramInformation
TARGET_FAMILY_INFO TargetFamilyInfo
DEV_FAMILY_INFO DevFamilyInfo
PROJECT_DESCRIPTION ProjectDesc
LANG_FAMILY_INFO LangFamilyInfo
ASSOCIATED_GROUP_INFO InAssocInfo
Definition logger.h:60
LOGGING_MODE Mode
Definition logger.h:61
QString Message
Definition logger.h:63
LOGGING_SEVERITY Severity
Definition logger.h:62