Skip to content

Commit 4665b3d

Browse files
committed
Fix a behavior of the "Reset to default button" in the CloudDialog()
1 parent cfda6b4 commit 4665b3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gui/synchronization_dialogs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,6 @@ def update_gui(self):
268268
self.l_setdBox.append(self.ps_row)
269269

270270
set_button_sensitive = settings["periodic-saving"] != "Never" and not os.path.exists(path)
271-
if "red" in folder:
272-
self.set_response_enabled('ok', False)
273-
[os.remove(path) for path in [f"{home}/.config/autostart/io.github.vikdevelop.SaveDesktop.sync.desktop", f"{DATA}/savedesktop-synchronization.sh"] if os.path.exists(path)] # remove these files if the periodic saving folder is not a cloud drive folder
274271
if _("Periodic saving file does not exist.") in folder:
275272
self._make_pb_file()
276273
if _("You didn't select the cloud drive folder!") in folder:
@@ -279,6 +276,8 @@ def update_gui(self):
279276
self.lmButton.add_css_class("suggested-action")
280277
self.lmButton.connect("clicked", self._open_sync_link)
281278
self.file_row.add_suffix(self.lmButton)
279+
self.set_response_enabled('ok', False)
280+
[os.remove(path) for path in [f"{home}/.config/autostart/io.github.vikdevelop.SaveDesktop.sync.desktop", f"{DATA}/savedesktop-synchronization.sh"] if os.path.exists(path)] # remove these files if the periodic saving folder is not a cloud drive folder
282281
self.set_body("") # set the body as empty after loading the periodic saving information
283282

284283
# make the periodic saving file if it does not exist
@@ -433,7 +432,8 @@ def reset_cloud_folder(self, w):
433432
self.cfileRow.remove(self.resetButton)
434433
self.set_response_enabled('ok', True)
435434
settings["file-for-syncing"] = self.cfileRow.get_subtitle()
436-
[os.remove(path) for path in [f"{home}/.config/autostart/io.github.vikdevelop.SaveDesktop.sync.desktop", f"{DATA}/savedesktop-synchronization.sh"] if os.path.exists(path)]
435+
if not settings["periodic-saving-folder"]:
436+
[os.remove(path) for path in [f"{home}/.config/autostart/io.github.vikdevelop.SaveDesktop.sync.desktop", f"{DATA}/savedesktop-synchronization.sh"] if os.path.exists(path)]
437437

438438
# enable or disable the response of this dialog in depending on the selected periodic synchronization interval
439439
def on_psync_changed(self, psyncRow, GParamObject):

0 commit comments

Comments
 (0)