4#include <QTableWidgetItem>
16 <<
"CONTROL_DOC_ACCESS"
17 <<
"ONLY_DEFAULT_PAGE"
18 <<
"GROUP_ACCESS_ONLY"
19 <<
"ENABLE_CUSTOM_DOXY"
22 <<
"ASSISTANCE_WELCOME"
23 <<
"DONATIONS_WELCOME"
24 <<
"OFFER_PAYPAL_DONATION";
31 <<
"BRIEF_DESCRIPTION"
45 <<
"PROJECT_DIRECTORY"
50 <<
"DOXY_EXTRA_STYLESHEET"
63 ui->ProjectSubsList->setColumnCount(2);
65 ui->ProjectSubsList->setHorizontalHeaderLabels( QStringList( {
"Key Word",
"Substitution String"} ));
67 ui->ProjectSubsList->setColumnWidth(1,(
ui->ProjectSubsList->width() -
ui->ProjectSubsList->columnWidth(0) ) );
74 log_entry.
Mode = Mode;
90 ui->ProjectSubsList->clearContents();
193 ui->ProjectSubsList->sortItems(0, Qt::AscendingOrder);
194 LogAdd(
LOG_DEBUG,
MODE_DATABASE, QString(
"Read %1 Substitution entries from table \"project_substitute\"").arg(QString::number(row_index)));
199 QString email_address;
200 QSqlQuery email_query(QString(
"select developer_email from developer where developer_index = %1").arg(QString::number(Index)));
201 while ( email_query.next() )
203 email_address = email_query.value(0).toString();
205 return(email_address);
215 int row_index = RowIndex;
218 QSqlQuery subs_query(QString(
"select key_word, substitution, lock_entry from project_substitute where project_index = 1 or project_index = %1 order by key_word").arg(QString::number(ProjectNo)));
220 locked_brush.setColor(Qt::lightGray);
222 while ( subs_query.next() )
224 QString keyword = subs_query.value(0).toString();
225 QString substitution = subs_query.value(1).toString();
226 bool locked = subs_query.value(2).toBool();
228 QTableWidgetItem *new_key =
new QTableWidgetItem( keyword );
229 new_key->data(locked);
230 QTableWidgetItem *new_value =
new QTableWidgetItem( substitution );
235 new_key->setFlags(new_key->flags() ^ Qt::ItemIsEditable);
236 new_value->setFlags(new_value->flags() ^ Qt::ItemIsEditable);
238 ui->ProjectSubsList->setItem( row_index, 0, new_key );
239 ui->ProjectSubsList->setItem( row_index, 1, new_value );
242 ui->ProjectSubsList->sortItems(0, Qt::AscendingOrder);
248 QTableWidgetItem *new_key =
new QTableWidgetItem( Key );
250 QTableWidgetItem *new_value =
new QTableWidgetItem( Value );
253 new_key->setFlags(new_key->flags() ^ Qt::ItemIsEditable);
254 new_value->setFlags(new_value->flags() ^ Qt::ItemIsEditable);
255 ui->ProjectSubsList->setItem( RowIndex, 0, new_key );
256 ui->ProjectSubsList->setItem( RowIndex, 1, new_value );
261 ui->ProjectSubsList->clearContents();
266 ui->ProjectSubsGroupBox->setEnabled(State);
267 ui->ProjectSubsList->setEnabled(State);
268 ui->ReloadSubstituitions->setEnabled(State);
269 ui->ClearSubstituitions->setEnabled(State);
270 ui->SaveSubstituitions->setEnabled(State);
285 QModelIndexList selection =
ui->ProjectSubsList->selectionModel()->selectedRows();
288 for(
int i=0; i< selection.count(); i++)
290 QModelIndex index = selection.at(i);
291 QTableWidgetItem* item =
ui->ProjectSubsList->item(index.row(), 0);
292 if ((item != 0) && (item->flags() & Qt::ItemIsEditable))
ui->ProjectSubsList->removeRow(index.row());
294 ui->ProjectSubsList->sortItems(0, Qt::AscendingOrder);
369 QTableWidgetItem* found_item = NULL;
372 QList<QTableWidgetItem*> item_list =
ui->ProjectSubsList->findItems(Key, Qt::MatchExactly);
373 if (item_list.count() == 1)
375 found_item = item_list[0];
391 int row = item->row();
394 QTableWidgetItem* value_item =
ui->ProjectSubsList->item(row, column);
395 value_item->setText(Value);
485 uint project_index =
project_info->ProjectDesc.ProjectIndex;
486 QString query_string(QString(
"delete from project_substitute where project_index = %1 and lock_entry = false").arg(QString::number(project_index)));
487 QSqlQuery remove_query;
488 if (!remove_query.exec(query_string))
497 int row_count =
ui->ProjectSubsList->rowCount();
498 for (
int row = 0; row < row_count; row++)
500 QTableWidgetItem* key_item =
ui->ProjectSubsList->item(row, 0);
501 QTableWidgetItem* value_item =
ui->ProjectSubsList->item(row, 1);
503 if (key_item !=
nullptr)
506 Qt::ItemFlags flags = key_item->flags();
507 Qt::ItemFlags flag_bit = flags & Qt::ItemIsEditable;
508 bool is_locked = !(flag_bit & Qt::ItemIsEditable);
515 if (
SaveKeyValuePair(project_index, key_item->text(), value_item->text(),
false))
538 QString insert_string = QString(
"insert into project_substitute values (null, %1, '%2', '%3', %4)").arg(QString::number(ProjectId), Key, Value, QString::number(Lock));
539 QSqlQuery insert_keyvalue;
540 bool result = insert_keyvalue.exec(insert_string);
543 LogAdd(
LOG_ERROR,
MODE_DATABASE, QString(
"Unable to Add Key-Value Pair \"%1 - %2\" to project Id %3").arg(Key, Value, QString::number(ProjectId)));
547 LogAdd(
LOG_DEBUG,
MODE_DATABASE, QString(
"Added Key-Value Pair \"%1 - %2\" to project Id %3").arg(Key, Value, QString::number(ProjectId)));
555 Item->setFlags(Item->flags() | Qt::ItemIsEditable);
652 Project->
SubsMap.insert(
"[#LEAD_IN#]",
"'@htmlonly [# @endhtmlonly'");
653 Project->
SubsMap.insert(
"[#LEAD_OUT#]",
"'@htmlonly #] @endhtmlonly'");
728 Project->
SubsMap.insert(
"[#WEB_DIR#]", web_directory);
733 Project->
SubsMap.insert(
"[#DOXY_IMAGE_PATH#]", web_directory +
"/images");
734 Project->
SubsMap.insert(
"[#DOT_IMAGE_FORMAT#]",
ui->DotImageType->currentText());
735 if (
ui->DotImageType->currentText() ==
"SVG") Project->
SubsMap.insert(
"[#INTERACTIVE_SVG#]",
"YES");
736 Project->
SubsMap.insert(
"[#DOXY_TAB_SIZE#]", QString::number(
ui->DoxyTabSize->value()));
753 Project->
SubsMap.insert(
"[#ARCHIVE_FILENAME#]", archive_web_location);
757 QString key; QString value;
bool key_set =
false;
761 key =
"[#OPTIMIZE_C#]"; value =
"YES"; key_set =
true;
765 key =
"[#OPTIMIZE_JAVA#]"; value =
"YES"; key_set =
true;
769 key =
"[#OPTIMIZE_FORTRAN#]"; value =
"YES"; key_set =
true;
773 key =
"[#OPTIMIZE_FORTRAN#]"; value =
"YES"; key_set =
true;
780 if (key_set) Project->
SubsMap.insert(key, value);
784 QString created_query_template =
"select version_timestamp from proj_version_info where project_id = %1 and major_version = 0 and minor_version = 0 and revision = 0";
785 QSqlQuery created_query(QString(created_query_template).arg(QString::number(Project->
ProjectDesc.
ProjectIndex)));
787 QString creation_year =
"";
788 while ( created_query.next() )
790 QDateTime created_datetime = created_query.value(0).toDateTime();
791 creation_year = created_datetime.toString(
"yyyy");
793 QString current_year = QDateTime::currentDateTime().toString(
"yyyy");
794 QString copyright_year = creation_year +
"-" + current_year;
795 QString copyright_template =
"Copyright © %1 by %2";
797 Project->
SubsMap.insert(
"[#COPYRIGHT_STATEMENT#]", copyright_statement);
807 QString key_string; QString value_string;
810 QString user_subs_query =
"select key_word, substitution, lock_entry from project_substitute where project_index = 1 or project_index = %1 order by key_word";
813 while ( subs_query.next() )
816 value_string = subs_query.value(1).toString();
817 Project->
SubsMap.insert(key_string, value_string);
bool UpdateItem(QString Key, QString Value)
Update the Value of an Entry in the Substitution List.
void ReadProjectId(PROJECT_INFORMATION *ProjectInfo)
Load the Substitution Table for th Project.
void ReadMinorVersion(int MinorVersion)
Update the Minor Version in the Substitute Table.
QTableWidgetItem * FindItemByKey(QString Key)
Find a Substitution Entry in the Substitution List by Name.
ProjectSubstitute(Ui::MainWindow *UI_Window, ProjectOptionsManager *ProjectOptsManager)
LicenceManager Construction routine.
void ReadRevision(int Revision)
Update the Revision in the Substitute Table.
void UpdateDevFamily(DEVELOPMENT_FAMILY DevelopmentTypes)
Update the Dev Families Information in the Substitute Table.
void SaveLocalSubstitutes(void)
Save the Local Substitutes to the Database.
int DecodeProjectOptions(uint Options, int RowIndex, bool NewProject)
Add Key-Value items for all Project Options.
void UpdateProjectIcon(QString Name)
void UpdateDoxyFooter(QString DoxyFooter)
Update Doxygen's Footer Filename in Substitute Table.
void LoadBasePresets(int RowIndex, int ProjectNo)
void UpdateInAssocation(QString Association)
ProjectOptionsManager * project_opts_manager
Pointer the Project Options Manager Class.
void LoadFileSubsList(PROJECT_INFORMATION *Project)
Load the Substitution table from the Project Information.
void UpdateProjectContact(QString ContactName)
void UpdateVersion(REMOTE_VERSION_ENTRY Version)
Update the Version Information in the Substitute Table.
void SetEditableState(QTableWidgetItem *Item)
void AddKeyValue(QString Key, QString Value, int RowIndex)
Add a New Key-Value pair to the Substitution List.
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
void UpdateDoxyHeader(QString DoxyHeader)
Update Doxygen's Header Filename in Substitute Table.
void SetOptionState(uint Options)
void DoClear(void)
Clear the Substitution lists and display.
QStringList sys_item_name
List of System Names for Subtitution process.
void UpdateProjectBrief(QString Text)
Update Project Brief in Substitute Table.
void LoadUserSubstitutes(PROJECT_INFORMATION *Project)
void LoadSubsTable(int ProjectNo)
QString GetProjectEmail(int Index)
void UpdateDocumentationLicence(QString LicenceName)
Update the Documentation Licence Information in the Substitute Table.
void LoadPresets(void)
Load the Substitution Table.
void ReadMajorVersion(int MajorVersion)
Update the Major Version in the Substitute Table.
void ReloadSubstituteTable(void)
Reload the Substituition Table & Display.
bool SaveKeyValuePair(int ProjectId, QString Key, QString Value, bool Lock)
void SetSubstituteState(bool State)
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
Add a Log Entry.
Ui::MainWindow * ui
Pointer to the Main Window.
PROJECT_INFORMATION * project_info
Structure to hold Project Information.
void UpdateProjectName(QString Name)
Update Project Name in Substitute Table.
void UpdateDoxyProjectLogo(QString DoxyProjectLogo)
Update Doxygen's Project Logo Filename in Substitute Table.
void UpdateHardwareLicence(QString LicenceName)
Update the Hardware Licence Information in the Substitute Table.
QString leadin_string
Lead in Characters for substitution blocks.
QStringList option_name
List of Option Names for Subtitution process.
void UpdateDepartureURL(QString Name)
Update Exit URL in Substitute Table.
void UpdateSoftwareLicence(QString LicenceName)
Update the Software Licence Information in the Substitute Table.
void UpdateProjectDateTime(QString ProjectDateTime)
Update Project's DateTime in Substitute Table.
void UpdateStatus(STATUS_INFO StatusInfo)
Update the Deve Families Information in the Substitute Table.
QColor system_colour
table Background Colour
QString leadout_string
Lead out Characters for substitution blocks.
void UpdateFullDescription(QString FullDescription)
Update the Full Description in the Substitute Table.
void UpdateDoxyStylesheet(QString DoxyStylesheet)
Update Doxygen's Stylesheet Filename in Substitute Table.
void ClearSubstituteEntry(void)
Clear the Select Substitution Row & data.
#define DOXY_LOG_FILE
The name of the Doxygen Log File.
@ ENABLE_CUSTOM_DOXYGEN_BIT
@ OFFER_PAYPAL_DONATION_BIT
@ EXCLUDE_PROJECT_LIST_BIT
#define ENABLE_CUSTOM_DOXYGEN
Enable Custom Doxygen Definitions Mask.
#define CAVEAT_LECTOR
Display User Warning Mask.
#define DATETIME_DISPLAY_FORMAT
DateTime formatting for the program displays.
#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 CREATE_SOURCE_ARCHIVE
Create a SOurce Archive when Documentation Generated.
LOGGING_SEVERITY
Log Severity allow the selection of logging events based on Severity.
LOGGING_MODE
Log Severity allow the selection of logging events based on the mode.
Class Controlling Text Substitution.
#define MAXIMUM_KEY_VALUE_PAIRS
Define the Maximum number of Key-Value pairs to Display.
#define PROJECT_KEY_COLUMN_WIDTH
Define the Key's Column Width in the display.
QString CompilerToolImage
QString CompilerDirectory
Summary of Project Types.
QString LanguageFamilyString
QString CompilerFamilyString
QString TargetFamilyString
QString DevelopmentFamilyString
QString DoxyExtraStylesheetFilename
QString DoxyHtmlHeaderFilename
QString DoxyHtmlFooterFilename
LOGGING_SEVERITY Severity
Version Structure used between functions.
Information about the Development Status.
QString StatusDescription
QString StatusDateTimeString
QString TargetFamilyImage
QString VersionDateString
QString CurrentVersionString
QString FullVersionString