Esempio n. 1
0
 def setupHistoryMenu(self):
     if tmsettings.value("recentConnections"):
         self.menu_history.setEnabled(True)
         for connection_dict in tmsettings.value("recentConnections"):
             action = QtWidgets.QAction(connection_dict["url"], self.menu_history)
             action.triggered.connect(partial(self.openConnection, connection_dict))
             self.menu_history.addAction(action)
     else:
         self.menu_history.setEnabled(False)
Esempio n. 2
0
    def setupSplitters(self):
        if tmsettings.value("consoleSplitterSize"):
            self.consoleSplitter.restoreState(tmsettings.value("consoleSplitterSize"))
        else:
            self.consoleSplitter.setSizes([self.height() - 200, 200])

        if tmsettings.value("treeViewSplitterSize"):
            self.treeViewSplitter.restoreState(tmsettings.value("treeViewSplitterSize"))
        else:
            self.treeViewSplitter.setSizes([200, self.width() - 200])
Esempio n. 3
0
    def save_connection(self):
        connection_dict = {
            "url": self.serverUrl.text(),
            "ws_url": self.socketsUrl.text(),
            "username": self.adminUsername.text(),
            "password": self.adminPassword.text()
        }

        if tmsettings.value("recentConnections"):
            history_list = tmsettings.value("recentConnections")
            if not connection_dict in history_list:
                history_list.append(connection_dict)
                tmsettings.setValue("recentConnections", history_list)
        else:
            tmsettings.setValue("recentConnections", [connection_dict])
Esempio n. 4
0
    def save_connection(self):
        connection_dict = {
            "url" : self.serverUrl.text(),
            "ws_url": self.socketsUrl.text(),
            "username": self.adminUsername.text(),
            "password": self.adminPassword.text() 
        }

        if tmsettings.value("recentConnections"):
            history_list = tmsettings.value("recentConnections")
            if not connection_dict in history_list:
                history_list.append(connection_dict)
                tmsettings.setValue("recentConnections", history_list)
        else:
            tmsettings.setValue("recentConnections", [connection_dict])