@@ -1123,7 +1123,7 @@ Item {
11231123 if (!backup) {
11241124 return;
11251125 }
1126- applyConfigDialog.show(backup);
1126+ applyConfigDialog.show(backup, false, false );
11271127 }
11281128
11291129 function idBackup() {
@@ -1140,7 +1140,7 @@ Item {
11401140 if (!backup) {
11411141 return;
11421142 }
1143- applyConfigDialog.show(backup);
1143+ applyConfigDialog.show(backup, false, false );
11441144 }
11451145
11461146 function autoBackup() {
@@ -1158,7 +1158,7 @@ Item {
11581158 if (!backup) {
11591159 return;
11601160 }
1161- applyConfigDialog.show(backup);
1161+ applyConfigDialog.show(backup, false, false );
11621162 }
11631163
11641164 function triggerAutoRestore() {
@@ -1170,7 +1170,7 @@ Item {
11701170 var backup = loadBackup("auto_backup_" + board.getId());
11711171 if (backup) {
11721172 print("Refloat: Automatic backup restore.");
1173- applyConfigDialog.show(backup, true);
1173+ applyConfigDialog.show(backup, true, false );
11741174 } else {
11751175 print("Refloat: No automatic backup to restore.");
11761176 }
@@ -4456,7 +4456,7 @@ Item {
44564456 width: tuneArchiveTunesList.width
44574457 text: tune.name
44584458 onClicked: {
4459- applyConfigDialog.show(tune);
4459+ applyConfigDialog.show(tune, false, true );
44604460 }
44614461 }
44624462 }
@@ -4920,8 +4920,8 @@ Item {
49204920 NText {
49214921 Layout.fillWidth: true
49224922 horizontalAlignment: Text.AlignHCenter
4923- visible: isEmpty && !isTune
4924- text: "Current config is the same as this backup ."
4923+ visible: isEmpty
4924+ text: "There are no differences to your current config ."
49254925 }
49264926
49274927 Item {
@@ -4932,10 +4932,11 @@ Item {
49324932 BaseDialog {
49334933 id: applyConfigDialog
49344934
4935- title: "Restore Config"
4935+ title: isTune ? "Apply Tune" : "Restore Config"
49364936
49374937 property var config
49384938 property bool automatic: false
4939+ property bool isTune: false
49394940
49404941 property var name: config ? config.name : "(Unknown)"
49414942 property var date: config && config.date ? Qt.formatDateTime(new Date(config.date)) : ""
@@ -4947,11 +4948,13 @@ Item {
49474948 applyConfigDiff.setModel(diff);
49484949 }
49494950
4950- function show(cfg, autoRestore ) {
4951+ function show(cfg, auto, tune ) {
49514952 config = cfg;
4952- automatic = !!autoRestore;
4953+ automatic = !!auto;
4954+ isTune = !!tune;
49534955 applyConfigDiff.reset();
4954- if (!applyConfigDiff.isEmpty) {
4956+ applyConfigDiff.isTune = isTune;
4957+ if (!applyConfigDiff.isEmpty && !isTune) {
49554958 standardButton(Dialog.Apply).text = "Restore";
49564959 }
49574960 open();
@@ -5036,7 +5039,7 @@ Item {
50365039 horizontalAlignment: Text.AlignHCenter
50375040 verticalAlignment: Text.AlignVCenter
50385041 wrapMode: Text.WordWrap
5039- visible: !applyConfigDiff.isEmpty
5042+ visible: !applyConfigDiff.isEmpty && !applyConfigDialog.isTune
50405043 text: "Restoring this backup will overwrite your current config."
50415044 }
50425045 }
0 commit comments