Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove: hook_attach_context_menu

Each node is responsible for his own menu, base class can be called to
attach default item
  • Loading branch information...
commit 743804678ffa0377cc096e535c6675ea65cf78f0 1 parent c70e59e
@showi showi authored
View
4 .pydevproject
@@ -3,8 +3,8 @@
<pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/plugin.audio.qobuzgithub</path>
-<path>/plugin.audio.qobuzgithub/resources/lib/qobuz</path>
+<path>/plugin.audio.qobuz</path>
+<path>/plugin.audio.qobuz/resources/lib/qobuz</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
View
5 resources/lib/qobuz/node/friend.py
@@ -136,10 +136,13 @@ def _build_down(self, xbmc_directory, lvl, flag = None):
self.add_child(node)
return True
- def hook_attach_context_menu(self, item, menuItems):
+ def attach_context_menu(self, item, menuItems = []):
colorItem = qobuz.addon.getSetting('color_item')
colorWarn = qobuz.addon.getSetting('color_item_caution')
''' Delete friend'''
url = self.make_url(mode=Mode.FRIEND_REMOVE)
menuItems.append((color(colorItem, 'Remove friend (i8n)' + ': ') + self.name, "XBMC.RunPlugin("+url+")"))
+
+ ''' Calling base class '''
+ super(Node_friend, self).attach_context_menu(item, menuItems)
View
5 resources/lib/qobuz/node/friend_list.py
@@ -69,7 +69,7 @@ def _build_down(self, xbmc_directory, lvl, flag = None):
node.set_name(str(name))
self.add_child(node)
- def hook_attach_context_menu(self, item, menuItems):
+ def attach_context_menu(self, item, menuItems = []):
colorItem = qobuz.addon.getSetting('color_item')
color_warn = qobuz.addon.getSetting('color_item_caution')
label = self.get_label()
@@ -77,3 +77,6 @@ def hook_attach_context_menu(self, item, menuItems):
''' SET AS CURRENT '''
url = self.make_url(mode=Mode.FRIEND_ADD)
menuItems.append((color(colorItem, 'Add friend (i8n)' + ': ') + label, "XBMC.RunPlugin("+url+")"))
+
+ ''' Calling base class '''
+ super(Node_friend_list, self).attach_context_menu(item, menuItems)
View
16 resources/lib/qobuz/node/node.py
@@ -311,14 +311,13 @@ def build_down(self,xbmc_directory,lvl=1,whiteFlag=NodeFlag.TYPE_NODE):
def _build_down(self,xbmc_directory,lvl,flag):
pass
- def attach_context_menu(self,item):
+ def attach_context_menu(self, item, menuItems = []):
colorItem = qobuz.addon.getSetting('color_item')
- menuItems = []
cmd = ''
- ''' ADD AS NEW '''
- cmd = "XBMC.Container.Update(%s)" % (self.make_url(mode=Mode.TEST))
- menuItems.append((color(colorItem,"TEST WINDOW"),cmd))
+ ''' TEST'''
+# cmd = "XBMC.Container.Update(%s)" % (self.make_url(mode=Mode.TEST))
+# menuItems.append((color(colorItem,"TEST WINDOW"),cmd))
''' VIEW BIG DIR '''
path = self.make_url(mode=Mode.VIEW_BIG_DIR)
@@ -365,10 +364,6 @@ def attach_context_menu(self,item):
''' CREATE '''
cmd = xbmcRunPlugin(self.make_url(mode=Mode.PLAYLIST_CREATE))
menuItems.append((color(colorItem,lang(39008)), cmd))
- '''
- Give a chance to our siblings to attach their items
- '''
- self.hook_attach_context_menu(item,menuItems)
''' SCAN '''
if qobuz.addon.getSetting('enable_scan_feature') == 'true':
@@ -389,6 +384,3 @@ def attach_context_menu(self,item):
if len(menuItems) > 0:
item.addContextMenuItems(menuItems,replaceItems=False)
-
- def hook_attach_context_menu(self,item,menuItems):
- pass
View
6 resources/lib/qobuz/node/playlist.py
@@ -126,7 +126,7 @@ def make_XbmcListItem(self):
self.attach_context_menu(item)
return item
- def hook_attach_context_menu(self, item, menuItems):
+ def attach_context_menu(self, item, menuItems = []):
colorItem = qobuz.addon.getSetting('color_item')
colorWarn = qobuz.addon.getSetting('color_item_caution')
label = self.get_label()
@@ -150,7 +150,9 @@ def hook_attach_context_menu(self, item, menuItems):
''' REMOVE '''
url = self.make_url(mode=Mode.PLAYLIST_REMOVE)
menuItems.append((color(colorWarn, lang(39010) + ': ') + label, "XBMC.RunPlugin("+url+")"))
-
+
+ ''' Calling base class '''
+ super(Node_playlist, self).attach_context_menu(item, menuItems)
def remove_tracks(self, tracks_id):
import qobuz, xbmc
View
5 resources/lib/qobuz/node/track.py
@@ -261,7 +261,7 @@ def make_XbmcListItem(self):
self.attach_context_menu(item)
return item
- def hook_attach_context_menu(self, item, menuItems):
+ def attach_context_menu(self, item, menuItems = []):
colorItem = qobuz.addon.getSetting('color_item')
if self.parent and self.parent.type & NodeFlag.TYPE_PLAYLIST:
url = self.parent.make_url(mode=Mode.PLAYLIST_REMOVE_TRACK) + '&track-id=' + str(self.get_property('playlist_track_id'))
@@ -271,3 +271,6 @@ def hook_attach_context_menu(self, item, menuItems):
''' REMOVE '''
url = self.make_url(mode=Mode.FAVORITE_DELETE)
menuItems.append((color(colorItem, 'Remove from favorite') + self.label, "XBMC.RunPlugin("+url+")"))
+
+ ''' Calling base class '''
+ super(Node_track, self).attach_context_menu(item, menuItems)
Please sign in to comment.
Something went wrong with that request. Please try again.