Sat, 26 Feb 2022 16:34:20 +0100
Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
CMakeLists.txt | file | annotate | diff | comparison | revisions | |
src/EditWater.cpp | file | annotate | diff | comparison | revisions | |
src/EditWater.h | file | annotate | diff | comparison | revisions | |
src/InventoryWaters.cpp | file | annotate | diff | comparison | revisions | |
src/InventoryWaters.h | file | annotate | diff | comparison | revisions | |
src/InventoryYeasts.cpp | file | annotate | diff | comparison | revisions | |
src/MainWindow.cpp | file | annotate | diff | comparison | revisions | |
src/MainWindow.h | file | annotate | diff | comparison | revisions | |
src/Utils.cpp | file | annotate | diff | comparison | revisions | |
src/Utils.h | file | annotate | diff | comparison | revisions | |
ui/EditWater.ui | file | annotate | diff | comparison | revisions | |
ui/InventoryWaters.ui | file | annotate | diff | comparison | revisions | |
ui/MainWindow.ui | file | annotate | diff | comparison | revisions |
--- 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 )
--- /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 <http://www.gnu.org/licenses/>. + */ +#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); +}
--- /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 <QDialog> + + +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
--- /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 <http://www.gnu.org/licenses/>. + */ +#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<QPushButton *>(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(); +} +
--- /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 <QDialog> + +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
--- 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) {
--- 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;
--- 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 <QMainWindow> @@ -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; };
--- 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 <math.h> -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; }
--- 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);
--- /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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>EditWater</class> + <widget class="QDialog" name="EditWater"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>1024</width> + <height>560</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QWidget" name="topWidget" native="true"> + <widget class="QLabel" name="nameLabel"> + <property name="geometry"> + <rect> + <x>60</x> + <y>10</y> + <width>91</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Name:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="notesLabel"> + <property name="geometry"> + <rect> + <x>60</x> + <y>40</y> + <width>91</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Notes:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="inventoryLabel"> + <property name="geometry"> + <rect> + <x>50</x> + <y>340</y> + <width>101</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Inventory L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="costLabel"> + <property name="geometry"> + <rect> + <x>610</x> + <y>340</y> + <width>101</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Cost per L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLineEdit" name="nameEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>10</y> + <width>691</width> + <height>23</height> + </rect> + </property> + <property name="maxLength"> + <number>128</number> + </property> + <property name="placeholderText"> + <string>Name of the brewing water</string> + </property> + </widget> + <widget class="QPlainTextEdit" name="notesEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>40</y> + <width>691</width> + <height>81</height> + </rect> + </property> + <property name="placeholderText"> + <string>Notes or the source of this water.</string> + </property> + </widget> + <widget class="QDoubleSpinBox" name="inventoryEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>340</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + <property name="buttonSymbols"> + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>100000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.500000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="costEdit"> + <property name="geometry"> + <rect> + <x>730</x> + <y>340</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>5</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.010000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QPushButton" name="quitButton"> + <property name="geometry"> + <rect> + <x>90</x> + <y>510</y> + <width>80</width> + <height>23</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Quit</string> + </property> + <property name="icon"> + <iconset> + <normaloff>:icons/silk/door_out.png</normaloff>:icons/silk/door_out.png</iconset> + </property> + </widget> + <widget class="QPushButton" name="saveButton"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>850</x> + <y>510</y> + <width>80</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>Save</string> + </property> + <property name="icon"> + <iconset> + <normaloff>:icons/silk/disk.png</normaloff>:icons/silk/disk.png</iconset> + </property> + </widget> + <widget class="QPushButton" name="deleteButton"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>463</x> + <y>510</y> + <width>80</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>Delete</string> + </property> + <property name="icon"> + <iconset> + <normaloff>:icons/silk/delete.png</normaloff>:icons/silk/delete.png</iconset> + </property> + </widget> + <widget class="QLabel" name="caLabel"> + <property name="geometry"> + <rect> + <x>10</x> + <y>150</y> + <width>141</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Calcium (Ca) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="mgLabel"> + <property name="geometry"> + <rect> + <x>10</x> + <y>180</y> + <width>141</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Magnesium (Mg) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="naLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>210</y> + <width>131</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Sodium (Na) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="phLabel"> + <property name="geometry"> + <rect> + <x>60</x> + <y>290</y> + <width>91</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Acid pH:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="unlimitedLabel"> + <property name="geometry"> + <rect> + <x>40</x> + <y>370</y> + <width>111</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Unlimited stock:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QCheckBox" name="unlimitedEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>370</y> + <width>85</width> + <height>21</height> + </rect> + </property> + <property name="text"> + <string>Yes</string> + </property> + </widget> + <widget class="QDoubleSpinBox" name="caEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>150</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="mgEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>180</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="naEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>210</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="phEdit"> + <property name="geometry"> + <rect> + <x>160</x> + <y>290</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.010000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="so4Edit"> + <property name="geometry"> + <rect> + <x>730</x> + <y>150</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="clEdit"> + <property name="geometry"> + <rect> + <x>730</x> + <y>180</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="hcoEdit"> + <property name="geometry"> + <rect> + <x>730</x> + <y>210</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="alkalinityEdit"> + <property name="geometry"> + <rect> + <x>730</x> + <y>240</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QDoubleSpinBox" name="balanceEdit"> + <property name="geometry"> + <rect> + <x>730</x> + <y>290</y> + <width>121</width> + <height>24</height> + </rect> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="accelerated"> + <bool>false</bool> + </property> + <property name="minimum"> + <double>-100.000000000000000</double> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.010000000000000</double> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::DefaultStepType</enum> + </property> + </widget> + <widget class="QLabel" name="so4Label"> + <property name="geometry"> + <rect> + <x>570</x> + <y>150</y> + <width>151</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Sulfate (SO4) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="clLabel"> + <property name="geometry"> + <rect> + <x>570</x> + <y>180</y> + <width>151</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Chloride (Cl) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="hcoLabel"> + <property name="geometry"> + <rect> + <x>540</x> + <y>210</y> + <width>181</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Bicarbonate (HCO3) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="alkalinityLabel"> + <property name="geometry"> + <rect> + <x>540</x> + <y>240</y> + <width>181</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Alkalinity (CaCO3) mg/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="balanceLabel"> + <property name="geometry"> + <rect> + <x>570</x> + <y>290</y> + <width>151</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Ion balance meq/L:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="balanceIcon"> + <property name="geometry"> + <rect> + <x>860</x> + <y>290</y> + <width>56</width> + <height>20</height> + </rect> + </property> + <property name="pixmap"> + <pixmap resource="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc">:/icons/silk/tick.png</pixmap> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + <tabstops> + <tabstop>nameEdit</tabstop> + <tabstop>notesEdit</tabstop> + <tabstop>inventoryEdit</tabstop> + <tabstop>costEdit</tabstop> + <tabstop>quitButton</tabstop> + <tabstop>deleteButton</tabstop> + <tabstop>saveButton</tabstop> + </tabstops> + <resources> + <include location="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc"/> + </resources> + <connections/> +</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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>InventoryWaters</class> + <widget class="QDialog" name="InventoryWaters"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>1280</width> + <height>640</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QTableWidget" name="tableWaters"> + <property name="enabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QGroupBox" name="groupBox"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="flat"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>6</number> + </property> + <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> + </property> + <item alignment="Qt::AlignLeft"> + <widget class="QPushButton" name="quitButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>24</height> + </size> + </property> + <property name="text"> + <string>Quit</string> + </property> + <property name="icon"> + <iconset> + <normaloff>:icons/silk/door_out.png</normaloff>:icons/silk/door_out.png</iconset> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="exportButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>24</height> + </size> + </property> + <property name="text"> + <string>Export</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="importButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>24</height> + </size> + </property> + <property name="text"> + <string>Import</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="insertButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>24</height> + </size> + </property> + <property name="text"> + <string>New</string> + </property> + <property name="icon"> + <iconset> + <normaloff>:icons/silk/table_row_insert.png</normaloff>:icons/silk/table_row_insert.png</iconset> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources> + <include location="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc"/> + </resources> + <connections/> +</ui>