def __init__(self, parent=None):
        """Class Constructor."""
        super(GeoODKConverter, self).__init__(parent)

        # Set up the user interface from Designer.
        # After setupUI you can access any designer object by doing
        # self.<objectname>, and you can use autoconnect slots - see
        # http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
        # #widgets-and-dialogs-with-aut o-connect
        self.connect_action = pyqtSignal(str)
        self.setupUi(self)

        self.chk_all.setCheckState(Qt.Checked)
        self.entity_model = EntitiesModel()
        self.set_entity_model_view(self.entity_model)
        self.stdm_config = None
        self.parent = parent
        self.load_profiles()
        self.check_state_on()

        self.check_geoODK_path_exist()

        self.chk_all.stateChanged.connect(self.check_state_on)
        self.btnShowOutputFolder.clicked.connect(self.onShowOutputFolder)
        # self.btn_upload.clicked.connect(self.upload_generated_form)

        self._notif_bar_str = NotificationBar(self.vlnotification)
Beispiel #2
0
    def __init__(self, parent, source_cols, dest_table, dest_col, src_col):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        TranslatorDialogBase.__init__(self, source_cols, dest_table, dest_col,
                                      src_col)

        self._notif_bar = NotificationBar(self.vlNotification)

        #Assert if the entity supports documents
        self._assert_entity_supports_documents()

        #Set the source document directory
        self.source_document_directory = None

        #Document type name
        self._document_type_name = self._dest_col

        #Document type ID
        self._document_type_id = None

        #Set document type ID
        self._set_document_type_id()

        #Connect slots
        self.btn_source_doc_folder.clicked.connect(
            self._load_source_document_directory_selector)
Beispiel #3
0
    def initGui(self):
        '''
        Initialize GUI
        '''
        # Change the name of the OK button to Login
        btnLogin = self.btnBox.button(QDialogButtonBox.Ok)

        if self._test_connect_mode:
            btnLogin.setText(QApplication.translate("LoginDialog", "Test"))
            self.setWindowTitle(
                QApplication.translate("LoginDialog", "STDM Database "
                                       "Connection"))
            self.btn_db_settings.setVisible(False)

        else:
            btnLogin.setText(QApplication.translate("LoginDialog", "Login"))
            self.btn_db_settings.setVisible(True)

        # Connect slots
        self.btn_db_settings.clicked.connect(self.settingsDialog)
        self.btnBox.accepted.connect(self.acceptdlg)

        # Configure notification bar
        self.notifBar = NotificationBar(self.vlNotification)

        if self._test_connect_mode:
            self.txtUserName.setFocus()

        else:
            self.txtUserName.setText('postgres')
            self.txtPassword.setFocus()
Beispiel #4
0
    def __init__(self, parent, lookup_entity_name, profile=None):
        """
        Initializes LookupValueSelector.
        :param parent: The parent of the dialog.
        :type parent: QWidget
        :param lookup_entity_name: The lookup entity name
        :type lookup_entity_name: String
        :param profile: The current profile object
        :type profile: Object
        """
        QDialog.__init__(self, parent,
                         Qt.WindowTitleHint | Qt.WindowCloseButtonHint)
        self.setupUi(self)
        self.value_and_code = None
        if profile is None:
            self._profile = current_profile()
        else:
            self._profile = profile

        self.lookup_entity = self._profile.entity_by_name('{}_{}'.format(
            self._profile.prefix, lookup_entity_name))

        self.notice = NotificationBar(self.notice_bar)
        self._view_model = QStandardItemModel()
        self.value_list_box.setModel(self._view_model)
        header_item = QStandardItem(lookup_entity_name)
        self._view_model.setHorizontalHeaderItem(0, header_item)
        self.populate_value_list_view()

        self.selected_code = None
        self.selected_value_code = None

        self.value_list_box.clicked.connect(self.validate_selected_code)
