summaryrefslogtreecommitdiff
path: root/rapid/misc.py
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2013-10-23 11:48:26 +0200
committerJulien Valroff <julien@kirya.net>2013-10-23 11:48:26 +0200
commit6da396f006a9175e25f9af1cb215cb521dad59bb (patch)
tree3b83d14388e1ece0cbbfa65ae2b60364b884bf33 /rapid/misc.py
parent2c1a009a7e32e7e33dd91a8318498f03b04a6f6b (diff)
parente4926afd94329126adacce416fa8cf9daa32673b (diff)
Merge tag 'upstream/0.4.7'
Upstream version 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