ui, prefs: fixed loading nodes if no langs available

Don't fail loading nodes if there're no languages available.
This commit is contained in:
Gustavo Iñiguez Goia 2023-03-23 23:49:13 +01:00
parent 816496ae72
commit 75cacf3530
Failed to generate hash of commit

View file

@ -131,7 +131,7 @@ class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
self._reset_node_settings()
self._set_status_message(QC.translate("preferences", "There're no nodes connected"))
except Exception as e:
print(self.LOG_TAG + "exception loading nodes", e)
print(self.LOG_TAG + "exception loading nodes:", e)
self._load_settings()
@ -158,6 +158,7 @@ class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
self.tabWidget.setCurrentIndex(self.TAB_NODES)
def _load_langs(self):
try:
self.comboUILang.clear()
self.comboUILang.blockSignals(True)
self.comboUILang.addItem(QC.translate("preferences", "System default"), "")
@ -165,6 +166,8 @@ class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
for idx, lang in enumerate(langs):
self.comboUILang.addItem(langNames[idx].capitalize(), langs[idx])
self.comboUILang.blockSignals(False)
except Exception as e:
print(self.LOG_TAG + "exception loading languages:", e)
def _load_themes(self):
self.comboUITheme.blockSignals(True)