Issue 218 in ulipad: improvement, add_current_directory menu in pop menu of dirbrowser

0 views
Skip to first unread message

uli...@googlecode.com

unread,
Nov 28, 2009, 10:49:25 PM11/28/09
to uli...@googlegroups.com
Status: New
Owner: ----

New issue 218 by sunyin51: improvement, add_current_directory menu in pop
menu of dirbrowser
http://code.google.com/p/ulipad/issues/detail?id=218

import functools
def OnAddCurrentPath(self,event):
item = self.tree.GetSelection()
if not self.is_ok(item):
print item , 'is not ok'
return
filename = self.get_node_filename(item)
if self.isFile(item):
item = self.tree.GetItemParent(item)
filename = self.get_node_filename(item)
path = filename
if path:
self.addpath(path)
if self.pref.open_project_setting_dlg:
wx.CallAfter(self.OnSetProject)

# use static popup menu
def addmenu(app):
app.OnAddCurrentPath = functools.partial(OnAddCurrentPath,app)
app.popmenulist.extend( [('IDPM_ADD', [
(99, 'IDPM_ADD_CURDIR', tr('Add Current Directory'), wx.ITEM_NORMAL,
'OnAddCurrentPath', ''),
]), ])
Mixin.setPlugin('dirbrowser', 'init', addmenu)

Attachments:
addcurrentdir.png 10.4 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

uli...@googlecode.com

unread,
Nov 29, 2009, 12:12:36 AM11/29/09
to uli...@googlegroups.com

Comment #1 on issue 218 by limodou: improvement, add_current_directory menu
This feature seems good, but I want to know how do you know the current
directory is?
And ulipad supports drag and drop from explorer, so I think this feature
seems not very
necessary. What do you think?

uli...@googlecode.com

unread,
Nov 29, 2009, 12:22:38 AM11/29/09
to uli...@googlegroups.com

Comment #2 on issue 218 by sunyin51: improvement, add_current_directory
When the mouse right click on the selected item inside the dirbrowser, you
will know
from the tree.GetSelection. I just inserted another handler into the
dirbrowser.init.addmenu. As I don't know how to use mixin to pass the
function of
OnAddCurrentPath, I use functools.
the implementation is based on the existing feature. I find it is faster
than drag and
drop and should work under linux.

uli...@googlecode.com

unread,
Nov 29, 2009, 12:52:48 AM11/29/09
to uli...@googlegroups.com

Comment #3 on issue 218 by limodou: improvement, add_current_directory menu
So you mean you want to add sub-folder in one top directory? So because
you've add the
top folder why you want to add sub-folder again?

uli...@googlecode.com

unread,
Nov 29, 2009, 12:59:30 PM11/29/09
to uli...@googlegroups.com

Comment #4 on issue 218 by sunyin51: improvement, add_current_directory
it is faster to access them from top folder than open folder by folder from
a common
root.
I treat dirbrowser as a shortcut to browse the projects I am working on.
For example on the top folder I keep one entry for /aaa/bbb/ulipad
I will also keep one entry for /aaa/bbb/ulipad/modules/wxctrl
so that I don't have to always click ulipad, scroll to modules, then scroll
to modules
click modules, then click wxctrl.
you know there are lots of files under ulipad.

uli...@googlecode.com

unread,
Dec 1, 2009, 12:10:55 AM12/1/09
to uli...@googlegroups.com
Updates:
Status: Fixed

Comment #5 on issue 218 by limodou: improvement, add_current_directory menu
I've merged your code to DirBrowser.py. Fixed.
Reply all
Reply to author
Forward
0 new messages