コード例 #1
0
 def extendAddonsItemMenu(self, menu, node):
     #Menu de los addons
     addonMenues = ["-"]
     for addon in self.addons:
         addonMenues.extend(addon.contributeToContextMenu(node))
     if len(addonMenues) > 1:
         extend_menu_section(menu, addonMenues, section='properties')
コード例 #2
0
ファイル: projects.py プロジェクト: D3f0/prymatex
 def extendAddonsItemMenu(self, menu, node):
     #Menu de los addons
     addonMenues = [ "-" ]
     for component in self.components():
         addonMenues.extend(component.contributeToContextMenu(node))
     if len(addonMenues) > 1:
         extend_menu_section(menu, addonMenues, section = 'properties')
コード例 #3
0
ファイル: projects.py プロジェクト: D3f0/prymatex
 def extendProjectBundleItemMenu(self, menu, node):
     #Menu de los bundles relacionados al proyecto
     #Try get all bundles for project bundle definition
     bundles = [self.application.supportManager.getManagedObject(uuid) for uuid in node.project().bundleMenu or []]
     #Filter None bundles
     bundles = [bundle for bundle in bundles if bundle is not None]
     #Sort by name
     bundles = sorted(bundles, key=lambda bundle: bundle.name)
     if bundles:
         bundleMenues = [self.application.supportManager.menuForBundle(bundle) for bundle in bundles]
         extend_menu_section(menu, bundleMenues, section = "bundles", position = 0)
コード例 #4
0
 def extendProjectBundleItemMenu(self, menu, node):
     #Menu de los bundles relacionados al proyecto
     #Try get all bundles for project bundle definition
     bundles = map(
         lambda uuid: self.application.supportManager.getManagedObject(uuid
                                                                       ),
         node.project().bundleMenu or [])
     #Filter None bundles
     bundles = filter(lambda bundle: bundle is not None, bundles)
     #Sort by name
     bundles = sorted(bundles, key=lambda bundle: bundle.name)
     if bundles:
         bundleMenues = map(
             lambda bundle: self.application.supportManager.menuForBundle(
                 bundle), bundles)
         extend_menu_section(menu,
                             bundleMenues,
                             section="bundles",
                             position=0)
コード例 #5
0
    def extendFileSystemItemMenu(self, menu, node):
        extend_menu_section(menu, [
            "--open", self.actionOpenSystemEditor, "--handlepaths",
            self.actionDelete, self.actionRename
        ])
        #extend_menu_section(menu, ["--interact", self.actionSetInTerminal ], section = -1)
        # TODO Quiza sea mejor ponerle un type y controlar contra una cadena
        if isinstance(node, ProjectTreeNode):
            extend_menu_section(menu, [self.actionPaste, self.actionRemove],
                                section="handlepaths",
                                position=0)
            #extend_menu_section(menu, [self.actionCloseProject, self.actionOpenProject], section = "refresh")
            #extend_menu_section(menu, [self.actionBashInit], section = "interact")
            extend_menu_section(menu, [self.actionBundleEditor],
                                section="bundles")
        else:
            extend_menu_section(
                menu, [self.actionCut, self.actionCopy, self.actionPaste],
                section="handlepaths",
                position=0)
        if node.isfile:
            extend_menu_section(menu,
                                self.actionOpen,
                                section="open",
                                position=0)

        #El final
        extend_menu_section(menu, ["--properties", self.actionProperties],
                            section=-1)
コード例 #6
0
ファイル: projects.py プロジェクト: D3f0/prymatex
 def extendFileSystemItemMenu(self, menu, node):
     extend_menu_section(menu, ["--open", self.actionOpenSystemEditor, "--handlepaths", self.actionDelete, self.actionRename])
     #extend_menu_section(menu, ["--interact", self.actionSetInTerminal ], section = -1)
     # TODO Quiza sea mejor ponerle un type y controlar contra una cadena
     if isinstance(node, ProjectTreeNode):
         extend_menu_section(menu, [self.actionPaste, self.actionRemove], section = "handlepaths", position = 0)
         #extend_menu_section(menu, [self.actionBashInit], section = "interact")
         extend_menu_section(menu, [self.actionProjectBundles, self.actionSelectRelatedBundles], section = "bundles")
     else:
         extend_menu_section(menu, [self.actionCut, self.actionCopy, self.actionPaste], section = "handlepaths", position = 0)
     if node.isfile:
         extend_menu_section(menu, self.actionOpen, section = "open", position = 0)
     if node.isdir or isinstance(node, ProjectTreeNode):
         extend_menu_section(menu, [self.actionGoDown], section = "refresh")
         
     #El final
     extend_menu_section(menu, ["--properties", self.actionProperties], section = -1)