diff --git a/twander.py b/twander.py index e41a4d4..d4ad46a 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.73 2003/01/19 08:03:49 tundra Exp $" +RCSID = "$Id: twander.py,v 2.74 2003/01/19 17:40:27 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -149,7 +149,7 @@ ##### HEIGHT = 25 -WIDTH = 90 +WIDTH = 110 ##### # Default Colors @@ -223,6 +223,7 @@ NONAVIGATE = FALSE # TRUE means that all directory navigation is prevented USETHREADS = TRUE # Use threads on Unix USEWIN32ALL = TRUE # Use win32all features if available +WIN32ALLON = TRUE # Flag for toggling win32all features while running WARN = TRUE # Warnings on ##### @@ -244,7 +245,7 @@ # Get the user name if OSNAME == 'nt': - if WIN32ALL and USEWIN32ALL: + if WIN32ALL and USEWIN32ALL and WIN32ALLON: USERNAME = GetUserName() else: USERNAME = os.getenv("LOGNAME") @@ -296,7 +297,7 @@ # Stat-Related Constants -if WIN32ALL and USEWIN32ALL: +if WIN32ALL and USEWIN32ALL and WIN32ALLON: # Used with win32all-based permissions logic. # Format for each entry is: (mask to test, symbol if true). @@ -512,7 +513,7 @@ " -r turn off automatic content refreshing (default: refresh on)", " -t no quoting when substituting Built-In Variables (default: quoting on)", " -v print detailed version information", - " -x width window width (default: 90)", + " -x width window width (default: 110)", " -y height window height (default: 25)", ] @@ -545,7 +546,7 @@ # Get Win32 drive string, split on nulls, and get # rid of any resulting null entries. - if WIN32ALL and USEWIN32ALL: + if WIN32ALL and USEWIN32ALL and WIN32ALLON: return filter(lambda x : x, GetDrives().split('\x00')) else: return "" @@ -1479,9 +1480,11 @@ ##### def KeyToggleWin32All(event): - global USEWIN32ALL + global WIN32ALLON - USEWIN32ALL = not USEWIN32ALL + if USEWIN32ALL: + WIN32ALLON = not WIN32ALLON + RefreshDirList(event) # End of 'KeyToggleWin32All()' @@ -2193,7 +2196,7 @@ continue # Do Win32-specific mode if win32all is loaded - if WIN32ALL and USEWIN32ALL: + if WIN32ALL and USEWIN32ALL and WIN32ALLON: modlen = len(win32all_mode) @@ -2295,7 +2298,7 @@ owner = 'win32user' group = 'win32group' - if WIN32ALL and USEWIN32ALL: + if WIN32ALL and USEWIN32ALL and WIN32ALLON: try: ho = GetFileSecurity(fn, OWNER_SECURITY_INFORMATION) hg = GetFileSecurity(fn, GROUP_SECURITY_INFORMATION) @@ -2656,6 +2659,12 @@ UI.HelpBtn.config(state=NORMAL) ##### + # Reflect Our Changes In The Interface + ##### + + RefreshDirList() + + ##### # Dump requested debug information ##### @@ -2945,6 +2954,18 @@ # Initialize Command History data structures ClearHistory(None) +# Need mutex to serialize on widget updates +UI.DirListMutex = mutex.mutex() + +# Intialize the "new dir via mouse" flag +UI.MouseNewDir = FALSE + +# Initialize the polling counter +UI.ElapsedTime = 0 + +# Start in detailed mode +UI.SetDetailedView(TRUE) + ##### # Command line processing - Options are set with the @@ -3049,24 +3070,15 @@ # Get starting directory into canonical form STARTDIR = os.path.abspath(STARTDIR) +# Initialize the UI directory listing +LoadDirList(STARTDIR) +KeySelTop(None) + # Process options to catch any changes detected in # environment variable or command line ProcessOptions() -# Need mutex to serialize on widget updates -UI.DirListMutex = mutex.mutex() - -# Intialize the "new dir via mouse" flag -UI.MouseNewDir = FALSE - -# Initialize the polling counter -UI.ElapsedTime = 0 - -# Initialize the UI directory listing -LoadDirList(STARTDIR) -KeySelTop(None) - # And start the periodic polling of the widget UI.poll()