mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
QML UI: add property to pass detected device name to UI
If the user plugs in a device on Android we get a device string that should allow us to figure out which dive computer was plugged in. Make that string available to the QML UI. Right now all we do is log it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7cc9da6347
commit
a3ddd823bb
3 changed files with 11 additions and 2 deletions
|
@ -25,6 +25,7 @@ Kirigami.ApplicationWindow {
|
||||||
property alias notificationText: manager.notificationText
|
property alias notificationText: manager.notificationText
|
||||||
property alias syncToCloud: manager.syncToCloud
|
property alias syncToCloud: manager.syncToCloud
|
||||||
property alias locationServiceEnabled: manager.locationServiceEnabled
|
property alias locationServiceEnabled: manager.locationServiceEnabled
|
||||||
|
property alias pluggedInDeviceName: manager.pluggedInDeviceName
|
||||||
property alias showPin: prefs.showPin
|
property alias showPin: prefs.showPin
|
||||||
onNotificationTextChanged: {
|
onNotificationTextChanged: {
|
||||||
if (notificationText != "") {
|
if (notificationText != "") {
|
||||||
|
@ -610,6 +611,10 @@ if you have network connectivity and want to sync your data to cloud storage."),
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPluggedInDeviceNameChanged: {
|
||||||
|
console.log("Show download page for device " + pluggedInDeviceName);
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
rootItem.visible = true
|
rootItem.visible = true
|
||||||
diveList.opacity = 1
|
diveList.opacity = 1
|
||||||
|
|
|
@ -139,7 +139,8 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
||||||
m_updateSelectedDive(-1),
|
m_updateSelectedDive(-1),
|
||||||
m_selectedDiveTimestamp(0),
|
m_selectedDiveTimestamp(0),
|
||||||
alreadySaving(false),
|
alreadySaving(false),
|
||||||
m_device_data(new DCDeviceData)
|
m_device_data(new DCDeviceData),
|
||||||
|
m_pluggedInDeviceName("")
|
||||||
{
|
{
|
||||||
LOG_STP("qmlmgr starting");
|
LOG_STP("qmlmgr starting");
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
|
|
|
@ -49,6 +49,7 @@ class QMLManager : public QObject {
|
||||||
Q_PROPERTY(bool DC_createNewTrip READ DC_createNewTrip WRITE DC_setCreateNewTrip)
|
Q_PROPERTY(bool DC_createNewTrip READ DC_createNewTrip WRITE DC_setCreateNewTrip)
|
||||||
Q_PROPERTY(bool DC_saveDump READ DC_saveDump WRITE DC_setSaveDump)
|
Q_PROPERTY(bool DC_saveDump READ DC_saveDump WRITE DC_setSaveDump)
|
||||||
Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId)
|
Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId)
|
||||||
|
Q_PROPERTY(QString pluggedInDeviceName MEMBER m_pluggedInDeviceName NOTIFY pluggedInDeviceNameChanged)
|
||||||
public:
|
public:
|
||||||
QMLManager();
|
QMLManager();
|
||||||
~QMLManager();
|
~QMLManager();
|
||||||
|
@ -86,7 +87,7 @@ public:
|
||||||
Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product);
|
Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product);
|
||||||
Q_INVOKABLE int getDetectedVendorIndex();
|
Q_INVOKABLE int getDetectedVendorIndex();
|
||||||
Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText);
|
Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText);
|
||||||
public:
|
|
||||||
static QMLManager *instance();
|
static QMLManager *instance();
|
||||||
Q_INVOKABLE void registerError(QString error);
|
Q_INVOKABLE void registerError(QString error);
|
||||||
QString consumeError();
|
QString consumeError();
|
||||||
|
@ -226,6 +227,7 @@ private:
|
||||||
QString m_progressMessage;
|
QString m_progressMessage;
|
||||||
bool m_btEnabled;
|
bool m_btEnabled;
|
||||||
void updateAllGlobalLists();
|
void updateAllGlobalLists();
|
||||||
|
QString m_pluggedInDeviceName;
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||||
QString appLogFileName;
|
QString appLogFileName;
|
||||||
|
@ -252,6 +254,7 @@ signals:
|
||||||
void divemasterListChanged();
|
void divemasterListChanged();
|
||||||
void locationListChanged();
|
void locationListChanged();
|
||||||
void waitingForPositionChanged();
|
void waitingForPositionChanged();
|
||||||
|
void pluggedInDeviceNameChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue