From: <cl...@us...> - 2002-06-18 02:24:44
|
Update of /cvsroot/todo-manager/todo-manager In directory usw-pr-cvs1:/tmp/cvs-serv15062 Modified Files: Tag: dev-bronze interface.py main.py Log Message: Manually loading the default file is the same as File->Reload Default File Index: interface.py =================================================================== RCS file: /cvsroot/todo-manager/todo-manager/Attic/interface.py,v retrieving revision 1.1.2.35 retrieving revision 1.1.2.36 diff -u -d -r1.1.2.35 -r1.1.2.36 --- interface.py 18 Jun 2002 02:09:59 -0000 1.1.2.35 +++ interface.py 18 Jun 2002 02:24:41 -0000 1.1.2.36 @@ -509,7 +509,7 @@ # These are small commands that external modules may want to call # args isn't a full argument list (*args) because the core will send a tuple if command == "set_current_filename": - if args[0] == appname: val = appname + if not args[0] or (args[0] == appname): val = appname else: val = "%s - %s" %(appname, args[0]) self._master.title(val) elif command == "display_error": tkMessageBox.showerror(args[0], args[1]) Index: main.py =================================================================== RCS file: /cvsroot/todo-manager/todo-manager/main.py,v retrieving revision 1.1.2.19 retrieving revision 1.1.2.20 diff -u -d -r1.1.2.19 -r1.1.2.20 --- main.py 9 Jun 2002 05:22:06 -0000 1.1.2.19 +++ main.py 18 Jun 2002 02:24:41 -0000 1.1.2.20 @@ -273,7 +273,15 @@ self.__file_modified = FALSE self.interface_call(ALL, "update_list_items") - self.interface_call(ALL, "set_current_filename", os.path.split(filename)[1]) + + # See if the file that has just been loaded is the default file + dir = os.path.dirname(__file__) + if dir == ".": dir = '' + f = os.path.join(os.getcwd(), dir, filename) + if f == default_file: val = '' + else: val = os.path.split(filename)[1] + + self.interface_call(ALL, "set_current_filename", val) def load_default_file(self, ui=None): """Load the default file.""" |