def _add_backend_triggered(self): """Create and show the add backend dialog""" diag = AddBackendDialog(self) if (diag.exec_()): ssh_tunnel = None if (diag.checkBox.isChecked()): ssh_tunnel = diag.ssh.text() ds = DataSource(self, diag.hostname.text(), diag.port.value(), ssh_tunnel) logging.debug("Adding new data source '%s'", ds.name())
def _add_backend_triggered(self): """Create and show the add backend dialog""" diag = AddBackendDialog(self) if(diag.exec_()): ssh_tunnel = None if(diag.checkBox.isChecked()): ssh_tunnel = diag.ssh.text() ds = DataSource(self, diag.hostname.text(), diag.port.value(), ssh_tunnel) logging.debug("Adding new data source '%s'", ds.name())
def _init_data_sources(self, settings): """Restore data sources from the settings.""" loaded_sources = [] pd_settings = [] if(settings.contains("plotData") and settings.value("plotData") is not None): pd_settings = settings.value("plotData") if(settings.contains("dataSources") and settings.value("dataSources") is not None): for ds in settings.value("dataSources"): ds = DataSource(self, ds[0], ds[1], ds[2]) ds.restore_state(pd_settings) loaded_sources.append(ds) logging.debug("Loaded data source '%s' from settings", ds.name()) return loaded_sources