From aa11fcc4e6bb1405fbcce00204a8b623819ccaf6 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sat, 31 Dec 2016 00:38:18 -0500 Subject: [PATCH] Some simple fleshing out of AboutDialog. --- CMakeLists.txt | 16 +++++------- glabels/AboutDialog.cpp | 31 +++++++++++++++++------ glabels/CMakeLists.txt | 6 +++++ glabels/Version.h.in | 37 +++++++++++++++++++++++++++ glabels/ui/AboutDialog.ui | 53 +++++++++++++++++++++------------------ 5 files changed, 101 insertions(+), 42 deletions(-) create mode 100644 glabels/Version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a0d7323..2fb9117 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,19 +7,15 @@ project (glabels_qt) #======================================= -# Package and Version Information +# Version Information #======================================= -set (Package_Name "glabels-qt") -set (Short_Name "glabels-qt") -set (Package_URL "https://github.com/jimevins/glabels-qt") +set (Website "http://glabels.org") -set (Major_Version "0") -set (Minor_Version "0") -set (Bugfix_Version "0") +set (Major_Version "3") +set (Minor_Version "99") +set (Micro_Version "0") -set (Package_Version "${Major_Version}.${Minor_Version}.${Bugfix_Version}") - -set (Unique_Package_Name ${Package_Name}-${API_Version}) +set (Full_Version "${Major_Version}.${Minor_Version}.${Micro_Version}") #======================================= diff --git a/glabels/AboutDialog.cpp b/glabels/AboutDialog.cpp index 24234fb..3f861f5 100644 --- a/glabels/AboutDialog.cpp +++ b/glabels/AboutDialog.cpp @@ -20,6 +20,7 @@ #include "AboutDialog.h" +#include "Version.h" #include #include #include @@ -33,14 +34,30 @@ AboutDialog::AboutDialog( QWidget *parent ) { setupUi( this ); - QString titleImage = ":images/glabels-label-designer.png"; - QString version = "x.x.x"; + QString version = tr("Version") + " " + Version::STRING; + QString description = tr("A program to create labels and business cards."); + + QString copyright = "Copyright © 2017 Jim Evins "; + + QString licenseParagraph1 = + tr( "gLabels is free software: you can redistribute it and/or modify " + "it under the terms of the GNU General Public License as published by " + "the Free Software Foundation, either version 3 of the License, or " + "(at your option) any later version." ); - QString markup = QString("

").arg( titleImage ) - + "

" + version + "

" - + "

" + description + "

" - + "

Copyright © 2016 Jim Evins

"; + QString licenseParagraph2 = + tr( "gLabels is distributed in the hope that it will be useful, " + "but WITHOUT ANY WARRANTY; without even the implied warranty of " + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " + "GNU General Public License for more details." ); + + QString markup = + "

" + version + "

" + + "

" + description + "

" + + "

" + copyright + "

" + + "

" + licenseParagraph1 + "

" + + "

" + licenseParagraph2 + "

"; aboutLabel->setText( markup ); } @@ -60,5 +77,5 @@ void AboutDialog::onLicenseButtonClicked() /// void AboutDialog::onWebsiteButtonClicked() { - QDesktopServices::openUrl( QUrl("http://glabels.org/") ); + QDesktopServices::openUrl( QUrl(Version::WEBSITE) ); } diff --git a/glabels/CMakeLists.txt b/glabels/CMakeLists.txt index 2de2816..a5dcca2 100644 --- a/glabels/CMakeLists.txt +++ b/glabels/CMakeLists.txt @@ -6,6 +6,12 @@ cmake_minimum_required (VERSION 2.8.12) project (app CXX) +#======================================= +# Auto-generate Version.h +#======================================= +configure_file (Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/Version.h @ONLY) + + #======================================= # Sources #======================================= diff --git a/glabels/Version.h.in b/glabels/Version.h.in new file mode 100644 index 0000000..ea3ae64 --- /dev/null +++ b/glabels/Version.h.in @@ -0,0 +1,37 @@ +/* Version.h + * + * Copyright (C) 2016 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gLabels-qt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gLabels-qt. If not, see . + */ + +#ifndef glabels_Version_h +#define glabels_Version_h + + +namespace Version +{ + const QString WEBSITE = "@Website@"; + + const int MAJOR = @Major_Version@; + const int MINOR = @Minor_Version@; + const int MICRO = @Micro_Version@; + + const QString STRING = "@Full_Version@"; +} + + +#endif // glabels_Version_h diff --git a/glabels/ui/AboutDialog.ui b/glabels/ui/AboutDialog.ui index 6baaa4d..ef102eb 100644 --- a/glabels/ui/AboutDialog.ui +++ b/glabels/ui/AboutDialog.ui @@ -9,8 +9,8 @@ 0 0 - 379 - 317 + 456 + 497 @@ -25,7 +25,7 @@ true - + @@ -39,6 +39,19 @@ + + + + + + + :/images/glabels-label-designer.png + + + Qt::AlignCenter + + + @@ -48,7 +61,10 @@ Qt::RichText - Qt::AlignCenter + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true 10 @@ -57,19 +73,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -85,14 +88,7 @@ - - - &Close - - - - - + Qt::Horizontal @@ -104,6 +100,13 @@ + + + + &Close + + +