Renamed AbsenceDialog to AbsencesDialog
This commit is contained in:
@@ -4,17 +4,20 @@ TARGET = absenceplugin
|
||||
|
||||
DBLIBS += core gui
|
||||
|
||||
HEADERS += absencedialog.h \
|
||||
HEADERS += \
|
||||
absencesmodel.h \
|
||||
absenceplugin.h \
|
||||
absencewidget.h
|
||||
absencewidget.h \
|
||||
absencesdialog.h
|
||||
|
||||
SOURCES += absencedialog.cpp \
|
||||
SOURCES += \
|
||||
absencesmodel.cpp \
|
||||
absenceplugin.cpp \
|
||||
absencewidget.cpp
|
||||
absencewidget.cpp \
|
||||
absencesdialog.cpp
|
||||
|
||||
FORMS += absencedialog.ui
|
||||
FORMS += \
|
||||
absencesdialog.ui
|
||||
|
||||
RESOURCES += absenceplugin_resources.qrc
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "absencedialog.h"
|
||||
#include "ui_absencedialog.h"
|
||||
#include "absencesdialog.h"
|
||||
#include "ui_absencesdialog.h"
|
||||
|
||||
#include <QDate>
|
||||
#include <QLocale>
|
||||
@@ -10,35 +10,35 @@
|
||||
|
||||
#include "absencesmodel.h"
|
||||
|
||||
AbsenceDialog::AbsenceDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent) :
|
||||
AbsencesDialog::AbsencesDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent) :
|
||||
ZeiterfassungDialog(parent),
|
||||
ui(new Ui::AbsenceDialog)
|
||||
ui(new Ui::AbsencesDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->labelTitle->setText(tr("Absences for %0").arg(QLocale().toString(date)));
|
||||
|
||||
m_model = new AbsencesModel(userId, date, erfassung, this);
|
||||
connect(m_model, &AbsencesModel::errorOccured, this, &AbsenceDialog::errorOccured);
|
||||
connect(m_model, &AbsencesModel::errorOccured, this, &AbsencesDialog::errorOccured);
|
||||
|
||||
ui->treeView->setModel(m_model);
|
||||
ui->treeView->setEnabled(m_model->enabled());
|
||||
connect(m_model, &AbsencesModel::enabledChanged, ui->treeView, &QWidget::setEnabled);
|
||||
|
||||
connect(ui->treeView, &QWidget::customContextMenuRequested, this, &AbsenceDialog::customContextMenuRequested);
|
||||
connect(ui->treeView, &QWidget::customContextMenuRequested, this, &AbsencesDialog::customContextMenuRequested);
|
||||
}
|
||||
|
||||
AbsenceDialog::~AbsenceDialog()
|
||||
AbsencesDialog::~AbsencesDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AbsenceDialog::errorOccured(const QString &message)
|
||||
void AbsencesDialog::errorOccured(const QString &message)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not load absences!"), tr("Could not load absences!") % "\n\n" % message);
|
||||
}
|
||||
|
||||
void AbsenceDialog::customContextMenuRequested(const QPoint &pos)
|
||||
void AbsencesDialog::customContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
auto index = ui->treeView->indexAt(pos);
|
||||
|
@@ -7,22 +7,22 @@ class QDate;
|
||||
class ZeiterfassungApi;
|
||||
|
||||
class AbsencesModel;
|
||||
namespace Ui { class AbsenceDialog; }
|
||||
namespace Ui { class AbsencesDialog; }
|
||||
|
||||
class AbsenceDialog : public ZeiterfassungDialog
|
||||
class AbsencesDialog : public ZeiterfassungDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AbsenceDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent = 0);
|
||||
~AbsenceDialog();
|
||||
explicit AbsencesDialog(int userId, const QDate &date, ZeiterfassungApi &erfassung, QWidget *parent = 0);
|
||||
~AbsencesDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void errorOccured(const QString &message);
|
||||
void customContextMenuRequested(const QPoint &pos);
|
||||
|
||||
private:
|
||||
Ui::AbsenceDialog *ui;
|
||||
Ui::AbsencesDialog *ui;
|
||||
|
||||
AbsencesModel *m_model;
|
||||
};
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AbsenceDialog</class>
|
||||
<widget class="QDialog" name="AbsenceDialog">
|
||||
<class>AbsencesDialog</class>
|
||||
<widget class="QDialog" name="AbsencesDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -50,7 +50,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AbsenceDialog</receiver>
|
||||
<receiver>AbsencesDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@@ -66,7 +66,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>AbsenceDialog</receiver>
|
||||
<receiver>AbsencesDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
@@ -3,7 +3,7 @@
|
||||
#include "stripswidget.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "absencedialog.h"
|
||||
#include "absencesdialog.h"
|
||||
|
||||
AbsenceWidget::AbsenceWidget(StripsWidget &stripsWidget) :
|
||||
QToolButton(&stripsWidget),
|
||||
@@ -17,7 +17,7 @@ AbsenceWidget::AbsenceWidget(StripsWidget &stripsWidget) :
|
||||
|
||||
void AbsenceWidget::pressedSlot()
|
||||
{
|
||||
AbsenceDialog dialog(m_stripsWidget.mainWindow().userInfo().userId, m_stripsWidget.date(),
|
||||
AbsencesDialog dialog(m_stripsWidget.mainWindow().userInfo().userId, m_stripsWidget.date(),
|
||||
m_stripsWidget.mainWindow().erfassung(), this);
|
||||
dialog.exec();
|
||||
}
|
||||
|
Reference in New Issue
Block a user