From: <cl...@us...> - 2003-04-27 03:44:44
|
Update of /cvsroot/todo-manager/todo-manager In directory sc8-pr-cvs1:/tmp/cvs-serv9601 Modified Files: interface.py main.py Log Message: I've moved around the config loading/saving code. Now the config for the interface is loaded after the interface is fully initialized. All final modifications to the settings are now stored at the core's request. Index: interface.py =================================================================== RCS file: /cvsroot/todo-manager/todo-manager/interface.py,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- interface.py 6 Apr 2003 20:03:38 -0000 1.46 +++ interface.py 27 Apr 2003 03:44:39 -0000 1.47 @@ -295,7 +295,6 @@ i = i + 1 - self.load_config() self._taskList.update() # So the controls are fully drawn @@ -650,8 +649,6 @@ def OnExit(self, event=None): # Tell the core that the interface is no longer in use if self._app.unbind_interface(self): - self.save_config() - # Destroy the main window self._master.quit() @@ -809,6 +806,9 @@ self.remove_plugin_menu_entry(menu, name) + elif command == "save_settings": + self.save_config() + def remove_plugin_menu_entry(self, menu, name): # The menu must be a plugin menu if not menu in (self._import_menu, self._export_menu, self._sorting_menu, @@ -967,8 +967,6 @@ # Change this back to an integer so everything else works peachy app.save_setting(CONF_SECTION, "sortandfilter", TRUE) - else: - app.save_setting(CONF_SECTION, "sortandfilter", FALSE) def save_config(self): app = self._app @@ -1009,6 +1007,8 @@ def post_init(self): """Actions that are executed after initialization""" + + self.load_config() self.OnSortingMethod() #------------------------------------------------------------------------------- Index: main.py =================================================================== RCS file: /cvsroot/todo-manager/todo-manager/main.py,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- main.py 26 Apr 2003 22:19:08 -0000 1.77 +++ main.py 27 Apr 2003 03:44:39 -0000 1.78 @@ -724,6 +724,7 @@ # If cancel was selected then stop if self.ask_save_curfile(interface) == -1: return FALSE + self.interface_call(interface, "save_settings") self.interface_call(interface, "clear_list_items") self.interface_call(interface, "update_list_groups", []) self.__interfaces.remove(interface) |