Add about dialog to File menu of the connection manager.

Make the contents of the dialog more accurate and include a link to the releasenotes file.
This commit is contained in:
eelke 2022-09-03 12:44:32 +02:00
parent 4e1d128ee9
commit c874b297c1
8 changed files with 66 additions and 14 deletions

23
pglab/About.cpp Normal file
View file

@ -0,0 +1,23 @@
#include "About.h"
#include <QCoreApplication>
#include <QMessageBox>
#include <QString>
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(
"<h1>Version %3</h1>"
"<p><a href=\"%2\">Releasenotes</a></p>"
"<p>Copyrights 2016-%1, Eelke Klein, All Rights Reserved.</p>"
"<p>The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS "
"FOR A PARTICULAR PURPOSE.</p>"
"<p>This program is dynamically linked with Qt " QT_VERSION_STR " Copyrights "
"the Qt Company Ltd. https://www.qt.io/licensing/.</p>"
"<p>Some icons by <a href=\"https://icons8.com\">Icons8</a> and others by <a href=\"http://www.fatcow.com/free-icons\">fatcow</a> provided under Creative Commons "
"attribution 3.0 license.</p>"
).arg(year).arg(releaseNotesUrl).arg(pgLabVersionString));
}

5
pglab/About.h Normal file
View file

@ -0,0 +1,5 @@
#pragma once
#include <QWidget>
void ShowAboutDialog(QWidget *parent);

View file

@ -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);
}

View file

@ -39,6 +39,8 @@ private slots:
void on_actionConfigureCopy_triggered();
void on_actionAbout_triggered();
private:
Ui::ConnectionManagerWindow *ui;
MasterController *m_masterController;

View file

@ -26,13 +26,14 @@
<x>0</x>
<y>0</y>
<width>413</width>
<height>30</height>
<height>29</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>Fi&amp;le</string>
</property>
<addaction name="actionAbout"/>
<addaction name="actionQuit_application"/>
</widget>
<addaction name="menuFile"/>
@ -164,6 +165,16 @@ QToolButton {
<string>Configure copy</string>
</property>
</action>
<action name="actionAbout">
<property name="icon">
<iconset>
<normalon>:/icons/about.png</normalon>
</iconset>
</property>
<property name="text">
<string>About</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>

View file

@ -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);
}

View file

@ -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 \

View file

@ -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.