From 804015b6e8a2b8c1c993db9056e9e2576b4b7682 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 19 Dec 2017 18:59:49 +0100 Subject: [PATCH] Added LunchMealDialog --- plugins/lunchmealplugin/lunchmealdialog.cpp | 17 ++++ plugins/lunchmealplugin/lunchmealdialog.h | 22 ++++++ plugins/lunchmealplugin/lunchmealdialog.ui | 88 +++++++++++++++++++++ plugins/lunchmealplugin/lunchmealplugin.pro | 9 ++- plugins/lunchmealplugin/lunchmealwidget.cpp | 5 +- 5 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 plugins/lunchmealplugin/lunchmealdialog.cpp create mode 100644 plugins/lunchmealplugin/lunchmealdialog.h create mode 100644 plugins/lunchmealplugin/lunchmealdialog.ui diff --git a/plugins/lunchmealplugin/lunchmealdialog.cpp b/plugins/lunchmealplugin/lunchmealdialog.cpp new file mode 100644 index 0000000..b4f2bc6 --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealdialog.cpp @@ -0,0 +1,17 @@ +#include "lunchmealdialog.h" +#include "ui_lunchmealdialog.h" + +#include "stripswidget.h" +#include "mainwindow.h" + +LunchMealDialog::LunchMealDialog(StripsWidget &stripsWidget) : + QDialog(&stripsWidget.mainWindow()), + ui(new Ui::LunchMealDialog) +{ + ui->setupUi(this); +} + +LunchMealDialog::~LunchMealDialog() +{ + delete ui; +} diff --git a/plugins/lunchmealplugin/lunchmealdialog.h b/plugins/lunchmealplugin/lunchmealdialog.h new file mode 100644 index 0000000..c5a2aff --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealdialog.h @@ -0,0 +1,22 @@ +#ifndef LUNCHMEALDIALOG_H +#define LUNCHMEALDIALOG_H + +#include + +class StripsWidget; + +namespace Ui { class LunchMealDialog; } + +class LunchMealDialog : public QDialog +{ + Q_OBJECT + +public: + explicit LunchMealDialog(StripsWidget &stripsWidget); + ~LunchMealDialog(); + +private: + Ui::LunchMealDialog *ui; +}; + +#endif // LUNCHMEALDIALOG_H diff --git a/plugins/lunchmealplugin/lunchmealdialog.ui b/plugins/lunchmealplugin/lunchmealdialog.ui new file mode 100644 index 0000000..de5ebfe --- /dev/null +++ b/plugins/lunchmealplugin/lunchmealdialog.ui @@ -0,0 +1,88 @@ + + + LunchMealDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + 16 + 75 + true + + + + Lunch meal for + + + + + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttonBox + accepted() + LunchMealDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + LunchMealDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/plugins/lunchmealplugin/lunchmealplugin.pro b/plugins/lunchmealplugin/lunchmealplugin.pro index e57c562..62d9852 100644 --- a/plugins/lunchmealplugin/lunchmealplugin.pro +++ b/plugins/lunchmealplugin/lunchmealplugin.pro @@ -15,12 +15,15 @@ DEPENDPATH += $$PWD/../../zeiterfassunglib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT HEADERS += lunchmealplugin.h \ - lunchmealwidget.h + lunchmealwidget.h \ + lunchmealdialog.h SOURCES += lunchmealplugin.cpp \ - lunchmealwidget.cpp + lunchmealwidget.cpp \ + lunchmealdialog.cpp -FORMS += +FORMS += \ + lunchmealdialog.ui RESOURCES += lunchmealplugin_resources.qrc diff --git a/plugins/lunchmealplugin/lunchmealwidget.cpp b/plugins/lunchmealplugin/lunchmealwidget.cpp index 1d5f1b2..eacaaf6 100644 --- a/plugins/lunchmealplugin/lunchmealwidget.cpp +++ b/plugins/lunchmealplugin/lunchmealwidget.cpp @@ -6,6 +6,8 @@ #include "mainwindow.h" #include "zeiterfassungapi.h" +#include "lunchmealdialog.h" + LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) : QToolButton(&stripsWidget), m_stripsWidget(stripsWidget) @@ -18,5 +20,6 @@ LunchMealWidget::LunchMealWidget(StripsWidget &stripsWidget) : void LunchMealWidget::pressedSlot() { - + LunchMealDialog dialog(m_stripsWidget); + dialog.exec(); }