Skip to contentSkip to conversation

hob2: set beginning folders for FileChooserDialog

PATCH Applied Kang Kai 2 participants 2 messages May 30, 2012

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

PATCH 1/1 hob2: set beginning folders for FileChooserDialog

Set begining folders FileChooserDialog for the select images and some local directory configurations. That may make user feel more convenient.

---
 bitbake/lib/bb/ui/crumbs/hig.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
bitbake/lib/bb/ui/crumbs/hig.py +4 -0
index 4baf960..38db466 100644
@@ -137,6 +137,8 @@ class AdvancedSettingDialog (CrumbsDialog):
     def entry_widget_select_path_cb(self, action, parent, entry):
         dialog = gtk.FileChooserDialog("", parent,
                                        gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
+        text = entry.get_text()
+        dialog.set_current_folder(text if len(text) > 0 else os.getcwd())
         button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
         HobAltButton.style_button(button)
         button = dialog.add_button("Open", gtk.RESPONSE_YES)
@@ -1092,6 +1094,8 @@ class ImageSelectionDialog (CrumbsDialog):
     def select_path_cb(self, action, parent, entry):
         dialog = gtk.FileChooserDialog("", parent,
                                        gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
+        text = entry.get_text()
+        dialog.set_current_folder(text if len(text) > 0 else os.getcwd())
         button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
         HobAltButton.style_button(button)
         button = dialog.add_button("Open", gtk.RESPONSE_YES)
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 8 lines · Kang Kai

Set begining folders FileChooserDialog for the select images and some local directory configurations. That may make user feel more convenient.

---
 bitbake/lib/bb/ui/crumbs/hig.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Merged to master, thanks.

Richard