diff --git a/pglab/About.cpp b/pglab/About.cpp new file mode 100644 index 0000000..e5c3753 --- /dev/null +++ b/pglab/About.cpp @@ -0,0 +1,23 @@ +#include "About.h" +#include +#include +#include + +void ShowAboutDialog(QWidget *parent) +{ + QString pgLabVersionString = "0.2"; + QString releaseNotesUrl = "file:///" + QCoreApplication::applicationDirPath() + "\\releasenotes.html"; + QString year = QString::fromLatin1(__DATE__, 11).right(4); + QMessageBox::about(parent, "pgLab " + pgLabVersionString, QMessageBox::tr( + "

Version %3

" + "

Releasenotes

" + "

Copyrights 2016-%1, Eelke Klein, All Rights Reserved.

" + "

The program is provided AS IS with NO WARRANTY OF ANY KIND, " + "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS " + "FOR A PARTICULAR PURPOSE.

" + "

This program is dynamically linked with Qt " QT_VERSION_STR " Copyrights " + "the Qt Company Ltd. https://www.qt.io/licensing/.

" + "

Some icons by Icons8 and others by fatcow provided under Creative Commons " + "attribution 3.0 license.

" + ).arg(year).arg(releaseNotesUrl).arg(pgLabVersionString)); +} diff --git a/pglab/About.h b/pglab/About.h new file mode 100644 index 0000000..1274f37 --- /dev/null +++ b/pglab/About.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +void ShowAboutDialog(QWidget *parent); diff --git a/pglab/ConnectionManagerWindow.cpp b/pglab/ConnectionManagerWindow.cpp index 0e57c48..10bdc06 100644 --- a/pglab/ConnectionManagerWindow.cpp +++ b/pglab/ConnectionManagerWindow.cpp @@ -1,4 +1,5 @@ #include "ConnectionManagerWindow.h" +#include "About.h" #include "ui_ConnectionManagerWindow.h" #include "MasterController.h" #include "ConnectionController.h" @@ -102,3 +103,9 @@ void ConnectionManagerWindow::on_actionConfigureCopy_triggered() auto ci = ui->treeView->selectionModel()->currentIndex(); m_connectionController->editCopy(ci); } + +void ConnectionManagerWindow::on_actionAbout_triggered() +{ + ShowAboutDialog(this); +} + diff --git a/pglab/ConnectionManagerWindow.h b/pglab/ConnectionManagerWindow.h index b740ed1..8ad70b3 100644 --- a/pglab/ConnectionManagerWindow.h +++ b/pglab/ConnectionManagerWindow.h @@ -39,6 +39,8 @@ private slots: void on_actionConfigureCopy_triggered(); + void on_actionAbout_triggered(); + private: Ui::ConnectionManagerWindow *ui; MasterController *m_masterController; diff --git a/pglab/ConnectionManagerWindow.ui b/pglab/ConnectionManagerWindow.ui index 64ab8e6..6eee4e4 100644 --- a/pglab/ConnectionManagerWindow.ui +++ b/pglab/ConnectionManagerWindow.ui @@ -26,13 +26,14 @@ 0 0 413 - 30 + 29 Fi&le + @@ -164,6 +165,16 @@ QToolButton { Configure copy + + + + :/icons/about.png + + + + About + + diff --git a/pglab/DatabaseWindow.cpp b/pglab/DatabaseWindow.cpp index d00a925..57908f6 100644 --- a/pglab/DatabaseWindow.cpp +++ b/pglab/DatabaseWindow.cpp @@ -1,4 +1,5 @@ #include "DatabaseWindow.h" +#include "About.h" #include "ui_DatabaseWindow.h" #include "util.h" #include "crud/CrudTab.h" @@ -305,19 +306,7 @@ void DatabaseWindow::dropEvent(QDropEvent *event) void DatabaseWindow::on_actionAbout_triggered() { - QMessageBox::about(this, "pgLab 0.1", tr( - "Copyrights 2016-2019, Eelke Klein, All Rights Reserved.\n" - "\n" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS " - "FOR A PARTICULAR PURPOSE.\n" - "\n" - "This program is dynamically linked with Qt 5.12 Copyright (C) 2018 " - "The Qt Company Ltd. https://www.qt.io/licensing/. \n" - "\n" - "Icons by fatcow http://www.fatcow.com/free-icons provided under Creative Commons " - "attribution 3.0 license." - )); + ShowAboutDialog(this); } diff --git a/pglab/pglab.pro b/pglab/pglab.pro index 916109e..3bc5b30 100644 --- a/pglab/pglab.pro +++ b/pglab/pglab.pro @@ -21,6 +21,7 @@ DEFINES += _WIN32_WINNT=0x0501 win32:RC_ICONS += pglab.ico SOURCES += main.cpp\ + About.cpp \ catalog/delegates/IconColumnDelegate.cpp \ catalog/models/BaseTableModel.cpp \ catalog/models/ColumnTableModel.cpp \ @@ -91,6 +92,7 @@ SOURCES += main.cpp\ widgets/SingleRecordWidget.cpp HEADERS += \ + About.h \ catalog/delegates/IconColumnDelegate.h \ catalog/models/BaseTableModel.h \ catalog/models/ColumnTableModel.h \ diff --git a/releasenotes/notes/about-7eeb6e282f8e2ef1.yaml b/releasenotes/notes/about-7eeb6e282f8e2ef1.yaml new file mode 100644 index 0000000..54555b8 --- /dev/null +++ b/releasenotes/notes/about-7eeb6e282f8e2ef1.yaml @@ -0,0 +1,13 @@ +--- +features: + - The connection window now has an About item in the file menu. + - The about dialog now uses html for enhanced formatting and hyperlinks. + - | + The about dialog now declares the usage of Icons8 icons and provides a + link to icons8.com in accordance with the free usage conditions. + - | + The about dialog now shows the Qt version it was actually build with instead of + a hardcoded value. + - | + The about dialog now contains a link to the releasenotes.html file which will be + opened in the users browser.