aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/btdeviceselectiondialog.cpp
AgeCommit message (Collapse)Author
2020-08-22core/BLE: don't insist on pairing of pure BLE devicesGravatar Dirk Hohndel
Most (all?) BLE dive computers actually don't need to be paired, and some apparently can't be paired. So let's not enforce that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: replace deprecated setBackgroundColor() methodGravatar Dirk Hohndel
Here the replacement has been around for a very long time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-06-06Cleanup: remove unnecessary QRegularExpression copiesGravatar Berthold Stoeger
A regular expression was generated and then copied twice without apparent reason. Remove these copies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-14Desktop: only show dive computers in the Bluetooth device listGravatar Dirk Hohndel
By default we'll only show devices that we believe to be dive computers, but the user can override that with the recently introduced check box. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-30Bluetooth: use standard Qt code on WindowsGravatar Dirk Hohndel
We shouldn't need our hand crafted code anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-18Bluetooth: don't call deviceDiscoveryError() on scan finishedGravatar Berthold Stoeger
In the remoteDeviceScanFinished slot, the old code called into the deviceDiscoveryError() in case the device discovery agent had the error flag set. This is not necessary, since the agent will send an error signal in such a case. For Qt's device discovery agent, the whole check-for-error is unnecessary, as the documentation states: "The signal is not going to be emitted if the device discovery finishes with an error." But for the homebrew WinBluetoothDeviceDiscoveryAgent, which derives from QThread, both an error() *and* a finished() signal will be sent. Therefore keep the test, but don't call into the slot twice. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-26Cleanup: Use QString as parameter for [get|save]BtDeviceInfo()Gravatar Berthold Stoeger
Each callsite of saveBtDeviceInfo() has a QString, which is converted to a C-string, passed and immediately converted back. Remove these conversions by taking a reference to QString directly. getBtDeviceInfo() is not as clear. Here, the callsite has a C-string handed down from libdivecomputer. Nevertheless, pass a reference of QString here as well. Firstly, for reasons of symmetry. Secondly, to avoid multiple conversions in the getBtDeviceInfo() functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-11Cleanup: fix emits in WinBluetoothDeviceDiscoveryAgentGravatar Berthold Stoeger
As far as I know, Qt's emit is defined to nothing. Thus, the construct "emit(lastError);" is compiled to "(lastError);", which is a no-op. Obviously "emit error(lastError)" was meant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-11Cleanup: use constructor directly instead of move-assignmentGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-16Introduce mode field in Bluetooth device selection dialogGravatar Berthold Stoeger
Some BT devices support both, classical and LE, modes. Users could choose either by prepending or removing "LE:" in the device address field. After commit d23bd46a1be2dfb25293639abcf06b5b4d4b94df, the device field is always disabled in Bluetooth mode. Therefore, add a mode combo box to the Bluetooth device selection dialog. In the default mode (auto), the old code path (based on the Qt device flags) is used. The two other modes (force LE, force classical) allow the user to force the preferred behavior. This feature is meant as a stop-gap measure until a more refined transport choice is implemented. Therefore, the value of the new combo box is not saved in the settings, to avoid cluttering of the preferences with soon to be obsolete entries. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-13Make Bluetooth naming consistentGravatar Berthold Stoeger
Currently, on Linux, after selecting a Bluetooth device the name of the device is shown. On reopening the download dialog, on the other hand, the address is shown. In the device selection dialog both are shown. This patch changes the download dialog such that both, name and address, are shown. The bulk of the patch introduces the name of the device in the preferences and DCDeviceData. It has to be noted that DCDeviceData is an encapsulation of the libdivecomputer device_data_t. Nevertheless, the new Bluetooth-name field is, at the moment, not passed through to libdivecomputer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-12Trivial: Replace a QSharedPointer by a QScopedPointerGravatar Berthold Stoeger
Since the QSharedPointer is never passed or copied, reference counting is certainly not needed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-06BT device selection dialog: make Save the default buttonGravatar Berthold Stoeger
When a user presses enter, they probably want their selection saved, not discarded. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-04Replace itemClicked() by currentItemChanged() in Bt device selectionGravatar Berthold Stoeger
This fixes two problems: 1) Using the keybord or clicking below the list and moving the mouse up while holding the mouse button did not properly update the status message and the save button. For example, one could save with a non- paired device selected. 2) The code assumed that a device is selected if the save button is active, but the save button was not disabled on scan. Thus, one could provoke a crash by selecting an item, scanning and then pressing save. This problem is fixed indirectly, because the save button is now always disabled if the selection is cleared. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-09-17BLE: create controller from QBtDeviceInfoGravatar Dirk Hohndel
Creating it from an address is a) deprecated and b) impossible on Mac or iOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17BLE: on Mac/iOS use UUID instead of addressGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30BLE handling: create helper function to add the LE: prefixGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29Better colors for BT pairing dialogGravatar Dirk Hohndel
Linus had complained about these colors for a while. I think this is a massive improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30BT address 0 is bogusGravatar Robert C. Helling
Grey out those devices in the scanning list and prevent the user from selecting those. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-06-26Bluetooth: make LE-only devices add "LE:" as an address prefixGravatar Linus Torvalds
This seems a bit odd, but it actually has three different reasons for it: - It's a visual indication of BT LE mode for users - the rfcomm code only works with legacy BT support, and if we scan a device that only does LE, we want the custom serial code to instead automatically fall back on a "emulate serial over LE packets" model. - we want rfcomm to remain the default for devices that do both legacy BT _and_ LE, but we want people to have the ability to override the choice manually. They can now do so by just editing the address field and adding the "LE:" prefix manually, and it automatically gets saved for next time. So while a bit hacky, it's actually a very convenient model that not only works automatically, but allows the manual override. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07btdeviceselectiondialog.cpp: fix unused variableGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-10-30Move qt-ui to desktop-widgetsGravatar Tomaz Canabrava
Since we have now destkop and mobile versions, 'qt-ui' was a very poor name choice for a folder that contains only destkop-enabled widgets. Also, move the graphicsview-common.h/cpp to subsurface-core because it doesn't depend on qgraphicsview, it merely implements all the colors that we use throughout Subsurface, and we will use colors on both desktop and mobile versions Same thing applies for metrics.h/cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>