added "About" action
This commit is contained in:
parent
f3f910b867
commit
1dba4a7a83
|
@ -0,0 +1,31 @@
|
||||||
|
#include "AboutWindow.h"
|
||||||
|
#include "ui_AboutWindow.h"
|
||||||
|
|
||||||
|
AboutWindow::AboutWindow(QWidget* parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::AboutWindow)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->text->setText(
|
||||||
|
QString("\
|
||||||
|
Argento - Un gestionale da paura, scritto per\n\
|
||||||
|
GOLEM - Gruppo Operativo Linux Empoli\n\
|
||||||
|
\n\
|
||||||
|
Questo programma è software libero rilasciato sotto GPL 3\n\
|
||||||
|
presso git.golem.linux.it\n\
|
||||||
|
\n\
|
||||||
|
QT Version: %1\n\
|
||||||
|
git commit: %2\n\
|
||||||
|
data di compilazione: %3\n\
|
||||||
|
")
|
||||||
|
.arg(QT_VERSION_STR)
|
||||||
|
.arg(GOLEM_CURRENT_COMMIT)
|
||||||
|
.arg(QDate::currentDate().toString())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
AboutWindow::~AboutWindow()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QDate>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class AboutWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
class AboutWindow : public QDialog {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AboutWindow(QWidget* parent = nullptr);
|
||||||
|
~AboutWindow();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::AboutWindow *ui;
|
||||||
|
};
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AboutWindow</class>
|
||||||
|
<widget class="QDialog" name="AboutWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>360</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>A proposito...</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><img src=":/logo.svg"/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="text">
|
||||||
|
<property name="text">
|
||||||
|
<string>GOLEM - Gruppo Operativo Linux Empoli</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<action name="actionExit">
|
||||||
|
<property name="text">
|
||||||
|
<string>Exit</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAbout">
|
||||||
|
<property name="text">
|
||||||
|
<string>About</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -15,4 +15,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||||
} else {
|
} else {
|
||||||
status(Ui::ERROR, "Cannot connect to database: " + db.lastError().text());
|
status(Ui::ERROR, "Cannot connect to database: " + db.lastError().text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect (ui->actionExit, &QAction::triggered, [=]() {
|
||||||
|
close();
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->actionAbout, &QAction::triggered, [=]() {
|
||||||
|
AboutWindow window;
|
||||||
|
window.exec();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "SociListTab.h"
|
#include "SociListTab.h"
|
||||||
#include "EditWindow.h"
|
#include "EditWindow.h"
|
||||||
|
#include "AboutWindow.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>File</string>
|
<string>File</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="actionAbout"/>
|
||||||
<addaction name="actionExit"/>
|
<addaction name="actionExit"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuwhat_s_this"/>
|
<addaction name="menuwhat_s_this"/>
|
||||||
|
@ -67,6 +68,11 @@
|
||||||
<string>Exit</string>
|
<string>Exit</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionAbout">
|
||||||
|
<property name="text">
|
||||||
|
<string>About</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -21,6 +21,8 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
|
DEFINES += GOLEM_CURRENT_COMMIT="\\\"$(shell git rev-parse --short=16 HEAD)\\\""
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
@ -30,7 +32,8 @@ SOURCES += \
|
||||||
status.cpp \
|
status.cpp \
|
||||||
fullQuery.cpp \
|
fullQuery.cpp \
|
||||||
SociListTab.cpp \
|
SociListTab.cpp \
|
||||||
RenewalTab.cpp
|
RenewalTab.cpp \
|
||||||
|
AboutWindow.cpp
|
||||||
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
@ -39,14 +42,19 @@ HEADERS += \
|
||||||
status.h \
|
status.h \
|
||||||
fullQuery.h \
|
fullQuery.h \
|
||||||
SociListTab.h \
|
SociListTab.h \
|
||||||
RenewalTab.h
|
RenewalTab.h \
|
||||||
|
AboutWindow.h
|
||||||
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
MainWindow.ui \
|
MainWindow.ui \
|
||||||
EditWindow.ui \
|
EditWindow.ui \
|
||||||
SociListTab.ui \
|
SociListTab.ui \
|
||||||
RenewalTab.ui
|
RenewalTab.ui \
|
||||||
|
AboutWindow.ui
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
resources.qrc
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 23 KiB |
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE RCC><RCC version="1.0">
|
||||||
|
<qresource>
|
||||||
|
<file>logo.svg</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
Loading…
Reference in New Issue