Esempio n. 1
0
    def ProcessApplicationCommand(self, command: CAC.ApplicationCommand):

        command_processed = True

        data = command.GetData()

        if command.IsSimpleCommand():

            action = data

            if action == CAC.SIMPLE_EXIT_APPLICATION:

                HG.client_controller.gui.TryToExit()

            elif action == CAC.SIMPLE_EXIT_APPLICATION_FORCE_MAINTENANCE:

                HG.client_controller.gui.TryToExit(
                    force_shutdown_maintenance=True)

            elif action == CAC.SIMPLE_RESTART_APPLICATION:

                HG.client_controller.gui.TryToExit(restart=True)

            elif action == CAC.SIMPLE_HIDE_TO_SYSTEM_TRAY:

                HG.client_controller.gui.HideToSystemTray()

            elif action == CAC.SIMPLE_CLOSE_MEDIA_VIEWER:

                self.close()

            elif action == CAC.SIMPLE_SWITCH_BETWEEN_FULLSCREEN_BORDERLESS_AND_REGULAR_FRAMED_WINDOW:

                self.FullscreenSwitch()

            elif action == CAC.SIMPLE_FLIP_DARKMODE:

                HG.client_controller.gui.FlipDarkmode()

            elif action == CAC.SIMPLE_GLOBAL_AUDIO_MUTE:

                ClientGUIMediaControls.SetMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL, True)

            elif action == CAC.SIMPLE_GLOBAL_AUDIO_UNMUTE:

                ClientGUIMediaControls.SetMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL, False)

            elif action == CAC.SIMPLE_GLOBAL_AUDIO_MUTE_FLIP:

                ClientGUIMediaControls.FlipMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL)

            else:

                command_processed = False

        else:

            command_processed = False

        return command_processed
Esempio n. 2
0
    def ProcessApplicationCommand(self, command):

        command_processed = True

        command_type = command.GetCommandType()
        data = command.GetData()

        if command_type == CC.APPLICATION_COMMAND_TYPE_SIMPLE:

            action = data

            if action == 'exit_application':

                HG.client_controller.gui.TryToSaveAndClose()

            elif action == 'exit_application_force_maintenance':

                HG.client_controller.gui.TryToSaveAndClose(
                    force_shutdown_maintenance=True)

            elif action == 'restart_application':

                HG.client_controller.gui.TryToSaveAndClose(restart=True)

            elif action == 'hide_to_system_tray':

                HG.client_controller.gui.HideToSystemTray()

            elif action == 'close_media_viewer':

                self.close()

            elif action == 'switch_between_fullscreen_borderless_and_regular_framed_window':

                self.FullscreenSwitch()

            elif action == 'flip_darkmode':

                HG.client_controller.gui.FlipDarkmode()

            elif action == 'global_audio_mute':

                ClientGUIMediaControls.SetMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL, True)

            elif action == 'global_audio_unmute':

                ClientGUIMediaControls.SetMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL, False)

            elif action == 'global_audio_mute_flip':

                ClientGUIMediaControls.FlipMute(
                    ClientGUIMediaControls.AUDIO_GLOBAL)

            else:

                command_processed = False

        else:

            command_processed = False

        return command_processed