summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lakshman <acrlakshman@gmail.com>2014-04-17 21:48:00 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-17 22:39:36 -0700
commite871169e4ce9ff1681a17c0ca0960c69daa8ec09 (patch)
tree828083f921c4dda9e950db2c379b620962ee1810 /qt-ui
parent3027701a14711e175b18462010dab382c2d68c5b (diff)
downloadsubsurface-e871169e4ce9ff1681a17c0ca0960c69daa8ec09.tar.gz
Fixed mismatched connections
Fixed connections to call drawProfile() in diveplanner whenever cylinder table widget is edited. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp14
-rw-r--r--qt-ui/diveplanner.h2
2 files changed, 12 insertions, 4 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index ac7a208ea..93826675c 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -151,6 +151,7 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent
#undef ADD_ACTION
connect(plannerModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(drawProfile()));
+ connect(plannerModel, SIGNAL(cylinderModelEdited()), this, SLOT(drawProfile()));
connect(plannerModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
this, SLOT(pointInserted(const QModelIndex &, int, int)));
@@ -972,12 +973,12 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg
GasSelectionModel::instance(), SLOT(repopulate()));
connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)),
GasSelectionModel::instance(), SLOT(repopulate()));
- connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, int, int)),
- plannerModel, SLOT(drawProfile()));
+ connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+ plannerModel, SLOT(emitCylinderModelEdited()));
connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)),
- plannerModel, SLOT(drawProfile()));
+ plannerModel, SLOT(emitCylinderModelEdited()));
connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)),
- plannerModel, SLOT(drawProfile()));
+ plannerModel, SLOT(emitCylinderModelEdited()));
ui.tableWidget->setBtnToolTip(tr("add dive data point"));
connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime)));
@@ -1055,6 +1056,11 @@ bool DivePlannerPointsModel::recalcQ()
return recalc;
}
+void DivePlannerPointsModel::emitCylinderModelEdited()
+{
+ cylinderModelEdited();
+}
+
int DivePlannerPointsModel::columnCount(const QModelIndex &parent) const
{
return COLUMNS;
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index 8352d6a69..91f8744d8 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -78,10 +78,12 @@ slots:
void deleteTemporaryPlan();
void loadFromDive(dive *d);
void restoreBackupDive();
+ void emitCylinderModelEdited();
signals:
void planCreated();
void planCanceled();
+ void cylinderModelEdited();
private:
explicit DivePlannerPointsModel(QObject *parent = 0);