mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
muster is not using Qt until tray_init is triggered
This commit is contained in:
parent
d8eec091c3
commit
4785cf26c4
1 changed files with 13 additions and 16 deletions
|
|
@ -1,10 +1,7 @@
|
||||||
import appdirs
|
|
||||||
from avalon import style
|
|
||||||
from Qt import QtWidgets
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from .widget_login import MusterLogin
|
import appdirs
|
||||||
from avalon.vendor import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
class MusterModule:
|
class MusterModule:
|
||||||
|
|
@ -21,6 +18,11 @@ class MusterModule:
|
||||||
self.cred_path = os.path.join(
|
self.cred_path = os.path.join(
|
||||||
self.cred_folder_path, self.cred_filename
|
self.cred_folder_path, self.cred_filename
|
||||||
)
|
)
|
||||||
|
self.tray_init(main_parent, parent)
|
||||||
|
|
||||||
|
def tray_init(self, main_parent, parent):
|
||||||
|
from .widget_login import MusterLogin
|
||||||
|
|
||||||
self.main_parent = main_parent
|
self.main_parent = main_parent
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.widget_login = MusterLogin(main_parent, self)
|
self.widget_login = MusterLogin(main_parent, self)
|
||||||
|
|
@ -38,10 +40,6 @@ class MusterModule:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def process_modules(self, modules):
|
def process_modules(self, modules):
|
||||||
|
|
||||||
def api_callback():
|
|
||||||
self.aShowLogin.trigger()
|
|
||||||
|
|
||||||
if "RestApiServer" in modules:
|
if "RestApiServer" in modules:
|
||||||
def api_show_login():
|
def api_show_login():
|
||||||
self.aShowLogin.trigger()
|
self.aShowLogin.trigger()
|
||||||
|
|
@ -51,13 +49,12 @@ class MusterModule:
|
||||||
|
|
||||||
# Definition of Tray menu
|
# Definition of Tray menu
|
||||||
def tray_menu(self, parent):
|
def tray_menu(self, parent):
|
||||||
"""
|
"""Add **change credentials** option to tray menu."""
|
||||||
Add **change credentials** option to tray menu.
|
from Qt import QtWidgets
|
||||||
"""
|
|
||||||
# Menu for Tray App
|
# Menu for Tray App
|
||||||
self.menu = QtWidgets.QMenu('Muster', parent)
|
self.menu = QtWidgets.QMenu('Muster', parent)
|
||||||
self.menu.setProperty('submenu', 'on')
|
self.menu.setProperty('submenu', 'on')
|
||||||
self.menu.setStyleSheet(style.load_stylesheet())
|
|
||||||
|
|
||||||
# Actions
|
# Actions
|
||||||
self.aShowLogin = QtWidgets.QAction(
|
self.aShowLogin = QtWidgets.QAction(
|
||||||
|
|
@ -91,9 +88,9 @@ class MusterModule:
|
||||||
if not MUSTER_REST_URL:
|
if not MUSTER_REST_URL:
|
||||||
raise AttributeError("Muster REST API url not set")
|
raise AttributeError("Muster REST API url not set")
|
||||||
params = {
|
params = {
|
||||||
'username': username,
|
'username': username,
|
||||||
'password': password
|
'password': password
|
||||||
}
|
}
|
||||||
api_entry = '/api/login'
|
api_entry = '/api/login'
|
||||||
response = self._requests_post(
|
response = self._requests_post(
|
||||||
MUSTER_REST_URL + api_entry, params=params)
|
MUSTER_REST_URL + api_entry, params=params)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue