Compare commits

...

4 Commits

10 changed files with 34 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,7 +1,6 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>software-application.png</file> <file>no-picture.png</file>
<file>feature.png</file> <file>application-icon.png</file>
<file>no-picture-taking.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -38,7 +38,7 @@ MainWindow::MainWindow(QWidget* parent)
setWindowTitle(QCoreApplication::applicationName() + " [*]"); setWindowTitle(QCoreApplication::applicationName() + " [*]");
/// application icon /// application icon
const QString iconString = "://feature.png"; const QString iconString = "://application-icon.png";
#ifdef QT_DEBUG #ifdef QT_DEBUG
QPixmap pixmap = QPixmap(iconString); QPixmap pixmap = QPixmap(iconString);
QTransform transform = QTransform(); QTransform transform = QTransform();
@ -163,6 +163,11 @@ void MainWindow::onAboutClicked() {
"Solidarische Landwirtschaft (SoLaWi))." "Solidarische Landwirtschaft (SoLaWi))."
"<br><br><a href=\"https://working-copy.org/\">Working-Copy_Collective website</a>" "<br><br><a href=\"https://working-copy.org/\">Working-Copy_Collective website</a>"
"<br><br><a href=\"mailto:support@working-copy.org\">Mail to support</a>" "<br><br><a href=\"mailto:support@working-copy.org\">Mail to support</a>"
"<br><br>Icon credits:"
"<br><a href=\"https://www.flaticon.com/free-icons/money\" title=\"money "
"icons\">Money icons created by Freepik - Flaticon</a>"
"<br><a href=\"https://www.flaticon.com/free-icons/no-photo\" title=\"no photo "
"icons\">No photo icons created by kerismaker - Flaticon</a>"
"<br><br>It uses the <a href=\"https://qt.io\">Qt Framework</a>.") "<br><br>It uses the <a href=\"https://qt.io\">Qt Framework</a>.")
.arg(applicationName) .arg(applicationName)
.arg(APPLICATION_VERSION) .arg(APPLICATION_VERSION)

View File

@ -262,7 +262,7 @@ void ItemDetailMapper::onCurrentIndexChanged(const QModelIndex& current,
void ItemDetailMapper::updateQRCode(const QString text) { void ItemDetailMapper::updateQRCode(const QString text) {
QImage unscaledImage; QImage unscaledImage;
if (text.isEmpty()) { if (text.isEmpty()) {
unscaledImage = QImage("://no-picture-taking.png"); unscaledImage = QImage("://no-picture.png");
} else { } else {
unscaledImage = m_generator.generateQr(text); unscaledImage = m_generator.generateQr(text);
} }

View File

@ -23,9 +23,12 @@ QList<ModelItemValues> CsvParser::getItemsFromCSVFile(const QString& fileName) {
bool CsvParser::exportToCSVFile(const QList<QStringList>& rows, const QString& filePath) { bool CsvParser::exportToCSVFile(const QList<QStringList>& rows, const QString& filePath) {
Document doc(std::string(), LabelParams(0, -1)); Document doc(std::string(), LabelParams(0, -1));
const QList<QString> headerNames = GET_HEADER_NAMES(); // const QList<QString> headerNames = GET_HEADER_NAMES();
for (int column = 0; column < headerNames.size(); ++column) { const int columnCount = USER_FACING_ROLES.size();
doc.SetColumnName(column, headerNames.at(column).toStdString()); for (int column = 0; column < columnCount; ++column) {
const UserRoles role = GET_ROLE_FOR_COLUMN(column);
std::string columnName = ROLE_NAMES.value(role).toStdString();
doc.SetColumnName(column, columnName);
} }
for (int row = 0; row < rows.size(); ++row) { for (int row = 0; row < rows.size(); ++row) {
QStringList rowValues = rows.at(row); QStringList rowValues = rows.at(row);
@ -129,8 +132,22 @@ ModelItemValues CsvParser::getItemValuesForRow(
QVariant CsvParser::parseItemValue(const int role, const std::string& valueString) { QVariant CsvParser::parseItemValue(const int role, const std::string& valueString) {
QVariant result; QVariant result;
if (STRING_ROLES.contains(role)) { if (STRING_ROLES.contains(role)) {
if (role == ShareTypeRole) {
if (valueString == "AGA") {
result = "erarbeitet";
} else if (valueString == "ja") {
result = "bezahlt";
} else if (valueString == "teils") {
result = "teils/teils";
} else {
result = "";
}
} else {
/// string values /// string values
result = QString::fromStdString(valueString); result = QString::fromStdString(valueString);
}
} else if (INT_ROLES.contains(role)) { } else if (INT_ROLES.contains(role)) {
/// int values /// int values

View File

@ -53,6 +53,8 @@ QByteArray JsonParser::itemValuesListToJson(const QList<ModelItemValues>& itemVa
const QVariant value = itemValues.value(role); const QVariant value = itemValues.value(role);
if (STRING_ROLES.contains(role)) { if (STRING_ROLES.contains(role)) {
itemObject.insert(roleName, value.toString()); itemObject.insert(roleName, value.toString());
} else if (TYPE_ROLES.contains(role)) {
itemObject.insert(roleName, value.toString());
} else if (INT_ROLES.contains(role)) { } else if (INT_ROLES.contains(role)) {
itemObject.insert(roleName, value.toInt()); itemObject.insert(roleName, value.toInt());
} else if (DOUBLE_ROLES.contains(role)) { } else if (DOUBLE_ROLES.contains(role)) {

View File

@ -164,7 +164,6 @@ void GenericCore::onLoginSuccessful() {
void GenericCore::onBiddingsChanged(const QList<bidding> biddings) { void GenericCore::onBiddingsChanged(const QList<bidding> biddings) {
qInfo() << "onBiddingsChanged: biddings:" << biddings.count(); qInfo() << "onBiddingsChanged: biddings:" << biddings.count();
// NEXT merge biddings into model
m_mainModel->updateBiddings(biddings); m_mainModel->updateBiddings(biddings);
} }