def edit_connection(self): conn_name = self.cmbConnections.currentText() conn_sett = None if conn_name is not None: conn_sett = PluginSettings.get_ngw_connection(conn_name) dlg = NGWConnectionEditDialog(ngw_connection_settings=conn_sett) if dlg.exec_(): conn_sett = dlg.ngw_connection_settings # if conn was renamed - remove old if conn_name is not None and conn_name != conn_sett.connection_name: PluginSettings.remove_ngw_connection(conn_name) # save new PluginSettings.save_ngw_connection(conn_sett) self.populate_connection_list() del dlg
def delete_connection(self): PluginSettings.remove_ngw_connection(self.cmbConnections.currentText()) self.populate_connection_list()