示例#1
0
 def rename_selected_node(self):
     ''' Opens a dialog box for changing the node name. '''
     if not self.has_selected_item():
         return
     item = self.selected_item()
     node = item.node
     taken_names = [n.get('name') for n in node.getparent().getchildren() if not n is node]
     dialog = RenameDialog(node.get('name'), taken_names, self.view)
     if dialog.exec_() == dialog.Accepted:
         node.set('name', dialog.accepted_name)
    def changeClassModule(self):
        ''' Opens a dialog box for changing the class module. '''
        assert self.has_selected_item()

        item = self.selected_item()
        node = item.node
        dialog = RenameDialog(node.text, [], self.view)
        if dialog.exec_() == dialog.Accepted:
            node.text = dialog.accepted_name
            self.model.make_item_local(item)
    def changePathToTools(self):
        ''' Opens a dialog box for changing the path to tools. '''
        assert self.has_selected_item()

        item = self.selected_item()
        node = item.node
        dialog = RenameDialog(node.text, [], self.view)
        if dialog.exec_() == dialog.Accepted:
            node.text = dialog.accepted_name
            self.model.make_item_local(item)
    def changePathToTools(self):
        """ Opens a dialog box for changing the path to tools. """
        assert self.has_selected_item()

        item = self.selected_item()
        node = item.node
        dialog = RenameDialog(node.text, [], self.view)
        if dialog.exec_() == dialog.Accepted:
            node.text = dialog.accepted_name
            self.model.make_item_local(item)