Closed GoogleCodeExporter closed 9 years ago
i don't know how to get the path of file browser root directory. Any suggestion?
Original comment by swatch.c...@gmail.com
on 6 Jan 2011 at 1:02
Hi,
Although I'm not a GEdit plugin developer but after searching around, I found
that the plugin SnapOpen integrate quite well with the File Browser plugin. I
attached the source code of the SnapOpen plugin, it's just a Python file. Here
is the snippet that SnapOpen get the root directory
# FILEBROWSER integration
def get_filebrowser_root(self):
base = u'/apps/gedit-2/plugins/filebrowser/on_load'
client = gconf.client_get_default()
client.add_dir(base, gconf.CLIENT_PRELOAD_NONE)
path = os.path.join(base, u'virtual_root')
val = client.get(path)
if val is not None:
#also read hidden files setting
base = u'/apps/gedit-2/plugins/filebrowser'
client = gconf.client_get_default()
client.add_dir(base, gconf.CLIENT_PRELOAD_NONE)
path = os.path.join(base, u'filter_mode')
try:
fbfilter = client.get(path).get_string()
except AttributeError:
fbfilter = "hidden"
if fbfilter.find("hidden") == -1:
self._show_hidden = True
else:
self._show_hidden = False
return val.get_string()
Hope that help :)
Original comment by xuantinh@gmail.com
on 6 Jan 2011 at 3:16
Attachments:
Thanks for your information. This feature is implemented at v0.7.0. Check the
"Root Follow Filebrowser" option in plugin configuration dialog to enable it.
Original comment by swatch.c...@gmail.com
on 6 Jan 2011 at 3:01
I think you misunderstood my idea. The current implementation is automatically
set the directory that contain the document in the active tab
('/data/Projects/Evolus/Groovy/TouchCats/TouchCats-trunk/grails-app/conf'). But
what I mean is it should set the root folder of the file browser plugin
('/data/Projects/Evolus/Groovy/TouchCats/TouchCats-trunk/').
I've also attached a screenshot for better description.
Original comment by xuantinh@gmail.com
on 8 Jan 2011 at 7:17
Attachments:
You must check the "Root Follow Filebrowser" option in plugin configuration
dialog(Edit->Preferences->Plugins->Advanced Find/Replace) to enable this
feature first. And you should't check the "Directory follow current doc."
option in advanced find/replace dialog or the directory path follows where the
current active document is.
Original comment by swatch.c...@gmail.com
on 10 Jan 2011 at 3:51
Many thanks, I overlooked the settings in the 'Configure Plugin' dialog.
Problem solved
Original comment by xuantinh@gmail.com
on 10 Jan 2011 at 4:16
Original comment by swatch.c...@gmail.com
on 17 Jan 2012 at 2:07
Original issue reported on code.google.com by
xuantinh@gmail.com
on 5 Jan 2011 at 2:57