diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 9 | ||||
-rw-r--r-- | qt-ui/diveplanner.h | 1 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 2 | ||||
-rw-r--r-- | qt-ui/mainwindow.ui | 2 |
4 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 2abf68f94..932c6366a 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1002,6 +1002,12 @@ DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidge setMinimumHeight(0); } +void DivePlannerWidget::settingsChanged() +{ + ui.gflow->setValue(prefs.gflow); + ui.gfhigh->setValue(prefs.gfhigh); +} + void DivePlannerPointsModel::addCylinder_clicked() { CylindersModel::instance()->add(); @@ -1402,6 +1408,9 @@ void DivePlannerPointsModel::createTemporaryPlan() // Get the user-input and calculate the dive info // Not sure if this is the place to create the diveplan... // We just start with a surface node at time = 0 + if (!stagingDive) + return; + diveplan.dp = NULL; int lastIndex = -1; for (int i = 0; i < rowCount(); i++) { diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 0241bc6e3..d65757262 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -236,6 +236,7 @@ public: explicit DivePlannerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0); public slots: + void settingsChanged(); void atmPressureChanged(const QString& pressure); void bottomSacChanged(const QString& bottomSac); void decoSacChanged(const QString& decosac); diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 4b6581053..1ea115fc7 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -56,6 +56,7 @@ MainWindow::MainWindow() : helpView(0) connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ProfileWidget, SLOT(refresh())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.InfoWidget, SLOT(updateDiveInfo())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.divePlanner, SLOT(settingsChanged())); + connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.divePlannerWidget, SLOT(settingsChanged())); ui.mainErrorMessage->hide(); initialUiSetup(); @@ -67,6 +68,7 @@ MainWindow::MainWindow() : helpView(0) ui.ListWidget->expand(ui.ListWidget->model()->index(0,0)); ui.ListWidget->scrollTo(ui.ListWidget->model()->index(0,0), QAbstractItemView::PositionAtCenter); ui.divePlanner->settingsChanged(); + ui.divePlannerWidget->settingsChanged(); } // this gets called after we download dives from a divecomputer diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 5107b20cb..2261b4d04 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -53,7 +53,7 @@ <number>0</number> </property> <item> - <widget class="DivePlannerWidget" name="widget" native="true"/> + <widget class="DivePlannerWidget" name="divePlannerWidget" native="true"/> </item> </layout> </widget> |