Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
Loading...
Searching...
No Matches
programidentification.cpp
Go to the documentation of this file.
2
3#include <QObject>
4#include <QLineEdit>
5#include <QSysInfo>
6#include <QGridLayout>
7#include <QSqlDatabase>
8#include <QSqlQuery>
9#include "pm_include.hpp"
10
12{
13 ui = UI_Window;
14}
15
17{
18 ui->ProgramIdentificationCode->setText(PROJECT_IDENTIFIER);
19 ui->ProgramVersion->setText(VERSION_STRING);
20 ui->Compiler->setText("Qt");
21 ui->ProgramBuildDate->setText(QStringLiteral(__DATE__) + QStringLiteral(" ") + QStringLiteral(__TIME__));
22 ui->CompilerVersion->setText(QT_VERSION_STR);
23 ui->ContactName->setText(CONTACT_NAME);
24 ui->ContactEmail->setText(CONTACT_EMAIL);
25 ui->ProgramWebsite->setText(PROJECT_WEBSITE);
26 ui->SoftwareLicence->setText(PROGRAM_SOFTWARE_LICENCE);
27 ui->DocumentationLicence->setText(PROGRAM_DOCUMENTATION_LICENCE);
28 ui->HardwareLicence->setText(PROGRAM_HARDWARE_LICENCE);
29 ui->CopyrightStatement->setText(COPYRIGHT_STATEMENT);
30 LogAdd(LOG_DEBUG, MODE_CONFIG, "Program's Build Information Loaded.");
31
32 ui->SystemArchitecture->setText(QSysInfo::currentCpuArchitecture());
33 ui->OpSysProductName->setText(QSysInfo::prettyProductName());
34 ui->OpSysVersion->setText(QSysInfo::productVersion());
35 ui->NodeName->setText(QSysInfo::machineHostName());
36 QString qt_version;
37 qt_version.fromLocal8Bit(qVersion());
38 ui->BuildProgram->setText(qt_version);
39 ui->ProgramBuildDate->setText(QStringLiteral(__DATE__) + QStringLiteral(" ") + QStringLiteral(__TIME__));
40 LogAdd(LOG_DEBUG, MODE_CONFIG, "Program's System Information Loaded.");
41
42 // Create List of Images to Display on Identification tab
43 image_list << "Brigadoon_Logo.bmp" << "Built_with_Qt_RGB_logo_vertical.png";
44 QString os_type = QSysInfo::kernelType().toLower();
45 if (os_type == "linux") image_list << "linux_dual.jpg"; else if (os_type == "winnt") image_list << "windows_logo.png";
46 image_list << "git.png" << "doxygen_logo.jpg" << "md5deep.png" << "dia_logo.jpg" << "plantuml.png" << "graphviz.png" << "cppcheck.png" << "Files-Tar-icon.png" << "Cloc.png" << "Mariadb.png";
47
48 // Define a Grid Layout
49 QGridLayout* image_layout = new QGridLayout(ui->ProgramImageLayout);
50 int row = 0; int column = 0;
51
52 int list_size = image_list.size();
53
54 if (list_size > 0)
55 {
56 // Iterate Through the Image List
57 for (int index = 0; index < list_size; index++)
58 {
59 QPixmap the_pixmap( QString(":/Resources/") + image_list[index] );
60 QLabel* the_image = new QLabel();
61 the_image->setPixmap(the_pixmap.scaledToWidth(140));
62 image_layout->addWidget(the_image, row++, column, 1, 1, Qt::AlignCenter);
63 if ( row > 2){ row = 0; column++; }
64 }
65 }
66 LogAdd(LOG_DEBUG, MODE_CONFIG, "Program's Acknowledgement Images Loaded.");
67}
68
69void ProgramIdentification::LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
70{
71 REMOTE_LOG_ENTRY log_entry;
72 log_entry.Severity = Severity;
73 log_entry.Mode = Mode;
74 log_entry.Message = Message;
75 emit SendLogEntry(log_entry);
76}
77
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
Add a Log Entry.
void LoadProgramIdentification()
Load Program Identification Information.
ProgramIdentification(Ui::MainWindow *UI_Window)
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
QStringList image_list
A list of the images used by the program.
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_CONFIG
Definition logger.h:26
Defination File for Project Manager.
#define COPYRIGHT_STATEMENT
Overall Claim of Ownership.
#define CONTACT_EMAIL
The contact email for the Project's Developers.
#define VERSION_STRING
#define PROGRAM_SOFTWARE_LICENCE
Project Software Release Licence.
#define PROJECT_WEBSITE
The name(s) of the Developer's Website.
#define PROJECT_IDENTIFIER
Unique Project Identifier.
#define PROGRAM_DOCUMENTATION_LICENCE
Project Documentation Release Licence.
#define CONTACT_NAME
The name(s) of the Project's Contact.
#define PROGRAM_HARDWARE_LICENCE
Project Hardware Release Licence.
Common Structure Defintitions.
Definition logger.h:60
LOGGING_MODE Mode
Definition logger.h:61
QString Message
Definition logger.h:63
LOGGING_SEVERITY Severity
Definition logger.h:62