Example #1
0
def main():
    os.environ["AVALON_APP"] = HOST_NAME

    # Allow to change icon of running process in windows taskbar
    if os.name == "nt":
        ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
            u"standalonepublish")

    qt_app = QtWidgets.QApplication([])
    # app.setQuitOnLastWindowClosed(False)
    qt_app.setStyleSheet(style.load_stylesheet())
    icon = QtGui.QIcon(resources.pype_icon_filepath())
    qt_app.setWindowIcon(icon)

    def signal_handler(sig, frame):
        print("You pressed Ctrl+C. Process ended.")
        qt_app.quit()

    signal.signal(signal.SIGINT, signal_handler)
    signal.signal(signal.SIGTERM, signal_handler)

    modules_manager = ModulesManager()
    module = modules_manager.modules_by_name["standalonepublish_tool"]

    window = Window(module.publish_paths)
    window.show()

    sys.exit(qt_app.exec_())
Example #2
0
 def _show_message_box(self, title, message, details=None):
     dialog = QtWidgets.QMessageBox()
     icon = QtGui.QIcon(resources.pype_icon_filepath())
     dialog.setWindowIcon(icon)
     dialog.setStyleSheet(style.load_stylesheet())
     dialog.setWindowTitle(title)
     dialog.setText(message)
     if details:
         dialog.setDetailedText(details)
     dialog.exec_()
Example #3
0
    def __init__(self, parent=None):
        super(PypeInfoWidget, self).__init__(parent)

        self.setStyleSheet(style.load_stylesheet())

        icon = QtGui.QIcon(resources.pype_icon_filepath())
        self.setWindowIcon(icon)
        self.setWindowTitle("OpenPype info")

        main_layout = QtWidgets.QVBoxLayout(self)
        main_layout.setAlignment(QtCore.Qt.AlignTop)
        main_layout.addWidget(self._create_openpype_info_widget(), 0)
        main_layout.addWidget(self._create_separator(), 0)
        main_layout.addWidget(self._create_workstation_widget(), 0)
        main_layout.addWidget(self._create_separator(), 0)
        main_layout.addWidget(self._create_local_settings_widget(), 0)
        main_layout.addWidget(self._create_separator(), 0)
        main_layout.addWidget(self._create_environ_widget(), 1)
        main_layout.addWidget(self._create_btns_section(), 0)
Example #4
0
    def __init__(self, parent):
        icon = QtGui.QIcon(resources.pype_icon_filepath())

        super(SystemTrayIcon, self).__init__(icon, parent)

        # Store parent - QtWidgets.QMainWindow()
        self.parent = parent

        # Setup menu in Tray
        self.menu = QtWidgets.QMenu()
        self.menu.setStyleSheet(style.load_stylesheet())

        # Set modules
        self.tray_man = TrayManager(self, self.parent)
        self.tray_man.initialize_modules()

        # Catch activate event for left click if not on MacOS
        #   - MacOS has this ability by design so menu would be doubled
        if platform.system().lower() != "darwin":
            self.activated.connect(self.on_systray_activated)
        # Add menu to Context of SystemTrayIcon
        self.setContextMenu(self.menu)
Example #5
0
    def __init__(self, parent=None):
        super(LauncherWindow, self).__init__(parent)

        self.log = logging.getLogger(".".join(
            [__name__, self.__class__.__name__]))
        self.dbcon = AvalonMongoDB()

        self.setWindowTitle("Launcher")
        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose, False)

        icon = QtGui.QIcon(resources.pype_icon_filepath())
        self.setWindowIcon(icon)
        self.setStyleSheet(style.load_stylesheet())

        # Allow minimize
        self.setWindowFlags(self.windowFlags()
                            | QtCore.Qt.WindowMinimizeButtonHint)

        project_panel = ProjectsPanel(self.dbcon)
        asset_panel = AssetsPanel(self.dbcon)

        page_slider = SlidePageWidget()
        page_slider.addWidget(project_panel)
        page_slider.addWidget(asset_panel)

        # actions
        actions_bar = ActionBar(self.dbcon, self)

        # statusbar
        statusbar = QtWidgets.QWidget()
        layout = QtWidgets.QHBoxLayout(statusbar)

        message_label = QtWidgets.QLabel()
        message_label.setFixedHeight(15)

        action_history = ActionHistory()
        action_history.setStatusTip("Show Action History")

        layout.addWidget(message_label)
        layout.addWidget(action_history)

        # Vertically split Pages and Actions
        body = QtWidgets.QSplitter()
        body.setContentsMargins(0, 0, 0, 0)
        body.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                           QtWidgets.QSizePolicy.Expanding)
        body.setOrientation(QtCore.Qt.Vertical)
        body.addWidget(page_slider)
        body.addWidget(actions_bar)

        # Set useful default sizes and set stretch
        # for the pages so that is the only one that
        # stretches on UI resize.
        body.setStretchFactor(0, 10)
        body.setSizes([580, 160])

        layout = QtWidgets.QVBoxLayout(self)
        layout.addWidget(body)
        layout.addWidget(statusbar)
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)

        self.message_label = message_label
        self.project_panel = project_panel
        self.asset_panel = asset_panel
        self.actions_bar = actions_bar
        self.action_history = action_history
        self.page_slider = page_slider
        self._page = 0

        # signals
        actions_bar.action_clicked.connect(self.on_action_clicked)
        action_history.trigger_history.connect(self.on_history_action)
        project_panel.project_clicked.connect(self.on_project_clicked)
        asset_panel.back_clicked.connect(self.on_back_clicked)
        asset_panel.session_changed.connect(self.on_session_changed)

        # todo: Simplify this callback connection
        asset_panel.project_bar.project_changed.connect(
            self.on_project_changed)

        self.resize(520, 740)