Example #1
0
 def add_child_menu_actions(self, node, menu):
     entity = node.state.get('self')
     if entity:
         path = self.model.sgfs.path_for_entity(entity)
         action = menu.addAction(icon('silk/folder_go', as_icon=True), 'Jump to Folder', functools.partial(call_open, path))
         if not path:
             action.setEnabled(False)
         menu.addAction(icon('silk/cog_go', as_icon=True), 'Open in Shotgun', functools.partial(call_open, entity.url))
Example #2
0
 def add_child_menu_actions(self, node, menu):
     entity = node.state.get('self')
     if entity:
         path = self.model.sgfs.path_for_entity(entity)
         action = menu.addAction(icon('silk/folder_go', as_icon=True),
                                 'Jump to Folder',
                                 functools.partial(call_open, path))
         if not path:
             action.setEnabled(False)
         menu.addAction(icon('silk/cog_go', as_icon=True),
                        'Open in Shotgun',
                        functools.partial(call_open, entity.url))
Example #3
0
 def _on_context_menu(self, view, point):
     index = view.indexAt(point)
     node = self.model().node_from_index(index)
     
     menu = QtGui.QMenu()
     if node.parent and not isinstance(node, base.Group):
         node.parent.add_child_menu_actions(node, menu)
     
     if not menu.isEmpty():
         menu.addSeparator()
     
     menu.addAction(icon('fatcow/arrow_refresh', as_icon=True), "Reload", functools.partial(self._reload_node, node))
     menu.exec_(view.mapToGlobal(point))
Example #4
0
File: view.py Project: vfxetc/sgfs
    def _on_context_menu(self, view, point):
        index = view.indexAt(point)
        node = self.model().node_from_index(index)

        menu = Q.Menu()
        if node.parent and not isinstance(node, base.Group):
            node.parent.add_child_menu_actions(node, menu)

        if not menu.isEmpty():
            menu.addSeparator()

        menu.addAction(icon('fatcow/arrow_refresh', as_icon=True), "Reload",
                       functools.partial(self._reload_node, node))
        menu.exec_(view.mapToGlobal(point))