# HG changeset patch # User Michiel Broek # Date 1644585746 -3600 # Node ID fe106c497b75b7314b902ae2e902624209a5ab9f # Parent 4b95e33ee476c4802b539a392af6934dd41012ec Added About dialog diff -r 4b95e33ee476 -r fe106c497b75 CMakeLists.txt --- 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 ) diff -r 4b95e33ee476 -r fe106c497b75 src/AboutDialog.cpp --- /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 . + */ +#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; +} diff -r 4b95e33ee476 -r fe106c497b75 src/AboutDialog.h --- /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 + +namespace Ui { +class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +private: + Ui::AboutDialog *ui; +}; + +#endif // ABOUTDIALOG_H diff -r 4b95e33ee476 -r fe106c497b75 src/MainWindow.cpp --- 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 . + */ #include "MainWindow.h" +#include "AboutDialog.h" #include "../ui/ui_MainWindow.h" #include @@ -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(); +} + + diff -r 4b95e33ee476 -r fe106c497b75 src/MainWindow.h --- 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: diff -r 4b95e33ee476 -r fe106c497b75 src/database/database.cpp --- 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 . + */ +#include "database.h" -// from: https://evileg.com/en/post/93/ - -#include "database.h" DataBase::DataBase(QObject *parent) : QObject(parent) { diff -r 4b95e33ee476 -r fe106c497b75 ui/AboutDialog.ui --- /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 @@ + + + AboutDialog + + + + 0 + 0 + 684 + 353 + + + + Dialog + + + + + + true + + + + Liberation Sans + 28 + 75 + true + + + + Brewery Management System app + + + Qt::AlignCenter + + + 30 + + + + + + + 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 + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + AboutDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff -r 4b95e33ee476 -r fe106c497b75 ui/MainWindow.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 @@ 0 0 - 1450 - 1108 + 1280 + 640 @@ -78,7 +78,13 @@ &Profiles + + + &Inventory + + +