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:
parent
4e1d128ee9
commit
c874b297c1
8 changed files with 66 additions and 14 deletions
23
pglab/About.cpp
Normal file
23
pglab/About.cpp
Normal 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
5
pglab/About.h
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
void ShowAboutDialog(QWidget *parent);
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ private slots:
|
|||
|
||||
void on_actionConfigureCopy_triggered();
|
||||
|
||||
void on_actionAbout_triggered();
|
||||
|
||||
private:
|
||||
Ui::ConnectionManagerWindow *ui;
|
||||
MasterController *m_masterController;
|
||||
|
|
|
|||
|
|
@ -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&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"/>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue