mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
modified avalon_apps module
This commit is contained in:
parent
4f2ffa6022
commit
eb16141a0e
1 changed files with 15 additions and 18 deletions
|
|
@ -1,10 +1,7 @@
|
||||||
import os
|
from Qt import QtWidgets
|
||||||
import argparse
|
|
||||||
from Qt import QtGui, QtWidgets
|
|
||||||
from avalon.tools import libraryloader
|
from avalon.tools import libraryloader
|
||||||
from pype.api import Logger
|
from pype.api import Logger
|
||||||
from avalon import io
|
from pype.tools.launcher import LauncherWindow, actions
|
||||||
from launcher import launcher_widget, lib as launcher_lib
|
|
||||||
|
|
||||||
|
|
||||||
class AvalonApps:
|
class AvalonApps:
|
||||||
|
|
@ -12,7 +9,12 @@ class AvalonApps:
|
||||||
self.log = Logger().get_logger(__name__)
|
self.log = Logger().get_logger(__name__)
|
||||||
self.main_parent = main_parent
|
self.main_parent = main_parent
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.app_launcher = None
|
|
||||||
|
self.app_launcher = LauncherWindow()
|
||||||
|
|
||||||
|
# actions.register_default_actions()
|
||||||
|
actions.register_config_actions()
|
||||||
|
actions.register_environment_actions()
|
||||||
|
|
||||||
def process_modules(self, modules):
|
def process_modules(self, modules):
|
||||||
if "RestApiServer" in modules:
|
if "RestApiServer" in modules:
|
||||||
|
|
@ -32,23 +34,18 @@ class AvalonApps:
|
||||||
self.log.warning('Parent menu is not set')
|
self.log.warning('Parent menu is not set')
|
||||||
return
|
return
|
||||||
|
|
||||||
icon = QtGui.QIcon(launcher_lib.resource("icon", "main.png"))
|
action_launcher = QtWidgets.QAction("Launcher", parent_menu)
|
||||||
aShowLauncher = QtWidgets.QAction(icon, "&Launcher", parent_menu)
|
action_library_loader = QtWidgets.QAction("Library", parent_menu)
|
||||||
aLibraryLoader = QtWidgets.QAction("Library", parent_menu)
|
|
||||||
|
|
||||||
aShowLauncher.triggered.connect(self.show_launcher)
|
action_launcher.triggered.connect(self.show_launcher)
|
||||||
aLibraryLoader.triggered.connect(self.show_library_loader)
|
action_library_loader.triggered.connect(self.show_library_loader)
|
||||||
|
|
||||||
parent_menu.addAction(aShowLauncher)
|
parent_menu.addAction(action_launcher)
|
||||||
parent_menu.addAction(aLibraryLoader)
|
parent_menu.addAction(action_library_loader)
|
||||||
|
|
||||||
def show_launcher(self):
|
def show_launcher(self):
|
||||||
# if app_launcher don't exist create it/otherwise only show main window
|
# if app_launcher don't exist create it/otherwise only show main window
|
||||||
if self.app_launcher is None:
|
self.app_launcher.show()
|
||||||
io.install()
|
|
||||||
APP_PATH = launcher_lib.resource("qml", "main.qml")
|
|
||||||
self.app_launcher = launcher_widget.Launcher(APP_PATH)
|
|
||||||
self.app_launcher.window.show()
|
|
||||||
|
|
||||||
def show_library_loader(self):
|
def show_library_loader(self):
|
||||||
libraryloader.show(
|
libraryloader.show(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue