mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
5766d1894c
commit
b4c4d95ea4
3 changed files with 38 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -77,8 +77,10 @@ slots:
|
|||
void updateProgressBar();
|
||||
void checkLogFile(int state);
|
||||
void checkDumpFile(int state);
|
||||
void enableBluetoothMode(int state);
|
||||
void pickDumpFile();
|
||||
void pickLogFile();
|
||||
void selectRemoteBluetoothDevice();
|
||||
|
||||
private:
|
||||
void markChildrenAsDisabled();
|
||||
|
|
|
@ -116,6 +116,23 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QCheckBox" name="bluetoothMode">
|
||||
<property name="text">
|
||||
<string>Choose Bluetooth Download mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QToolButton" name="chooseBluetoothDevice">
|
||||
<property name="toolTip">
|
||||
<string>Select a remote Bluetooth device.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
|
Loading…
Reference in a new issue