commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9421 - trunk/gnue-forms/src/uidrivers/curses/widgets


From: johannes
Subject: [gnue] r9421 - trunk/gnue-forms/src/uidrivers/curses/widgets
Date: Fri, 2 Mar 2007 02:23:42 -0600 (CST)

Author: johannes
Date: 2007-03-02 02:23:41 -0600 (Fri, 02 Mar 2007)
New Revision: 9421

Modified:
   trunk/gnue-forms/src/uidrivers/curses/widgets/form.py
Log:
Added directory selection

issue152 in-progress


Modified: trunk/gnue-forms/src/uidrivers/curses/widgets/form.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/curses/widgets/form.py       2007-03-01 
14:48:39 UTC (rev 9420)
+++ trunk/gnue-forms/src/uidrivers/curses/widgets/form.py       2007-03-02 
08:23:41 UTC (rev 9421)
@@ -229,6 +229,30 @@
         return result
 
     # -------------------------------------------------------------------------
+    # Show a directory selection box
+    # -------------------------------------------------------------------------
+
+    def _ui_select_dir_(self, title, default_dir, new_dir=False):
+        """
+        Bring up a dialog for selecting a directory path.
+
+        @param title: Message to show on the dialog
+        @param default_dir: the default directory, or the empty string
+        @param new_dir: If true, add "Create new directory" button and allow
+            directory names to be editable. On Windows the new directory button
+            is only available with recent versions of the common dialogs.
+
+        @returns: a path or None if the dialog has been cancelled.
+        """
+
+        dirname = self.ask(u_("Directory"), default_dir)
+        if not dirname:
+           dirname = None
+
+        return dirname
+
+
+    # -------------------------------------------------------------------------
     # Output a message on the status bar
     # -------------------------------------------------------------------------
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]