# HG changeset patch # User Michiel Broek # Date 1645889660 -3600 # Node ID 76846c99f827265009eb8d3269612be8fbfcede5 # Parent 93a70b1502cac4e6f3923c5f9efa63c2b1dc5340 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable. diff -r 93a70b1502ca -r 76846c99f827 CMakeLists.txt --- a/CMakeLists.txt Fri Feb 25 10:51:36 2022 +0100 +++ b/CMakeLists.txt Sat Feb 26 16:34:20 2022 +0100 @@ -108,6 +108,8 @@ ${SRCDIR}/EditYeast.cpp ${SRCDIR}/InventoryMiscs.cpp ${SRCDIR}/EditMisc.cpp + ${SRCDIR}/InventoryWaters.cpp + ${SRCDIR}/EditWater.cpp ${SRCDIR}/Setup.cpp ${SRCDIR}/Utils.cpp ${SRCDIR}/MainWindow.cpp @@ -128,6 +130,8 @@ ${SRCDIR}/EditYeast.h ${SRCDIR}/InventoryMiscs.h ${SRCDIR}/EditMisc.h + ${SRCDIR}/InventoryWaters.h + ${SRCDIR}/EditWater.h ${SRCDIR}/Setup.h ${SRCDIR}/Utils.h ${SRCDIR}/MainWindow.h @@ -147,6 +151,7 @@ ${UIDIR}/EditYeast.ui ${UIDIR}/InventoryMiscs.ui ${UIDIR}/EditMisc.ui + ${UIDIR}/InventoryWaters.ui ${UIDIR}/Setup.ui ${UIDIR}/MainWindow.ui ) diff -r 93a70b1502ca -r 76846c99f827 src/EditWater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/EditWater.cpp Sat Feb 26 16:34:20 2022 +0100 @@ -0,0 +1,250 @@ +/** + * EditWater.cpp is part of bmsapp. + * + * bmsapp is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * bmsapp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "EditWater.h" +#include "../ui/ui_EditWater.h" +#include "bmsapp.h" + + +EditWater::EditWater(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditWater) +{ + QSqlQuery query; + + qDebug() << "EditWater record:" << id; + ui->setupUi(this); + this->recno = id; + + WindowTitle(); + + if (id >= 0) { + query.prepare("SELECT * FROM inventory_waters WHERE record = :recno"); + query.bindValue(":recno", id); + query.exec(); + query.next(); + + ui->nameEdit->setText(query.value(1).toString()); + ui->unlimitedEdit->setChecked(query.value(2).toInt() ? true:false); + ui->caEdit->setValue(query.value(3).toDouble()); + ui->hcoEdit->setValue(query.value(4).toDouble()); + ui->so4Edit->setValue(query.value(5).toDouble()); + ui->clEdit->setValue(query.value(6).toDouble()); + ui->naEdit->setValue(query.value(7).toDouble()); + ui->mgEdit->setValue(query.value(8).toDouble()); + ui->phEdit->setValue(query.value(9).toDouble()); + ui->notesEdit->setPlainText(query.value(10).toString()); + ui->alkalinityEdit->setValue(query.value(11).toDouble()); + ui->inventoryEdit->setValue(query.value(12).toDouble()); + ui->costEdit->setValue(query.value(13).toDouble()); + } else { + /* Set some defaults */ + ui->phEdit->setValue(7.0); + } + WaterSet(); + connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditWater::is_changed); + connect(ui->unlimitedEdit, &QCheckBox::stateChanged, this, &EditWater::is_changed); + connect(ui->caEdit, &QDoubleSpinBox::textChanged, this, &EditWater::water_changed); + connect(ui->hcoEdit, &QDoubleSpinBox::textChanged, this, &EditWater::hco_changed); + connect(ui->so4Edit, &QDoubleSpinBox::textChanged, this, &EditWater::water_changed); + connect(ui->clEdit, &QDoubleSpinBox::textChanged, this, &EditWater::water_changed); + connect(ui->naEdit, &QDoubleSpinBox::textChanged, this, &EditWater::water_changed); + connect(ui->mgEdit, &QDoubleSpinBox::textChanged, this, &EditWater::water_changed); + connect(ui->phEdit, &QDoubleSpinBox::textChanged, this, &EditWater::water_changed); + connect(ui->alkalinityEdit, &QDoubleSpinBox::textChanged, this, &EditWater::alkalinity_changed); + connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(is_changed())); + connect(ui->inventoryEdit, &QDoubleSpinBox::textChanged, this, &EditWater::is_changed); + connect(ui->costEdit, &QDoubleSpinBox::textChanged, this, &EditWater::is_changed); + + ui->saveButton->setEnabled(false); + ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && id >= 0) ? true:false); +} + + +EditWater::~EditWater() +{ + qDebug() << "EditWater done"; + delete ui; + emit entry_changed(); +} + + +/* + * Window header, mark any change with '**' + */ +void EditWater::WindowTitle() +{ + QString txt; + + if (this->recno < 0) { + txt = QString(tr("BMSapp - Add new brewing water")); + } else { + txt = QString(tr("BMSapp - Edit brewing water %1").arg(this->recno)); + } + + if (this->textIsChanged) { + txt.append((QString(" **"))); + } + setWindowTitle(txt); +} + + +void EditWater::on_saveButton_clicked() +{ + QSqlQuery query; + + /* If there are errors in the form, show a message and do "return;" */ + if (ui->nameEdit->text().length() < 2) { + QMessageBox::warning(this, tr("Edit Water"), tr("Name empty or too short.")); + return; + } + + if (this->textIsChanged) { + if (this->recno == -1) { + query.prepare("INSERT INTO inventory_waters SET name=:name, unlimited_stock=:unlimited, calcium=:ca, " + "bicarbonate=:hco, sulfate=:so4, chloride=:cl, sodium=:na, magnesium=:mg, ph=:ph, notes=:notes, " + "total_alkalinity=:alkalinity, inventory=:inventory, cost=:cost, uuid = :uuid"); + } else { + query.prepare("UPDATE inventory_waters SET name=:name, unlimited_stock=:unlimited, calcium=:ca, " + "bicarbonate=:hco, sulfate=:so4, chloride=:cl, sodium=:na, magnesium=:mg, ph=:ph, notes=:notes, " + "total_alkalinity=:alkalinity, inventory=:inventory, cost=:cost WHERE record = :recno"); + } + query.bindValue(":name", ui->nameEdit->text()); + query.bindValue(":unlimited", ui->unlimitedEdit->isChecked() ? 1:0); + query.bindValue(":ca", QString("%1").arg(ui->caEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":hco", QString("%1").arg(ui->hcoEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":so4", QString("%1").arg(ui->so4Edit->value(), 2, 'f', 1, '0')); + query.bindValue(":cl", QString("%1").arg(ui->clEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":na", QString("%1").arg(ui->naEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":mg", QString("%1").arg(ui->mgEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":ph", QString("%1").arg(ui->phEdit->value(), 3, 'f', 2, '0')); + query.bindValue(":notes", ui->notesEdit->toPlainText()); + query.bindValue(":alkalinity", QString("%1").arg(ui->alkalinityEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":inventory", QString("%1").arg(ui->inventoryEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":cost", QString("%1").arg(ui->costEdit->value(), 6, 'f', 5, '0')); + if (this->recno == -1) { + query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36)); + } else { + query.bindValue(":recno", this->recno); + } + query.exec(); + if (query.lastError().isValid()) { + qDebug() << "EditWater" << query.lastError(); + QMessageBox::warning(this, tr("Database error"), + tr("MySQL error: %1\n%2\n%3") + .arg(query.lastError().nativeErrorCode()) + .arg(query.lastError().driverText()) + .arg(query.lastError().databaseText())); + } else { + qDebug() << "EditWater Saved"; + } + } + + ui->saveButton->setEnabled(false); + this->textIsChanged = false; + WindowTitle(); +} + + +void EditWater::on_deleteButton_clicked() +{ + QSqlQuery query; + + query.prepare("DELETE FROM inventory_waters WHERE record = :recno"); + query.bindValue(":recno", this->recno); + query.exec(); + if (query.lastError().isValid()) { + qDebug() << "EditWater" << query.lastError(); + QMessageBox::warning(this, tr("Database error"), + tr("MySQL error: %1\n%2\n%3") + .arg(query.lastError().nativeErrorCode()) + .arg(query.lastError().driverText()) + .arg(query.lastError().databaseText())); + } else { + qDebug() << "EditWater Deleted" << this->recno; + } + + this->close(); + this->setResult(1); +} + + +void EditWater::WaterSet() +{ + double cations, anions, balance; + + cations = (ui->caEdit->value() / 20.039) + (ui->mgEdit->value() / 12.1525) + (ui->naEdit->value() / 22.989); + anions = (ui->hcoEdit->value() / 61.016) + (ui->so4Edit->value() / 48.031) + (ui->clEdit->value() / 35.4527); + balance = round((cations - anions) * 100) / 100; + ui->balanceEdit->setValue(balance); + + if (balance <= 0.1 && balance >= -0.1) { + ui->balanceIcon->setPixmap(QPixmap(":icons/silk/tick.png")); + } else if (balance <= 0.5 && balance >= -0.5) { + ui->balanceIcon->setPixmap(QPixmap(":icons/silk/thumb_down.png")); + } else { + ui->balanceIcon->setPixmap(QPixmap(":icons/silk/error.png")); + } +} + + +void EditWater::is_changed() +{ + ui->saveButton->setEnabled(true); + ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && this->recno >= 0) ? true:false); + this->textIsChanged = true; + WindowTitle(); +} + + +void EditWater::water_changed() +{ + WaterSet(); + is_changed(); +} + + +void EditWater::hco_changed() +{ + ui->alkalinityEdit->setValue(ui->hcoEdit->value() * 50 / 61); + water_changed(); +} + + +void EditWater::alkalinity_changed() +{ + ui->hcoEdit->setValue(ui->alkalinityEdit->value() * 1.22); + water_changed(); +} + + +void EditWater::on_quitButton_clicked() +{ + if (this->textIsChanged) { + int rc = QMessageBox::warning(this, tr("Water changed"), tr("The water has been modified\n Save changes?"), + QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save); + switch (rc) { + case QMessageBox::Save: + on_saveButton_clicked(); + break; /* Saved and then Quit */ + case QMessageBox::Discard: + break; /* Quit without Save */ + case QMessageBox::Cancel: + return; /* Return to the editor page */ + } + } + + this->close(); + this->setResult(1); +} diff -r 93a70b1502ca -r 76846c99f827 src/EditWater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/EditWater.h Sat Feb 26 16:34:20 2022 +0100 @@ -0,0 +1,40 @@ +#ifndef _EDITWATER_H +#define _EDITWATER_H + +#include + + +namespace Ui { +class EditWater; +} + +class EditWater : public QDialog +{ + Q_OBJECT + +signals: + void entry_changed(); + +public: + explicit EditWater(int id, QWidget *parent = 0); + ~EditWater(); + +private slots: + void on_saveButton_clicked(); + void on_quitButton_clicked(); + void on_deleteButton_clicked(); + void is_changed(); + void water_changed(); + void hco_changed(); + void alkalinity_changed(); + +private: + Ui::EditWater *ui; + int recno; + bool textIsChanged = false; + + void WindowTitle(); + void WaterSet(); +}; + +#endif diff -r 93a70b1502ca -r 76846c99f827 src/InventoryWaters.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/InventoryWaters.cpp Sat Feb 26 16:34:20 2022 +0100 @@ -0,0 +1,144 @@ +/** + * InventoryWaters.cpp is part of bmsapp. + * + * bmsapp is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * bmsapp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "InventoryWaters.h" +#include "EditWater.h" +#include "../ui/ui_InventoryWaters.h" +#include "config.h" +#include "bmsapp.h" + + +InventoryWaters::InventoryWaters(QWidget *parent) : QDialog(parent), ui(new Ui::InventoryWaters) +{ + qDebug() << "InventoryWaters start"; + + ui->setupUi(this); + emit refreshTable(); + + setWindowTitle( QString("BMSapp - %1 - Inventory Waters").arg(VERSIONSTRING) ); +} + + +void InventoryWaters::refreshTable() +{ + QString w; + QWidget* pWidget; + QLabel *label; + QHBoxLayout* pLayout; + + qDebug() << "InventoryWaters reload"; + + QSqlQuery query("SELECT * FROM inventory_waters ORDER BY name"); + const QStringList labels({tr("Name"), tr("Notes"), tr("Unlimited"), tr("Stock"), tr("Edit")}); + + ui->tableWaters->setColumnCount(5); + ui->tableWaters->setColumnWidth(0, 200); /* Name */ + ui->tableWaters->setColumnWidth(1, 500); /* Notes */ + ui->tableWaters->setColumnWidth(2, 75); /* Unlimited */ + ui->tableWaters->setColumnWidth(3, 75); /* Stock */ + ui->tableWaters->setColumnWidth(4, 80); /* Edit button */ + ui->tableWaters->setRowCount(query.size()); + ui->tableWaters->setHorizontalHeaderLabels(labels); + ui->tableWaters->verticalHeader()->hide(); + ui->tableWaters->setFixedSize(930 + 24, 640); /* Even if this is too large, it works */ + + QTableWidgetItem *rightitem = new QTableWidgetItem(); + rightitem->setTextAlignment(Qt::AlignRight); + + query.first(); + for (int ridx = 0 ; ridx < query.size() ; ridx++ ) { + ui->tableWaters->setItem(ridx, 0, new QTableWidgetItem(query.value(1).toString())); /* Name */ + ui->tableWaters->setItem(ridx, 1, new QTableWidgetItem(query.value(10).toString())); /* Notes */ + if (query.value(2).toInt()) { + pWidget = new QWidget(); + label = new QLabel; + label->setPixmap(QPixmap(":icons/silk/tick.png")); + pLayout = new QHBoxLayout(pWidget); + pLayout->addWidget(label); + pLayout->setAlignment(Qt::AlignCenter); + pLayout->setContentsMargins(0, 0, 0, 0); + pWidget->setLayout(pLayout); + ui->tableWaters->setCellWidget(ridx, 2, pWidget); + } else { + ui->tableWaters->removeCellWidget(ridx, 2); + } + + w = QString(""); + if (query.value(12).toDouble() > 0) { + w = QString("%1 L").arg(query.value(12).toDouble(), 2, 'f', 1, '0' ); + } + QTableWidgetItem *item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableWaters->setItem(ridx, 3, item); + + /* Add the Edit button */ + pWidget = new QWidget(); + QPushButton* btn_edit = new QPushButton(); + btn_edit->setObjectName(QString("%1").arg(query.value(0).toString())); /* Send record with the button */ + btn_edit->setText(tr("Edit")); + connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked())); + pLayout = new QHBoxLayout(pWidget); + pLayout->addWidget(btn_edit); + pLayout->setContentsMargins(5, 0, 5, 0); + pWidget->setLayout(pLayout); + ui->tableWaters->setCellWidget(ridx, 4, pWidget); + query.next(); + } + + setWindowTitle( QString("BMSapp - %1 - Inventory Waters").arg(VERSIONSTRING) ); +} + + +InventoryWaters::~InventoryWaters() +{ + qDebug() << "InventoryWaters done"; + delete ui; +} + + +void InventoryWaters::edit(int recno) +{ + qDebug() << "InventoryWaters edit:" << recno; + + EditWater dialog(recno, this); + /* Signal from editor if a refresh is needed */ + connect(&dialog, SIGNAL(entry_changed()), this, SLOT(refreshTable())); + dialog.setModal(true); + dialog.exec(); +} + + +void InventoryWaters::on_editButton_clicked() +{ + QPushButton *pb = qobject_cast(QObject::sender()); + int recno = pb->objectName().toInt(); + qDebug() << Q_FUNC_INFO << recno; + edit(recno); +} + + +void InventoryWaters::on_insertButton_clicked() +{ + qDebug() << Q_FUNC_INFO; + edit(-1); +} + + +void InventoryWaters::on_quitButton_clicked() +{ + emit firstWindow(); +} + diff -r 93a70b1502ca -r 76846c99f827 src/InventoryWaters.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/InventoryWaters.h Sat Feb 26 16:34:20 2022 +0100 @@ -0,0 +1,32 @@ +#ifndef _INVENTORYWATERS_H +#define _INVENTORYWATERS_H + +#include + +namespace Ui { +class InventoryWaters; +} + +class InventoryWaters : public QDialog +{ + Q_OBJECT + +public: + explicit InventoryWaters(QWidget *parent = nullptr); + ~InventoryWaters(); + +signals: + void firstWindow(); + +private slots: + void on_quitButton_clicked(); + void on_insertButton_clicked(); + void on_editButton_clicked(); + void refreshTable(void); + +private: + Ui::InventoryWaters *ui; + void edit(int recno); +}; + +#endif diff -r 93a70b1502ca -r 76846c99f827 src/InventoryYeasts.cpp --- a/src/InventoryYeasts.cpp Fri Feb 25 10:51:36 2022 +0100 +++ b/src/InventoryYeasts.cpp Sat Feb 26 16:34:20 2022 +0100 @@ -95,6 +95,8 @@ pLayout->setContentsMargins(0, 0, 0, 0); pWidget->setLayout(pLayout); ui->tableYeasts->setCellWidget(ridx, 7, pWidget); + } else { + ui->tableYeasts->removeCellWidget(ridx, 7); } if (query.value(19).toInt()) { pWidget = new QWidget(); @@ -106,7 +108,9 @@ pLayout->setContentsMargins(0, 0, 0, 0); pWidget->setLayout(pLayout); ui->tableYeasts->setCellWidget(ridx, 8, pWidget); - } + } else { + ui->tableYeasts->removeCellWidget(ridx, 8); + } w = QString(""); if (query.value(14).toDouble() > 0) { diff -r 93a70b1502ca -r 76846c99f827 src/MainWindow.cpp --- a/src/MainWindow.cpp Fri Feb 25 10:51:36 2022 +0100 +++ b/src/MainWindow.cpp Sat Feb 26 16:34:20 2022 +0100 @@ -21,6 +21,7 @@ #include "InventoryHops.h" #include "InventoryYeasts.h" #include "InventoryMiscs.h" +#include "InventoryWaters.h" #include "Setup.h" #include "../ui/ui_MainWindow.h" #include "config.h" @@ -145,6 +146,24 @@ } +void MainWindow::fromInventoryWaters() +{ + qDebug() << Q_FUNC_INFO; + delete InventoryWatersWindow; + this->show(); +} + + +void MainWindow::on_actionWaters_triggered() +{ + qDebug() << Q_FUNC_INFO; + InventoryWatersWindow = new InventoryWaters(this); + QObject::connect(InventoryWatersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryWaters())); + this->hide(); // Close the main window + InventoryWatersWindow->show(); // Show a second window +} + + void MainWindow::fromSetup() { qDebug() << Q_FUNC_INFO; diff -r 93a70b1502ca -r 76846c99f827 src/MainWindow.h --- a/src/MainWindow.h Fri Feb 25 10:51:36 2022 +0100 +++ b/src/MainWindow.h Sat Feb 26 16:34:20 2022 +0100 @@ -6,6 +6,7 @@ #include "InventoryHops.h" #include "InventoryYeasts.h" #include "InventoryMiscs.h" +#include "InventoryWaters.h" #include "Setup.h" #include @@ -32,6 +33,7 @@ void on_actionHops_triggered(); void on_actionYeasts_triggered(); void on_actionMiscs_triggered(); + void on_actionWaters_triggered(); void on_actionSetup_triggered(); void on_actionAbout_triggered(); @@ -41,6 +43,7 @@ void fromInventoryHops(); void fromInventoryYeasts(); void fromInventoryMiscs(); + void fromInventoryWaters(); void fromSetup(); private: @@ -52,6 +55,7 @@ InventoryHops *InventoryHopsWindow; InventoryYeasts *InventoryYeastsWindow; InventoryMiscs *InventoryMiscsWindow; + InventoryWaters *InventoryWatersWindow; Setup *SetupWindow; }; diff -r 93a70b1502ca -r 76846c99f827 src/Utils.cpp --- a/src/Utils.cpp Fri Feb 25 10:51:36 2022 +0100 +++ b/src/Utils.cpp Sat Feb 26 16:34:20 2022 +0100 @@ -18,14 +18,6 @@ #include -double Utils::Round(double n, int d) -{ - int m; - - for (int i = 0, m = 1; i < d; i++, m *= 10); - return round(n * m) / m; -} - double Utils::lintner_to_kolbach(double lintner) { @@ -38,6 +30,6 @@ double Utils::kolbach_to_lintner(double kolbach) { - return Round((kolbach + 16) / 3.5, 3); + return round(((kolbach + 16) / 3.5) * 1000.0) / 1000.0; } diff -r 93a70b1502ca -r 76846c99f827 src/Utils.h --- a/src/Utils.h Fri Feb 25 10:51:36 2022 +0100 +++ b/src/Utils.h Sat Feb 26 16:34:20 2022 +0100 @@ -9,8 +9,6 @@ */ namespace Utils { - double Round(double n, int d); - double lintner_to_kolbach(double lintner); double kolbach_to_lintner(double kolbach); diff -r 93a70b1502ca -r 76846c99f827 ui/EditWater.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/EditWater.ui Sat Feb 26 16:34:20 2022 +0100 @@ -0,0 +1,692 @@ + + + EditWater + + + + 0 + 0 + 1024 + 560 + + + + Dialog + + + + + + + + 60 + 10 + 91 + 20 + + + + Name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 40 + 91 + 20 + + + + Notes: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 50 + 340 + 101 + 20 + + + + Inventory L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 610 + 340 + 101 + 20 + + + + Cost per L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 160 + 10 + 691 + 23 + + + + 128 + + + Name of the brewing water + + + + + + 160 + 40 + 691 + 81 + + + + Notes or the source of this water. + + + + + + 160 + 340 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + QAbstractSpinBox::UpDownArrows + + + true + + + 1 + + + 100000.000000000000000 + + + 0.500000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 730 + 340 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 5 + + + 1000.000000000000000 + + + 0.010000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 90 + 510 + 80 + 23 + + + + + 0 + 0 + + + + Quit + + + + :icons/silk/door_out.png:icons/silk/door_out.png + + + + + false + + + + 850 + 510 + 80 + 23 + + + + Save + + + + :icons/silk/disk.png:icons/silk/disk.png + + + + + false + + + + 463 + 510 + 80 + 23 + + + + Delete + + + + :icons/silk/delete.png:icons/silk/delete.png + + + + + + 10 + 150 + 141 + 20 + + + + Calcium (Ca) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 180 + 141 + 20 + + + + Magnesium (Mg) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 20 + 210 + 131 + 20 + + + + Sodium (Na) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 290 + 91 + 20 + + + + Acid pH: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 40 + 370 + 111 + 20 + + + + Unlimited stock: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 160 + 370 + 85 + 21 + + + + Yes + + + + + + 160 + 150 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 160 + 180 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 160 + 210 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 160 + 290 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1000.000000000000000 + + + 0.010000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 730 + 150 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 730 + 180 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 730 + 210 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 730 + 240 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1 + + + 1000.000000000000000 + + + 0.100000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 730 + 290 + 121 + 24 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + false + + + -100.000000000000000 + + + 1000.000000000000000 + + + 0.010000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + 570 + 150 + 151 + 20 + + + + Sulfate (SO4) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 570 + 180 + 151 + 20 + + + + Chloride (Cl) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 540 + 210 + 181 + 20 + + + + Bicarbonate (HCO3) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 540 + 240 + 181 + 20 + + + + Alkalinity (CaCO3) mg/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 570 + 290 + 151 + 20 + + + + Ion balance meq/L: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 860 + 290 + 56 + 20 + + + + :/icons/silk/tick.png + + + + + + + + nameEdit + notesEdit + inventoryEdit + costEdit + quitButton + deleteButton + saveButton + + + + + + diff -r 93a70b1502ca -r 76846c99f827 ui/InventoryWaters.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/InventoryWaters.ui Sat Feb 26 16:34:20 2022 +0100 @@ -0,0 +1,141 @@ + + + InventoryWaters + + + + 0 + 0 + 1280 + 640 + + + + Dialog + + + + + + true + + + + + + + true + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 80 + 24 + + + + Quit + + + + :icons/silk/door_out.png:icons/silk/door_out.png + + + + + + + + 0 + 0 + + + + + 80 + 24 + + + + Export + + + + + + + + 0 + 0 + + + + + 80 + 24 + + + + Import + + + + + + + + 0 + 0 + + + + + 80 + 24 + + + + New + + + + :icons/silk/table_row_insert.png:icons/silk/table_row_insert.png + + + + + + + + + + + + + diff -r 93a70b1502ca -r 76846c99f827 ui/MainWindow.ui --- a/ui/MainWindow.ui Fri Feb 25 10:51:36 2022 +0100 +++ b/ui/MainWindow.ui Sat Feb 26 16:34:20 2022 +0100 @@ -242,7 +242,7 @@ - false + true