diff options
author | Louie S <louie@example.com> | 2024-03-16 17:52:01 -0400 |
---|---|---|
committer | Louie S <louie@example.com> | 2024-03-16 17:52:01 -0400 |
commit | 3a9b931e6a8c5d21fb776791cbfaad4bcdb8cc56 (patch) | |
tree | 8e89cbe0c0131a8e5d7e466ba4034bcd4b3dfc33 | |
parent | 84137fe7739f14c9dc5697105cf1ae2af4271b4e (diff) |
Tidy up about page
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | config.h.in | 11 | ||||
-rw-r--r-- | resources.qrc | 5 | ||||
-rw-r--r-- | src/assignmentList.cpp | 7 | ||||
-rw-r--r-- | src/assignmentList.ui | 8 | ||||
-rw-r--r-- | src/icon/assignment-list.dia (renamed from data/assignment-list.dia) | bin | 1426 -> 1426 bytes |
7 files changed, 35 insertions, 2 deletions
@@ -1,3 +1,4 @@ .cache build compile_commands.json +config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fea0dae..19fed72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5) project(assignment-list VERSION 0.0.1 LANGUAGES CXX) +set(PROJECT_TITLE "Assignment List") + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED) @@ -77,9 +79,12 @@ set(project_uis ) set(project_misc + "resources.qrc" "src/icon/assignment-list.rc" ) +configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h @ONLY) + add_executable(assignment-list ${project_sources} ${project_headers} diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..f1add5e --- /dev/null +++ b/config.h.in @@ -0,0 +1,11 @@ +#ifndef CONFIG_H_IN +#define CONFIG_H_IN + +#define PROJECT_NAME "@PROJECT_NAME@" +#define PROJECT_TITLE "@PROJECT_TITLE@" +#define VERSION "@CMAKE_PROJECT_VERSION@" +#define VERSION_MAJOR "@VERSION_MAJOR@" +#define VERSION_MINOR "@VERSION_MINOR@" +#define VERSION_PATCH "@VERSION_PATCH@" + +#endif diff --git a/resources.qrc b/resources.qrc new file mode 100644 index 0000000..82c49d8 --- /dev/null +++ b/resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>data/assignment-list.svg</file> + </qresource> +</RCC> diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp index abd2bda..8d041e4 100644 --- a/src/assignmentList.cpp +++ b/src/assignmentList.cpp @@ -14,6 +14,7 @@ #include <QDebug> #include <QErrorMessage> +#include "../config.h" #include "addGroupForm.h" #include "assignmentList.h" #include "backend/db_sqlite.h" @@ -140,5 +141,9 @@ void AssignmentList::cleanHidden() { void AssignmentList::aboutDialog() { QMessageBox about; - about.about(this, "About Assignment List", "Created by Louie S. - 2023"); + QString title("About " + QString(PROJECT_TITLE)); + QString text( + QString(PROJECT_TITLE) + " " + QString(VERSION) + "\n" + + "Created by Louie S. - 2024"); + about.about(this, title, text); } diff --git a/src/assignmentList.ui b/src/assignmentList.ui index bc3c0fb..60c66da 100644 --- a/src/assignmentList.ui +++ b/src/assignmentList.ui @@ -13,6 +13,10 @@ <property name="windowTitle"> <string>Assignment List</string> </property> + <property name="windowIcon"> + <iconset resource="../resources.qrc"> + <normaloff>:/data/assignment-list.svg</normaloff>:/data/assignment-list.svg</iconset> + </property> <widget class="QWidget" name="centralwidget"> <layout class="QHBoxLayout" name="horizontalLayout"> <item> @@ -202,6 +206,8 @@ </property> </action> </widget> - <resources/> + <resources> + <include location="../resources.qrc"/> + </resources> <connections/> </ui> diff --git a/data/assignment-list.dia b/src/icon/assignment-list.dia Binary files differindex 91404e1..91404e1 100644 --- a/data/assignment-list.dia +++ b/src/icon/assignment-list.dia |