diff --git a/twander.py b/twander.py index 98fc8db..d42c374 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.141 2004/03/11 06:51:58 tundra Exp $" +RCSID = "$Id: twander.py,v 3.142 2004/03/11 07:21:18 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -307,7 +307,8 @@ REFRESHAFTER = '+' # Indicate we want a refresh after a command runs SHOWDRIVES = '\\\\' # Logical directory name for Win32 Drive Lists STRICTMATCH = CMDESCAPE # Tells wildcard system to enforce strict matching - +TTLMAXDIR = 80 # Maximum length of current directory path to show in titlebar +TTLDIR2LONG = "..." # String to place at front of long dir paths in titlebar # Sort Field Names In Normal View @@ -2081,7 +2082,7 @@ ##### - # Update title bar with most current information + # Update titlebar with most current information ##### def UpdateTitle(self, mainwin, refreshing=""): @@ -2103,6 +2104,15 @@ srtsep = YesOrNo[SORTSEPARATE] sepsort = "%s %s" % (TTLSORTSEP, srtsep) + # Limit width of current directory name display in case + # user get's *really* deeply nested in a file system. + # This keeps the other stuff of interest visible on the titlebar + + CurrentDir = UI.CurrentDir + pathlen = len(CurrentDir) + if pathlen > TTLMAXDIR: + CurrentDir = TTLDIR2LONG + CurrentDir[pathlen-TTLMAXDIR:] + # Indicate Reverse sort by appending a '-' to the sort field name if SORTREVERSE: @@ -2114,10 +2124,10 @@ autostate = YesOrNo[AUTOREFRESH] + refreshing mainwin.title("%s %s %s: %s %s %s %s %s %s%s %s %s" % - (PROGNAME, VERSION, FULLNAME, UI.CurrentDir, TTLFILES, + (PROGNAME, VERSION, FULLNAME, CurrentDir, TTLFILES, str(self.DirList.size()), TTLSIZE, FileLength(self.TotalSize), sortedby, sepsort, TTLAUTO, autostate)) - # Make sure the title bar gets updated + # Make sure the titlebar gets updated mainwin.update_idletasks() # End of method 'twanderUI.UpdateTitle()' @@ -2356,7 +2366,7 @@ # Toggle the state AUTOREFRESH = not AUTOREFRESH - # Update the title bar to reflect this + # Update the titlebar to reflect this UI.UpdateTitle(UIroot) # Update the help menu to reflect change @@ -3304,7 +3314,7 @@ # Update Help Menu to reflect whether we're in Normal or Drive List View LoadSortMenu() - # Update Titlebar to reflect any changes + # Update titlebar to reflect any changes UI.UpdateTitle(UIroot) #Release the lock