aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Claudiu Olteanu <olteanu.claudiu@ymail.com>2015-07-06 16:18:06 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-06 08:34:39 -0700
commitb4c4d95ea4d19d63492a5de4abdab31673ab9725 (patch)
tree3da7dc2cdf4d43c70170eb8d938b4d77103feaf1 /qt-ui/downloadfromdivecomputer.cpp
parent5766d1894c2fb3e5343ee12ce188d48e38b56e24 (diff)
downloadsubsurface-b4c4d95ea4d19d63492a5de4abdab31673ab9725.tar.gz
Add a checkbox and a button for Bluetooth download mode
The checkbox will be used to enable the Bluetooth downloading mode. The button will be used to create a dialog selection where the user will be able to scan and select remote devices. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index c5d57e6a5..f1bb05823 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -99,6 +99,9 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
ui.ok->setEnabled(false);
ui.downloadCancelRetryButton->setEnabled(true);
ui.downloadCancelRetryButton->setText(tr("Download"));
+ ui.chooseBluetoothDevice->setEnabled(ui.bluetoothMode->isChecked());
+ connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int)));
+ connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice()));
}
void DownloadFromDCWidget::updateProgressBar()
@@ -493,6 +496,8 @@ void DownloadFromDCWidget::markChildrenAsDisabled()
ui.chooseDumpFile->setEnabled(false);
ui.selectAllButton->setEnabled(false);
ui.unselectAllButton->setEnabled(false);
+ ui.bluetoothMode->setEnabled(false);
+ ui.chooseBluetoothDevice->setEnabled(false);
}
void DownloadFromDCWidget::markChildrenAsEnabled()
@@ -512,6 +517,20 @@ void DownloadFromDCWidget::markChildrenAsEnabled()
ui.chooseDumpFile->setEnabled(true);
ui.selectAllButton->setEnabled(true);
ui.unselectAllButton->setEnabled(true);
+ ui.bluetoothMode->setEnabled(true);
+ ui.chooseBluetoothDevice->setEnabled(true);
+}
+
+void DownloadFromDCWidget::selectRemoteBluetoothDevice()
+{
+ //TODO add implementation
+}
+
+void DownloadFromDCWidget::enableBluetoothMode(int state)
+{
+ ui.chooseBluetoothDevice->setEnabled(state == Qt::Checked);
+ if (state == Qt::Checked)
+ selectRemoteBluetoothDevice();
}
static void fillDeviceList(const char *name, void *data)