settings admin check
This commit is contained in:
@@ -1,20 +1,14 @@
|
|||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
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")
|
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):
|
class Settings(QtWidgets.QDialog, _settings):
|
||||||
def __init__(self):
|
def __init__(self,user):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
|
self.password.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
|
||||||
@@ -28,6 +22,10 @@ class Settings(QtWidgets.QDialog, _settings):
|
|||||||
|
|
||||||
self.font_size.setCurrentText("9")
|
self.font_size.setCurrentText("9")
|
||||||
# add button to toggle password visibility
|
# add button to toggle password visibility
|
||||||
|
if user == "admin":
|
||||||
|
self.debug.show()
|
||||||
|
else:
|
||||||
|
self.debug.hide()
|
||||||
self.showPassword = True
|
self.showPassword = True
|
||||||
self.togglePassword.clicked.connect(self.toggle_password)
|
self.togglePassword.clicked.connect(self.toggle_password)
|
||||||
self.tb_select_db.clicked.connect(self.select_db)
|
self.tb_select_db.clicked.connect(self.select_db)
|
||||||
|
|||||||
Reference in New Issue
Block a user