diff --git a/data/configuration/value_list.py b/data/configuration/value_list.py index 116edc4d..89f477db 100644 --- a/data/configuration/value_list.py +++ b/data/configuration/value_list.py @@ -74,8 +74,8 @@ def __init__(self, name, profile): self.user_editable = False - self.code_column = VarCharColumn('code', self, minimum=0, maximum=5) - self.value_column = VarCharColumn('value', self, minimum=2, maximum=50) + self.code_column = VarCharColumn('code', self, minimum=0, maximum=10) + self.value_column = VarCharColumn('value', self, minimum=2, maximum=100) self.values = OrderedDict() self._hash = hashlib diff --git a/settings/__init__.py b/settings/__init__.py index 7f22562b..470b2587 100755 --- a/settings/__init__.py +++ b/settings/__init__.py @@ -5,7 +5,7 @@ RegistryConfig, ENTITY_BROWSER_RECORD_LIMIT, IMPORT_MAPFILE, - ENUM_COUNTRY, + #Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- ENUM_COUNTRY, TRANS_PATH, MEDIA_URL, KOBO_USER, @@ -102,6 +102,7 @@ def save_import_mapfile(mapfile): reg_config = RegistryConfig() reg_config.write({IMPORT_MAPFILE:mapfile}) +"""Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- Edit Start def save_enum_country(country): reg_config = RegistryConfig() reg_config.write({ENUM_COUNTRY:country}) @@ -111,6 +112,7 @@ def get_enum_country(): enum_country_key = reg_config.read([ENUM_COUNTRY]) enum_country = enum_country_key.get(ENUM_COUNTRY, '') return enum_country +Edit End """ def get_trans_path(): reg_config = RegistryConfig() diff --git a/ui/export_data.py b/ui/export_data.py index ba010e7e..0c7c89aa 100755 --- a/ui/export_data.py +++ b/ui/export_data.py @@ -25,10 +25,11 @@ SIGNAL ) +from stdm.settings import get_primary_mapfile #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) import sqlalchemy from stdm.utils import * -from stdm.utils.util import getIndex +#Edited By strabzounly 03-may-2022 >- Select Custom Tables (Textual) from stdm.utils.util import getIndex from stdm.ui.reports import SqlHighlighter from stdm.data.pg_utils import ( process_report_filter, @@ -36,6 +37,11 @@ unique_column_values, pg_tables ) +from stdm.utils.util import ( #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + getIndex, #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + mapfile_section, #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + ) #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + from stdm.data.importexport.writer import OGRWriter from stdm.data.importexport import ( @@ -175,13 +181,22 @@ def loadSourceTables(self): #Load all STDM tables self.lstSrcTab.clear() # tables = pg_tables() + """Edited By strabzounly 03-may-2022 >- Select Custom Tables (Textual) >- Edit Start tables = profile_user_tables( self.curr_profile, True, True, sort=True ) + Edit End """ + tables = profile_user_tables(self.curr_profile, False, True) #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + primary_mapfile = get_primary_mapfile() #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + dest_tables = mapfile_section(primary_mapfile, 'imports') #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + for t in tables.keys(): + if len(dest_tables) > 0: #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) + if t not in dest_tables.values(): continue #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) tabItem = QListWidgetItem(t,self.lstSrcTab) tabItem.setIcon(QIcon(":/plugins/stdm/images/icons/table.png")) self.lstSrcTab.addItem(tabItem) + self.loadColumns("") #Added By strabzounly 03-may-2022 >- Select Custom Tables (Textual) def setDestFile(self): #Set the file path to the destination file diff --git a/ui/import_data.py b/ui/import_data.py index 8d22305e..356e47b2 100755 --- a/ui/import_data.py +++ b/ui/import_data.py @@ -86,7 +86,7 @@ get_kobo_user, get_kobo_pass, get_save_credit_option, - get_enum_country, + #Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- get_enum_country, get_family_photo, get_sign_photo, get_house_photo, diff --git a/ui/options_base.py b/ui/options_base.py index 3726a829..db3e8ad9 100644 --- a/ui/options_base.py +++ b/ui/options_base.py @@ -44,8 +44,8 @@ save_entity_browser_record_limit, get_primary_mapfile, save_import_mapfile, - save_enum_country, - get_enum_country + #Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- save_enum_country, + #Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- get_enum_country ) from stdm.settings.registryconfig import ( @@ -165,16 +165,20 @@ def init_gui(self): self.edtMapfile.setText(get_primary_mapfile()) + """Edited By strabzounly 03-may-2022 >- Deleted chk_logging >- Edit Start # Debug logging lvl = debug_logging() if lvl: self.chk_logging.setCheckState(Qt.Checked) else: self.chk_logging.setCheckState(Qt.Unchecked) + Edit End """ + """Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- Edit Start self.populate_enum_country() enum_country = get_enum_country() self.cbCountry.setCurrentIndex(self.cbCountry.findText(enum_country)) + Edit End """ def load_profiles(self): """ @@ -186,12 +190,12 @@ def load_profiles(self): self.cbo_profiles.addItem('') self.cbo_profiles.addItems(profile_names) + """Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- Edit Start def populate_enum_country(self): - """ - """ self.cbCountry.clear() self.cbCountry.addItem('Iraq') self.cbCountry.addItem('Lebanon') + Edit End """ def _load_db_conn_properties(self): #Load database connection properties from the registry. @@ -505,6 +509,7 @@ def _restore_stylesheet(self, textbox): if not sender is None: sender.deleteLater() + """Edited By strabzounly 03-may-2022 >- Deleted chk_logging >- Edit Start def apply_debug_logging(self): # Save debug logging logger = logging.getLogger('stdm') @@ -515,6 +520,7 @@ def apply_debug_logging(self): else: logger.setLevel(logging.ERROR) set_debug_logging(False) + Edit End """ def apply_settings(self): """ @@ -543,14 +549,14 @@ def apply_settings(self): if not self.set_document_output_path(): return False - self.apply_debug_logging() + #Edited By strabzounly 03-may-2022 >- Deleted chk_logging >- self.apply_debug_logging() # Set Entity browser record limit save_entity_browser_record_limit(self.edtEntityRecords.value()) save_import_mapfile(self.edtMapfile.text()) - save_enum_country(self.cbCountry.currentText()) + #Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- save_enum_country(self.cbCountry.currentText()) msg = self.tr('Settings successfully saved.') self.notif_bar.insertSuccessNotification(msg) diff --git a/ui/ui_options.py b/ui/ui_options.py index 5f8a89d2..1f3fb9bc 100644 --- a/ui/ui_options.py +++ b/ui/ui_options.py @@ -26,7 +26,7 @@ def _translate(context, text, disambig): class Ui_DlgOptions(object): def setupUi(self, DlgOptions): DlgOptions.setObjectName(_fromUtf8("DlgOptions")) - DlgOptions.resize(626, 612) + DlgOptions.resize(626, 525) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -123,9 +123,13 @@ def setupUi(self, DlgOptions): self.label_9 = QtGui.QLabel(self.scrollAreaWidgetContents) self.label_9.setObjectName(_fromUtf8("label_9")) self.gridLayout_6.addWidget(self.label_9, 3, 0, 1, 1) - self.cbCountry = QtGui.QComboBox(self.scrollAreaWidgetContents) - self.cbCountry.setObjectName(_fromUtf8("cbCountry")) - self.gridLayout_6.addWidget(self.cbCountry, 3, 1, 1, 1) + + + """Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- Edit Start + #self.cbCountry = QtGui.QComboBox(self.scrollAreaWidgetContents) + #self.cbCountry.setObjectName(_fromUtf8("cbCountry")) + #self.gridLayout_6.addWidget(self.cbCountry, 3, 1, 1, 1) + Edit End """ self.gridLayout_5.addLayout(self.gridLayout_6, 7, 0, 1, 5) self.gridLayout_7 = QtGui.QGridLayout() self.gridLayout_7.setHorizontalSpacing(6) @@ -147,9 +151,11 @@ def setupUi(self, DlgOptions): self.upgradeButton = QtGui.QPushButton(self.scrollAreaWidgetContents) self.upgradeButton.setObjectName(_fromUtf8("upgradeButton")) self.gridLayout_5.addWidget(self.upgradeButton, 10, 1, 1, 1) + """Edited By strabzounly 03-may-2022 >- Deleted chk_logging >- Edit Start self.chk_logging = QtGui.QCheckBox(self.scrollAreaWidgetContents) self.chk_logging.setObjectName(_fromUtf8("chk_logging")) self.gridLayout_5.addWidget(self.chk_logging, 9, 0, 1, 1) + Edit End """ self.groupBox = QtGui.QGroupBox(self.scrollAreaWidgetContents) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.gridLayout_3 = QtGui.QGridLayout(self.groupBox) @@ -246,10 +252,10 @@ def retranslateUi(self, DlgOptions): self.btn_supporting_docs.setToolTip(_translate("DlgOptions", "Choose supporting documents directory", None)) self.btn_supporting_docs.setText(_translate("DlgOptions", "...", None)) self.lblMapFile.setText(_translate("DlgOptions", "Root Import Map File:", None)) - self.label_9.setText(_translate("DlgOptions", "Country of Enumeration:", None)) + #Edited By strabzounly 03-may-2022 >- Deleted cbCountry >- self.label_9.setText(_translate("DlgOptions", "Country of Enumeration:", None)) self.label.setText(_translate("DlgOptions", "Set current profile", None)) self.upgradeButton.setText(_translate("DlgOptions", "Upgrade", None)) - self.chk_logging.setText(_translate("DlgOptions", "Debug logging", None)) + #Edited By strabzounly 03-may-2022 >- Deleted chk_logging >- self.chk_logging.setText(_translate("DlgOptions", "Debug logging", None)) self.groupBox.setTitle(_translate("DlgOptions", "Database Properties", None)) self.label_5.setText(_translate("DlgOptions", "

Note: Changes to the database connection properties will only take effect upon the next login

", None)) self.label_3.setText(_translate("DlgOptions", "Port", None))