diff options
author | 2013-05-01 23:54:38 -0300 | |
---|---|---|
committer | 2013-05-01 23:54:38 -0300 | |
commit | e5ad47e459af1d937d26782ce8308dbd67ecec4b (patch) | |
tree | 0340be89b69de619623db519c7f8287636646ee0 /qt-ui/maintab.cpp | |
parent | 764a863082f9337156fc4bcf5c0ecc6ae3d149d6 (diff) | |
parent | 00d85313827af88ae5f35b2391ffa6964e81da49 (diff) | |
download | subsurface-e5ad47e459af1d937d26782ce8308dbd67ecec4b.tar.gz |
Merge branch 'Qt' into RenderStarsOnTable
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 7d60db5c2..2467dd0d7 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -7,6 +7,7 @@ #include "maintab.h" #include "ui_maintab.h" #include "addcylinderdialog.h" +#include "addweightsystemdialog.h" #include <QLabel> @@ -61,6 +62,9 @@ void MainTab::clearStats() void MainTab::on_addCylinder_clicked() { + if (cylindersModel->rowCount() >= MAX_CYLINDERS) + return; + AddCylinderDialog dialog(this); cylinder_t *newCylinder = (cylinder_t*) malloc(sizeof(cylinder_t)); newCylinder->type.description = ""; @@ -83,6 +87,33 @@ void MainTab::on_delCylinder_clicked() { } +void MainTab::on_addWeight_clicked() +{ + if (weightModel->rowCount() >= MAX_WEIGHTSYSTEMS) + return; + + AddWeightsystemDialog dialog(this); + weightsystem_t newWeightsystem; + newWeightsystem.description = ""; + newWeightsystem.weight.grams = 0; + + dialog.setWeightsystem(&newWeightsystem); + int result = dialog.exec(); + if (result == QDialog::Rejected) + return; + + dialog.updateWeightsystem(); + weightModel->add(&newWeightsystem); +} + +void MainTab::on_editWeight_clicked() +{ +} + +void MainTab::on_delWeight_clicked() +{ +} + void MainTab::reload() { cylindersModel->update(); |