settings admin check

This commit is contained in:
WorldTeacher
2024-06-04 16:41:32 +02:00
parent d54d29261c
commit 38e09f3182

View File

@@ -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 = "<span style={style}>"
_style_editable = "<span style={style}>{text}</span>"
_italic = " font-style:italic;"
_bold = " font-weight:700;"
_underscore = " text-decoration: underline;"
_text_start = "<span>"
_text_end = "</span>"
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)