From e4926afd94329126adacce416fa8cf9daa32673b Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Wed, 23 Oct 2013 11:48:21 +0200 Subject: Imported Upstream version 0.4.7 --- rapid/misc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'rapid/misc.py') 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 -- cgit v1.2.3