Fri, 11 Feb 2022 14:22:26 +0100
Added About dialog
CMakeLists.txt | file | annotate | diff | comparison | revisions | |
src/AboutDialog.cpp | file | annotate | diff | comparison | revisions | |
src/AboutDialog.h | file | annotate | diff | comparison | revisions | |
src/MainWindow.cpp | file | annotate | diff | comparison | revisions | |
src/MainWindow.h | file | annotate | diff | comparison | revisions | |
src/database/database.cpp | file | annotate | diff | comparison | revisions | |
ui/AboutDialog.ui | file | annotate | diff | comparison | revisions | |
ui/MainWindow.ui | file | annotate | diff | comparison | revisions |
--- a/CMakeLists.txt Fri Feb 11 12:02:09 2022 +0100 +++ b/CMakeLists.txt Fri Feb 11 14:22:26 2022 +0100 @@ -97,17 +97,20 @@ set( SRCS ${SRCDIR}/main.cpp ${SRCDIR}/bmsapp.cpp + ${SRCDIR}/AboutDialog.cpp ${SRCDIR}/MainWindow.cpp ${SRCDIR}/database/database.cpp ) set( HDRS ${SRCDIR}/bmsapp.h + ${SRCDIR}/AboutDialog.h ${SRCDIR}/MainWindow.h ${SRCDIR}/database/database.h ) set( UIS + ${UIDIR}/AboutDialog.ui ${UIDIR}/MainWindow.ui )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/AboutDialog.cpp Fri Feb 11 14:22:26 2022 +0100 @@ -0,0 +1,28 @@ +/** + * AboutDialog.cpp is part of bmsapp. + * + * bmsapp 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. + * + * bmsapp 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 this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "AboutDialog.h" +#include "../ui/ui_AboutDialog.h" + +AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) +{ + ui->setupUi(this); +} + +AboutDialog::~AboutDialog() +{ + delete ui; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/AboutDialog.h Fri Feb 11 14:22:26 2022 +0100 @@ -0,0 +1,22 @@ +#ifndef _ABOUTDIALOG_H +#define _ABOUTDIALOG_H + +#include <QDialog> + +namespace Ui { +class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +private: + Ui::AboutDialog *ui; +}; + +#endif // ABOUTDIALOG_H
--- a/src/MainWindow.cpp Fri Feb 11 12:02:09 2022 +0100 +++ b/src/MainWindow.cpp Fri Feb 11 14:22:26 2022 +0100 @@ -1,5 +1,21 @@ - +/** + * MainWindow.cpp is part of bmsapp. + * + * bmsapp 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. + * + * bmsapp 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 this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "MainWindow.h" +#include "AboutDialog.h" #include "../ui/ui_MainWindow.h" #include <QApplication> @@ -11,14 +27,27 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { - ui->setupUi(this); + ui->setupUi(this); } MainWindow::~MainWindow() { - delete ui; + delete ui; } +void MainWindow::on_actionExit_triggered() +{ + this->close(); +} + +void MainWindow::on_actionAbout_triggered() +{ + AboutDialog dialog(this); + dialog.setModal(true); + dialog.exec(); +} + +
--- a/src/MainWindow.h Fri Feb 11 12:02:09 2022 +0100 +++ b/src/MainWindow.h Fri Feb 11 14:22:26 2022 +0100 @@ -12,13 +12,15 @@ class MainWindow : public QMainWindow { - Q_OBJECT + Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); private slots: + void on_actionExit_triggered(); + void on_actionAbout_triggered(); public slots:
--- a/src/database/database.cpp Fri Feb 11 12:02:09 2022 +0100 +++ b/src/database/database.cpp Fri Feb 11 14:22:26 2022 +0100 @@ -1,7 +1,21 @@ +/** + * database.cpp is part of bmsapp. + * + * bmsapp 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. + * + * bmsapp 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 this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "database.h" -// from: https://evileg.com/en/post/93/ - -#include "database.h" DataBase::DataBase(QObject *parent) : QObject(parent) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/AboutDialog.ui Fri Feb 11 14:22:26 2022 +0100 @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AboutDialog</class> + <widget class="QDialog" name="AboutDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>684</width> + <height>353</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="font"> + <font> + <family>Liberation Sans</family> + <pointsize>28</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Brewery Management System app</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="margin"> + <number>30</number> + </property> + </widget> + </item> + <item> + <widget class="QPlainTextEdit" name="plainTextEdit"> + <property name="plainText"> + <string>Code: +Author: Michiel Broek +Source: https://hg.mbse.eu/bmsapp/ +License: GPL v3 + +Icons: Silk +Author: Mark James +Source: http://www.famfamfam.com/lab/icons/silk/ +License: Creative Commons Attribution 2.5 License</string> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>AboutDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>AboutDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui>
--- a/ui/MainWindow.ui Fri Feb 11 12:02:09 2022 +0100 +++ b/ui/MainWindow.ui Fri Feb 11 14:22:26 2022 +0100 @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>1450</width> - <height>1108</height> + <width>1280</width> + <height>640</height> </rect> </property> <property name="sizePolicy"> @@ -78,7 +78,13 @@ <string>&Profiles</string> </property> </widget> + <widget class="QMenu" name="menuInventory"> + <property name="title"> + <string>&Inventory</string> + </property> + </widget> <addaction name="menuFile"/> + <addaction name="menuInventory"/> <addaction name="menuProfiles"/> <addaction name="menuHelp"/> </widget>