mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
simple version of user role in settings gui
This commit is contained in:
parent
537da30414
commit
cfbe04d536
2 changed files with 16 additions and 8 deletions
|
|
@ -11,8 +11,16 @@ if __name__ == "__main__":
|
||||||
app.setStyleSheet(stylesheet)
|
app.setStyleSheet(stylesheet)
|
||||||
app.setWindowIcon(QtGui.QIcon(settings.style.app_icon_path()))
|
app.setWindowIcon(QtGui.QIcon(settings.style.app_icon_path()))
|
||||||
|
|
||||||
develop = "-d" in sys.argv or "--develop" in sys.argv
|
_develop = "-d" in sys.argv or "--develop" in sys.argv
|
||||||
widget = settings.MainWidget(develop)
|
_user = "-m" in sys.argv or "--manager" in sys.argv
|
||||||
|
if _develop:
|
||||||
|
user_role = "developer"
|
||||||
|
elif _user:
|
||||||
|
user_role = "manager"
|
||||||
|
else:
|
||||||
|
user_role = "artist"
|
||||||
|
|
||||||
|
widget = settings.MainWidget(user_role)
|
||||||
widget.show()
|
widget.show()
|
||||||
|
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ class SystemWidget(QtWidgets.QWidget):
|
||||||
is_group = _is_group = False
|
is_group = _is_group = False
|
||||||
any_parent_is_group = _any_parent_is_group = False
|
any_parent_is_group = _any_parent_is_group = False
|
||||||
|
|
||||||
def __init__(self, develop_mode, parent=None):
|
def __init__(self, user_role, parent=None):
|
||||||
super(SystemWidget, self).__init__(parent)
|
super(SystemWidget, self).__init__(parent)
|
||||||
|
|
||||||
self.develop_mode = develop_mode
|
self.user_role = user_role
|
||||||
self._hide_studio_overrides = False
|
self._hide_studio_overrides = False
|
||||||
self._ignore_value_changes = False
|
self._ignore_value_changes = False
|
||||||
|
|
||||||
|
|
@ -68,7 +68,7 @@ class SystemWidget(QtWidgets.QWidget):
|
||||||
footer_widget = QtWidgets.QWidget()
|
footer_widget = QtWidgets.QWidget()
|
||||||
footer_layout = QtWidgets.QHBoxLayout(footer_widget)
|
footer_layout = QtWidgets.QHBoxLayout(footer_widget)
|
||||||
|
|
||||||
if self.develop_mode:
|
if self.user_role == "developer":
|
||||||
save_as_default_btn = QtWidgets.QPushButton("Save as Default")
|
save_as_default_btn = QtWidgets.QPushButton("Save as Default")
|
||||||
save_as_default_btn.clicked.connect(self._save_as_defaults)
|
save_as_default_btn.clicked.connect(self._save_as_defaults)
|
||||||
|
|
||||||
|
|
@ -415,10 +415,10 @@ class ProjectWidget(QtWidgets.QWidget):
|
||||||
is_group = _is_group = False
|
is_group = _is_group = False
|
||||||
any_parent_is_group = _any_parent_is_group = False
|
any_parent_is_group = _any_parent_is_group = False
|
||||||
|
|
||||||
def __init__(self, develop_mode, parent=None):
|
def __init__(self, user_role, parent=None):
|
||||||
super(ProjectWidget, self).__init__(parent)
|
super(ProjectWidget, self).__init__(parent)
|
||||||
|
|
||||||
self.develop_mode = develop_mode
|
self.user_role = user_role
|
||||||
self._hide_studio_overrides = False
|
self._hide_studio_overrides = False
|
||||||
|
|
||||||
self.is_overidable = False
|
self.is_overidable = False
|
||||||
|
|
@ -445,7 +445,7 @@ class ProjectWidget(QtWidgets.QWidget):
|
||||||
footer_widget = QtWidgets.QWidget()
|
footer_widget = QtWidgets.QWidget()
|
||||||
footer_layout = QtWidgets.QHBoxLayout(footer_widget)
|
footer_layout = QtWidgets.QHBoxLayout(footer_widget)
|
||||||
|
|
||||||
if self.develop_mode:
|
if self.user_role == "developer":
|
||||||
save_as_default_btn = QtWidgets.QPushButton("Save as Default")
|
save_as_default_btn = QtWidgets.QPushButton("Save as Default")
|
||||||
save_as_default_btn.clicked.connect(self._save_as_defaults)
|
save_as_default_btn.clicked.connect(self._save_as_defaults)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue