summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 4174ce5dd..f26a72a8a 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>
@@ -91,10 +92,17 @@ void MainTab::on_addWeight_clicked()
if (weightModel->rowCount() >= MAX_WEIGHTSYSTEMS)
return;
- /* this needs a dialog - right now we just fill in a dummy */
+ AddWeightsystemDialog dialog(this);
weightsystem_t *newWeightsystem = (weightsystem_t *) malloc(sizeof(weightsystem_t));
- newWeightsystem->description = "Just testing";
- newWeightsystem->weight.grams = 15000;
+ newWeightsystem->description = "";
+ newWeightsystem->weight.grams = 0;
+
+ dialog.setWeightsystem(newWeightsystem);
+ int result = dialog.exec();
+ if (result == QDialog::Rejected)
+ return;
+
+ dialog.updateWeightsystem();
weightModel->add(newWeightsystem);
}