def __init__(self, iface): QDialog.__init__(self, iface.mainWindow()) self.setupUi(self) self.iface = iface self.notif_bar = NotificationBar(self.vlNotification, 6000) self._apply_btn = self.buttonBox.button(QDialogButtonBox.Apply) self._reg_config = RegistryConfig() self._db_config = DatabaseConfig() #Connect signals self._apply_btn.clicked.connect(self.apply_settings) self.buttonBox.accepted.connect(self.on_accept) self.chk_pg_connections.toggled.connect(self._on_use_pg_connections) self.cbo_pg_connections.currentIndexChanged.connect( self._on_pg_profile_changed) self.btn_db_conn_clear.clicked.connect(self.clear_properties) self.btn_test_db_connection.clicked.connect(self._on_test_connection) self.btn_supporting_docs.clicked.connect( self._on_choose_supporting_docs_path) self.btn_template_folder.clicked.connect( self._on_choose_doc_designer_template_path) self.btn_composer_out_folder.clicked.connect( self._on_choose_doc_generator_output_path) self.upgradeButton.toggled.connect(self.manage_upgrade) self._config = StdmConfiguration.instance() self._default_style_sheet = self.txtRepoLocation.styleSheet() self.manage_upgrade() self.init_gui()
def __init__(self, iface): QDialog.__init__(self, iface.mainWindow()) self.setupUi(self) self.iface = iface self.notif_bar = NotificationBar(self.vlNotification, 6000) self._apply_btn = self.buttonBox.button(QDialogButtonBox.Apply) self._reg_config = RegistryConfig() self._db_config = DatabaseConfig() # Connect signals self._apply_btn.clicked.connect(self.apply_settings) self.buttonBox.accepted.connect(self.on_accept) self.chk_pg_connections.toggled.connect(self._on_use_pg_connections) self.cbo_pg_connections.currentIndexChanged.connect( self._on_pg_profile_changed) self.btn_db_conn_clear.clicked.connect(self.clear_properties) self.btn_test_db_connection.clicked.connect( self._on_test_db_connection) self.btn_template_folder.clicked.connect( self._on_choose_doc_designer_template_path) self.btn_composer_out_folder.clicked.connect( self._on_choose_doc_generator_output_path) self.btn_test_docs_repo_conn.clicked.connect( self._on_test_cmis_connection) self.txt_atom_pub_url.textChanged.connect(self._on_cmis_url_changed) self.btn_holders_conf_file.clicked.connect( self._on_choose_holders_config_file) self._config = StdmConfiguration.instance() self.init_gui()
def acceptdlg(self): """ On user clicking the login button """ isValid = self.validateInput() if isValid: # Set user object self._set_user() # Get mode and corresponding database connection object if not self._test_connect_mode: # Get DB connection dbconfig = DatabaseConfig() dbconn = dbconfig.read() if dbconn is None: msg = QApplication.translate( "loginDlg", "The FLTS database " "connection has not " "been configured in " "your system.\nWould " "you like to configure " "it now?") response = QMessageBox.warning( self, QApplication.translate("LoginDialog", "Database Connection"), msg, QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) if response == QMessageBox.Yes: dbDlg = dbconnDlg(self) if dbDlg.exec_() == QDialog.Accepted: # set the partial database connection properties dbconn = dbDlg.dbconn else: dbconn = self.dbConn # Whatever the outcome of the database settings definition process if dbconn is None: return dbconn.User = self.User # Test connection success, msg = dbconn.validateConnection() if success: self.dbConn = dbconn self.accept() else: QMessageBox.critical( self, QApplication.translate("LoginDialog", "Authentication Failed"), msg) self.txtPassword.setFocus() self.txtPassword.selectAll()
def __init__(self, iface): QDialog.__init__(self, iface.mainWindow()) self.setupUi(self) QgsGui.enableAutoGeometryRestore(self) self.btn_composer_out_folder.setIcon( GuiUtils.get_icon('open_file.png')) self.btn_template_folder.setIcon(GuiUtils.get_icon('open_file.png')) self.btn_supporting_docs.setIcon(GuiUtils.get_icon('open_file.png')) self.iface = iface self.notif_bar = NotificationBar(self.vlNotification, 6000) self._apply_btn = self.buttonBox.button(QDialogButtonBox.Apply) self._reg_config = RegistryConfig() self._db_config = DatabaseConfig() version = version_from_metadata() #upgrade_label_text = self.label_9.text().replace( #'1.4', version.strip() #) #self.label_9.setText(upgrade_label_text) # Connect signals self._apply_btn.clicked.connect(self.apply_settings) self.buttonBox.accepted.connect(self.on_accept) self.chk_pg_connections.toggled.connect(self._on_use_pg_connections) self.cbo_pg_connections.currentIndexChanged.connect( self._on_pg_profile_changed) self.btn_db_conn_clear.clicked.connect(self.clear_properties) self.btn_test_db_connection.clicked.connect(self._on_test_connection) self.btn_supporting_docs.clicked.connect( self._on_choose_supporting_docs_path) self.btn_template_folder.clicked.connect( self._on_choose_doc_designer_template_path) self.btn_composer_out_folder.clicked.connect( self._on_choose_doc_generator_output_path) self._config = StdmConfiguration.instance() self._default_style_sheet = self.txtRepoLocation.styleSheet() #self.upgradeButton.toggled.connect(self.manage_upgrade) #self.manage_upgrade() self.init_gui() self.profile_entity_widget = None self.cache = None self.sort_record_widget = None self.tabWidget.setCurrentIndex(0) self.btnAdd.clicked.connect(self.add_sorting_column) self.init_sorting_widgets(self.cbo_profiles.currentText()) self.cbo_profiles.currentIndexChanged.connect(self.profile_changed)
def __init__(self, iface): QDialog.__init__(self, iface.mainWindow()) self.setupUi(self) self.iface = iface self.notif_bar = NotificationBar(self.vlNotification, 6000) self._apply_btn = self.buttonBox.button(QDialogButtonBox.Apply) self._reg_config = RegistryConfig() self._db_config = DatabaseConfig() version = version_from_metadata() upgrade_label_text = self.label_9.text().replace('1.4', version) self.label_9.setText(upgrade_label_text) #Connect signals self._apply_btn.clicked.connect(self.apply_settings) self.buttonBox.accepted.connect(self.on_accept) self.chk_pg_connections.toggled.connect(self._on_use_pg_connections) self.cbo_pg_connections.currentIndexChanged.connect( self._on_pg_profile_changed) self.btn_db_conn_clear.clicked.connect(self.clear_properties) self.btn_test_db_connection.clicked.connect(self._on_test_connection) self.btn_supporting_docs.clicked.connect( self._on_choose_supporting_docs_path) self.btn_template_folder.clicked.connect( self._on_choose_doc_designer_template_path) self.btn_composer_out_folder.clicked.connect( self._on_choose_doc_generator_output_path) self.upgradeButton.toggled.connect(self.manage_upgrade) self._config = StdmConfiguration.instance() self._default_style_sheet = self.txtRepoLocation.styleSheet() self.manage_upgrade() self.sort_order = OrderedDict() self.sort_order['idasc'] = 'ID - Smallest to Biggest' self.sort_order['iddesc'] = 'ID - Biggest to Smallest' self.sort_order['asc'] = 'Smallest to Biggest' self.sort_order['desc'] = 'Biggest to Smallest' self.init_gui()
def acceptdlg(self): """ On user clicking the login button """ isValid = self.validateInput() if isValid: # Capture DB connection properties host = self.txtHost.text() port = self.txtPort.text() database = self.txtDatabase.text() dbconfig = DatabaseConfig() try: self.dbconn = DatabaseConnection(host, port, database) # Write DB conn object to the registry dbconfig.write(self.dbconn) except Exception as ex: QMessageBox.critical(self, QApplication.translate("DbConnectionDialog", "Error saving settings"), QApplication.translate("DbConnectionDialog", unicode(ex.message))) self.accept()