aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index f8c69ed9c..4174ce5dd 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -61,6 +61,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 = "";
@@ -85,6 +88,9 @@ void MainTab::on_delCylinder_clicked()
void MainTab::on_addWeight_clicked()
{
+ if (weightModel->rowCount() >= MAX_WEIGHTSYSTEMS)
+ return;
+
/* this needs a dialog - right now we just fill in a dummy */
weightsystem_t *newWeightsystem = (weightsystem_t *) malloc(sizeof(weightsystem_t));
newWeightsystem->description = "Just testing";