added action which shows the console widget

This commit is contained in:
iLLiCiTiT 2021-08-13 14:29:39 +02:00
parent de1e3759a2
commit cabc446102

View file

@ -0,0 +1,40 @@
from . import PypeModule, ITrayAction
class PythonInterpreterAction(PypeModule, ITrayAction):
label = "Console"
name = "python_interpreter"
def initialize(self, modules_settings):
self.enabled = True
self._interpreter_window = None
def tray_init(self):
self.create_interpreter_window()
def connect_with_modules(self, *args, **kwargs):
pass
def create_interpreter_window(self):
"""Initializa Settings Qt window."""
if self._interpreter_window:
return
from openpype.tools.python_console_interpreter import (
PythonInterpreterWidget
)
self._interpreter_window = PythonInterpreterWidget()
def on_action_trigger(self):
self.show_interpreter_window()
def show_interpreter_window(self):
self.create_interpreter_window()
if self._interpreter_window.isVisible():
self._interpreter_window.activateWindow()
self._interpreter_window.raise_()
return
self._interpreter_window.show()