Removed subproject fields

This commit is contained in:
2019-04-09 19:22:54 +02:00
parent 4fb1c22227
commit 1ce00b5ced
13 changed files with 78 additions and 195 deletions

View File

@@ -95,23 +95,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" stretch="0,0,1"> <layout class="QHBoxLayout" stretch="0,1">
<item>
<widget class="QLabel" name="labelSubproject">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0,0,0,30);</string>
</property>
<property name="text">
<string notr="true">Subproject</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="labelWorkpackage"> <widget class="QLabel" name="labelWorkpackage">
<property name="minimumSize"> <property name="minimumSize">

View File

@@ -7,7 +7,6 @@ const QString ZeiterfassungSettings::m_url("url");
const QString ZeiterfassungSettings::m_username("username"); const QString ZeiterfassungSettings::m_username("username");
const QString ZeiterfassungSettings::m_password("password"); const QString ZeiterfassungSettings::m_password("password");
const QString ZeiterfassungSettings::m_projects("projects"); const QString ZeiterfassungSettings::m_projects("projects");
const QString ZeiterfassungSettings::m_subprojects("subprojects");
const QString ZeiterfassungSettings::m_workpackages("workpackages"); const QString ZeiterfassungSettings::m_workpackages("workpackages");
const QString ZeiterfassungSettings::m_texts("texte"); const QString ZeiterfassungSettings::m_texts("texte");
const QString ZeiterfassungSettings::m_theme("theme"); const QString ZeiterfassungSettings::m_theme("theme");
@@ -180,37 +179,6 @@ bool ZeiterfassungSettings::prependProject(const QString &project)
return setProjects(prependItem(projects(), project)); return setProjects(prependItem(projects(), project));
} }
QStringList ZeiterfassungSettings::subprojects() const
{
return value(m_subprojects).toStringList();
}
bool ZeiterfassungSettings::setSubprojects(const QStringList &subprojects)
{
if(this->subprojects() == subprojects)
return true;
if(subprojects.isEmpty())
remove(m_subprojects);
else
setValue(m_subprojects, subprojects);
sync();
const auto success = status() == QSettings::NoError;
if(success)
Q_EMIT subprojectsChanged(subprojects);
else
Q_EMIT saveErrorOccured();
return success;
}
bool ZeiterfassungSettings::prependSubproject(const QString &subproject)
{
return setSubprojects(prependItem(subprojects(), subproject));
}
QStringList ZeiterfassungSettings::workpackages() const QStringList ZeiterfassungSettings::workpackages() const
{ {
return value(m_workpackages).toStringList(); return value(m_workpackages).toStringList();

View File

@@ -17,7 +17,6 @@ class ZEITERFASSUNGCORELIB_EXPORT ZeiterfassungSettings : public QSettings
Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged) Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
Q_PROPERTY(QStringList projects READ projects WRITE setProjects NOTIFY projectsChanged) Q_PROPERTY(QStringList projects READ projects WRITE setProjects NOTIFY projectsChanged)
Q_PROPERTY(QStringList subprojects READ subprojects WRITE setSubprojects NOTIFY subprojectsChanged)
Q_PROPERTY(QStringList workpackages READ workpackages WRITE setWorkpackages NOTIFY workpackagesChanged) Q_PROPERTY(QStringList workpackages READ workpackages WRITE setWorkpackages NOTIFY workpackagesChanged)
Q_PROPERTY(QStringList texts READ texts WRITE setTexts NOTIFY textsChanged) Q_PROPERTY(QStringList texts READ texts WRITE setTexts NOTIFY textsChanged)
Q_PROPERTY(QString theme READ theme WRITE setTheme NOTIFY themeChanged) Q_PROPERTY(QString theme READ theme WRITE setTheme NOTIFY themeChanged)
@@ -48,10 +47,6 @@ public:
bool setProjects(const QStringList &projects); bool setProjects(const QStringList &projects);
bool prependProject(const QString &project); bool prependProject(const QString &project);
QStringList subprojects() const;
bool setSubprojects(const QStringList &subprojects);
bool prependSubproject(const QString &subproject);
QStringList workpackages() const; QStringList workpackages() const;
bool setWorkpackages(const QStringList &workpackages); bool setWorkpackages(const QStringList &workpackages);
bool prependWorkpackage(const QString &workpackage); bool prependWorkpackage(const QString &workpackage);
@@ -71,7 +66,6 @@ Q_SIGNALS:
void usernameChanged(const QString &username); void usernameChanged(const QString &username);
void passwordChanged(const QString &password); void passwordChanged(const QString &password);
void projectsChanged(const QStringList &projects); void projectsChanged(const QStringList &projects);
void subprojectsChanged(const QStringList &subprojects);
void workpackagesChanged(const QStringList &workpackages); void workpackagesChanged(const QStringList &workpackages);
void textsChanged(const QStringList &texts); void textsChanged(const QStringList &texts);
void themeChanged(const QString &theme); void themeChanged(const QString &theme);
@@ -84,7 +78,6 @@ private:
static const QString m_username; static const QString m_username;
static const QString m_password; static const QString m_password;
static const QString m_projects; static const QString m_projects;
static const QString m_subprojects;
static const QString m_workpackages; static const QString m_workpackages;
static const QString m_texts; static const QString m_texts;
static const QString m_theme; static const QString m_theme;

View File

@@ -78,7 +78,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass
m_getProjectsReply = erfassung.doGetProjects(userInfo.userId, QDate::currentDate()); m_getProjectsReply = erfassung.doGetProjects(userInfo.userId, QDate::currentDate());
connect(m_getProjectsReply.get(), &ZeiterfassungReply::finished, this, &MainWindow::getProjectsFinished); connect(m_getProjectsReply.get(), &ZeiterfassungReply::finished, this, &MainWindow::getProjectsFinished);
ui->comboBoxSubproject->lineEdit()->setPlaceholderText(tr("Subproject"));
ui->comboBoxWorkpackage->lineEdit()->setPlaceholderText(tr("Workpackage")); ui->comboBoxWorkpackage->lineEdit()->setPlaceholderText(tr("Workpackage"));
ui->comboBoxText->lineEdit()->setPlaceholderText(tr("Text")); ui->comboBoxText->lineEdit()->setPlaceholderText(tr("Text"));
@@ -241,8 +240,7 @@ void MainWindow::pushButtonStartPressed()
auto reply = m_erfassung.doUpdateTimeAssignment(timeAssignment.id, m_userInfo.userId, timeAssignment.date, auto reply = m_erfassung.doUpdateTimeAssignment(timeAssignment.id, m_userInfo.userId, timeAssignment.date,
timeAssignment.time, timespan, timeAssignment.time, timespan,
timeAssignment.project, timeAssignment.subproject, timeAssignment.project, timeAssignment.workpackage, timeAssignment.text);
timeAssignment.workpackage, timeAssignment.text);
reply->waitForFinished(); reply->waitForFinished();
@@ -260,8 +258,9 @@ void MainWindow::pushButtonStartPressed()
{ {
auto reply = m_erfassung.doCreateTimeAssignment(m_userInfo.userId, ui->dateEditDate->date(), auto reply = m_erfassung.doCreateTimeAssignment(m_userInfo.userId, ui->dateEditDate->date(),
timeAssignmentTime, QTime(0, 0), timeAssignmentTime, QTime(0, 0),
ui->comboBoxProject->currentData().toString(), ui->comboBoxSubproject->currentText(), ui->comboBoxProject->currentData().toString(),
ui->comboBoxWorkpackage->currentText(), ui->comboBoxText->currentText()); ui->comboBoxWorkpackage->currentText(),
ui->comboBoxText->currentText());
reply->waitForFinished(); reply->waitForFinished();
@@ -275,7 +274,6 @@ void MainWindow::pushButtonStartPressed()
} }
m_settings.prependProject(ui->comboBoxProject->currentData().toString()); m_settings.prependProject(ui->comboBoxProject->currentData().toString());
m_settings.prependSubproject(ui->comboBoxSubproject->currentText());
m_settings.prependWorkpackage(ui->comboBoxWorkpackage->currentText()); m_settings.prependWorkpackage(ui->comboBoxWorkpackage->currentText());
m_settings.prependText(ui->comboBoxText->currentText()); m_settings.prependText(ui->comboBoxText->currentText());
@@ -305,8 +303,7 @@ void MainWindow::pushButtonEndPressed()
auto reply = m_erfassung.doUpdateTimeAssignment(timeAssignment.id, m_userInfo.userId, timeAssignment.date, auto reply = m_erfassung.doUpdateTimeAssignment(timeAssignment.id, m_userInfo.userId, timeAssignment.date,
timeAssignment.time, timespan, timeAssignment.time, timespan,
timeAssignment.project, timeAssignment.subproject, timeAssignment.project, timeAssignment.workpackage, timeAssignment.text);
timeAssignment.workpackage, timeAssignment.text);
reply->waitForFinished(); reply->waitForFinished();
@@ -392,7 +389,6 @@ void MainWindow::startEnabledChanged()
ui->pushButtonNow->setEnabled(startEnabled || endEnabled); ui->pushButtonNow->setEnabled(startEnabled || endEnabled);
ui->comboBoxProject->setEnabled(startEnabled); ui->comboBoxProject->setEnabled(startEnabled);
ui->comboBoxSubproject->setEnabled(startEnabled);
ui->comboBoxWorkpackage->setEnabled(startEnabled); ui->comboBoxWorkpackage->setEnabled(startEnabled);
ui->comboBoxText->setEnabled(startEnabled); ui->comboBoxText->setEnabled(startEnabled);
@@ -440,16 +436,6 @@ void MainWindow::updateComboboxes()
} }
} }
ui->comboBoxSubproject->clear();
{
auto subprojects = m_settings.subprojects();
for(const auto &subproject : subprojects)
ui->comboBoxSubproject->addItem(subproject);
if(subprojects.count())
ui->comboBoxSubproject->setCurrentText(QString());
}
ui->comboBoxWorkpackage->clear(); ui->comboBoxWorkpackage->clear();
{ {

View File

@@ -117,22 +117,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="comboBoxSubproject">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QComboBox" name="comboBoxWorkpackage"> <widget class="QComboBox" name="comboBoxWorkpackage">
<property name="minimumSize"> <property name="minimumSize">
@@ -211,7 +195,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1393</width> <width>1393</width>
<height>428</height> <height>444</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="layoutWeek"/> <layout class="QHBoxLayout" name="layoutWeek"/>
@@ -226,7 +210,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1411</width> <width>1411</width>
<height>26</height> <height>20</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">

View File

@@ -327,7 +327,7 @@ bool StripsWidget::createStrips()
auto timeAssignment = *timeAssignmentsIter++; auto timeAssignment = *timeAssignmentsIter++;
appendTimeAssignmentStrip(timeAssignment.id, timeAssignment.timespan, buildProjectString(timeAssignment.project), appendTimeAssignmentStrip(timeAssignment.id, timeAssignment.timespan, buildProjectString(timeAssignment.project),
timeAssignment.subproject, timeAssignment.workpackage, timeAssignment.text); timeAssignment.workpackage, timeAssignment.text);
if(timeAssignment.timespan == QTime(0, 0)) if(timeAssignment.timespan == QTime(0, 0))
{ {
@@ -370,7 +370,7 @@ bool StripsWidget::createStrips()
timeAssignment = *timeAssignmentsIter++; timeAssignment = *timeAssignmentsIter++;
appendTimeAssignmentStrip(timeAssignment.id, timeAssignment.timespan, buildProjectString(timeAssignment.project), appendTimeAssignmentStrip(timeAssignment.id, timeAssignment.timespan, buildProjectString(timeAssignment.project),
timeAssignment.subproject, timeAssignment.workpackage, timeAssignment.text); timeAssignment.workpackage, timeAssignment.text);
if(timeAssignment.timespan == QTime(0, 0)) if(timeAssignment.timespan == QTime(0, 0))
{ {
@@ -426,7 +426,7 @@ bool StripsWidget::createStrips()
timeAssignment = *timeAssignmentsIter++; timeAssignment = *timeAssignmentsIter++;
appendTimeAssignmentStrip(timeAssignment.id, timeAssignment.timespan, buildProjectString(timeAssignment.project), appendTimeAssignmentStrip(timeAssignment.id, timeAssignment.timespan, buildProjectString(timeAssignment.project),
timeAssignment.subproject, timeAssignment.workpackage, timeAssignment.text); timeAssignment.workpackage, timeAssignment.text);
if(timeAssignment.timespan == QTime(0, 0)) if(timeAssignment.timespan == QTime(0, 0))
{ {
@@ -636,7 +636,7 @@ QWidget *StripsWidget::appendBookingEndStrip(int id, const QTime &time, const QT
return widget; return widget;
} }
QWidget *StripsWidget::appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &subproject, const QString &workpackage, const QString &text) QWidget *StripsWidget::appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &workpackage, const QString &text)
{ {
auto widget = m_mainWindow.stripFactory().createTimeAssignmentStrip(this).release(); auto widget = m_mainWindow.stripFactory().createTimeAssignmentStrip(this).release();
@@ -655,11 +655,6 @@ QWidget *StripsWidget::appendTimeAssignmentStrip(int id, const QTime &duration,
else else
qWarning() << "no labelId found!"; qWarning() << "no labelId found!";
if(auto labelSubproject = widget->findChild<QWidget*>(QStringLiteral("labelSubproject")))
labelSubproject->setProperty("text", subproject);
else
qWarning() << "no labelSubproject found!";
if(auto labelWorkpackage = widget->findChild<QWidget*>(QStringLiteral("labelWorkpackage"))) if(auto labelWorkpackage = widget->findChild<QWidget*>(QStringLiteral("labelWorkpackage")))
labelWorkpackage->setProperty("text", workpackage); labelWorkpackage->setProperty("text", workpackage);
else else

View File

@@ -87,8 +87,7 @@ private:
QWidget *appendBookingStartStrip(int id, const QTime &time); QWidget *appendBookingStartStrip(int id, const QTime &time);
QWidget *appendBookingEndStrip(int id, const QTime &time, const QTime &duration); QWidget *appendBookingEndStrip(int id, const QTime &time, const QTime &duration);
QWidget *appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &subproject, QWidget *appendTimeAssignmentStrip(int id, const QTime &duration, const QString &project, const QString &workpackage, const QString &text);
const QString &workpackage, const QString &text);
MainWindow &m_mainWindow; MainWindow &m_mainWindow;

View File

@@ -77,74 +77,74 @@
<translation>Jetzt</translation> <translation>Jetzt</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="171"/> <location filename="../mainwindow.ui" line="155"/>
<location filename="../mainwindow.cpp" line="400"/> <location filename="../mainwindow.cpp" line="396"/>
<location filename="../mainwindow.cpp" line="411"/> <location filename="../mainwindow.cpp" line="407"/>
<source>Start</source> <source>Start</source>
<translation>Kommen</translation> <translation>Kommen</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="191"/> <location filename="../mainwindow.ui" line="175"/>
<source>End</source> <source>End</source>
<translation>Gehen</translation> <translation>Gehen</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="234"/> <location filename="../mainwindow.ui" line="218"/>
<source>&amp;File</source> <source>&amp;File</source>
<translation>&amp;Datei</translation> <translation>&amp;Datei</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="240"/> <location filename="../mainwindow.ui" line="224"/>
<source>&amp;About</source> <source>&amp;About</source>
<translation>&amp;Über</translation> <translation>&amp;Über</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="250"/> <location filename="../mainwindow.ui" line="234"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>&amp;Ansicht</translation> <translation>&amp;Ansicht</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="257"/> <location filename="../mainwindow.ui" line="241"/>
<source>&amp;Tools</source> <source>&amp;Tools</source>
<translation>&amp;Werkzeuge</translation> <translation>&amp;Werkzeuge</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="282"/> <location filename="../mainwindow.ui" line="266"/>
<source>&amp;Quit</source> <source>&amp;Quit</source>
<translation>&amp;Beenden</translation> <translation>&amp;Beenden</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="291"/> <location filename="../mainwindow.ui" line="275"/>
<source>About &amp;Me</source> <source>About &amp;Me</source>
<translation>Über &amp;mich</translation> <translation>Über &amp;mich</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="300"/> <location filename="../mainwindow.ui" line="284"/>
<source>About &amp;zeiterfassung</source> <source>About &amp;zeiterfassung</source>
<translation>Über &amp;zeiterfassung</translation> <translation>Über &amp;zeiterfassung</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="309"/> <location filename="../mainwindow.ui" line="293"/>
<source>About &amp;Qt</source> <source>About &amp;Qt</source>
<translation>Über &amp;Qt</translation> <translation>Über &amp;Qt</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="318"/> <location filename="../mainwindow.ui" line="302"/>
<source>&amp;Today</source> <source>&amp;Today</source>
<translation>&amp;Heute</translation> <translation>&amp;Heute</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="327"/> <location filename="../mainwindow.ui" line="311"/>
<source>&amp;Refresh everything</source> <source>&amp;Refresh everything</source>
<translation>Alles &amp;neu laden</translation> <translation>Alles &amp;neu laden</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="336"/> <location filename="../mainwindow.ui" line="320"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation>&amp;Einstellungen</translation> <translation>&amp;Einstellungen</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="345"/> <location filename="../mainwindow.ui" line="329"/>
<source>Help</source> <source>Help</source>
<translation>Hilfe</translation> <translation>Hilfe</translation>
</message> </message>
@@ -155,51 +155,46 @@
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="81"/> <location filename="../mainwindow.cpp" line="81"/>
<source>Subproject</source>
<translation>Subprojekt</translation>
</message>
<message>
<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="83"/> <location filename="../mainwindow.cpp" line="82"/>
<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="195"/> <location filename="../mainwindow.cpp" line="195"/>
<location filename="../mainwindow.cpp" line="196"/>
<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="226"/> <location filename="../mainwindow.cpp" line="225"/>
<location filename="../mainwindow.cpp" line="330"/> <location filename="../mainwindow.cpp" line="327"/>
<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="253"/> <location filename="../mainwindow.cpp" line="251"/>
<location filename="../mainwindow.cpp" line="315"/> <location filename="../mainwindow.cpp" line="312"/>
<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="430"/> <location filename="../mainwindow.cpp" line="426"/>
<location filename="../mainwindow.cpp" line="439"/> <location filename="../mainwindow.cpp" line="435"/>
<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="270"/> <location filename="../mainwindow.cpp" line="269"/>
<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="400"/> <location filename="../mainwindow.cpp" line="396"/>
<location filename="../mainwindow.cpp" line="411"/> <location filename="../mainwindow.cpp" line="407"/>
<source>Switch</source> <source>Switch</source>
<translation>Wechseln</translation> <translation>Wechseln</translation>
</message> </message>

View File

@@ -77,74 +77,74 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="171"/> <location filename="../mainwindow.ui" line="155"/>
<location filename="../mainwindow.cpp" line="400"/> <location filename="../mainwindow.cpp" line="396"/>
<location filename="../mainwindow.cpp" line="411"/> <location filename="../mainwindow.cpp" line="407"/>
<source>Start</source> <source>Start</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="191"/> <location filename="../mainwindow.ui" line="175"/>
<source>End</source> <source>End</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="234"/> <location filename="../mainwindow.ui" line="218"/>
<source>&amp;File</source> <source>&amp;File</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="240"/> <location filename="../mainwindow.ui" line="224"/>
<source>&amp;About</source> <source>&amp;About</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="250"/> <location filename="../mainwindow.ui" line="234"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="257"/> <location filename="../mainwindow.ui" line="241"/>
<source>&amp;Tools</source> <source>&amp;Tools</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="282"/> <location filename="../mainwindow.ui" line="266"/>
<source>&amp;Quit</source> <source>&amp;Quit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="291"/> <location filename="../mainwindow.ui" line="275"/>
<source>About &amp;Me</source> <source>About &amp;Me</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="300"/> <location filename="../mainwindow.ui" line="284"/>
<source>About &amp;zeiterfassung</source> <source>About &amp;zeiterfassung</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="309"/> <location filename="../mainwindow.ui" line="293"/>
<source>About &amp;Qt</source> <source>About &amp;Qt</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="318"/> <location filename="../mainwindow.ui" line="302"/>
<source>&amp;Today</source> <source>&amp;Today</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="327"/> <location filename="../mainwindow.ui" line="311"/>
<source>&amp;Refresh everything</source> <source>&amp;Refresh everything</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="336"/> <location filename="../mainwindow.ui" line="320"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="345"/> <location filename="../mainwindow.ui" line="329"/>
<source>Help</source> <source>Help</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@@ -155,51 +155,46 @@
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="81"/> <location filename="../mainwindow.cpp" line="81"/>
<source>Subproject</source>
<translation type="unfinished"></translation>
</message>
<message>
<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="83"/> <location filename="../mainwindow.cpp" line="82"/>
<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="195"/> <location filename="../mainwindow.cpp" line="195"/>
<location filename="../mainwindow.cpp" line="196"/>
<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="226"/> <location filename="../mainwindow.cpp" line="225"/>
<location filename="../mainwindow.cpp" line="330"/> <location filename="../mainwindow.cpp" line="327"/>
<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="270"/> <location filename="../mainwindow.cpp" line="269"/>
<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="253"/> <location filename="../mainwindow.cpp" line="251"/>
<location filename="../mainwindow.cpp" line="315"/> <location filename="../mainwindow.cpp" line="312"/>
<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="400"/> <location filename="../mainwindow.cpp" line="396"/>
<location filename="../mainwindow.cpp" line="411"/> <location filename="../mainwindow.cpp" line="407"/>
<source>Switch</source> <source>Switch</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="430"/> <location filename="../mainwindow.cpp" line="426"/>
<location filename="../mainwindow.cpp" line="439"/> <location filename="../mainwindow.cpp" line="435"/>
<source>%0 (%1)</source> <source>%0 (%1)</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@@ -59,14 +59,13 @@ void GetTimeAssignmentsReply::requestFinished()
auto koWertList = obj.value(QStringLiteral("koWertList")).toArray(); auto koWertList = obj.value(QStringLiteral("koWertList")).toArray();
m_timeAssignments.append({ m_timeAssignments.append({
obj.value(QStringLiteral("bookingNr")).toInt(), .id = obj.value(QStringLiteral("bookingNr")).toInt(),
parseDate(obj.value(QStringLiteral("bookingDate"))), .date = parseDate(obj.value(QStringLiteral("bookingDate"))),
parseTime(obj.value(QStringLiteral("bookingTime"))), .time = parseTime(obj.value(QStringLiteral("bookingTime"))),
parseTime(obj.value(QStringLiteral("bookingTimespan"))), .timespan = parseTime(obj.value(QStringLiteral("bookingTimespan"))),
obj.value(QStringLiteral("text")).toString(), .text = obj.value(QStringLiteral("text")).toString(),
koWertList.at(0).toObject().value(QStringLiteral("value")).toString(), .project = koWertList.at(0).toObject().value(QStringLiteral("value")).toString(),
koWertList.at(1).toObject().value(QStringLiteral("value")).toString(), .workpackage = koWertList.at(1).toObject().value(QStringLiteral("value")).toString()
koWertList.at(2).toObject().value(QStringLiteral("value")).toString()
}); });
} }
} }

View File

@@ -27,7 +27,6 @@ public:
QTime timespan; QTime timespan;
QString text; QString text;
QString project; QString project;
QString subproject;
QString workpackage; QString workpackage;
}; };

View File

@@ -164,8 +164,7 @@ std::unique_ptr<GetTimeAssignmentsReply> ZeiterfassungApi::doGetTimeAssignments(
std::unique_ptr<CreateTimeAssignmentReply> ZeiterfassungApi::doCreateTimeAssignment(int userId, const QDate &date, const QTime &time, std::unique_ptr<CreateTimeAssignmentReply> ZeiterfassungApi::doCreateTimeAssignment(int userId, const QDate &date, const QTime &time,
const QTime &timespan, const QString &project, const QTime &timespan, const QString &project,
const QString &subproject, const QString &workpackage, const QString &workpackage, const QString &text)
const QString &text)
{ {
QNetworkRequest request(QUrl(m_url.toString() % "json/azebooking")); QNetworkRequest request(QUrl(m_url.toString() % "json/azebooking"));
request.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/json")); request.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/json"));
@@ -185,11 +184,6 @@ std::unique_ptr<CreateTimeAssignmentReply> ZeiterfassungApi::doCreateTimeAssignm
obj[QStringLiteral("value")] = project; obj[QStringLiteral("value")] = project;
koWertList << obj; koWertList << obj;
} }
{
QJsonObject obj;
obj[QStringLiteral("value")] = subproject;
koWertList << obj;
}
{ {
QJsonObject obj; QJsonObject obj;
obj[QStringLiteral("value")] = workpackage; obj[QStringLiteral("value")] = workpackage;
@@ -205,8 +199,7 @@ std::unique_ptr<CreateTimeAssignmentReply> ZeiterfassungApi::doCreateTimeAssignm
std::unique_ptr<UpdateTimeAssignmentReply> ZeiterfassungApi::doUpdateTimeAssignment(int timeAssignmentId, int userId, const QDate &date, std::unique_ptr<UpdateTimeAssignmentReply> ZeiterfassungApi::doUpdateTimeAssignment(int timeAssignmentId, int userId, const QDate &date,
const QTime &time, const QTime &timespan, const QString &project, const QTime &time, const QTime &timespan, const QString &project,
const QString &subproject, const QString &workpackage, const QString &workpackage, const QString &text)
const QString &text)
{ {
QNetworkRequest request(QUrl(QStringLiteral("%0json/azebooking/%1").arg(m_url.toString()).arg(timeAssignmentId))); QNetworkRequest request(QUrl(QStringLiteral("%0json/azebooking/%1").arg(m_url.toString()).arg(timeAssignmentId)));
request.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/json")); request.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/json"));
@@ -231,11 +224,6 @@ std::unique_ptr<UpdateTimeAssignmentReply> ZeiterfassungApi::doUpdateTimeAssignm
obj[QStringLiteral("value")] = project; obj[QStringLiteral("value")] = project;
koWertList << obj; koWertList << obj;
} }
{
QJsonObject obj;
obj[QStringLiteral("value")] = subproject;
koWertList << obj;
}
{ {
QJsonObject obj; QJsonObject obj;
obj[QStringLiteral("value")] = workpackage; obj[QStringLiteral("value")] = workpackage;

View File

@@ -55,12 +55,10 @@ public:
std::unique_ptr<GetTimeAssignmentsReply> doGetTimeAssignments(int userId, const QDate &start, const QDate &end); std::unique_ptr<GetTimeAssignmentsReply> doGetTimeAssignments(int userId, const QDate &start, const QDate &end);
std::unique_ptr<CreateTimeAssignmentReply> doCreateTimeAssignment(int userId, const QDate &date, const QTime &time, std::unique_ptr<CreateTimeAssignmentReply> doCreateTimeAssignment(int userId, const QDate &date, const QTime &time,
const QTime &timespan, const QString &project, const QTime &timespan, const QString &project,
const QString &subproject, const QString &workpackage, const QString &workpackage, const QString &text);
const QString &text);
std::unique_ptr<UpdateTimeAssignmentReply> doUpdateTimeAssignment(int timeAssignmentId, int userId, const QDate &date, std::unique_ptr<UpdateTimeAssignmentReply> doUpdateTimeAssignment(int timeAssignmentId, int userId, const QDate &date,
const QTime &time, const QTime &timespan, const QString &project, const QTime &time, const QTime &timespan, const QString &project,
const QString &subproject, const QString &workpackage, const QString &workpackage, const QString &text);
const QString &text);
std::unique_ptr<DeleteTimeAssignmentReply> doDeleteTimeAssignment(int timeAssignmentId); std::unique_ptr<DeleteTimeAssignmentReply> doDeleteTimeAssignment(int timeAssignmentId);
std::unique_ptr<GetProjectsReply> doGetProjects(int userId, const QDate &date); std::unique_ptr<GetProjectsReply> doGetProjects(int userId, const QDate &date);