def on_btn_edit_clicked(self, btn): # Get the ID of selected Connection tree = self.builder.get_object("connections_tree") # Get the selection (model, treeiter) = tree.get_selection().get_selected_rows() # Get the connection ID if model is not None and len(treeiter) > 0: # Get the ID connection_id = model[treeiter][1] # Load the Connection connection = Connection() connection.id = connection_id connection.load() connection.load_tunnels() # Open the Window with the connection ConnectionWindow(self.refresh_connections_list, connection)
def on_btn_connect_clicked(self, btn): # Get the selected ID tree = self.builder.get_object("connections_tree") # Get the selection (model, treeiter) = tree.get_selection().get_selected_rows() # Get the connection ID if model is not None and len(treeiter) > 0: # Get the ID connection_id = model[treeiter][1] # Load the Model connection = Connection() connection.id = connection_id connection.load() # Get the SSH Command command = connection.generate_ssh_command() # Open the Shell shell = Shell(command, connection.name) shell.run()