From 38e09f31828ff1f9bb31b90534c7e3bc18848e04 Mon Sep 17 00:00:00 2001 From: WorldTeacher <41587052+WorldTeacher@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:41:32 +0200 Subject: [PATCH] settings admin check --- src/ui/dialogs/settings.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/ui/dialogs/settings.py b/src/ui/dialogs/settings.py index e6ab045..efb25ac 100644 --- a/src/ui/dialogs/settings.py +++ b/src/ui/dialogs/settings.py @@ -1,20 +1,14 @@ from omegaconf import OmegaConf from PyQt6 import QtCore, QtGui, QtWidgets -from .dialog_sources.Ui_settings import Ui_Dialog as _settings +from .dialog_sources.settings_ui import Ui_Dialog as _settings config = OmegaConf.load("config.yaml") -_style = "" -_style_editable = "{text}" -_italic = " font-style:italic;" -_bold = " font-weight:700;" -_underscore = " text-decoration: underline;" -_text_start = "" -_text_end = "" + class Settings(QtWidgets.QDialog, _settings): - def __init__(self): + def __init__(self,user): super().__init__() self.setupUi(self) self.password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password) @@ -28,6 +22,10 @@ class Settings(QtWidgets.QDialog, _settings): self.font_size.setCurrentText("9") # add button to toggle password visibility + if user == "admin": + self.debug.show() + else: + self.debug.hide() self.showPassword = True self.togglePassword.clicked.connect(self.toggle_password) self.tb_select_db.clicked.connect(self.select_db)