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>
This commit is contained in:
Dirk Hohndel 2013-05-30 17:58:59 +09:00
parent ae2c132a26
commit f32e86eb32
4 changed files with 38 additions and 5 deletions

View file

@ -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()