Skip to content

Commit

Permalink
Automatically load settings
Browse files Browse the repository at this point in the history
This waits until the ground station IP address is discovered, then
immediately loads settings so they are available soon after launch.

Then it keeps them updated every 60 seconds.
  • Loading branch information
steveatinfincia committed Dec 6, 2019
1 parent 5b68570 commit 99d1f55
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions qml/ui/SettingsPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@ SettingsPopupForm {
*
*/


property double lastSettingsLoad: 0

Timer {
interval: 1000;
running: true;
repeat: true
onTriggered: {
if (!openHDSettings.ground_available) {
return;
}

var currentTime = (new Date).getTime();
if (currentTime - lastSettingsLoad > 60000) {
if (!settings_popup.opened) {
lastSettingsLoad = currentTime;
console.log("Settings panel not open, triggering load");
openHDSettings.fetchSettings();
}
}
}
}

ListModel {
dynamicRoles: true
id: generalSettingsModel
Expand Down

0 comments on commit 99d1f55

Please sign in to comment.