summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-30 17:58:59 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-30 18:02:29 +0900
commitf32e86eb32ee3697f255d01a61f6aa2e1cff5a8b (patch)
tree4f3db6fbaef45d931fb9dfda0286d445da2f9102 /qt-ui/mainwindow.cpp
parentae2c132a267932892d5c3f7965517194d38d962a (diff)
downloadsubsurface-f32e86eb32ee3697f255d01a61f6aa2e1cff5a8b.tar.gz
Hook up the Download dialog
The download already worked, but we didn't display the new dives. This introduces a new slot for MainWindow that updates what is displayed in Subsurface after files were imported. With this change we can successfully download ONCE - but when trying to download a second dive the dialog doesn't appear to get refreshed the right way - the OK button doesn't appear to work anymore (Cancel however does). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 8c600ea19..14958b50f 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -52,6 +52,14 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
instance = this;
}
+// this gets called after we download dives from a divecomputer
+void MainWindow::refreshDisplay()
+{
+ if (!selected_dive)
+ current_dive_changed(dive_table.nr - 1);
+ ui->ListWidget->reload();
+}
+
void MainWindow::current_dive_changed(int divenr)
{
select_dive(divenr);
@@ -162,8 +170,8 @@ void MainWindow::on_actionQuit_triggered()
void MainWindow::on_actionDownloadDC_triggered()
{
- DownloadFromDCWidget* downloadWidget = new DownloadFromDCWidget();
- downloadWidget->show();
+ DownloadFromDCWidget* downloadWidget = DownloadFromDCWidget::instance();
+ downloadWidget->runDialog();
}
void MainWindow::on_actionDownloadWeb_triggered()