def closeFun(self): "ask for saving files on exit" if doesFileStorageRequiresSave(self): answ = messagebox.askyesno(message = "Do you want to save files before leaving?", icon = "question", title = "Save files?") if answ: saveFileStorage(self) self.destroy()
def _askForSave(self, mode): "helper for asking to save files on exit (i.e. closeFun)" text = "Do you want to save {} files before leaving?".format( m.fullname[mode]) answ = messagebox.askyesno(message=text, icon="question", title="Save files?") if answ: saveFileStorage(self, mode)
def closeFun(self): "ask for saving files on exit" if not optionGet("Developer", False, 'bool', True): if doesFileStorageRequiresSave(self, m.mode): self._askForSave(m.mode) for mode in m.fs: if mode != m.mode and doesFileStorageRequiresSave(self, mode): self._askForSave(mode) path = optionGet("SelectedFilesDirectory", os.path.join(os.getcwd(), "Stuff", "Selected files"), "str", True) saveFileStorage(self, m.mode, os.path.join(path, "~last.files")) self.destroy()
def saveLoadedFiles(self): saveFileStorage(self.root, m.mode)
def _askForSave(self, mode): "helper for asking to save files on exit (i.e. closeFun)" text = "Do you want to save {} files before leaving?".format(m.fullname[mode]) answ = messagebox.askyesno(message = text, icon = "question", title = "Save files?") if answ: saveFileStorage(self, mode)
def saveLoadedFiles(self): saveFileStorage(self.root)