summaryrefslogtreecommitdiffstats
path: root/qt-ui/addcylinderdialog.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 12:14:06 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 12:14:06 -0700
commit63b6f7d5a25967f003a734d2058a73b4b13e8387 (patch)
tree0f5d68199afacaa04bd2bac7029fc08e42db18c5 /qt-ui/addcylinderdialog.cpp
parent9c3b512701c59955350f317eb6d19e6fdc93f546 (diff)
parent134e20bdc27f63c73ef8257dc357ae05642fece8 (diff)
downloadsubsurface-63b6f7d5a25967f003a734d2058a73b4b13e8387.tar.gz
Merge branch 'comboBoxDelegate' of https://github.com/tcanabrava/subsurface
Diffstat (limited to 'qt-ui/addcylinderdialog.cpp')
-rw-r--r--qt-ui/addcylinderdialog.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/qt-ui/addcylinderdialog.cpp b/qt-ui/addcylinderdialog.cpp
deleted file mode 100644
index 5b91617ed..000000000
--- a/qt-ui/addcylinderdialog.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * addcylinderdialog.cpp
- *
- * classes for the add cylinder dialog of Subsurface
- *
- */
-#include "addcylinderdialog.h"
-#include "ui_addcylinderdialog.h"
-#include <QComboBox>
-#include <QDoubleSpinBox>
-#include "../conversions.h"
-#include "models.h"
-
-AddCylinderDialog::AddCylinderDialog(QWidget *parent) : ui(new Ui::AddCylinderDialog())
-, tankInfoModel(new TankInfoModel())
-{
- ui->setupUi(this);
- ui->cylinderType->setModel(tankInfoModel);
-}
-
-void AddCylinderDialog::setCylinder(cylinder_t *cylinder)
-{
- double volume, pressure;
- int index;
-
- currentCylinder = cylinder;
- convert_volume_pressure(cylinder->type.size.mliter, cylinder->type.workingpressure.mbar, &volume, &pressure);
-
- index = ui->cylinderType->findText(QString(cylinder->type.description));
- ui->cylinderType->setCurrentIndex(index);
- ui->size->setValue(volume);
- ui->pressure->setValue(pressure);
-
- ui->o2percent->setValue(cylinder->gasmix.o2.permille / 10.0);
- ui->hepercent->setValue(cylinder->gasmix.he.permille / 10.0);
-
- convert_pressure(cylinder->start.mbar, &pressure);
- ui->start->setValue(pressure);
-
- convert_pressure(cylinder->end.mbar, &pressure);
- ui->end->setValue(pressure);
-}
-
-void AddCylinderDialog::updateCylinder()
-{
- QByteArray description = ui->cylinderType->currentText().toLocal8Bit();
-
- currentCylinder->type.description = description.data();
- currentCylinder->type.size.mliter = ui->size->value();
- currentCylinder->type.workingpressure.mbar = ui->pressure->value();
- currentCylinder->gasmix.o2.permille = ui->o2percent->value();
- currentCylinder->gasmix.he.permille = ui->hepercent->value();
- currentCylinder->start.mbar = ui->start->value();
- currentCylinder->end.mbar = ui->end->value();
-}
-