Skip to content

Commit

Permalink
Enable egeniouss receiver using plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenD98 committed Sep 16, 2024
1 parent 5c72442 commit ea00df0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/qml/PluginManagerSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Popup {
y: (parent.height - height) / 2
padding: 0

signal unLoadClicked(string Uuid)
signal loadClicked(string Uuid)

Page {
id: page
width: parent.width
Expand Down Expand Up @@ -119,8 +122,10 @@ Popup {
Enabled = checked == true;
if (Enabled) {
pluginManager.enableAppPlugin(Uuid);
loadClicked(Uuid);
} else {
pluginManager.disableAppPlugin(Uuid);
unLoadClicked(Uuid);
}
}
}
Expand Down
25 changes: 21 additions & 4 deletions src/qml/PositioningDeviceSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ Popup {
return positioningDeviceItem.item.getSettings();
}

function handleEgenioussChange() {
if (positioningSettings.enableEgeniouss) {
positioningDeviceTypeModel.insert(0, {
"name": qsTr('Egeniouss'),
"value": PositioningDeviceModel.EgenioussDevice
});
} else {
positioningDeviceTypeModel.remove(0, 1);
positioningDeviceModel.removeDevice("Egeniouss");
positioningDeviceComboBox.currentIndex = 0;
}
positioningDeviceType.model = positioningDeviceTypeModel;
}

Component.onCompleted: {
if (withBluetooth) {
positioningDeviceTypeModel.insert(0, {
Expand All @@ -54,7 +68,14 @@ Popup {
"value": PositioningDeviceModel.SerialPortDevice
});
}
if (positioningSettings.enableEgeniouss) {
positioningDeviceTypeModel.insert(0, {
"name": qsTr('Egeniouss'),
"value": PositioningDeviceModel.EgenioussDevice
});
}
positioningDeviceType.model = positioningDeviceTypeModel;
positioningSettings.onEnableEgenioussChanged.connect(handleEgenioussChange);
}

Page {
Expand Down Expand Up @@ -181,10 +202,6 @@ Popup {
name: qsTr('UDP (NMEA)')
value: PositioningDeviceModel.UdpDevice
}
ListElement {
name: qsTr('Egeniouss')
value: PositioningDeviceModel.EgenioussDevice
}
}

Loader {
Expand Down
1 change: 1 addition & 0 deletions src/qml/PositioningSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ Settings {
property int digitizingMeasureType: 1

property bool geofencingPreventDigitizingDuringAlert: false
property bool enableEgeniouss: false
}
7 changes: 7 additions & 0 deletions src/qml/qgismobileapp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ ApplicationWindow {

PositioningSettings {
id: positioningSettings
objectName: "positioningSettings"

onPositioningActivatedChanged: {
if (positioningActivated) {
Expand Down Expand Up @@ -2076,6 +2077,12 @@ ApplicationWindow {
modal: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
parent: Overlay.overlay

onUnLoadClicked: function (Uuid) {
if (Uuid.search === "qfield-egeniouss-plugin") {
positioningSettings.enableEgeniouss = false;
}
}
}

DashBoard {
Expand Down

0 comments on commit ea00df0

Please sign in to comment.