three - the last one I commented three lines so the code compiles, but I most probably broke something with that. there's a huge TODO on it so I remember to unbreak things tomorrow when I wake.
From 5dc1366a19ed94dcf7dba9ef8c8f039b4b863890 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <[email protected]> Date: Sun, 25 May 2014 00:28:24 -0300 Subject: [PATCH 1/3] Reenamble 'Delete Dive Point' on the planer / add
Just removed an #if 0 Signed-off-by: Tomaz Canabrava <[email protected]> --- qt-ui/diveplanner.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index e6780c1..53a1e78 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -186,11 +186,9 @@ void DiveHandler::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void DiveHandler::selfRemove() { -#if 0 setSelected(true); ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first()); view->keyDeleteAction(); -#endif } void DiveHandler::changeGas() -- 1.9.3
From 3ce48385426d0cccb7762714e61e05b82576141b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <[email protected]> Date: Sun, 25 May 2014 00:33:39 -0300 Subject: [PATCH 2/3] Reenables the air edition and deletion of handlers on the planner/add Only a tiny bit of poke around the contextMenuEvent - the events of the planner are dealt by the QGraphicsItem, and this makes the logic pretty easy to follow. :) Signed-off-by: Tomaz Canabrava <[email protected]> --- qt-ui/profile/profilewidget2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 413386e..2de64e7 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -783,6 +783,10 @@ extern int evn_used; void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) { + if (currentState == ADD || currentState == PLAN) { + QGraphicsView::contextMenuEvent(event); + return; + } QMenu m; bool isDCName = false; if (selected_dive == -1) -- 1.9.3
From 4a07b42322d96330aa7952053e14c93223005752 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <[email protected]> Date: Sun, 25 May 2014 00:51:05 -0300 Subject: [PATCH 3/3] Remove leftovers from the planner. Signed-off-by: Tomaz Canabrava <[email protected]> --- qt-ui/diveplanner.cpp | 6 +----- qt-ui/diveplanner.h | 9 --------- qt-ui/mainwindow.cpp | 16 ++++++++++++---- qt-ui/mainwindow.h | 4 ---- qt-ui/mainwindow.ui | 37 ++----------------------------------- 5 files changed, 15 insertions(+), 57 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 53a1e78..aaf530c 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -43,11 +43,6 @@ QString dpGasToStr(const divedatapoint &p) static DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); -DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent) -{ - -} - bool intLessThan(int a, int b) { return a <= b; @@ -139,6 +134,7 @@ void DivePlannerPointsModel::removeDeco() removeSelectedPoints(computedPoints); setRecalc(oldrec); } + #if 0 void DivePlannerGraphics::drawProfile() { diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 10c907b..4aa5f00 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -119,15 +119,6 @@ slots: void changeGas(); }; -class DivePlannerGraphics : public QGraphicsView { - Q_OBJECT -public: - DivePlannerGraphics(QWidget *parent = 0); -private -slots: - -}; - #include "ui_diveplanner.h" class DivePlannerWidget : public QWidget { diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 339ee8e..19a16a8 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -318,14 +318,16 @@ void MainWindow::on_actionDivePlanner_triggered() break; } } - ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); ui.infoPane->setCurrentIndex(PLANNERWIDGET); } void MainWindow::showProfile() { enableDcShortcuts(); - ui.stackedWidget->setCurrentIndex(PROFILE); + //TODO: I BROKE THIS BY COMMENTING THE LINE BELOW + // and I'm sleepy now, so I think I should not try to fix right away. + // we don't setCurrentIndex anymore, we ->setPlanState() or ->setAddState() on the ProfileView. + //ui.stackedWidget->setCurrentIndex(PROFILE); ui.infoPane->setCurrentIndex(MAINTAB); } @@ -1101,14 +1103,20 @@ void MainWindow::editCurrentDive() if (defaultDC == "manually added dive") { disableDcShortcuts(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); - ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner. + //TODO: I BROKE THIS BY COMMENTING THE LINE BELOW + // and I'm sleepy now, so I think I should not try to fix right away. + // we don't setCurrentIndex anymore, we ->setPlanState() or ->setAddState() on the ProfileView. + //ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner. ui.infoPane->setCurrentIndex(MAINTAB); DivePlannerPointsModel::instance()->loadFromDive(d); ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE); } else if (defaultDC == "planned dive") { disableDcShortcuts(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); - ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner. + //TODO: I BROKE THIS BY COMMENTING THE LINE BELOW + // and I'm sleepy now, so I think I should not try to fix right away. + // we don't setCurrentIndex anymore, we ->setPlanState() or ->setAddState() on the ProfileView. + //ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner. ui.infoPane->setCurrentIndex(PLANNERWIDGET); DivePlannerPointsModel::instance()->loadFromDive(d); ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE); diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 0aaab2a..a658fe3 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -42,10 +42,6 @@ public: COLLAPSED, EXPANDED }; - enum StackWidgetIndexes { - PROFILE, - PLANNERPROFILE - }; enum InfoWidgetIndexes { MAINTAB, PLANNERWIDGET diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 5885baf..1fd0fa7 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -85,15 +85,8 @@ </layout> </widget> </widget> - <widget class="QTabWidget" name="stackedWidget"> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="page_5"> - <attribute name="title"> - <string>Profile Visualization</string> - </attribute> - <layout class="QGridLayout" name="gridLayout"> + <widget class="QWidget" name="ProfileWidget"> + <layout class="QGridLayout" name="gridLayout"> <property name="leftMargin"> <number>0</number> </property> @@ -496,32 +489,6 @@ </spacer> </item> </layout> - </widget> - <widget class="QWidget" name="page_6"> - <attribute name="title"> - <string>Old Planner Visualization</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="DivePlannerGraphics" name="divePlanner"/> - </item> - </layout> - </widget> </widget> </widget> <widget class="QSplitter" name="listGlobeSplitter"> -- 1.9.3
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
