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