Tue, 15 Mar 2022 17:00:54 +0100
Added styles tables and editor.
CMakeLists.txt | file | annotate | diff | comparison | revisions | |
src/EditProfileStyle.cpp | file | annotate | diff | comparison | revisions | |
src/EditProfileStyle.h | file | annotate | diff | comparison | revisions | |
src/MainWindow.cpp | file | annotate | diff | comparison | revisions | |
src/MainWindow.h | file | annotate | diff | comparison | revisions | |
src/ProfileStyles.cpp | file | annotate | diff | comparison | revisions | |
src/ProfileStyles.h | file | annotate | diff | comparison | revisions | |
ui/EditProfileStyle.ui | file | annotate | diff | comparison | revisions | |
ui/MainWindow.ui | file | annotate | diff | comparison | revisions | |
ui/ProfileStyles.ui | file | annotate | diff | comparison | revisions |
--- a/CMakeLists.txt Mon Mar 14 16:56:59 2022 +0100 +++ b/CMakeLists.txt Tue Mar 15 17:00:54 2022 +0100 @@ -119,6 +119,8 @@ ${SRCDIR}/EditProfileWater.cpp ${SRCDIR}/ProfileMashs.cpp ${SRCDIR}/EditProfileMash.cpp + ${SRCDIR}/ProfileStyles.cpp + ${SRCDIR}/EditProfileStyle.cpp ${SRCDIR}/Setup.cpp ${SRCDIR}/Utils.cpp ${SRCDIR}/PrinterDialog.cpp @@ -148,6 +150,8 @@ ${SRCDIR}/EditProfileWater.h ${SRCDIR}/ProfileMashs.h ${SRCDIR}/EditProfileMash.h + ${SRCDIR}/ProfileStyles.h + ${SRCDIR}/EditProfileStyle.h ${SRCDIR}/Setup.h ${SRCDIR}/Utils.h ${SRCDIR}/PrinterDialog.h @@ -176,6 +180,8 @@ ${UIDIR}/EditProfileWater.ui ${UIDIR}/ProfileMashs.ui ${UIDIR}/EditProfileMash.ui + ${UIDIR}/ProfileStyles.ui + ${UIDIR}/EditProfileStyle.ui ${UIDIR}/Setup.ui ${UIDIR}/MainWindow.ui )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/EditProfileStyle.cpp Tue Mar 15 17:00:54 2022 +0100 @@ -0,0 +1,359 @@ +/** + * EditProfileStyle.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 "EditProfileStyle.h" +#include "../ui/ui_EditProfileStyle.h" +#include "bmsapp.h" + + +EditProfileStyle::EditProfileStyle(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditProfileStyle) +{ + QSqlQuery query; + + qDebug() << "EditProfileStyle record:" << id; + ui->setupUi(this); + this->recno = id; + + WindowTitle(); + + ui->typeEdit->addItem(tr("Lager")); + ui->typeEdit->addItem(tr("Ale")); + ui->typeEdit->addItem(tr("Mead")); + ui->typeEdit->addItem(tr("Wheat")); + ui->typeEdit->addItem(tr("Mixed")); + ui->typeEdit->addItem(tr("Cider")); + + if (id >= 0) { + query.prepare("SELECT * FROM profile_styles WHERE record = :recno"); + query.bindValue(":recno", id); + query.exec(); + query.next(); + + ui->styleEdit->setText(query.value(1).toString()); + ui->catEdit->setText(query.value(2).toString()); + ui->catnrEdit->setValue(query.value(3).toInt()); + ui->groupEdit->setText(query.value(4).toString()); + ui->guideEdit->setText(query.value(5).toString()); + ui->typeEdit->setCurrentIndex(query.value(6).toInt()); + ui->ogminEdit->setValue(query.value(7).toDouble()); + ui->ogmaxEdit->setValue(query.value(8).toDouble()); + ui->fgminEdit->setValue(query.value(9).toDouble()); + ui->fgmaxEdit->setValue(query.value(10).toDouble()); + ui->ibuminEdit->setValue(query.value(11).toDouble()); + ui->ibumaxEdit->setValue(query.value(12).toDouble()); + ui->ebcminEdit->setValue(query.value(13).toDouble()); + ui->ebcmaxEdit->setValue(query.value(14).toDouble()); + ui->co2minEdit->setValue(query.value(15).toDouble()); + ui->co2maxEdit->setValue(query.value(16).toDouble()); + ui->abvminEdit->setValue(query.value(17).toDouble()); + ui->abvmaxEdit->setValue(query.value(18).toDouble()); + ui->notesEdit->setPlainText(query.value(19).toString()); + ui->profileEdit->setPlainText(query.value(20).toString()); + ui->ingredientsEdit->setPlainText(query.value(21).toString()); + ui->examplesEdit->setPlainText(query.value(22).toString()); + } else { + /* Set some defaults */ + ui->catnrEdit->setValue(0); + ui->guideEdit->setText("BKG 2019"); + ui->typeEdit->setCurrentIndex(0); + ui->ogminEdit->setValue(1.030); + ui->ogmaxEdit->setValue(1.060); + ui->fgminEdit->setValue(1.005); + ui->fgmaxEdit->setValue(1.010); + ui->ibuminEdit->setValue(20); + ui->ibumaxEdit->setValue(30); + ui->ebcminEdit->setValue(52); + ui->ebcmaxEdit->setValue(79); + ui->co2minEdit->setValue(2.0); + ui->co2maxEdit->setValue(2.5); + ui->abvminEdit->setValue(4.0); + ui->abvmaxEdit->setValue(5.0); + } + connect(ui->styleEdit, &QLineEdit::textChanged, this, &EditProfileStyle::is_changed); + connect(ui->catEdit, &QLineEdit::textChanged, this, &EditProfileStyle::is_changed); + connect(ui->catnrEdit, &QSpinBox::textChanged, this, &EditProfileStyle::is_changed); + connect(ui->groupEdit, &QLineEdit::textChanged, this, &EditProfileStyle::is_changed); + connect(ui->guideEdit, &QLineEdit::textChanged, this, &EditProfileStyle::is_changed); + connect(ui->typeEdit, &QComboBox::currentTextChanged, this, &EditProfileStyle::is_changed); + connect(ui->ogminEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::ogmin_changed); + connect(ui->ogmaxEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::ogmax_changed); + connect(ui->fgminEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::fgmin_changed); + connect(ui->fgmaxEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::fgmax_changed); + connect(ui->ibuminEdit, &QSpinBox::textChanged, this, &EditProfileStyle::ibumin_changed); + connect(ui->ibumaxEdit, &QSpinBox::textChanged, this, &EditProfileStyle::ibumax_changed); + connect(ui->ebcminEdit, &QSpinBox::textChanged, this, &EditProfileStyle::ebcmin_changed); + connect(ui->ebcmaxEdit, &QSpinBox::textChanged, this, &EditProfileStyle::ebcmax_changed); + connect(ui->co2minEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::co2min_changed); + connect(ui->co2maxEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::co2max_changed); + connect(ui->abvminEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::abvmin_changed); + connect(ui->abvmaxEdit, &QDoubleSpinBox::textChanged, this, &EditProfileStyle::abvmax_changed); + connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(is_changed())); + connect(ui->profileEdit, SIGNAL(textChanged()), this, SLOT(is_changed())); + connect(ui->ingredientsEdit, SIGNAL(textChanged()), this, SLOT(is_changed())); + connect(ui->examplesEdit, SIGNAL(textChanged()), this, SLOT(is_changed())); + + ui->saveButton->setEnabled(false); + ui->deleteButton->setEnabled((id >= 0) ? true:false); +} + + +EditProfileStyle::~EditProfileStyle() +{ + qDebug() << "EditProfileStyle done"; + delete ui; + emit entry_changed(); +} + + +/* + * Window header, mark any change with '**' + */ +void EditProfileStyle::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 EditProfileStyle::on_saveButton_clicked() +{ + QSqlQuery query; + + /* If there are errors in the form, show a message and do "return;" */ + if (ui->styleEdit->text().length() < 2) { + QMessageBox::warning(this, tr("Edit Style"), tr("Beer style is empty or too short.")); + return; + } + + if (this->textIsChanged) { + if (this->recno == -1) { + query.prepare("INSERT INTO profile_styles SET name=:name, category=:category, " + "category_number=:catnr, style_letter=:group, style_guide=:guide, type=:type, " + "og_min=:og_min, og_max=:og_max, fg_min=:fg_min, fg_max=:fg_max, ibu_min=:ibu_min, " + "ibu_max=:ibu_max, color_min=:ebc_min, color_max=:ebc_max, carb_min=:co2_min, " + "carb_max=:co2_max, abv_min=:abv_min, abv_max=:abv_max, notes=:notes, " + "profile=:profile, ingredients=:ingredients, examples=:examples, uuid=:uuid"); + } else { + query.prepare("UPDATE profile_styles SET name=:name, category=:category, " + "category_number=:catnr, style_letter=:group, style_guide=:guide, type=:type, " + "og_min=:og_min, og_max=:og_max, fg_min=:fg_min, fg_max=:fg_max, ibu_min=:ibu_min, " + "ibu_max=:ibu_max, color_min=:ebc_min, color_max=:ebc_max, carb_min=:co2_min, " + "carb_max=:co2_max, abv_min=:abv_min, abv_max=:abv_max, notes=:notes, " + "profile=:profile, ingredients=:ingredients, examples=:examples WHERE record=:recno"); + } + query.bindValue(":name", ui->styleEdit->text()); + query.bindValue(":category", ui->catEdit->text()); + query.bindValue(":catnr", QString("%1").arg(ui->catnrEdit->value())); + query.bindValue(":group", ui->groupEdit->text()); + query.bindValue(":guide", ui->guideEdit->text()); + query.bindValue(":type", ui->typeEdit->currentIndex()); + query.bindValue(":og_min", QString("%1").arg(ui->ogminEdit->value(), 4, 'f', 3, '0')); + query.bindValue(":og_max", QString("%1").arg(ui->ogmaxEdit->value(), 4, 'f', 3, '0')); + query.bindValue(":fg_min", QString("%1").arg(ui->fgminEdit->value(), 4, 'f', 3, '0')); + query.bindValue(":fg_max", QString("%1").arg(ui->fgmaxEdit->value(), 4, 'f', 3, '0')); + query.bindValue(":ibu_min", QString("%1").arg(ui->ibuminEdit->value(), 1, 'f', 0, '0')); + query.bindValue(":ibu_max", QString("%1").arg(ui->ibumaxEdit->value(), 1, 'f', 0, '0')); + query.bindValue(":ebc_min", QString("%1").arg(ui->ebcminEdit->value(), 1, 'f', 0, '0')); + query.bindValue(":ebc_max", QString("%1").arg(ui->ebcmaxEdit->value(), 1, 'f', 0, '0')); + query.bindValue(":co2_min", QString("%1").arg(ui->co2minEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":co2_max", QString("%1").arg(ui->co2maxEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":abv_min", QString("%1").arg(ui->abvminEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":abv_max", QString("%1").arg(ui->abvmaxEdit->value(), 2, 'f', 1, '0')); + query.bindValue(":notes", ui->notesEdit->toPlainText()); + query.bindValue(":profile", ui->profileEdit->toPlainText()); + query.bindValue(":ingredients", ui->ingredientsEdit->toPlainText()); + query.bindValue(":examples", ui->examplesEdit->toPlainText()); + 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() << "EditProfileStyle" << 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() << "EditProfileStyle Saved"; + } + } + + ui->saveButton->setEnabled(false); + this->textIsChanged = false; + WindowTitle(); +} + + +void EditProfileStyle::on_deleteButton_clicked() +{ + QSqlQuery query; + + query.prepare("DELETE FROM profile_styles WHERE record = :recno"); + query.bindValue(":recno", this->recno); + query.exec(); + if (query.lastError().isValid()) { + qDebug() << "EditProfileStyle" << 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() << "EditProfileStyle Deleted" << this->recno; + } + + this->close(); + this->setResult(1); +} + + +void EditProfileStyle::is_changed() +{ + ui->saveButton->setEnabled(true); + ui->deleteButton->setEnabled((this->recno >= 0) ? true:false); + this->textIsChanged = true; + WindowTitle(); +} + + +void EditProfileStyle::ogmin_changed() +{ + if (ui->ogminEdit->value() > (ui->ogmaxEdit->value() - 0.001)) + ui->ogmaxEdit->setValue(ui->ogminEdit->value() + 0.001); + is_changed(); +} + + +void EditProfileStyle::ogmax_changed() +{ + if (ui->ogmaxEdit->value() < (ui->ogminEdit->value() + 0.001)) + ui->ogminEdit->setValue(ui->ogmaxEdit->value() - 0.001); + is_changed(); +} + + +void EditProfileStyle::fgmin_changed() +{ + if (ui->fgminEdit->value() > (ui->fgmaxEdit->value() - 0.001)) + ui->fgmaxEdit->setValue(ui->fgminEdit->value() + 0.001); + is_changed(); +} + + +void EditProfileStyle::fgmax_changed() +{ + if (ui->fgmaxEdit->value() < (ui->fgminEdit->value() + 0.001)) + ui->fgminEdit->setValue(ui->fgmaxEdit->value() - 0.001); + is_changed(); +} + + +void EditProfileStyle::ibumin_changed() +{ + if (ui->ibuminEdit->value() > (ui->ibumaxEdit->value() - 1)) + ui->ibumaxEdit->setValue(ui->ibuminEdit->value() + 1); + is_changed(); +} + + +void EditProfileStyle::ibumax_changed() +{ + if (ui->ibumaxEdit->value() < (ui->ibuminEdit->value() + 1)) + ui->ibuminEdit->setValue(ui->ibumaxEdit->value() - 1); + is_changed(); +} + + +void EditProfileStyle::ebcmin_changed() +{ + if (ui->ebcminEdit->value() > (ui->ebcmaxEdit->value() - 1)) + ui->ebcmaxEdit->setValue(ui->ebcminEdit->value() + 1); + is_changed(); +} + + +void EditProfileStyle::ebcmax_changed() +{ + if (ui->ebcmaxEdit->value() < (ui->ebcminEdit->value() + 1)) + ui->ebcminEdit->setValue(ui->ebcmaxEdit->value() - 1); + is_changed(); +} + + +void EditProfileStyle::co2min_changed() +{ + if (ui->co2minEdit->value() > (ui->co2maxEdit->value() - 0.1)) + ui->co2maxEdit->setValue(ui->co2minEdit->value() + 0.1); + is_changed(); +} + + +void EditProfileStyle::co2max_changed() +{ + if (ui->co2maxEdit->value() < (ui->co2minEdit->value() + 0.1)) + ui->co2minEdit->setValue(ui->co2maxEdit->value() - 0.1); + is_changed(); +} + + +void EditProfileStyle::abvmin_changed() +{ + if (ui->abvminEdit->value() > (ui->abvmaxEdit->value() - 0.1)) + ui->abvmaxEdit->setValue(ui->abvminEdit->value() + 0.1); + is_changed(); +} + + +void EditProfileStyle::abvmax_changed() +{ + if (ui->abvmaxEdit->value() < (ui->abvminEdit->value() + 0.1)) + ui->abvminEdit->setValue(ui->abvmaxEdit->value() - 0.1); + is_changed(); +} + + +void EditProfileStyle::on_quitButton_clicked() +{ + if (this->textIsChanged) { + int rc = QMessageBox::warning(this, tr("Style changed"), tr("The style 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/EditProfileStyle.h Tue Mar 15 17:00:54 2022 +0100 @@ -0,0 +1,48 @@ +#ifndef _EDITPROFILESTYLE_H +#define _EDITPROFILESTYLE_H + +#include <QDialog> + + +namespace Ui { +class EditProfileStyle; +} + +class EditProfileStyle : public QDialog +{ + Q_OBJECT + +signals: + void entry_changed(); + +public: + explicit EditProfileStyle(int id, QWidget *parent = 0); + ~EditProfileStyle(); + +private slots: + void on_saveButton_clicked(); + void on_quitButton_clicked(); + void on_deleteButton_clicked(); + void is_changed(); + void ogmin_changed(); + void ogmax_changed(); + void fgmin_changed(); + void fgmax_changed(); + void ibumin_changed(); + void ibumax_changed(); + void ebcmin_changed(); + void ebcmax_changed(); + void co2min_changed(); + void co2max_changed(); + void abvmin_changed(); + void abvmax_changed(); + +private: + Ui::EditProfileStyle *ui; + int recno; + bool textIsChanged = false; + + void WindowTitle(); +}; + +#endif
--- a/src/MainWindow.cpp Mon Mar 14 16:56:59 2022 +0100 +++ b/src/MainWindow.cpp Tue Mar 15 17:00:54 2022 +0100 @@ -25,6 +25,7 @@ #include "InventoryEquipments.h" #include "ProfileWaters.h" #include "ProfileMashs.h" +#include "ProfileStyles.h" #include "Setup.h" #include "PrinterDialog.h" #include "../ui/ui_MainWindow.h" @@ -236,6 +237,24 @@ } +void MainWindow::fromProfileStyles() +{ + qDebug() << Q_FUNC_INFO; + delete ProfileStylesWindow; + this->show(); +} + + +void MainWindow::on_actionStyles_profiles_triggered() +{ + qDebug() << Q_FUNC_INFO; + ProfileStylesWindow = new ProfileStyles(this); + QObject::connect(ProfileStylesWindow, SIGNAL(firstWindow()), this, SLOT(fromProfileStyles())); + this->hide(); // Close the main window + ProfileStylesWindow->show(); // Show a second window +} + + void MainWindow::fromSetup() { qDebug() << Q_FUNC_INFO;
--- a/src/MainWindow.h Mon Mar 14 16:56:59 2022 +0100 +++ b/src/MainWindow.h Tue Mar 15 17:00:54 2022 +0100 @@ -10,6 +10,7 @@ #include "InventoryEquipments.h" #include "ProfileWaters.h" #include "ProfileMashs.h" +#include "ProfileStyles.h" #include "Setup.h" #include <QMainWindow> @@ -42,6 +43,7 @@ void on_actionYeast_bank_triggered(); void on_actionWater_profiles_triggered(); void on_actionMash_profiles_triggered(); + void on_actionStyles_profiles_triggered(); void on_actionSetup_triggered(); void on_actionAbout_triggered(); @@ -55,6 +57,7 @@ void fromInventoryEquipments(); void fromProfileWaters(); void fromProfileMashs(); + void fromProfileStyles(); void fromSetup(); private: @@ -70,6 +73,7 @@ InventoryEquipments *InventoryEquipmentsWindow; ProfileWaters *ProfileWatersWindow; ProfileMashs *ProfileMashsWindow; + ProfileStyles *ProfileStylesWindow; Setup *SetupWindow; };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ProfileStyles.cpp Tue Mar 15 17:00:54 2022 +0100 @@ -0,0 +1,196 @@ +/** + * ProfileStyles.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 "ProfileStyles.h" +#include "EditProfileStyle.h" +#include "../ui/ui_ProfileStyles.h" +#include "config.h" +#include "bmsapp.h" + + +ProfileStyles::ProfileStyles(QWidget *parent) : QDialog(parent), ui(new Ui::ProfileStyles) +{ + qDebug() << "ProfileStyles start"; + + ui->setupUi(this); + emit refreshTable(); + + setWindowTitle( QString("BMSapp - %1 - Profile Styles").arg(VERSIONSTRING) ); +} + + +void ProfileStyles::refreshTable() +{ + QString w; + QWidget* pWidget; + QLabel *label; + QHBoxLayout* pLayout; + + qDebug() << "ProfileStyles reload"; + + QSqlQuery query("SELECT * FROM profile_styles ORDER BY style_guide,style_letter,name"); + const QStringList labels({tr("Guide"), tr("Gr"), tr("Name"), tr("OG"), tr("OG"), tr("FG"), tr("FG"), + tr("IBU"), tr("IBU"), tr("EBC"), tr("EBC"), tr("Co2"), tr("Co2"), tr("ABV"), tr("ABV"), tr("Edit")}); + + ui->tableStyles->setColumnCount(16); + ui->tableStyles->setColumnWidth(0, 100); /* Guide */ + ui->tableStyles->setColumnWidth(1, 25); /* Group */ + ui->tableStyles->setColumnWidth(2, 300); /* Name */ + ui->tableStyles->setColumnWidth(3, 50); /* OG */ + ui->tableStyles->setColumnWidth(4, 50); + ui->tableStyles->setColumnWidth(5, 50); /* FG */ + ui->tableStyles->setColumnWidth(6, 50); + ui->tableStyles->setColumnWidth(7, 40); /* IBU */ + ui->tableStyles->setColumnWidth(8, 40); + ui->tableStyles->setColumnWidth(9, 40); /* EBC */ + ui->tableStyles->setColumnWidth(10, 40); + ui->tableStyles->setColumnWidth(11, 40); /* Co2 */ + ui->tableStyles->setColumnWidth(12, 40); + ui->tableStyles->setColumnWidth(13, 40); /* ABV */ + ui->tableStyles->setColumnWidth(14, 40); + ui->tableStyles->setColumnWidth(15, 80); /* Edit button */ + ui->tableStyles->setRowCount(query.size()); + ui->tableStyles->setHorizontalHeaderLabels(labels); + ui->tableStyles->verticalHeader()->hide(); + ui->tableStyles->setFixedSize(1025 + 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->tableStyles->setItem(ridx, 0, new QTableWidgetItem(query.value(5).toString())); /* Guide */ + ui->tableStyles->setItem(ridx, 1, new QTableWidgetItem(query.value(4).toString())); /* Goup */ + ui->tableStyles->setItem(ridx, 2, new QTableWidgetItem(query.value(1).toString())); /* Name */ + + w = QString("%1").arg(query.value(7).toDouble(), 4, 'f', 3, '0' ); /* OG */ + QTableWidgetItem *item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 3, item); + + w = QString("%1").arg(query.value(8).toDouble(), 4, 'f', 3, '0' ); /* OG */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 4, item); + + w = QString("%1").arg(query.value(9).toDouble(), 4, 'f', 3, '0' ); /* FG */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 5, item); + + w = QString("%1").arg(query.value(10).toDouble(), 4, 'f', 3, '0' ); /* FG */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 6, item); + + w = QString("%1").arg(query.value(11).toDouble(), 1, 'f', 0, '0' ); /* IBU */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 7, item); + + w = QString("%1").arg(query.value(12).toDouble(), 1, 'f', 0, '0' ); /* IBU */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 8, item); + + w = QString("%1").arg(query.value(13).toDouble(), 1, 'f', 0, '0' ); /* EBC */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 9, item); + + w = QString("%1").arg(query.value(14).toDouble(), 1, 'f', 0, '0' ); /* EBC */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 10, item); + + w = QString("%1").arg(query.value(15).toDouble(), 2, 'f', 1, '0' ); /* Co2 */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 11, item); + + w = QString("%1").arg(query.value(16).toDouble(), 2, 'f', 1, '0' ); /* Co2 */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 12, item); + + w = QString("%1").arg(query.value(17).toDouble(), 2, 'f', 1, '0' ); /* ABV */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 13, item); + + w = QString("%1").arg(query.value(18).toDouble(), 2, 'f', 1, '0' ); /* ABV */ + item = new QTableWidgetItem(w); + item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + ui->tableStyles->setItem(ridx, 14, 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->tableStyles->setCellWidget(ridx, 15, pWidget); + query.next(); + } + + setWindowTitle( QString("BMSapp - %1 - Profile Styles").arg(VERSIONSTRING) ); +} + + +ProfileStyles::~ProfileStyles() +{ + qDebug() << "ProfileStyles done"; + delete ui; +} + + +void ProfileStyles::edit(int recno) +{ + qDebug() << "ProfileStyles edit:" << recno; + + EditProfileStyle 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 ProfileStyles::on_editButton_clicked() +{ + QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); + int recno = pb->objectName().toInt(); + qDebug() << Q_FUNC_INFO << recno; + edit(recno); +} + + +void ProfileStyles::on_insertButton_clicked() +{ + qDebug() << Q_FUNC_INFO; + edit(-1); +} + + +void ProfileStyles::on_quitButton_clicked() +{ + emit firstWindow(); +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ProfileStyles.h Tue Mar 15 17:00:54 2022 +0100 @@ -0,0 +1,32 @@ +#ifndef _PROFILESTYLES_H +#define _PROFILESTYLES_H + +#include <QDialog> + +namespace Ui { +class ProfileStyles; +} + +class ProfileStyles : public QDialog +{ + Q_OBJECT + +public: + explicit ProfileStyles(QWidget *parent = nullptr); + ~ProfileStyles(); + +signals: + void firstWindow(); + +private slots: + void on_quitButton_clicked(); + void on_insertButton_clicked(); + void on_editButton_clicked(); + void refreshTable(void); + +private: + Ui::ProfileStyles *ui; + void edit(int recno); +}; + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/EditProfileStyle.ui Tue Mar 15 17:00:54 2022 +0100 @@ -0,0 +1,735 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>EditProfileStyle</class> + <widget class="QDialog" name="EditProfileStyle"> + <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="styleLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>10</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Beer style:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLineEdit" name="styleEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>10</y> + <width>311</width> + <height>23</height> + </rect> + </property> + <property name="maxLength"> + <number>128</number> + </property> + <property name="placeholderText"> + <string>Name of the beer style</string> + </property> + </widget> + <widget class="QPlainTextEdit" name="notesEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>130</y> + <width>791</width> + <height>81</height> + </rect> + </property> + <property name="placeholderText"> + <string>Remarks about this style.</string> + </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="groupLabel"> + <property name="geometry"> + <rect> + <x>500</x> + <y>10</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Beer group:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLineEdit" name="groupEdit"> + <property name="geometry"> + <rect> + <x>630</x> + <y>10</y> + <width>311</width> + <height>23</height> + </rect> + </property> + <property name="maxLength"> + <number>128</number> + </property> + <property name="placeholderText"> + <string>Name of the beer group</string> + </property> + </widget> + <widget class="QLabel" name="catLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>40</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Category:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="catnrLabel"> + <property name="geometry"> + <rect> + <x>500</x> + <y>40</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Category number:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLineEdit" name="catEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>40</y> + <width>311</width> + <height>23</height> + </rect> + </property> + <property name="maxLength"> + <number>128</number> + </property> + <property name="placeholderText"> + <string>BJCP beer category</string> + </property> + </widget> + <widget class="QSpinBox" name="catnrEdit"> + <property name="geometry"> + <rect> + <x>630</x> + <y>40</y> + <width>101</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> + </widget> + <widget class="QLabel" name="profileLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>70</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Profile:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QPlainTextEdit" name="profileEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>70</y> + <width>791</width> + <height>51</height> + </rect> + </property> + <property name="placeholderText"> + <string>Profile description.</string> + </property> + </widget> + <widget class="QLabel" name="notesLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>130</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Remarks:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="typeLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>220</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Type:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QComboBox" name="typeEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>220</y> + <width>201</width> + <height>23</height> + </rect> + </property> + </widget> + <widget class="QLabel" name="guideLabel"> + <property name="geometry"> + <rect> + <x>500</x> + <y>220</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Style guide:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLineEdit" name="guideEdit"> + <property name="geometry"> + <rect> + <x>630</x> + <y>220</y> + <width>311</width> + <height>23</height> + </rect> + </property> + <property name="maxLength"> + <number>128</number> + </property> + <property name="placeholderText"> + <string>The name of the style guide</string> + </property> + </widget> + <widget class="QLabel" name="ogLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>250</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Original Gravity:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="fgLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>280</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Final Gravity:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="ibuLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>310</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>IBU:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QDoubleSpinBox" name="ogminEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>250</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>2.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.001000000000000</double> + </property> + </widget> + <widget class="QDoubleSpinBox" name="ogmaxEdit"> + <property name="geometry"> + <rect> + <x>260</x> + <y>250</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>2.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.001000000000000</double> + </property> + </widget> + <widget class="QDoubleSpinBox" name="fgminEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>280</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>2.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.001000000000000</double> + </property> + </widget> + <widget class="QDoubleSpinBox" name="fgmaxEdit"> + <property name="geometry"> + <rect> + <x>260</x> + <y>280</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>2.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.001000000000000</double> + </property> + </widget> + <widget class="QSpinBox" name="ibuminEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>310</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="maximum"> + <number>999</number> + </property> + </widget> + <widget class="QSpinBox" name="ibumaxEdit"> + <property name="geometry"> + <rect> + <x>260</x> + <y>310</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="maximum"> + <number>999</number> + </property> + </widget> + <widget class="QLabel" name="ebcLabel"> + <property name="geometry"> + <rect> + <x>500</x> + <y>250</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>EBC:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="co2Label"> + <property name="geometry"> + <rect> + <x>500</x> + <y>280</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Co2:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="abvLabel"> + <property name="geometry"> + <rect> + <x>500</x> + <y>310</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>ABV:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QSpinBox" name="ebcminEdit"> + <property name="geometry"> + <rect> + <x>630</x> + <y>250</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="maximum"> + <number>999</number> + </property> + </widget> + <widget class="QSpinBox" name="ebcmaxEdit"> + <property name="geometry"> + <rect> + <x>740</x> + <y>250</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="maximum"> + <number>999</number> + </property> + </widget> + <widget class="QDoubleSpinBox" name="co2minEdit"> + <property name="geometry"> + <rect> + <x>630</x> + <y>280</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + </widget> + <widget class="QDoubleSpinBox" name="co2maxEdit"> + <property name="geometry"> + <rect> + <x>740</x> + <y>280</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + </widget> + <widget class="QDoubleSpinBox" name="abvminEdit"> + <property name="geometry"> + <rect> + <x>630</x> + <y>310</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + </widget> + <widget class="QDoubleSpinBox" name="abvmaxEdit"> + <property name="geometry"> + <rect> + <x>740</x> + <y>310</y> + <width>91</width> + <height>24</height> + </rect> + </property> + <property name="accelerated"> + <bool>true</bool> + </property> + <property name="decimals"> + <number>1</number> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + </widget> + <widget class="QLabel" name="ingredientsLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>340</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Ingredients:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QLabel" name="examplesLabel"> + <property name="geometry"> + <rect> + <x>20</x> + <y>400</y> + <width>121</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Examples:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + <widget class="QPlainTextEdit" name="ingredientsEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>340</y> + <width>791</width> + <height>51</height> + </rect> + </property> + <property name="placeholderText"> + <string>Ingredients used in this style.</string> + </property> + </widget> + <widget class="QPlainTextEdit" name="examplesEdit"> + <property name="geometry"> + <rect> + <x>150</x> + <y>400</y> + <width>791</width> + <height>81</height> + </rect> + </property> + <property name="placeholderText"> + <string>Examples of this style.</string> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + <tabstops> + <tabstop>styleEdit</tabstop> + <tabstop>notesEdit</tabstop> + <tabstop>quitButton</tabstop> + <tabstop>deleteButton</tabstop> + <tabstop>saveButton</tabstop> + </tabstops> + <resources> + <include location="../../../../../../home/mbroek/MyProjects/bmsapp/resources/icons.qrc"/> + </resources> + <connections/> +</ui>
--- a/ui/MainWindow.ui Mon Mar 14 16:56:59 2022 +0100 +++ b/ui/MainWindow.ui Tue Mar 15 17:00:54 2022 +0100 @@ -79,7 +79,7 @@ </property> <addaction name="actionWater_profiles"/> <addaction name="actionMash_profiles"/> - <addaction name="actionBeer_styles"/> + <addaction name="actionStyles_profiles"/> <addaction name="actionFermentation_profiles"/> <addaction name="separator"/> <addaction name="actionSetup"/> @@ -312,7 +312,7 @@ <string>Mash schedules</string> </property> </action> - <action name="actionBeer_styles"> + <action name="actionStyles_profiles"> <property name="enabled"> <bool>true</bool> </property>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/ProfileStyles.ui Tue Mar 15 17:00:54 2022 +0100 @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ProfileStyles</class> + <widget class="QDialog" name="ProfileStyles"> + <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="tableStyles"> + <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="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>