Android: notify the UI a dive computer was plugged in

And try to guess which one from the device string we get from the Intent.

The function is named to indicate its future use (because once the user
plugs in such a device, we should show the download page).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-08-06 18:29:27 -07:00
parent a3ddd823bb
commit 0b242bcaca
3 changed files with 11 additions and 1 deletions

View file

@ -175,6 +175,9 @@ Java_org_subsurfacedivelog_mobile_SubsurfaceMobileActivity_setDeviceString(JNIEn
const char *deviceString = env->GetStringUTFChars(javaDeviceString, NULL);
Q_UNUSED (obj)
LOG(deviceString);
#if defined(SUBSURFACE_MOBILE)
QMLManager::instance()->showDownloadPage(deviceString);
#endif
env->ReleaseStringUTFChars(javaDeviceString, deviceString);
return;
}

View file

@ -1776,3 +1776,10 @@ int QMLManager::getDetectedProductIndex(const QString &currentVendorText)
{
return m_device_data->getDetectedProductIndex(currentVendorText);
}
void QMLManager::showDownloadPage(QString deviceString)
{
// inform the QML UI that it should show the download page
m_pluggedInDeviceName = strdup(qPrintable(deviceString));
emit pluggedInDeviceNameChanged();
}

View file

@ -192,7 +192,7 @@ public slots:
void quit();
void hasLocationSourceChanged();
void btRescan();
void showDownloadPage(QString deviceString);
private:
BuddyCompletionModel buddyModel;