From 4741e10a7a2ec484d22351c1eef65b3d7d187e72 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 12 Jan 2009 18:29:36 -0800 Subject: [PATCH] Fix #1439 (Sort is not saved when quitting) --- src/calibre/gui2/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 1bb252e97d..5429fb15c1 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -1482,8 +1482,9 @@ in which you want to store your books files. Any existing books will be automati return True - def shutdown(self): - self.write_settings() + def shutdown(self, write_settings=True): + if write_settings: + self.write_settings() self.job_manager.terminate_all_jobs() self.device_manager.keep_going = False self.cover_cache.stop() @@ -1503,6 +1504,7 @@ in which you want to store your books files. Any existing books will be automati def closeEvent(self, e): + self.write_settings() if self.system_tray_icon.isVisible(): if not dynamic['systray_msg'] and not isosx: info_dialog(self, 'calibre', 'calibre '+_('will keep running in the system tray. To close it, choose Quit in the context menu of the system tray.')).exec_() @@ -1512,7 +1514,7 @@ in which you want to store your books files. Any existing books will be automati else: if self.confirm_quit(): try: - self.shutdown() + self.shutdown(write_settings=False) except: pass e.accept()