summaryrefslogtreecommitdiff
path: root/rapid/misc.py
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2013-10-23 11:48:21 +0200
committerJulien Valroff <julien@kirya.net>2013-10-23 11:48:21 +0200
commite4926afd94329126adacce416fa8cf9daa32673b (patch)
tree69f107ed594fe3de037c59aeb870fa9ff77f23aa /rapid/misc.py
parent063aca3a12dbf69d5ecdd2e949a788e01c91659d (diff)
Imported Upstream version 0.4.7upstream/0.4.7
Diffstat (limited to 'rapid/misc.py')
-rw-r--r--rapid/misc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/rapid/misc.py b/rapid/misc.py
index 69b4a93..a2c6d08 100644
--- a/rapid/misc.py
+++ b/rapid/misc.py
@@ -19,6 +19,8 @@
### USA
# modified by Damon Lynch 2009 to remove default bold formatting and alignment
+# modified by Damon Lynch 2103 to add function to get folder chosen by user in file chooser button
+
"""Module of commonly used helper classes and functions
"""
@@ -44,3 +46,15 @@ def run_dialog( text, secondarytext=None, parent=None, messagetype=gtk.MESSAGE_
ret = d.run()
d.destroy()
return ret
+
+def get_folder_selection(filechooserbutton):
+ """
+ Returns the path (folder) the user has chosen in a filechooserbutton
+ """
+ # this no longer works on Ubuntu 13.10:
+ # path = filechooserbutton.get_current_folder()
+ # but this works on Ubuntu 13.10:
+ path = filechooserbutton.get_filenames() #returns a list
+ if path:
+ path = path[0]
+ return path