Beispiel #5
0
    def __init__(self, frame_item, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        if isinstance(frame_item, QgsLayoutFrame):
            self._composer_table_item = frame_item.multiFrame()
        else:
            self._composer_table_item = frame_item
        self._layout = self._composer_table_item.layout()

        self._notif_bar = NotificationBar(self.vl_notification)

        # Load fields if the data source has been specified
        ds_name = LayoutUtils.get_stdm_data_source_for_layout(self._layout)
        self.ref_table.load_data_source_fields(ds_name)

        # Load source tables
        self.ref_table.load_link_tables()

        self.ref_table.set_layout(self._layout)

        # self.ref_table.cbo_ref_table.currentIndexChanged[str].connect(self.set_table_vector_layer)

        self.ref_table.cbo_ref_table.currentIndexChanged[str].connect(
            self.set_table_vector_layer)

        layer_name = self.current_table_layer_name()
        idx = self.ref_table.cbo_ref_table.findText(layer_name)
        self.ref_table.cbo_ref_table.setCurrentIndex(idx)
Beispiel #6
0
    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()
Beispiel #7
0
    def __init__(self, parent=None, **kwargs):
        super(ImageExportSettings, self).__init__(parent)
        self.setupUi(self)

        self.btn_path.setIcon(GuiUtils.get_icon('open_file.png'))

        self._image_tr = self.tr('Image')

        self.notif_bar = NotificationBar(self.vl_notification, 6000)

        # Connect signals
        self.btn_path.clicked.connect(self._on_choose_image_path)
        self.buttonBox.accepted.connect(self.on_accept)
        self.sb_resolution.valueChanged.connect(self._on_resolution_changed)

        # Set color button defaults
        self._default_color = Qt.white
        self.btn_color.setDefaultColor(self._default_color)
        self.btn_color.setColor(self._default_color)
        self.btn_color.setAllowOpacity(True)

        self.path = kwargs.get('image_path', '')
        self.resolution = kwargs.get('resolution', '96')
        self.background_color = kwargs.get('background', Qt.transparent)

        self._update_controls()
Beispiel #8
0
    def __init__(self, model, entity):
        '''
        :param model: Callable (new instances) or instance (existing instance
        for updating) of STDM model.
        '''
        if callable(model):
            self._model = model()
            self._mode = SAVE
        else:
            self._model = model
            self._mode = UPDATE
        self.entity = entity
        self._attrMappers = []
        self._attr_mapper_collection = {}
        self._dirtyTracker = ControlDirtyTrackerCollection()
        self._notifBar = None
        self.is_valid = False
        self.saved_model = None

        # Get document objects

        self.entity_model = entity_model(entity)

        self.entity_model_obj = self.entity_model()
        #Initialize notification bar
        if hasattr(self, "vlNotification"):
            self._notifBar = NotificationBar(self.vlNotification)
Beispiel #9
0
    def __init__(self, item: StdmPhotoLayoutItem, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self._layout = item.layout()
        self._item = item

        self._notif_bar = NotificationBar(self.vl_notification)

        self._curr_profile = current_profile()

        # Load fields if the data source has been specified
        ds_name = LayoutUtils.get_stdm_data_source_for_layout(self._layout)
        self.ref_table.load_data_source_fields(ds_name)

        # Base document table in the current profile
        self._base_document_table = self._curr_profile.supporting_document.name

        # Add it to the list of tables to omit
        self.ref_table.add_omit_table(self._base_document_table)
        '''
        Load referenced table list and filter so to only load supporting
        doc tables.
        '''
        self.ref_table.load_link_tables(supporting_doc_tables_regexp())

        self.ref_table.set_layout(self._layout)

        self.ref_table.cbo_ref_table.currentIndexChanged[str].connect(
            self.update_document_types)

        self.set_from_item()

        self.ref_table.changed.connect(self._item_changed)
        self.cbo_document_type.currentTextChanged.connect(self._item_changed)
Beispiel #10
0
    def __init__(self, parent=None):
        """
        initailize class variables here
        """
        super(ProfileInstanceRecords, self).__init__(parent)
        self.setupUi(self)

        self.path = None
        self.instance_list = []
        self.relations = OrderedDict()
        self.parent_ids = {}
        self.importlogger = ImportLogger()
        self._notif_bar_str = NotificationBar(self.vlnotification)

        self.chk_all.setCheckState(Qt.Checked)
        self.entity_model = EntitiesModel()
        self.uuid_extractor = InstanceUUIDExtractor(self.path)
        self.btn_chang_dir.setIcon(GuiUtils.get_icon("open_file.png"))
        self.btn_refresh.setIcon(GuiUtils.get_icon("update.png"))

        self.chk_all.stateChanged.connect(self.change_check_state)
        # self.cbo_profile.currentIndexChanged.connect(self.current_profile_changed)
        self.btn_chang_dir.clicked.connect(self.on_directory_search)
        self.lst_widget.itemClicked.connect(self.user_selected_entities)
        self.btn_refresh.clicked.connect(self.update_files_with_custom_filter)

        self.buttonBox.button(QDialogButtonBox.Save).setText('Import')

        # self.load_config()
        self.init_file_path()
        self.current_profile_changed()
        self.change_check_state(self.chk_all.checkState())
        self.instance_dir()
Beispiel #11
0
    def __init__(self, dir, doc_types, parent=None, filters=None):
        super(DirDocumentTypeSelector, self).__init__(parent)
        self.setWindowTitle(
            self.tr('Documents in Folder')
        )
        self._filters = filters
        # Use PDF as default filter
        if not self._filters:
            self._filters = ['*.pdf']

        self._init_ui()
        self._dir = QDir(dir)
        self._dir.setNameFilters(self._filters)
        self._doc_types = doc_types

        self._attr_model = QStandardItemModel(self)
        self._sel_doc_types = OrderedDict()

        # Notification bar
        self._notif_bar = NotificationBar(self.vl_notif)

        self.resize(320, 350)

        # Load documents
        self.load_document_types()
Beispiel #12
0
    def __init__(self, composer_wrapper, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self._composer_wrapper = composer_wrapper

        self._notif_bar = NotificationBar(self.vl_notification)

        self.cbo_chart_type.currentIndexChanged[int].connect(self._on_chart_type_changed)

        '''
        Register chartname to the positional index of the corresponding editor
        '''
        self._short_name_idx = {}

        # Add registered chart types
        self._load_chart_type_settings()

        # Load legend positions
        self._load_legend_positions()

        self.groupBox_2.setCollapsed(True)
        self.groupBox_2.collapsedStateChanged.connect(self._on_series_properties_collapsed)

        # Load fields if the data source has been specified
        ds_name = self._composer_wrapper.selectedDataSource()
        self.ref_table.load_data_source_fields(ds_name)

        # Load referenced table list
        self.ref_table.load_link_tables()

        # Connect signals
        self._composer_wrapper.dataSourceSelected.connect(self.ref_table.on_data_source_changed)
        self.ref_table.referenced_table_changed.connect(self.on_referenced_table_changed)
Beispiel #13
0
    def __init__(self, model=None, entity=None, parent=None):
        """
        :param model: Callable (new instances) or instance (existing instance
        for updating) of STDM model.
        """
        super().__init__(parent)
        if callable(model):
            self._model = model()
            self._mode = SAVE
        else:
            self._model = model
            self._mode = UPDATE
        self.entity = entity
        self._attrMappers = []
        self._attr_mapper_collection = {}
        self._dirtyTracker = ControlDirtyTrackerCollection()
        self._notifBar = None
        self.is_valid = False
        self.saved_model = None

        # Get document objects

        self.entity_model = entity_model(entity)

        self.entity_model_obj = self.entity_model()

        # Flag to indicate whether to close the widget or dialog once model has been submitted
        # self.closeOnSubmit = True

        # Initialize notification bar
        if hasattr(self, "vlNotification"):
            self._notifBar = NotificationBar(self.vlNotification)
    def __init__(self, parent=None):
        """
        initailize class variables here
        """
        super(ProfileInstanceRecords, self).__init__(parent)
        self.setupUi(self)

        self.path = None
        self.instance_list = []
        self.relations = {}
        self.parent_ids = {}
        self.importlogger = ImportLogger()
        self._notif_bar_str = NotificationBar(self.vlnotification)

        self.chk_all.setCheckState(Qt.Checked)
        self.entity_model = EntitiesModel()
        self.uuid_extractor = InstanceUUIDExtractor(self.path)
        self.btn_chang_dir.setIcon(
            QIcon(":/plugins/stdm/images/icons/open_file.png"))
        self.btn_refresh.setIcon(
            QIcon(":/plugins/stdm/images/icons/update.png"))
        self.btn_srid.setIcon(QIcon(":/plugins/stdm/images/icons/edit24.png"))

        self.chk_all.stateChanged.connect(self.check_state_on)
        #self.cbo_profile.currentIndexChanged.connect(self.current_profile_changed)
        self.btn_chang_dir.clicked.connect(self.on_directory_search)
        self.lst_widget.itemClicked.connect(self.user_selected_entities)
        self.btn_srid.clicked.connect(self.projection_settings)
        self.btn_refresh.clicked.connect(self.update_files_with_custom_filter)

        #self.load_config()
        self.on_filepath()
        self.current_profile_changed()
        self.check_state_on()
        self.instance_dir()
Beispiel #15
0
    def __init__(self, parent, lookup_entity_name, profile=None):
        """

        """
        QDialog.__init__(self, parent, Qt.WindowTitleHint|Qt.WindowCloseButtonHint)
        self.setupUi(self)
        self.value_and_code = None
        if profile is None:
            self._profile = current_profile()
        else:
            self._profile = profile

        self.lookup_entity = self._profile.entity_by_name(
            '{}_{}'.format(self._profile.prefix, lookup_entity_name)
        )

        self.notice = NotificationBar(self.notice_bar)
        self._view_model = QStandardItemModel()
        self.value_list_box.setModel(self._view_model)
        header_item = QStandardItem(lookup_entity_name)
        self._view_model.setHorizontalHeaderItem(0, header_item)
        self.populate_value_list_view()

        self.selected_code = None
        self.selected_value_code = None

        self.value_list_box.clicked.connect(self.validate_selected_code)
Beispiel #16
0
    def __init__(self, composer_wrapper, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self._composer_wrapper = composer_wrapper

        self._notif_bar = NotificationBar(self.vl_notification)

        self._curr_profile = current_profile()

        # Load fields if the data source has been specified
        ds_name = self._composer_wrapper.selectedDataSource()
        self.ref_table.load_data_source_fields(ds_name)

        # Base document table in the current profile
        self._base_document_table = self._curr_profile.supporting_document.name

        # Add it to the list of tables to omit
        self.ref_table.add_omit_table(self._base_document_table)

        '''
        Load referenced table list and filter so to only load supporting
        doc tables.
        '''
        self.ref_table.load_link_tables(supporting_doc_tables_regexp())

        # Connect signals
        self._composer_wrapper.dataSourceSelected.connect(self.ref_table.on_data_source_changed)
        self.ref_table.cbo_ref_table.currentIndexChanged[str].connect(
            self.update_document_types
        )
Beispiel #17
0
    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()
Beispiel #18
0
    def __init__(self, parent):
        QDialog.__init__(self, parent)

        self.profile_name = ''
        self.desc = ''

        self.setupUi(self)
        self.init_controls()
        self.notice_bar = NotificationBar(self.notif_bar)
Beispiel #19
0
    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)
Beispiel #20
0
    def __init__(self, parent, source_cols, dest_table, dest_col, src_col):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        TranslatorDialogBase.__init__(self, source_cols, dest_table, dest_col,
                                      src_col)

        self._notif_bar = NotificationBar(self.vl_notification)

        # Populate controls
        self._load_lookup_tables()

        # Connect signals
        self.cbo_lookup.currentIndexChanged.connect(
            self._on_lookup_table_name_changed)
    def __init__(self, parent, source_cols, dest_table, dest_col, src_col):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        TranslatorDialogBase.__init__(self, source_cols, dest_table, dest_col, src_col)

        self._notif_bar = NotificationBar(self.vl_notification)

        # Container of column names for an enumeration table
        self._enum_col_names = []

        self._load_separators()

        # Init user selection to the corresponding UI controls
        self.txt_source_col.setText(self._src_col)
Beispiel #22
0
    def __init__(self, iface, access_templates, parent=None, plugin=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)

        self.btnSelectTemplate.setIcon(GuiUtils.get_icon('document.png'))

        self._iface = iface
        self.plugin = plugin
        self._docTemplatePath = ""
        self._outputFilePath = ""
        self.curr_profile = current_profile()
        self.last_data_source = None
        self._config_mapping = OrderedDict()

        self._notif_bar = NotificationBar(self.vlNotification)

        self._doc_generator = DocumentGenerator(self._iface, self)

        self._data_source = ""

        self.access_templates = access_templates

        enable_drag_sort(self.lstDocNaming)

        # Configure generate button
        generateBtn = self.buttonBox.button(QDialogButtonBox.Ok)
        if not generateBtn is None:
            generateBtn.setText(
                QApplication.translate("DocumentGeneratorDialog", "Generate"))

        # Load supported image types
        supportedImageTypes = QImageWriter.supportedImageFormats()
        for imageType in supportedImageTypes:
            imageTypeStr = imageType.data().decode()
            self.cboImageType.addItem(imageTypeStr)

        self._init_progress_dialog()
        # Connect signals
        self.btnSelectTemplate.clicked.connect(self.onSelectTemplate)
        self.buttonBox.accepted.connect(self.onGenerate)
        self.chkUseOutputFolder.stateChanged.connect(
            self.onToggledOutputFolder)
        self.rbExpImage.toggled.connect(self.onToggleExportImage)
        self.tabWidget.currentChanged.connect(self.on_tab_index_changed)
        self.chk_template_datasource.stateChanged.connect(
            self.on_use_template_datasource)

        self.btnShowOutputFolder.clicked.connect(self.onShowOutputFolder)
Beispiel #23
0
    def __init__(self, **kwargs):
        """
        :param parent: Owner of this dialog
        :param profile : current profile
        :param entity : current entity
        :param in_db : Boolean flag to check if entity exist in database
        """
        self.form_parent = kwargs.get('parent', self)
        self.profile = kwargs.get('profile', None)
        self.entity = kwargs.get('entity', None)
        self.in_db = kwargs.get('in_db', False)

        QDialog.__init__(self, self.form_parent)
        self.setupUi(self)
        self.notice_bar = NotificationBar(self.notif_bar)
        self.init_gui_controls()
Beispiel #24
0
    def __init__(self, parent, lookup, code_value=None):
        """
        :param parent: Owner of this dialog window
        :type parent: QWidget
        :param lookup: A value list object to add the value
        :type lookup: ValueList
        :param code_value: A value object to add to the lookup,
        if None this is a new value, else its an edit.
        :type code_value: CodeValue
        """
        QDialog.__init__(self, parent)
        self.setupUi(self)

        self.lookup = lookup
        self.code_value = code_value
        self.notice_bar = NotificationBar(self.notif_bar)
        self.init_gui()
Beispiel #25
0
    def __init__(self, item: StdmChartLayoutItem, parent=None):
        super().__init__(parent)
        self.setupUi(self)

        self._item = item
        self._layout = item.layout()

        self._notif_bar = NotificationBar(self.vl_notification)

        self.cbo_chart_type.currentIndexChanged[int].connect(
            self._on_chart_type_changed)

        # Register chartname to the positional index of the corresponding editor
        self._short_name_idx = {}

        # Add registered chart types
        self._load_chart_type_settings()

        # Load legend positions
        self._load_legend_positions()

        self.groupBox_2.setCollapsed(True)
        self.groupBox_2.collapsedStateChanged.connect(
            self._on_series_properties_collapsed)

        # Load fields if the data source has been specified
        ds_name = LayoutUtils.get_stdm_data_source_for_layout(self._layout)
        self.ref_table.load_data_source_fields(ds_name)

        # Load referenced table list
        self.ref_table.load_link_tables()

        self.ref_table.set_layout(self._layout)

        self.set_from_item()

        # Connect signals
        self.ref_table.referenced_table_changed.connect(
            self.on_referenced_table_changed)

        self.ref_table.changed.connect(self._item_changed)
        self.cbo_chart_type.currentIndexChanged.connect(self._item_changed)
        self.txt_plot_title.textChanged.connect(self._item_changed)
        self.gb_legend.toggled.connect(self._item_changed)
        self.cbo_legend_pos.currentIndexChanged.connect(self._item_changed)
Beispiel #26
0
 def __init__(self,model):
     '''
     :param model: Callable (new instances) or instance (existing instance for updating) of STDM model.
     '''
     if callable(model):
         self._model = model()
         self._mode = SAVE
     else:
         self._model = model
         self._mode = UPDATE
     
     self._attrMappers = []
     self._dirtyTracker = ControlDirtyTrackerCollection()
     self._notifBar = None
     
     #Initialize notification bar
     if hasattr(self,"vlNotification"):
         self._notifBar = NotificationBar(self.vlNotification)
Beispiel #27
0
    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()
Beispiel #28
0
    def __init__(self, parent, source_cols, dest_table, dest_col, src_col):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        TranslatorDialogBase.__init__(self, source_cols, dest_table, dest_col,
                                      src_col)

        self._notif_bar = NotificationBar(self.vl_notification)

        self._set_source_table_headers()

        #Set UI values
        self.txt_table_name.setText(dest_table)
        self.txt_column_name.setText(dest_col)

        #Load STDM tables exluding views
        self._load_tables()

        #Connect signals
        self.cbo_source_tables.currentIndexChanged.connect(
            self._on_source_table_changed)
Beispiel #29
0
    def __init__(self, composer_wrapper, frame_item, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self._composer_wrapper = composer_wrapper
        if isinstance(frame_item, QgsComposerFrame):
            self._composer_table_item = frame_item.multiFrame()
        else:
            self._composer_table_item = frame_item

        self._notif_bar = NotificationBar(self.vl_notification)

        # Load fields if the data source has been specified
        ds_name = self._composer_wrapper.selectedDataSource()
        self.ref_table.load_data_source_fields(ds_name)

        # Load source tables
        self.ref_table.load_link_tables()

        # Connect signals
        self._composer_wrapper.dataSourceSelected.connect(self.ref_table.on_data_source_changed)
Beispiel #30
0
    def __init__(self, parent, profile, lookup=None):
        """
        :param parent: Owner of this dialog
        :type parent: QWidget
        :param profile: A profile to add/edit lookup
        :type profile: Profile
        :type inplace: Flag to check if lookup creation is initiated from the
                       'normal' lookup creation process -inplace = False,
                       this is the normal state. If 'inplace' = True, then
                       creation is initiated from the the lookup selection dialog
        :param lookup: Value list to create, if None this is a new value list
         else its an edit
        :type lookup: ValueList
        """
        QDialog.__init__(self, parent)
        self.setupUi(self)

        self.profile = profile
        self.lookup = lookup
        self.notice_bar = NotificationBar(self.notif_bar)
        self.init_gui()