aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar bs <bstoeger@mail.tuwien.ac.at>2017-10-16 13:29:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-16 14:02:06 -0400
commit1fe76b02da3c7817fcad12bc994e9434e1d1d9ce (patch)
tree1e90989056a2043b5e15cecb321b0ed3ce1961db
parent180e51a906029b5d54244e9489bc8b4baeb0777c (diff)
downloadsubsurface-1fe76b02da3c7817fcad12bc994e9434e1d1d9ce.tar.gz
Connect finished signal of download thread only once
Connect finished signal of download thread only once in constructor of DownloadFromDCWidget instead of every time the Download / Cancel / Retry button is clicked. Fixes minor nuisance: On repeated download attempts multiple massage boxes were shown. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--desktop-widgets/downloadfromdivecomputer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp
index 424cf277a..637f6034d 100644
--- a/desktop-widgets/downloadfromdivecomputer.cpp
+++ b/desktop-widgets/downloadfromdivecomputer.cpp
@@ -71,6 +71,13 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
connect(close, SIGNAL(activated()), this, SLOT(close()));
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
+ connect(&thread, SIGNAL(finished()),
+ this, SLOT(onDownloadThreadFinished()), Qt::QueuedConnection);
+
+ //TODO: Don't call mainwindow.
+ MainWindow *w = MainWindow::instance();
+ connect(&thread, SIGNAL(finished()), w, SLOT(refreshDisplay()));
+
auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
if (!dc->dc_vendor().isEmpty()) {
ui.vendor->setCurrentIndex(ui.vendor->findText(dc->dc_vendor()));
@@ -330,13 +337,6 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked()
dc->setDownloadMode(ui.bluetoothMode->isChecked() ? DC_TRANSPORT_BLUETOOTH : DC_TRANSPORT_SERIAL);
#endif
- connect(&thread, SIGNAL(finished()),
- this, SLOT(onDownloadThreadFinished()), Qt::QueuedConnection);
-
- //TODO: Don't call mainwindow.
- MainWindow *w = MainWindow::instance();
- connect(&thread, SIGNAL(finished()), w, SLOT(refreshDisplay()));
-
// before we start, remember where the dive_table ended
previousLast = dive_table.nr;
thread.start();