mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Adjust signature to match data we need
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ea8de175a7
commit
0c410aaf5d
3 changed files with 10 additions and 14 deletions
|
@ -330,7 +330,7 @@ device_data_t* DCDeviceData::internalData()
|
||||||
return &data;
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DCDeviceData::getDetectedVendorIndex(const QString ¤tText)
|
int DCDeviceData::getDetectedVendorIndex()
|
||||||
{
|
{
|
||||||
auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings;
|
auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings;
|
||||||
if (!dcs->dc_vendor().isEmpty()) {
|
if (!dcs->dc_vendor().isEmpty()) {
|
||||||
|
@ -351,8 +351,7 @@ int DCDeviceData::getDetectedVendorIndex(const QString ¤tText)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DCDeviceData::getDetectedProductIndex(const QString ¤tVendorText,
|
int DCDeviceData::getDetectedProductIndex(const QString ¤tVendorText)
|
||||||
const QString ¤tProductText)
|
|
||||||
{
|
{
|
||||||
auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings;
|
auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings;
|
||||||
if (!dcs->dc_vendor().isEmpty()) {
|
if (!dcs->dc_vendor().isEmpty()) {
|
||||||
|
@ -377,8 +376,7 @@ int DCDeviceData::getDetectedProductIndex(const QString ¤tVendorText,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DCDeviceData::getDetectedDeviceAddress(const QString ¤tVendorText,
|
QString DCDeviceData::getDetectedDeviceAddress(const QString ¤tProductText)
|
||||||
const QString ¤tProductText)
|
|
||||||
{
|
{
|
||||||
#if defined(BT_SUPPORT)
|
#if defined(BT_SUPPORT)
|
||||||
// Pull the vendor from the found devices that are possible real dive computers
|
// Pull the vendor from the found devices that are possible real dive computers
|
||||||
|
|
|
@ -47,11 +47,9 @@ public:
|
||||||
Q_INVOKABLE QStringList getProductListFromVendor(const QString& vendor);
|
Q_INVOKABLE QStringList getProductListFromVendor(const QString& vendor);
|
||||||
Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product);
|
Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product);
|
||||||
|
|
||||||
Q_INVOKABLE int getDetectedVendorIndex(const QString ¤tText);
|
Q_INVOKABLE int getDetectedVendorIndex();
|
||||||
Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText,
|
Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText);
|
||||||
const QString ¤tProductText);
|
Q_INVOKABLE QString getDetectedDeviceAddress(const QString ¤tProductText);
|
||||||
Q_INVOKABLE QString getDetectedDeviceAddress(const QString ¤tVendorText,
|
|
||||||
const QString ¤tProductText);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setVendor(const QString& vendor);
|
void setVendor(const QString& vendor);
|
||||||
|
|
|
@ -61,7 +61,7 @@ Kirigami.Page {
|
||||||
GridLayout {
|
GridLayout {
|
||||||
columns: 2
|
columns: 2
|
||||||
Kirigami.Label { text: qsTr(" Vendor name: ") }
|
Kirigami.Label { text: qsTr(" Vendor name: ") }
|
||||||
property var vendoridx: downloadThread.data().getDetectedVendorIndex("")
|
property var vendoridx: downloadThread.data().getDetectedVendorIndex()
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: comboVendor
|
id: comboVendor
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -87,14 +87,14 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
onCurrentTextChanged: {
|
onCurrentTextChanged: {
|
||||||
comboProduct.model = downloadThread.data().getProductListFromVendor(currentText)
|
comboProduct.model = downloadThread.data().getProductListFromVendor(currentText)
|
||||||
if (currentIndex == downloadThread.data().getDetectedVendorIndex(currentText))
|
if (currentIndex == downloadThread.data().getDetectedVendorIndex())
|
||||||
comboProduct.currentIndex = downloadThread.data().getDetectedProductIndex(currentText, comboProduct.currentText)
|
comboProduct.currentIndex = downloadThread.data().getDetectedProductIndex(currentText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.Label { text: qsTr(" Dive Computer:") }
|
Kirigami.Label { text: qsTr(" Dive Computer:") }
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: comboProduct
|
id: comboProduct
|
||||||
property var productidx: downloadThread.data().getDetectedProductIndex(comboVendor.currentText, currentText)
|
property var productidx: downloadThread.data().getDetectedProductIndex(comboVendor.currentText)
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
model: null
|
model: null
|
||||||
currentIndex: productidx
|
currentIndex: productidx
|
||||||
|
|
Loading…
Add table
Reference in a new issue