diff --git a/glabels/AboutDialog.cpp b/glabels/AboutDialog.cpp new file mode 100644 index 0000000..d09ab7f --- /dev/null +++ b/glabels/AboutDialog.cpp @@ -0,0 +1,65 @@ +/* AboutDialog.cpp + * + * 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 . + */ + +#include "AboutDialog.h" + +#include +#include +#include + + +/// +/// Constructor +/// +AboutDialog::AboutDialog( QWidget *parent ) + : QDialog(parent) +{ + setupUi( this ); + + QString subtitle = tr("Label Designer"); + QString version = "x.x.x"; + QString description = tr("A program to create labels and business cards."); + + QString markup = "

gLabels " + + subtitle + "

" + + "

" + version + "

" + + "

" + description + "

" + + "

Copyright © 2016 Jim Evins

"; + + aboutLabel->setText( markup ); +} + + +/// +/// "License" Button Clicked Slot +/// +void AboutDialog::onLicenseButtonClicked() +{ + QDesktopServices::openUrl( QUrl("http://www.gnu.org/licenses/gpl-3.0.txt") ); +} + + +/// +/// "Website" Button Clicked Slot +/// +void AboutDialog::onWebsiteButtonClicked() +{ + QDesktopServices::openUrl( QUrl("http://glabels.org/") ); +} diff --git a/glabels/AboutDialog.h b/glabels/AboutDialog.h new file mode 100644 index 0000000..bf44d05 --- /dev/null +++ b/glabels/AboutDialog.h @@ -0,0 +1,52 @@ +/* AboutDialog.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 AboutDialog_h +#define AboutDialog_h + +#include "ui_AboutDialog.h" + + +/// +/// About Dialog Widget +/// +class AboutDialog : public QDialog, public Ui_AboutDialog +{ + Q_OBJECT + + + ///////////////////////////////// + // Life Cycle + ///////////////////////////////// +public: + AboutDialog( QWidget *parent = 0 ); + + + ///////////////////////////////// + // Slots + ///////////////////////////////// +private slots: + void onLicenseButtonClicked(); + void onWebsiteButtonClicked(); + +}; + + +#endif // AboutDialog_h diff --git a/glabels/CMakeLists.txt b/glabels/CMakeLists.txt index 51e6404..298b65e 100644 --- a/glabels/CMakeLists.txt +++ b/glabels/CMakeLists.txt @@ -4,6 +4,7 @@ project (app CXX) set (glabels_sources glabels_main.cpp + AboutDialog.cpp BarcodeBackends.cpp BarcodeMenu.cpp BarcodeMenuButton.cpp @@ -55,6 +56,7 @@ set (glabels_sources ) set (glabels_qobject_headers + AboutDialog.h BarcodeMenu.h BarcodeMenuButton.h BarcodeMenuItem.h @@ -88,6 +90,7 @@ set (glabels_qobject_headers ) set (glabels_forms + ui/AboutDialog.ui ui/MergePropertyEditor.ui ui/ObjectEditor.ui ui/PreferencesDialog.ui diff --git a/glabels/Help.cpp b/glabels/Help.cpp index ab7aa1e..5d5c299 100644 --- a/glabels/Help.cpp +++ b/glabels/Help.cpp @@ -20,7 +20,7 @@ #include "Help.h" -#include +#include "AboutDialog.h" #include @@ -39,18 +39,6 @@ void Help::displayContents( QWidget *parent ) /// void Help::displayAbout( QWidget *parent ) { - QMessageBox aboutBox( QMessageBox::NoIcon, - QMessageBox::tr("About gLabels"), - QMessageBox::tr("

gLabels Label Designer

" - "

x.x.x

" - "

A program to create labels and business cards.

" - "" - "

Homepage

" - "

Copyright © 2016 Jim Evins

" - "
"), - QMessageBox::Ok, - parent ); - aboutBox.setIconPixmap( QPixmap( ":/images/glabels-logo.png" ) ); - - aboutBox.exec(); + AboutDialog dialog( parent ); + dialog.exec(); } diff --git a/glabels/StartupWizard.cpp b/glabels/StartupWizard.cpp index 2f9a0e8..4c54fba 100644 --- a/glabels/StartupWizard.cpp +++ b/glabels/StartupWizard.cpp @@ -31,6 +31,13 @@ StartupWizard::StartupWizard( QWidget *parent ) : QDialog(parent) { setupUi( this ); + + QString subtitle = tr("Label Designer"); + + QString markup = "gLabels " + + subtitle + ""; + + titleLabel->setText( markup ); } diff --git a/glabels/ui/AboutDialog.ui b/glabels/ui/AboutDialog.ui new file mode 100644 index 0000000..6baaa4d --- /dev/null +++ b/glabels/ui/AboutDialog.ui @@ -0,0 +1,168 @@ + + + AboutDialog + + + Qt::WindowModal + + + + 0 + 0 + 379 + 317 + + + + + 0 + 0 + + + + About gLabels + + + true + + + + + + + + + :/images/glabels-logo.png + + + Qt::AlignCenter + + + + + + + + + + Qt::RichText + + + Qt::AlignCenter + + + 10 + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &License + + + + + + + &Website + + + + + + + &Close + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + closeButton + clicked() + AboutDialog + accept() + + + 322 + 306 + + + 340 + 316 + + + + + websiteButton + clicked() + AboutDialog + onWebsiteButtonClicked() + + + 202 + 296 + + + 211 + 312 + + + + + licenseButton + clicked() + AboutDialog + onLicenseButtonClicked() + + + 110 + 294 + + + 116 + 313 + + + + + + onWebsiteButtonClicked() + onLicenseButtonClicked() + + diff --git a/glabels/ui/StartupWizard.ui b/glabels/ui/StartupWizard.ui index f38040c..a371e6d 100644 --- a/glabels/ui/StartupWizard.ui +++ b/glabels/ui/StartupWizard.ui @@ -46,7 +46,7 @@ padding:8px; - <html><head/><body><p><span style=" font-size:24pt; font-weight:600;">gLabels </span><span style=" font-size:16pt; color:#909090;">Label Designer</span></p></body></html> + <html><head/><body><p><span style=" font-size:24pt; font-weight:600;">gLabels </span><span style=" font-size:16pt; color:#909090;">Label Designer</span></p></body></html>