Some simple fleshing out of AboutDialog.

This commit is contained in:
Jim Evins
2016-12-31 00:38:18 -05:00
parent 9fced3fcb7
commit aa11fcc4e6
5 changed files with 101 additions and 42 deletions
+24 -7
View File
@@ -20,6 +20,7 @@
#include "AboutDialog.h"
#include "Version.h"
#include <QUrl>
#include <QDesktopServices>
#include <QtDebug>
@@ -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 &copy; 2017 Jim Evins <evins@snaught.com>";
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("<p><img src='%1'></p>").arg( titleImage )
+ "<p>" + version + "</p>"
+ "<p>" + description + "</p>"
+ "<p>Copyright &copy; 2016 Jim Evins <evins@snaught.com></p>";
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 =
"<p align='center'>" + version + "</p>" +
"<p align='center'>" + description + "</p>" +
"<p align='center'>" + copyright + "</p>" +
"<p align='left'>" + licenseParagraph1 + "</p>" +
"<p align='left'>" + licenseParagraph2 + "</p>";
aboutLabel->setText( markup );
}
@@ -60,5 +77,5 @@ void AboutDialog::onLicenseButtonClicked()
///
void AboutDialog::onWebsiteButtonClicked()
{
QDesktopServices::openUrl( QUrl("http://glabels.org/") );
QDesktopServices::openUrl( QUrl(Version::WEBSITE) );
}
+6
View File
@@ -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
#=======================================
+37
View File
@@ -0,0 +1,37 @@
/* Version.h
*
* Copyright (C) 2016 Jim Evins <evins@snaught.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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
+28 -25
View File
@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>379</width>
<height>317</height>
<width>456</width>
<height>497</height>
</rect>
</property>
<property name="sizePolicy">
@@ -25,7 +25,7 @@
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1,0">
<item>
<widget class="QLabel" name="Icon">
<property name="text">
@@ -39,6 +39,19 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/glabels-label-designer.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="aboutLabel">
<property name="text">
@@ -48,7 +61,10 @@
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>10</number>
@@ -57,19 +73,6 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="licenseButton">
<property name="text">
@@ -85,14 +88,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>&amp;Close</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -104,6 +100,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>&amp;Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>