예제 #1
0
 def initUi(self):
     """
         Initialize UI.
     """
     GroupDialog.initUi(self)
     
     self.setWindowTitle(QtCore.QString.fromUtf8(tr("Edit group")) + ": " + QtCore.QString.fromUtf8(tr(self.__group._name)))
예제 #2
0
    def __add_group(self, button):
        dialog = GroupDialog()
        result = dialog.prompt()
        if result is None:
            return

        self.__quick_menu.add_group(result)
        self.__build_store()
예제 #3
0
 def initUi(self):
     """
         Initialize UI components
     """
     # first call parent initialization.
     GroupDialog.initUi(self)
     
     self.setWindowTitle(tr("Add new group"))
예제 #4
0
    def __edit(self, button):
        result = self.__get_selection()
        if result is None:
            return

        selection, depth = result

        # group
        if depth == 0:
            group_name = self.__store[selection][5]
            if group_name == '':
                return
            dialog = GroupDialog(group_name)
            result = dialog.prompt()
            if result is None:
                return
            self.__quick_menu.edit_group(group_name, result)

        # ssh entry
        elif depth == 1:
            group_name = self.__store[self.__store.iter_parent(selection)][5]
            host = self.__store[selection]
            host_id = host[0]
            host_username = host[1]
            host_hostname = host[2]
            host_port = host[3]
            host_label = host[4]

            dialog = HostDialog(self.__quick_menu.groups.keys(), host_username, host_hostname, host_port, host_label, group_name)
            result = dialog.prompt()

            if result is None:
                return
            new_group_name, hostname, username, port, label = result
            self.__quick_menu.edit_host(group_name, new_group_name, host_id, username, hostname, port, label)

        self.__build_store()