From 3a9b931e6a8c5d21fb776791cbfaad4bcdb8cc56 Mon Sep 17 00:00:00 2001 From: Louie S Date: Sat, 16 Mar 2024 17:52:01 -0400 Subject: Tidy up about page --- .gitignore | 1 + CMakeLists.txt | 5 +++++ config.h.in | 11 +++++++++++ data/assignment-list.dia | Bin 1426 -> 0 bytes resources.qrc | 5 +++++ src/assignmentList.cpp | 7 ++++++- src/assignmentList.ui | 8 +++++++- src/icon/assignment-list.dia | Bin 0 -> 1426 bytes 8 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 config.h.in delete mode 100644 data/assignment-list.dia create mode 100644 resources.qrc create mode 100644 src/icon/assignment-list.dia diff --git a/.gitignore b/.gitignore index ebc041f..517f101 100644 --- a/.gitignore +++ b/.gitignore @@ -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/data/assignment-list.dia b/data/assignment-list.dia deleted file mode 100644 index 91404e1..0000000 Binary files a/data/assignment-list.dia and /dev/null differ diff --git a/resources.qrc b/resources.qrc new file mode 100644 index 0000000..82c49d8 --- /dev/null +++ b/resources.qrc @@ -0,0 +1,5 @@ + + + data/assignment-list.svg + + 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 #include +#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 @@ Assignment List + + + :/data/assignment-list.svg:/data/assignment-list.svg + @@ -202,6 +206,8 @@ - + + + diff --git a/src/icon/assignment-list.dia b/src/icon/assignment-list.dia new file mode 100644 index 0000000..91404e1 Binary files /dev/null and b/src/icon/assignment-list.dia differ -- cgit