summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 85b31608c..74015c73f 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -115,6 +115,8 @@ MainWindow::MainWindow() : QMainWindow(),
#ifdef NO_PRINTING
ui.menuFile->removeAction(ui.actionPrint);
#endif
+ memset(&copyPasteDive, 0, sizeof(copyPasteDive));
+ memset(&what, 0, sizeof(what));
}
MainWindow::~MainWindow()
@@ -243,6 +245,7 @@ void MainWindow::setToolButtonsEnabled(bool enabled)
ui.profScaled->setEnabled(enabled);
ui.profHR->setEnabled(enabled);
ui.profTogglePicture->setEnabled(enabled);
+ ui.profTankbar->setEnabled(enabled);
}
bool MainWindow::okToClose(QString message)
@@ -400,6 +403,12 @@ void MainWindow::planCanceled()
void MainWindow::planCreated()
{
+ // get the new dive selected and assign a number if reasonable
+ dive_list()->unselectDives();
+ select_dive(dive_table.nr - 1);
+ dive_list()->selectDive(selected_dive);
+ set_dive_nr_for_current_dive();
+
showProfile();
refreshDisplay();
}
@@ -797,6 +806,7 @@ void MainWindow::readSettings()
TOOLBOX_PREF_BUTTON(rulergraph, rulergraph, profRuler);
TOOLBOX_PREF_BUTTON(show_sac, show_sac, profSAC);
TOOLBOX_PREF_BUTTON(show_pictures_in_profile, show_pictures_in_profile, profTogglePicture);
+ TOOLBOX_PREF_BUTTON(tankbar, tankbar, profTankbar);
s.endGroup();
s.beginGroup("DiveComputer");
default_dive_computer_vendor = getSetting(s, "dive_computer_vendor");
@@ -1271,6 +1281,7 @@ TOOLBOX_PREF_PROFILE(profRuler, rulergraph, rulergraph);
TOOLBOX_PREF_PROFILE(profSAC, show_sac, show_sac);
TOOLBOX_PREF_PROFILE(profScaled, zoomed_plot, zoomed_plot);
TOOLBOX_PREF_PROFILE(profTogglePicture, show_pictures_in_profile, show_pictures_in_profile);
+TOOLBOX_PREF_PROFILE(profTankbar, tankbar, tankbar);
void MainWindow::turnOffNdlTts()
{
@@ -1296,10 +1307,26 @@ void MainWindow::on_actionConfigure_Dive_Computer_triggered()
void MainWindow::setEnabledToolbar(bool arg1)
{
- QList<QToolButton*> toolBar; toolBar << ui.profCalcAllTissues << ui.profCalcCeiling
- << ui.profDcCeiling << ui.profEad << ui.profHR << ui.profIncrement3m
- << ui.profMod << ui.profNdl_tts << ui.profNdl_tts << ui.profPhe << ui.profPn2
- << ui.profPO2 << ui.profRuler << ui.profSAC << ui.profScaled << ui.profTogglePicture;
+ QList<QToolButton*> toolBar;
+ toolBar << ui.profCalcAllTissues << ui.profCalcCeiling << ui.profDcCeiling << ui.profEad <<
+ ui.profHR << ui.profIncrement3m << ui.profMod << ui.profNdl_tts << ui.profNdl_tts <<
+ ui.profPhe << ui.profPn2 << ui.profPO2 << ui.profRuler << ui.profSAC << ui.profScaled <<
+ ui.profTogglePicture << ui.profTankbar;
Q_FOREACH(QToolButton *b, toolBar)
b->setEnabled(arg1);
}
+
+void MainWindow::on_copy_triggered()
+{
+ // open dialog to select what gets copied
+ // copy the displayed dive
+ DiveComponentSelection dialog(this, &copyPasteDive, &what);
+ dialog.exec();
+}
+
+void MainWindow::on_paste_triggered()
+{
+ // take the data in our copyPasteDive and apply it to selected dives
+ selective_copy_dive(&copyPasteDive, &displayed_dive, what, false);
+ ui.InfoWidget->showAndTriggerEditSelective(what);
+}