Mobile: only show dive computers in the Bluetooth connection list

And offer an option to show all devices in the settings. This is intentionally
not stored in the preferences as this should never be needed. We don't support
BT or BLE dive computers that we don't recognize. This is a last resort in case
a new firmware were to change the name or some other weird issue causes us not
to recognize a dive computer - and that should be fixed instead of worked
around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-02-13 22:48:50 -08:00
parent f35a0f3b09
commit 9d582c5512
5 changed files with 60 additions and 2 deletions

View file

@ -48,6 +48,7 @@ class QMLManager : public QObject {
Q_PROPERTY(bool DC_saveDump READ DC_saveDump WRITE DC_setSaveDump)
Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId)
Q_PROPERTY(QString pluggedInDeviceName MEMBER m_pluggedInDeviceName NOTIFY pluggedInDeviceNameChanged)
Q_PROPERTY(bool showNonDiveComputers MEMBER m_showNonDiveComputers WRITE setShowNonDiveComputers NOTIFY showNonDiveComputersChanged)
public:
QMLManager();
~QMLManager();
@ -126,6 +127,8 @@ public:
bool btEnabled() const;
void setBtEnabled(bool value);
void setShowNonDiveComputers(bool show);
DiveListSortModel *dlSortModel;
QStringList suitList() const;
@ -234,6 +237,7 @@ private:
bool m_btEnabled;
void updateAllGlobalLists();
QString m_pluggedInDeviceName;
bool m_showNonDiveComputers;
struct dive *m_copyPasteDive = NULL;
struct dive_components what;
@ -262,6 +266,7 @@ signals:
void locationListChanged();
void waitingForPositionChanged();
void pluggedInDeviceNameChanged();
void showNonDiveComputersChanged();
};
#endif