Show statistics, centered at the bottom
This commit is contained in:
parent
cfc632a986
commit
8e5080b888
3 changed files with 68 additions and 4 deletions
|
@ -139,6 +139,8 @@ MainWindow::MainWindow()
|
||||||
|
|
||||||
readGeometry();
|
readGeometry();
|
||||||
setWindowIcon(QIcon(":/misc/kima2.ico"));
|
setWindowIcon(QIcon(":/misc/kima2.ico"));
|
||||||
|
|
||||||
|
updateStatLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onActionEditSellerTriggered()
|
void MainWindow::onActionEditSellerTriggered()
|
||||||
|
@ -159,6 +161,8 @@ void MainWindow::onActionEditSellerTriggered()
|
||||||
}
|
}
|
||||||
|
|
||||||
setSaleModel();
|
setSaleModel();
|
||||||
|
updateStatLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setSaleModel()
|
void MainWindow::setSaleModel()
|
||||||
|
@ -189,6 +193,8 @@ void MainWindow::onPaidButtonTriggered()
|
||||||
ui_.drawbackContainerWidget->setEnabled(false);
|
ui_.drawbackContainerWidget->setEnabled(false);
|
||||||
ui_.sellerNoEdit->setFocus();
|
ui_.sellerNoEdit->setFocus();
|
||||||
statusBar()->showMessage("Verkaufsvorgang erfolgreich durchgeführt.", STATUSBAR_TIMEOUT);
|
statusBar()->showMessage("Verkaufsvorgang erfolgreich durchgeführt.", STATUSBAR_TIMEOUT);
|
||||||
|
updateStatLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,6 +356,7 @@ void MainWindow::onCancelSaleButtonClicked([[maybe_unused]] bool checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_.salesView->collapseAll();
|
ui_.salesView->collapseAll();
|
||||||
|
updateStatLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onPrintSaleReceiptButtonClicked([[maybe_unused]] bool checked)
|
void MainWindow::onPrintSaleReceiptButtonClicked([[maybe_unused]] bool checked)
|
||||||
|
@ -436,6 +443,8 @@ void MainWindow::onImportSellerExcelActionTriggered()
|
||||||
fs::path filePath(filename.toStdWString());
|
fs::path filePath(filename.toStdWString());
|
||||||
|
|
||||||
ExcelReader::readSellersFromFile(filePath, marketplace_.get());
|
ExcelReader::readSellersFromFile(filePath, marketplace_.get());
|
||||||
|
updateStatLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onImportSellerJsonActionTriggered()
|
void MainWindow::onImportSellerJsonActionTriggered()
|
||||||
|
@ -457,6 +466,8 @@ void MainWindow::onImportSellerJsonActionTriggered()
|
||||||
fs::path filePath(filename.toStdWString());
|
fs::path filePath(filename.toStdWString());
|
||||||
|
|
||||||
JsonUtil::importSellers(filePath, marketplace_.get());
|
JsonUtil::importSellers(filePath, marketplace_.get());
|
||||||
|
updateStatLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onExportSellerJsonActionTriggered()
|
void MainWindow::onExportSellerJsonActionTriggered()
|
||||||
|
@ -510,6 +521,8 @@ void MainWindow::onImportSalesJsonActionTriggered()
|
||||||
.exec();
|
.exec();
|
||||||
}
|
}
|
||||||
setSaleModel();
|
setSaleModel();
|
||||||
|
updateStatLabel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::writeGeometry()
|
void MainWindow::writeGeometry()
|
||||||
|
@ -537,3 +550,14 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
writeGeometry();
|
writeGeometry();
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::updateStatLabel()
|
||||||
|
{
|
||||||
|
std::string statistics("<b>KIMA2 - Version ");
|
||||||
|
statistics += PROJECT_VERSION;
|
||||||
|
statistics += "</b><br />Verkäufer: " + std::to_string(marketplace_->getSellers().size() - 1);
|
||||||
|
statistics += "<br />Kunden: " + std::to_string(marketplace_->getSales().size());
|
||||||
|
statistics += "<br />Umsatz: " + marketplace_->getOverallSumAsString();
|
||||||
|
|
||||||
|
ui_.statLabel->setText(statistics.c_str());
|
||||||
|
}
|
|
@ -47,6 +47,7 @@ class MainWindow : public QMainWindow
|
||||||
void setSaleModel();
|
void setSaleModel();
|
||||||
void writeGeometry();
|
void writeGeometry();
|
||||||
void readGeometry();
|
void readGeometry();
|
||||||
|
void updateStatLabel();
|
||||||
|
|
||||||
Ui::MainWindow ui_;
|
Ui::MainWindow ui_;
|
||||||
std::unique_ptr<Marketplace> marketplace_;
|
std::unique_ptr<Marketplace> marketplace_;
|
||||||
|
|
|
@ -92,7 +92,16 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -331,6 +340,37 @@ drucken</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="statLabel">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<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>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
<item>
|
<item>
|
||||||
|
@ -379,7 +419,7 @@ drucken</string>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>817</width>
|
<width>817</width>
|
||||||
<height>29</height>
|
<height>24</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menu_Datei">
|
<widget class="QMenu" name="menu_Datei">
|
||||||
|
@ -433,8 +473,7 @@ drucken</string>
|
||||||
<action name="actionQuit">
|
<action name="actionQuit">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="application-exit">
|
<iconset theme="application-exit">
|
||||||
<normaloff/>
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Beenden</string>
|
<string>&Beenden</string>
|
||||||
|
|
Loading…
Reference in a new issue