mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:13:23 +00:00
Stop the SDP agent if the Clear/Save button was pressed
If the Cancel button was pressed then we should stop the SDP agent. The same thing happens when the Save button was pressed. We don't need to add new BT remote devices to the list if the widget was closed or if the list with the discovered BT devices was cleared. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
05109b2d6c
commit
619e97ee4f
1 changed files with 12 additions and 0 deletions
|
@ -86,6 +86,12 @@ void BtDeviceSelectionDialog::on_save_clicked()
|
|||
// Save the selected device
|
||||
selectedRemoteDeviceInfo = QSharedPointer<QBluetoothDeviceInfo>(new QBluetoothDeviceInfo(remoteDeviceInfo));
|
||||
|
||||
if (remoteDeviceDiscoveryAgent->isActive()) {
|
||||
// Stop the SDP agent if the clear button is pressed and enable the Scan button
|
||||
remoteDeviceDiscoveryAgent->stop();
|
||||
ui->scan->setEnabled(true);
|
||||
}
|
||||
|
||||
// Close the device selection dialog and set the result code to Accepted
|
||||
accept();
|
||||
}
|
||||
|
@ -95,6 +101,12 @@ void BtDeviceSelectionDialog::on_clear_clicked()
|
|||
ui->dialogStatus->setText("Remote devices list was cleaned.");
|
||||
ui->discoveredDevicesList->clear();
|
||||
ui->save->setEnabled(false);
|
||||
|
||||
if (remoteDeviceDiscoveryAgent->isActive()) {
|
||||
// Stop the SDP agent if the clear button is pressed and enable the Scan button
|
||||
remoteDeviceDiscoveryAgent->stop();
|
||||
ui->scan->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void BtDeviceSelectionDialog::on_scan_clicked()
|
||||
|
|
Loading…
Add table
Reference in a new issue