Splitted auswertung label into smaller ones
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>394</width>
|
<width>394</width>
|
||||||
<height>169</height>
|
<height>181</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="pixmap">
|
<property name="pixmap">
|
||||||
<pixmap resource="resources.qrc">:/zeiterfassung/images/authentication.png</pixmap>
|
<pixmap resource="../resources.qrc">:/zeiterfassung/images/authentication.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
<property name="scaledContents">
|
<property name="scaledContents">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources.qrc"/>
|
<include location="../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -102,8 +102,15 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, Zeiterfassung &erfassung
|
|||||||
connect(ui->treeViewKontierungen, &QWidget::customContextMenuRequested,
|
connect(ui->treeViewKontierungen, &QWidget::customContextMenuRequested,
|
||||||
this, &MainWindow::contextMenuKontierung);
|
this, &MainWindow::contextMenuKontierung);
|
||||||
|
|
||||||
ui->statusbar->addPermanentWidget(m_kontierungLabel = new QLabel(ui->statusbar));
|
ui->statusbar->addPermanentWidget(m_workingTimeLabel = new QLabel(ui->statusbar));
|
||||||
ui->statusbar->addPermanentWidget(m_auswertungLabel = new QLabel(ui->statusbar));
|
m_workingTimeLabel->setFrameShape(QFrame::Panel);
|
||||||
|
m_workingTimeLabel->setFrameShadow(QFrame::Sunken);
|
||||||
|
ui->statusbar->addPermanentWidget(m_balanceLabel = new QLabel(ui->statusbar));
|
||||||
|
m_balanceLabel->setFrameShape(QFrame::Panel);
|
||||||
|
m_balanceLabel->setFrameShadow(QFrame::Sunken);
|
||||||
|
ui->statusbar->addPermanentWidget(m_holidaysLabel = new QLabel(ui->statusbar));
|
||||||
|
m_holidaysLabel->setFrameShape(QFrame::Panel);
|
||||||
|
m_holidaysLabel->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
refresh(true);
|
refresh(true);
|
||||||
}
|
}
|
||||||
@@ -152,7 +159,7 @@ void MainWindow::refresh(bool forceAuswertung)
|
|||||||
ui->treeViewBuchungen->setEnabled(false);
|
ui->treeViewBuchungen->setEnabled(false);
|
||||||
ui->treeViewKontierungen->setEnabled(false);
|
ui->treeViewKontierungen->setEnabled(false);
|
||||||
|
|
||||||
m_kontierungLabel->setText(tr("Kontierung time: ???"));
|
m_workingTimeLabel->setText(tr("Working time: %0").arg(tr("???")));
|
||||||
|
|
||||||
auto waitForBuchugen = m_buchungenModel->refresh(m_userInfo.userId, ui->dateEditDate->date(), ui->dateEditDate->date());
|
auto waitForBuchugen = m_buchungenModel->refresh(m_userInfo.userId, ui->dateEditDate->date(), ui->dateEditDate->date());
|
||||||
if(waitForBuchugen)
|
if(waitForBuchugen)
|
||||||
@@ -187,9 +194,8 @@ void MainWindow::refresh(bool forceAuswertung)
|
|||||||
auto auswertungDate = QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1);
|
auto auswertungDate = QDate(ui->dateEditDate->date().year(), ui->dateEditDate->date().month(), 1);
|
||||||
if(forceAuswertung || m_auswertungDate != auswertungDate)
|
if(forceAuswertung || m_auswertungDate != auswertungDate)
|
||||||
{
|
{
|
||||||
m_auswertungLabel->setText(tr("Urlaubsanspruch: %0 Gleitzeit: %1")
|
m_balanceLabel->setText(tr("Balance: %0").arg(tr("???")));
|
||||||
.arg(QStringLiteral("???"))
|
m_holidaysLabel->setText(tr("Holidays: %0").arg(tr("???")));
|
||||||
.arg(QStringLiteral("???")));
|
|
||||||
|
|
||||||
ui->actionAuswertung->setEnabled(false);
|
ui->actionAuswertung->setEnabled(false);
|
||||||
m_auswertung.clear();
|
m_auswertung.clear();
|
||||||
@@ -243,45 +249,28 @@ void MainWindow::getAuswertungFinished(bool success, const QString &message, con
|
|||||||
ui->actionAuswertung->setEnabled(true);
|
ui->actionAuswertung->setEnabled(true);
|
||||||
m_auswertung = content;
|
m_auswertung = content;
|
||||||
|
|
||||||
QString normalArbeitszeit = QStringLiteral("???");
|
auto urlaubsAnspruch = tr("???");
|
||||||
QString urlaubsAnspruch = QStringLiteral("???");
|
auto gleitzeit = tr("???");
|
||||||
QString gleitzeit = QStringLiteral("???");
|
|
||||||
|
|
||||||
{
|
{
|
||||||
static QRegularExpression regex("Normalarbeitsze +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)");
|
static QRegularExpression regex(QStringLiteral("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)"));
|
||||||
auto match = regex.match(content);
|
auto match = regex.match(content);
|
||||||
if(match.hasMatch())
|
if(match.hasMatch())
|
||||||
{
|
|
||||||
normalArbeitszeit = match.captured(2);
|
|
||||||
qDebug() << "Normalarbeitszeit" << match.captured(1) << match.captured(2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
qWarning() << "Normalarbeitszeit not found";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
static QRegularExpression regex("Urlaubsanspruch +([0-9]+\\.[0-9]+\\-?) +([0-9]+\\.[0-9]+\\-?)");
|
|
||||||
auto match = regex.match(content);
|
|
||||||
if(match.hasMatch())
|
|
||||||
{
|
|
||||||
urlaubsAnspruch = match.captured(2);
|
urlaubsAnspruch = match.captured(2);
|
||||||
qDebug() << "Urlaubsanspruch" << match.captured(1) << match.captured(2);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
qWarning() << "Urlaubsanspruch not found";
|
qWarning() << "Urlaubsanspruch not found";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
static QRegularExpression regex("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)");
|
static QRegularExpression regex(QStringLiteral("Gleitzeit +([0-9]+\\:[0-9]+\\-?) +([0-9]+\\:[0-9]+\\-?)"));
|
||||||
auto match = regex.match(content);
|
auto match = regex.match(content);
|
||||||
if(match.hasMatch())
|
if(match.hasMatch())
|
||||||
{
|
|
||||||
gleitzeit = match.captured(2);
|
gleitzeit = match.captured(2);
|
||||||
qDebug() << "Gleitzeit" << match.captured(1) << match.captured(2);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
qWarning() << "Gleitzeit not found";
|
qWarning() << "Gleitzeit not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
m_auswertungLabel->setText(tr("Urlaubsanspruch: %0 Gleitzeit: %1").arg(urlaubsAnspruch).arg(gleitzeit));
|
m_balanceLabel->setText(tr("Balance: %0").arg(gleitzeit));
|
||||||
|
m_holidaysLabel->setText(tr("Holidays: %0").arg(urlaubsAnspruch));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::refreshBuchungenFinished(bool success, const QString &message)
|
void MainWindow::refreshBuchungenFinished(bool success, const QString &message)
|
||||||
@@ -1088,11 +1077,9 @@ void MainWindow::validateEntries()
|
|||||||
|
|
||||||
after:
|
after:
|
||||||
if(errorMessage.isEmpty())
|
if(errorMessage.isEmpty())
|
||||||
m_kontierungLabel->setText(tr("Kontierung time: %0h").arg(m_kontierungTime.toString(QStringLiteral("HH:mm"))));
|
m_workingTimeLabel->setText(tr("Working time: %0").arg(m_kontierungTime.toString(QStringLiteral("HH:mm"))));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_kontierungLabel->setText(tr("Kontierung time: ???"));
|
|
||||||
|
|
||||||
auto label = new QLabel(tr("Strip rendering aborted due error."), ui->scrollAreaWidgetContents);
|
auto label = new QLabel(tr("Strip rendering aborted due error."), ui->scrollAreaWidgetContents);
|
||||||
ui->verticalLayout2->addWidget(label);
|
ui->verticalLayout2->addWidget(label);
|
||||||
label->setMinimumHeight(20);
|
label->setMinimumHeight(20);
|
||||||
|
@@ -51,8 +51,9 @@ private:
|
|||||||
QMap<QString, QString> m_projekte;
|
QMap<QString, QString> m_projekte;
|
||||||
QDate m_auswertungDate;
|
QDate m_auswertungDate;
|
||||||
QByteArray m_auswertung;
|
QByteArray m_auswertung;
|
||||||
QLabel *m_kontierungLabel;
|
QLabel *m_workingTimeLabel;
|
||||||
QLabel *m_auswertungLabel;
|
QLabel *m_balanceLabel;
|
||||||
|
QLabel *m_holidaysLabel;
|
||||||
|
|
||||||
BuchungenModel *m_buchungenModel;
|
BuchungenModel *m_buchungenModel;
|
||||||
KontierungenModel *m_kontierungenModel;
|
KontierungenModel *m_kontierungenModel;
|
||||||
|
Reference in New Issue
Block a user