Added AbsenceDialog
This commit is contained in:
14
plugins/absenceplugin/absencedialog.cpp
Normal file
14
plugins/absenceplugin/absencedialog.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "absencedialog.h"
|
||||
#include "ui_absencedialog.h"
|
||||
|
||||
AbsenceDialog::AbsenceDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AbsenceDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
AbsenceDialog::~AbsenceDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
19
plugins/absenceplugin/absencedialog.h
Normal file
19
plugins/absenceplugin/absencedialog.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AbsenceDialog;
|
||||
}
|
||||
|
||||
class AbsenceDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AbsenceDialog(QWidget *parent = 0);
|
||||
~AbsenceDialog();
|
||||
|
||||
private:
|
||||
Ui::AbsenceDialog *ui;
|
||||
};
|
71
plugins/absenceplugin/absencedialog.ui
Normal file
71
plugins/absenceplugin/absencedialog.ui
Normal file
@@ -0,0 +1,71 @@
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>AbsenceDialog</class>
|
||||
<widget name="AbsenceDialog" class="QDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget name="buttonBox" class="QDialogButtonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AbsenceDialog</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>AbsenceDialog</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>
|
@@ -8,16 +8,19 @@ HEADERS += \
|
||||
absencesmodel.h \
|
||||
absenceplugin.h \
|
||||
absencewidget.h \
|
||||
absencesdialog.h
|
||||
absencesdialog.h \
|
||||
absencedialog.h
|
||||
|
||||
SOURCES += \
|
||||
absencesmodel.cpp \
|
||||
absenceplugin.cpp \
|
||||
absencewidget.cpp \
|
||||
absencesdialog.cpp
|
||||
absencesdialog.cpp \
|
||||
absencedialog.cpp
|
||||
|
||||
FORMS += \
|
||||
absencesdialog.ui
|
||||
absencesdialog.ui \
|
||||
absencedialog.ui
|
||||
|
||||
RESOURCES += absenceplugin_resources.qrc
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include <QAction>
|
||||
|
||||
#include "absencesmodel.h"
|
||||
#include "absencedialog.h"
|
||||
|
||||
AbsencesDialog::AbsencesDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent) :
|
||||
ZeiterfassungDialog(parent),
|
||||
@@ -50,7 +51,11 @@ void AbsencesDialog::customContextMenuRequested(const QPoint &pos)
|
||||
auto selectedAction = menu.exec(ui->treeView->viewport()->mapToGlobal(pos));
|
||||
if(selectedAction == createAction)
|
||||
{
|
||||
//TODO
|
||||
AbsenceDialog dialog(this);
|
||||
if(dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
else if(selectedAction == refreshAction)
|
||||
{
|
||||
@@ -67,7 +72,11 @@ void AbsencesDialog::customContextMenuRequested(const QPoint &pos)
|
||||
auto selectedAction = menu.exec(ui->treeView->viewport()->mapToGlobal(pos));
|
||||
if(selectedAction == editAction)
|
||||
{
|
||||
//TODO
|
||||
AbsenceDialog dialog(this);
|
||||
if(dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
else if(selectedAction == deleteAction)
|
||||
{
|
||||
|
Reference in New Issue
Block a user