Implemented ProjectsModel
This commit is contained in:
@@ -20,123 +20,123 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>main</name>
|
<name>main</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="64"/>
|
<location filename="../main.cpp" line="61"/>
|
||||||
<source>Loading translations...</source>
|
<source>Loading translations...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="76"/>
|
<location filename="../main.cpp" line="73"/>
|
||||||
<location filename="../main.cpp" line="77"/>
|
<location filename="../main.cpp" line="74"/>
|
||||||
<source>Invalid language selection!</source>
|
<source>Invalid language selection!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="78"/>
|
<location filename="../main.cpp" line="75"/>
|
||||||
<source>You did not select a valid language!</source>
|
<source>You did not select a valid language!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="97"/>
|
<location filename="../main.cpp" line="94"/>
|
||||||
<source>Loading theme...</source>
|
<source>Loading theme...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="108"/>
|
<location filename="../main.cpp" line="105"/>
|
||||||
<location filename="../main.cpp" line="109"/>
|
<location filename="../main.cpp" line="106"/>
|
||||||
<location filename="../main.cpp" line="116"/>
|
<location filename="../main.cpp" line="113"/>
|
||||||
<location filename="../main.cpp" line="117"/>
|
<location filename="../main.cpp" line="114"/>
|
||||||
<source>Could not load theme!</source>
|
<source>Could not load theme!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="110"/>
|
<location filename="../main.cpp" line="107"/>
|
||||||
<source>Theme file does not exist!</source>
|
<source>Theme file does not exist!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="130"/>
|
<location filename="../main.cpp" line="127"/>
|
||||||
<source>Loading strip layouts...</source>
|
<source>Loading strip layouts...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="134"/>
|
<location filename="../main.cpp" line="131"/>
|
||||||
<location filename="../main.cpp" line="135"/>
|
<location filename="../main.cpp" line="132"/>
|
||||||
<location filename="../main.cpp" line="143"/>
|
<location filename="../main.cpp" line="140"/>
|
||||||
<location filename="../main.cpp" line="144"/>
|
<location filename="../main.cpp" line="141"/>
|
||||||
<location filename="../main.cpp" line="153"/>
|
<location filename="../main.cpp" line="150"/>
|
||||||
<location filename="../main.cpp" line="154"/>
|
<location filename="../main.cpp" line="151"/>
|
||||||
<location filename="../main.cpp" line="163"/>
|
<location filename="../main.cpp" line="160"/>
|
||||||
<location filename="../main.cpp" line="164"/>
|
<location filename="../main.cpp" line="161"/>
|
||||||
<source>Could not load strips!</source>
|
<source>Could not load strips!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="174"/>
|
<location filename="../main.cpp" line="171"/>
|
||||||
<source>Loading login page...</source>
|
<source>Loading login page...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="183"/>
|
<location filename="../main.cpp" line="180"/>
|
||||||
<location filename="../main.cpp" line="184"/>
|
<location filename="../main.cpp" line="181"/>
|
||||||
<source>Could not access Zeiterfassung!</source>
|
<source>Could not access Zeiterfassung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="188"/>
|
<location filename="../main.cpp" line="185"/>
|
||||||
<source>Base url</source>
|
<source>Base url</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="189"/>
|
<location filename="../main.cpp" line="186"/>
|
||||||
<source>Please enter the base url to the Zeiterfassung:</source>
|
<source>Please enter the base url to the Zeiterfassung:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="198"/>
|
<location filename="../main.cpp" line="195"/>
|
||||||
<source>Invalid url!</source>
|
<source>Invalid url!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="199"/>
|
<location filename="../main.cpp" line="196"/>
|
||||||
<source>This url is not valid!</source>
|
<source>This url is not valid!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="214"/>
|
<location filename="../main.cpp" line="211"/>
|
||||||
<source>Authenticating...</source>
|
<source>Authenticating...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="235"/>
|
<location filename="../main.cpp" line="232"/>
|
||||||
<location filename="../main.cpp" line="236"/>
|
<location filename="../main.cpp" line="233"/>
|
||||||
<source>Could not authenticate with Zeiterfassung!</source>
|
<source>Could not authenticate with Zeiterfassung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="257"/>
|
<location filename="../main.cpp" line="254"/>
|
||||||
<source>Getting user information...</source>
|
<source>Getting user information...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="266"/>
|
<location filename="../main.cpp" line="263"/>
|
||||||
<location filename="../main.cpp" line="267"/>
|
<location filename="../main.cpp" line="264"/>
|
||||||
<source>Could not get user information!</source>
|
<source>Could not get user information!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="300"/>
|
<location filename="../main.cpp" line="297"/>
|
||||||
<location filename="../main.cpp" line="301"/>
|
<location filename="../main.cpp" line="298"/>
|
||||||
<source>Could not load plugin %0!</source>
|
<source>Could not load plugin %0!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="310"/>
|
<location filename="../main.cpp" line="307"/>
|
||||||
<location filename="../main.cpp" line="311"/>
|
<location filename="../main.cpp" line="308"/>
|
||||||
<source>Plugin not valid %0!</source>
|
<source>Plugin not valid %0!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="340"/>
|
<location filename="../main.cpp" line="337"/>
|
||||||
<source>Loading settings...</source>
|
<source>Loading settings...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -20,123 +20,123 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>main</name>
|
<name>main</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="64"/>
|
<location filename="../main.cpp" line="61"/>
|
||||||
<source>Loading translations...</source>
|
<source>Loading translations...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="76"/>
|
<location filename="../main.cpp" line="73"/>
|
||||||
<location filename="../main.cpp" line="77"/>
|
<location filename="../main.cpp" line="74"/>
|
||||||
<source>Invalid language selection!</source>
|
<source>Invalid language selection!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="78"/>
|
<location filename="../main.cpp" line="75"/>
|
||||||
<source>You did not select a valid language!</source>
|
<source>You did not select a valid language!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="97"/>
|
<location filename="../main.cpp" line="94"/>
|
||||||
<source>Loading theme...</source>
|
<source>Loading theme...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="108"/>
|
<location filename="../main.cpp" line="105"/>
|
||||||
<location filename="../main.cpp" line="109"/>
|
<location filename="../main.cpp" line="106"/>
|
||||||
<location filename="../main.cpp" line="116"/>
|
<location filename="../main.cpp" line="113"/>
|
||||||
<location filename="../main.cpp" line="117"/>
|
<location filename="../main.cpp" line="114"/>
|
||||||
<source>Could not load theme!</source>
|
<source>Could not load theme!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="110"/>
|
<location filename="../main.cpp" line="107"/>
|
||||||
<source>Theme file does not exist!</source>
|
<source>Theme file does not exist!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="130"/>
|
<location filename="../main.cpp" line="127"/>
|
||||||
<source>Loading strip layouts...</source>
|
<source>Loading strip layouts...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="134"/>
|
<location filename="../main.cpp" line="131"/>
|
||||||
<location filename="../main.cpp" line="135"/>
|
<location filename="../main.cpp" line="132"/>
|
||||||
<location filename="../main.cpp" line="143"/>
|
<location filename="../main.cpp" line="140"/>
|
||||||
<location filename="../main.cpp" line="144"/>
|
<location filename="../main.cpp" line="141"/>
|
||||||
<location filename="../main.cpp" line="153"/>
|
<location filename="../main.cpp" line="150"/>
|
||||||
<location filename="../main.cpp" line="154"/>
|
<location filename="../main.cpp" line="151"/>
|
||||||
<location filename="../main.cpp" line="163"/>
|
<location filename="../main.cpp" line="160"/>
|
||||||
<location filename="../main.cpp" line="164"/>
|
<location filename="../main.cpp" line="161"/>
|
||||||
<source>Could not load strips!</source>
|
<source>Could not load strips!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="174"/>
|
<location filename="../main.cpp" line="171"/>
|
||||||
<source>Loading login page...</source>
|
<source>Loading login page...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="183"/>
|
<location filename="../main.cpp" line="180"/>
|
||||||
<location filename="../main.cpp" line="184"/>
|
<location filename="../main.cpp" line="181"/>
|
||||||
<source>Could not access Zeiterfassung!</source>
|
<source>Could not access Zeiterfassung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="188"/>
|
<location filename="../main.cpp" line="185"/>
|
||||||
<source>Base url</source>
|
<source>Base url</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="189"/>
|
<location filename="../main.cpp" line="186"/>
|
||||||
<source>Please enter the base url to the Zeiterfassung:</source>
|
<source>Please enter the base url to the Zeiterfassung:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="198"/>
|
<location filename="../main.cpp" line="195"/>
|
||||||
<source>Invalid url!</source>
|
<source>Invalid url!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="199"/>
|
<location filename="../main.cpp" line="196"/>
|
||||||
<source>This url is not valid!</source>
|
<source>This url is not valid!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="214"/>
|
<location filename="../main.cpp" line="211"/>
|
||||||
<source>Authenticating...</source>
|
<source>Authenticating...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="235"/>
|
<location filename="../main.cpp" line="232"/>
|
||||||
<location filename="../main.cpp" line="236"/>
|
<location filename="../main.cpp" line="233"/>
|
||||||
<source>Could not authenticate with Zeiterfassung!</source>
|
<source>Could not authenticate with Zeiterfassung!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="257"/>
|
<location filename="../main.cpp" line="254"/>
|
||||||
<source>Getting user information...</source>
|
<source>Getting user information...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="266"/>
|
<location filename="../main.cpp" line="263"/>
|
||||||
<location filename="../main.cpp" line="267"/>
|
<location filename="../main.cpp" line="264"/>
|
||||||
<source>Could not get user information!</source>
|
<source>Could not get user information!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="300"/>
|
<location filename="../main.cpp" line="297"/>
|
||||||
<location filename="../main.cpp" line="301"/>
|
<location filename="../main.cpp" line="298"/>
|
||||||
<source>Could not load plugin %0!</source>
|
<source>Could not load plugin %0!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="310"/>
|
<location filename="../main.cpp" line="307"/>
|
||||||
<location filename="../main.cpp" line="311"/>
|
<location filename="../main.cpp" line="308"/>
|
||||||
<source>Plugin not valid %0!</source>
|
<source>Plugin not valid %0!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="340"/>
|
<location filename="../main.cpp" line="337"/>
|
||||||
<source>Loading settings...</source>
|
<source>Loading settings...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -6,6 +6,7 @@ find_package(Qt5LinguistTools CONFIG REQUIRED)
|
|||||||
|
|
||||||
set(HEADERS
|
set(HEADERS
|
||||||
mainwindow.h
|
mainwindow.h
|
||||||
|
projectsmodel.h
|
||||||
settingswidget.h
|
settingswidget.h
|
||||||
stripfactory.h
|
stripfactory.h
|
||||||
stripswidget.h
|
stripswidget.h
|
||||||
@@ -19,6 +20,7 @@ set(HEADERS
|
|||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
mainwindow.cpp
|
mainwindow.cpp
|
||||||
|
projectsmodel.cpp
|
||||||
settingswidget.cpp
|
settingswidget.cpp
|
||||||
stripfactory.cpp
|
stripfactory.cpp
|
||||||
stripswidget.cpp
|
stripswidget.cpp
|
||||||
|
@@ -37,7 +37,8 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
|||||||
m_stripFactory(stripFactory),
|
m_stripFactory(stripFactory),
|
||||||
m_plugins(plugins),
|
m_plugins(plugins),
|
||||||
m_currentStripWidget(Q_NULLPTR),
|
m_currentStripWidget(Q_NULLPTR),
|
||||||
m_timerId(-1)
|
m_timerId(-1),
|
||||||
|
m_projectsModel(m_userInfo.userId, QDate::currentDate(), m_erfassung)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@@ -96,6 +97,8 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
|
|||||||
}
|
}
|
||||||
|
|
||||||
dateChangedSlot(ui->dateEditDate->date());
|
dateChangedSlot(ui->dateEditDate->date());
|
||||||
|
|
||||||
|
ui->comboBoxDebug->setModel(&m_projectsModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include "replies/getuserinforeply.h"
|
#include "replies/getuserinforeply.h"
|
||||||
#include "replies/getcomboboxreply.h"
|
#include "replies/getcomboboxreply.h"
|
||||||
#include "replies/getpresencestatusreply.h"
|
#include "replies/getpresencestatusreply.h"
|
||||||
|
#include "projectsmodel.h"
|
||||||
|
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
@@ -85,4 +86,6 @@ private:
|
|||||||
StripsWidget *m_currentStripWidget;
|
StripsWidget *m_currentStripWidget;
|
||||||
|
|
||||||
int m_timerId;
|
int m_timerId;
|
||||||
|
|
||||||
|
ProjectsModel m_projectsModel;
|
||||||
};
|
};
|
||||||
|
@@ -176,6 +176,22 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxDebug"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
217
zeiterfassungguilib/projectsmodel.cpp
Normal file
217
zeiterfassungguilib/projectsmodel.cpp
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
#include "projectsmodel.h"
|
||||||
|
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
|
#include "zeiterfassungapi.h"
|
||||||
|
#include "replies/getcomboboxreply.h"
|
||||||
|
|
||||||
|
ProjectsModel::ProjectsModel(int userId, const QDate &date, ZeiterfassungApi &api, QObject *parent) :
|
||||||
|
QAbstractListModel(parent),
|
||||||
|
m_userId(userId),
|
||||||
|
m_date(date),
|
||||||
|
m_api(api)
|
||||||
|
{
|
||||||
|
m_getProjectsReply = m_api.doGetProjects(m_userId, m_date);
|
||||||
|
connect(m_getProjectsReply.get(), &ZeiterfassungReply::finished, this, &ProjectsModel::getProjectsFinished);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ProjectsModel::rowCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
if (parent.isValid())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (m_getProjectsReply != nullptr)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
int rows { 0 };
|
||||||
|
for (const auto &project : m_projects)
|
||||||
|
{
|
||||||
|
rows++; // header
|
||||||
|
if (project.getWorkpackagesReply != nullptr)
|
||||||
|
rows++; // loading or failed
|
||||||
|
else
|
||||||
|
rows += project.workpackages.size();
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant ProjectsModel::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
if (!index.isValid() || index.column() != 0 || index.row() < 0)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
if (m_getProjectsReply != nullptr)
|
||||||
|
{
|
||||||
|
if (index.row() != 0)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
switch (role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
if (m_getProjectsReply->isFinished())
|
||||||
|
{
|
||||||
|
Q_ASSERT(!m_getProjectsReply->success());
|
||||||
|
return m_getProjectsReply->message();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return tr("Loading projects...");
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int row { 0 };
|
||||||
|
for (const auto &project : m_projects)
|
||||||
|
{
|
||||||
|
if (row++ == index.row())
|
||||||
|
{
|
||||||
|
switch (role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
return project.value + " (" + project.label + ')';
|
||||||
|
case Qt::EditRole:
|
||||||
|
return project.value;
|
||||||
|
case Qt::FontRole:
|
||||||
|
{
|
||||||
|
QFont font;
|
||||||
|
font.setBold(true);
|
||||||
|
return font;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project.getWorkpackagesReply != nullptr)
|
||||||
|
{
|
||||||
|
if (row++ == index.row())
|
||||||
|
{
|
||||||
|
switch (role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
case Qt::EditRole:
|
||||||
|
if (project.getWorkpackagesReply->isFinished())
|
||||||
|
{
|
||||||
|
Q_ASSERT(!project.getWorkpackagesReply->success());
|
||||||
|
return project.getWorkpackagesReply->message();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return tr("Loading workpackages...");
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (const auto &workpackage : project.workpackages)
|
||||||
|
{
|
||||||
|
if (row++ == index.row())
|
||||||
|
{
|
||||||
|
switch (role)
|
||||||
|
{
|
||||||
|
case Qt::DisplayRole:
|
||||||
|
return std::get<0>(workpackage) + " (" + std::get<1>(workpackage) + ')';
|
||||||
|
case Qt::EditRole:
|
||||||
|
return std::get<0>(workpackage);
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags ProjectsModel::flags(const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
auto flags = QAbstractListModel::flags(index);
|
||||||
|
if (!isSelectable(index))
|
||||||
|
flags &=~Qt::ItemIsSelectable;
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProjectsModel::getProjectsFinished()
|
||||||
|
{
|
||||||
|
if (!m_getProjectsReply->success())
|
||||||
|
{
|
||||||
|
emit dataChanged(createIndex(0, 0), createIndex(0, 0), { Qt::DisplayRole, Qt::EditRole });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit beginResetModel();
|
||||||
|
for (const auto &item : m_getProjectsReply->items())
|
||||||
|
{
|
||||||
|
const auto index = m_projects.size();
|
||||||
|
auto &project = m_projects.emplace_back(item.label, item.value, m_api.doGetWorkpackages(m_userId, m_date, item.value));
|
||||||
|
connect(project.getWorkpackagesReply.get(), &ZeiterfassungReply::finished, this, [this,index](){ getWorkspacesFinished(index); });
|
||||||
|
}
|
||||||
|
m_getProjectsReply = nullptr;
|
||||||
|
emit endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProjectsModel::getWorkspacesFinished(int index)
|
||||||
|
{
|
||||||
|
getWorkspacesFinished(m_projects[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProjectsModel::getWorkspacesFinished(ProjectsModel::Project &project)
|
||||||
|
{
|
||||||
|
if (!project.getWorkpackagesReply->success())
|
||||||
|
{
|
||||||
|
//TODO: improve performance
|
||||||
|
emit beginResetModel();
|
||||||
|
emit endResetModel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &item : project.getWorkpackagesReply->items())
|
||||||
|
project.workpackages.push_back(std::make_pair(item.value, item.label));
|
||||||
|
|
||||||
|
project.getWorkpackagesReply = nullptr;
|
||||||
|
|
||||||
|
//TODO: improve performance
|
||||||
|
emit beginResetModel();
|
||||||
|
emit endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ProjectsModel::isSelectable(const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
if (!index.isValid() || index.column() != 0 || index.row() < 0)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
if (m_getProjectsReply != nullptr)
|
||||||
|
{
|
||||||
|
if (index.row() != 0)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int row { 0 };
|
||||||
|
for (const auto &project : m_projects)
|
||||||
|
{
|
||||||
|
if (row++ == index.row())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (project.getWorkpackagesReply != nullptr)
|
||||||
|
{
|
||||||
|
if (row++ == index.row())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (const auto &workpackage : project.workpackages)
|
||||||
|
{
|
||||||
|
Q_UNUSED(workpackage)
|
||||||
|
if (row++ == index.row())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
50
zeiterfassungguilib/projectsmodel.h
Normal file
50
zeiterfassungguilib/projectsmodel.h
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QAbstractListModel>
|
||||||
|
#include <QDate>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class ZeiterfassungApi;
|
||||||
|
class GetComboboxReply;
|
||||||
|
|
||||||
|
class ProjectsModel : public QAbstractListModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
struct Project {
|
||||||
|
Project(const QString &label, const QString &value, std::unique_ptr<GetComboboxReply> getWorkpackagesReply) :
|
||||||
|
label(label), value(value), getWorkpackagesReply(std::move(getWorkpackagesReply))
|
||||||
|
{}
|
||||||
|
|
||||||
|
QString label;
|
||||||
|
QString value;
|
||||||
|
|
||||||
|
std::unique_ptr<GetComboboxReply> getWorkpackagesReply;
|
||||||
|
|
||||||
|
std::vector<std::pair<QString, QString> > workpackages;
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ProjectsModel(int userId, const QDate &date, ZeiterfassungApi &api, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
int rowCount(const QModelIndex &parent) const override;
|
||||||
|
QVariant data(const QModelIndex &index, int role) const override;
|
||||||
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void getProjectsFinished();
|
||||||
|
void getWorkspacesFinished(int index);
|
||||||
|
void getWorkspacesFinished(Project &project);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool isSelectable(const QModelIndex &index) const;
|
||||||
|
|
||||||
|
const int m_userId;
|
||||||
|
const QDate m_date;
|
||||||
|
ZeiterfassungApi &m_api;
|
||||||
|
|
||||||
|
std::unique_ptr<GetComboboxReply> m_getProjectsReply;
|
||||||
|
std::vector<Project> m_projects;
|
||||||
|
};
|
@@ -78,8 +78,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="155"/>
|
<location filename="../mainwindow.ui" line="155"/>
|
||||||
<location filename="../mainwindow.cpp" line="396"/>
|
<location filename="../mainwindow.cpp" line="399"/>
|
||||||
<location filename="../mainwindow.cpp" line="407"/>
|
<location filename="../mainwindow.cpp" line="410"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation>Kommen</translation>
|
<translation>Kommen</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -89,116 +89,129 @@
|
|||||||
<translation>Gehen</translation>
|
<translation>Gehen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="218"/>
|
<location filename="../mainwindow.ui" line="234"/>
|
||||||
<source>&File</source>
|
<source>&File</source>
|
||||||
<translation>&Datei</translation>
|
<translation>&Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="224"/>
|
<location filename="../mainwindow.ui" line="240"/>
|
||||||
<source>&About</source>
|
<source>&About</source>
|
||||||
<translation>&Über</translation>
|
<translation>&Über</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="234"/>
|
<location filename="../mainwindow.ui" line="250"/>
|
||||||
<source>&View</source>
|
<source>&View</source>
|
||||||
<translation>&Ansicht</translation>
|
<translation>&Ansicht</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="241"/>
|
<location filename="../mainwindow.ui" line="257"/>
|
||||||
<source>&Tools</source>
|
<source>&Tools</source>
|
||||||
<translation>&Werkzeuge</translation>
|
<translation>&Werkzeuge</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="266"/>
|
<location filename="../mainwindow.ui" line="282"/>
|
||||||
<source>&Quit</source>
|
<source>&Quit</source>
|
||||||
<translation>&Beenden</translation>
|
<translation>&Beenden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="275"/>
|
<location filename="../mainwindow.ui" line="291"/>
|
||||||
<source>About &Me</source>
|
<source>About &Me</source>
|
||||||
<translation>Über &mich</translation>
|
<translation>Über &mich</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="284"/>
|
<location filename="../mainwindow.ui" line="300"/>
|
||||||
<source>About &zeiterfassung</source>
|
<source>About &zeiterfassung</source>
|
||||||
<translation>Über &zeiterfassung</translation>
|
<translation>Über &zeiterfassung</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="293"/>
|
<location filename="../mainwindow.ui" line="309"/>
|
||||||
<source>About &Qt</source>
|
<source>About &Qt</source>
|
||||||
<translation>Über &Qt</translation>
|
<translation>Über &Qt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="302"/>
|
<location filename="../mainwindow.ui" line="318"/>
|
||||||
<source>&Today</source>
|
<source>&Today</source>
|
||||||
<translation>&Heute</translation>
|
<translation>&Heute</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="311"/>
|
<location filename="../mainwindow.ui" line="327"/>
|
||||||
<source>&Refresh everything</source>
|
<source>&Refresh everything</source>
|
||||||
<translation>Alles &neu laden</translation>
|
<translation>Alles &neu laden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="320"/>
|
<location filename="../mainwindow.ui" line="336"/>
|
||||||
<source>&Settings</source>
|
<source>&Settings</source>
|
||||||
<translation>&Einstellungen</translation>
|
<translation>&Einstellungen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="329"/>
|
<location filename="../mainwindow.ui" line="345"/>
|
||||||
<source>Help</source>
|
<source>Help</source>
|
||||||
<translation>Hilfe</translation>
|
<translation>Hilfe</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="44"/>
|
<location filename="../mainwindow.cpp" line="45"/>
|
||||||
<source>Zeiterfassung - %0 (%1)</source>
|
<source>Zeiterfassung - %0 (%1)</source>
|
||||||
<translation>Zeiterfassung - %0 (%1)</translation>
|
<translation>Zeiterfassung - %0 (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="81"/>
|
<location filename="../mainwindow.cpp" line="82"/>
|
||||||
<source>Workpackage</source>
|
<source>Workpackage</source>
|
||||||
<translation>Arbeitspaket</translation>
|
<translation>Arbeitspaket</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="82"/>
|
<location filename="../mainwindow.cpp" line="83"/>
|
||||||
<source>Text</source>
|
<source>Text</source>
|
||||||
<translation>Text</translation>
|
<translation>Text</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="194"/>
|
<location filename="../mainwindow.cpp" line="197"/>
|
||||||
<location filename="../mainwindow.cpp" line="195"/>
|
<location filename="../mainwindow.cpp" line="198"/>
|
||||||
<source>Could not load bookings!</source>
|
<source>Could not load bookings!</source>
|
||||||
<translation>Konnte Buchungen nicht laden!</translation>
|
<translation>Konnte Buchungen nicht laden!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="225"/>
|
<location filename="../mainwindow.cpp" line="228"/>
|
||||||
<location filename="../mainwindow.cpp" line="327"/>
|
<location filename="../mainwindow.cpp" line="330"/>
|
||||||
<source>Could not create booking!</source>
|
<source>Could not create booking!</source>
|
||||||
<translation>Konnte Buchung nicht erstellen!</translation>
|
<translation>Konnte Buchung nicht erstellen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="251"/>
|
<location filename="../mainwindow.cpp" line="254"/>
|
||||||
<location filename="../mainwindow.cpp" line="312"/>
|
<location filename="../mainwindow.cpp" line="315"/>
|
||||||
<source>Could not edit time assignment!</source>
|
<source>Could not edit time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
<translation>Konnte Kontierung nicht bearbeiten!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="426"/>
|
<location filename="../mainwindow.cpp" line="429"/>
|
||||||
<location filename="../mainwindow.cpp" line="435"/>
|
<location filename="../mainwindow.cpp" line="438"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation>%0 (%1)</translation>
|
<translation>%0 (%1)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="269"/>
|
<location filename="../mainwindow.cpp" line="272"/>
|
||||||
<source>Could not create time assignment!</source>
|
<source>Could not create time assignment!</source>
|
||||||
<translation>Konnte Kontierung nicht erstellen!</translation>
|
<translation>Konnte Kontierung nicht erstellen!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="396"/>
|
<location filename="../mainwindow.cpp" line="399"/>
|
||||||
<location filename="../mainwindow.cpp" line="407"/>
|
<location filename="../mainwindow.cpp" line="410"/>
|
||||||
<source>Switch</source>
|
<source>Switch</source>
|
||||||
<translation>Wechseln</translation>
|
<translation>Wechseln</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>ProjectsModel</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../projectsmodel.cpp" line="58"/>
|
||||||
|
<source>Loading projects...</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../projectsmodel.cpp" line="100"/>
|
||||||
|
<source>Loading workpackages...</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SettingsDialog</name>
|
<name>SettingsDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@@ -78,8 +78,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="155"/>
|
<location filename="../mainwindow.ui" line="155"/>
|
||||||
<location filename="../mainwindow.cpp" line="396"/>
|
<location filename="../mainwindow.cpp" line="399"/>
|
||||||
<location filename="../mainwindow.cpp" line="407"/>
|
<location filename="../mainwindow.cpp" line="410"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -89,116 +89,129 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="218"/>
|
<location filename="../mainwindow.ui" line="234"/>
|
||||||
<source>&File</source>
|
<source>&File</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="224"/>
|
<location filename="../mainwindow.ui" line="240"/>
|
||||||
<source>&About</source>
|
<source>&About</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="234"/>
|
<location filename="../mainwindow.ui" line="250"/>
|
||||||
<source>&View</source>
|
<source>&View</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="241"/>
|
<location filename="../mainwindow.ui" line="257"/>
|
||||||
<source>&Tools</source>
|
<source>&Tools</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="266"/>
|
<location filename="../mainwindow.ui" line="282"/>
|
||||||
<source>&Quit</source>
|
<source>&Quit</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="275"/>
|
<location filename="../mainwindow.ui" line="291"/>
|
||||||
<source>About &Me</source>
|
<source>About &Me</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="284"/>
|
<location filename="../mainwindow.ui" line="300"/>
|
||||||
<source>About &zeiterfassung</source>
|
<source>About &zeiterfassung</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="293"/>
|
<location filename="../mainwindow.ui" line="309"/>
|
||||||
<source>About &Qt</source>
|
<source>About &Qt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="302"/>
|
<location filename="../mainwindow.ui" line="318"/>
|
||||||
<source>&Today</source>
|
<source>&Today</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="311"/>
|
<location filename="../mainwindow.ui" line="327"/>
|
||||||
<source>&Refresh everything</source>
|
<source>&Refresh everything</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="320"/>
|
<location filename="../mainwindow.ui" line="336"/>
|
||||||
<source>&Settings</source>
|
<source>&Settings</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.ui" line="329"/>
|
<location filename="../mainwindow.ui" line="345"/>
|
||||||
<source>Help</source>
|
<source>Help</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="44"/>
|
<location filename="../mainwindow.cpp" line="45"/>
|
||||||
<source>Zeiterfassung - %0 (%1)</source>
|
<source>Zeiterfassung - %0 (%1)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="81"/>
|
<location filename="../mainwindow.cpp" line="82"/>
|
||||||
<source>Workpackage</source>
|
<source>Workpackage</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="82"/>
|
<location filename="../mainwindow.cpp" line="83"/>
|
||||||
<source>Text</source>
|
<source>Text</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="194"/>
|
<location filename="../mainwindow.cpp" line="197"/>
|
||||||
<location filename="../mainwindow.cpp" line="195"/>
|
<location filename="../mainwindow.cpp" line="198"/>
|
||||||
<source>Could not load bookings!</source>
|
<source>Could not load bookings!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="225"/>
|
<location filename="../mainwindow.cpp" line="228"/>
|
||||||
<location filename="../mainwindow.cpp" line="327"/>
|
<location filename="../mainwindow.cpp" line="330"/>
|
||||||
<source>Could not create booking!</source>
|
<source>Could not create booking!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="269"/>
|
<location filename="../mainwindow.cpp" line="272"/>
|
||||||
<source>Could not create time assignment!</source>
|
<source>Could not create time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="251"/>
|
<location filename="../mainwindow.cpp" line="254"/>
|
||||||
<location filename="../mainwindow.cpp" line="312"/>
|
<location filename="../mainwindow.cpp" line="315"/>
|
||||||
<source>Could not edit time assignment!</source>
|
<source>Could not edit time assignment!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="396"/>
|
<location filename="../mainwindow.cpp" line="399"/>
|
||||||
<location filename="../mainwindow.cpp" line="407"/>
|
<location filename="../mainwindow.cpp" line="410"/>
|
||||||
<source>Switch</source>
|
<source>Switch</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../mainwindow.cpp" line="426"/>
|
<location filename="../mainwindow.cpp" line="429"/>
|
||||||
<location filename="../mainwindow.cpp" line="435"/>
|
<location filename="../mainwindow.cpp" line="438"/>
|
||||||
<source>%0 (%1)</source>
|
<source>%0 (%1)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>ProjectsModel</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../projectsmodel.cpp" line="58"/>
|
||||||
|
<source>Loading projects...</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../projectsmodel.cpp" line="100"/>
|
||||||
|
<source>Loading workpackages...</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SettingsDialog</name>
|
<name>SettingsDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@@ -8,9 +8,15 @@
|
|||||||
ZeiterfassungReply::ZeiterfassungReply(ZeiterfassungApi *zeiterfassung) :
|
ZeiterfassungReply::ZeiterfassungReply(ZeiterfassungApi *zeiterfassung) :
|
||||||
QObject(zeiterfassung),
|
QObject(zeiterfassung),
|
||||||
m_zeiterfassung(zeiterfassung),
|
m_zeiterfassung(zeiterfassung),
|
||||||
|
m_finished(false),
|
||||||
m_success(false)
|
m_success(false)
|
||||||
{
|
{
|
||||||
|
connect(this, &ZeiterfassungReply::finished, this, [this](){ m_finished = true; });
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZeiterfassungReply::isFinished() const
|
||||||
|
{
|
||||||
|
return m_finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZeiterfassungReply::success() const
|
bool ZeiterfassungReply::success() const
|
||||||
|
@@ -15,6 +15,8 @@ class ZEITERFASSUNGNETWORKLIB_EXPORT ZeiterfassungReply : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit ZeiterfassungReply(ZeiterfassungApi *zeiterfassung);
|
explicit ZeiterfassungReply(ZeiterfassungApi *zeiterfassung);
|
||||||
|
|
||||||
|
bool isFinished() const;
|
||||||
|
|
||||||
bool success() const;
|
bool success() const;
|
||||||
const QString &message() const;
|
const QString &message() const;
|
||||||
|
|
||||||
@@ -33,6 +35,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ZeiterfassungApi *m_zeiterfassung;
|
ZeiterfassungApi *m_zeiterfassung;
|
||||||
|
bool m_finished;
|
||||||
bool m_success;
|
bool m_success;
|
||||||
QString m_message;
|
QString m_message;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user