# Path: src/controllers/utils.py
# def registerContext(func):
#     @functools.wraps(func)
#     def wrapper(*args, **kwargs):
#         self = args[0]
#         if hasattr(self, '__contextName__'):
#             contexts.update({self.__contextName__: self})
#         func(*args, **kwargs)
# 
#     return wrapper
# 
# Path: src/controllers/signalmanager.py
# class SignalManager(QObject):
#     def __init__(self, parent=None):


import os
import sys
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty
from PyQt5.QtGui import QCursor
from .utils import registerContext
from .signalmanager import signalManager


class WindowManageWorker(QObject):

    mainWindowShowed = pyqtSignal()
    simpleWindowShowed = pyqtSignal()
    miniWindowShowed = pyqtSignal()
    currentMusicManagerPageNameChanged = pyqtSignal('QString')

    switchPageByID = pyqtSignal('QString')

    windowModeChanged = pyqtSignal('QString')

    __contextName__ = 'WindowManageWorker'

    @registerContext
    def __init__(self, parent=None):
        super(WindowManageWorker, self).__init__(parent)

        self._windowMode = 'Full'
        self._lastWindowMode = 'Full'
        self._currentMusicManagerPageName = 'ArtistPage'

        self.initConnect()

    def initConnect(self):
        signalManager.simpleFullToggle.connect(self.actionSimpleFullToggle)
        signalManager.miniFullToggle.connect(self.actionMiniFullToggle)
        signalManager.fullMode.connect(self.actionFullMode)
        signalManager.simpleMode.connect(self.actionSimpleMode)

# Path: src/controllers/utils.py
# def registerContext(func):
#     @functools.wraps(func)
#     def wrapper(*args, **kwargs):
#         self = args[0]
#         if hasattr(self, '__contextName__'):
#             contexts.update({self.__contextName__: self})
#         func(*args, **kwargs)
# 
#     return wrapper
# 
# Path: src/controllers/signalmanager.py
# class SignalManager(QObject):
#     def __init__(self, parent=None):


# Path: src/controllers/windowmanageworker.py
import os
import sys
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty
from PyQt5.QtGui import QCursor
from .utils import registerContext
from .signalmanager import signalManager



class WindowManageWorker(QObject):

    mainWindowShowed = pyqtSignal()
    simpleWindowShowed = pyqtSignal()
    miniWindowShowed = pyqtSignal()
    currentMusicManagerPageNameChanged = pyqtSignal('QString')

    switchPageByID = pyqtSignal('QString')

    windowModeChanged = pyqtSignal('QString')

    __contextName__ = 'WindowManageWorker'

    @registerContext
    def __init__(self, parent=None):
        super(WindowManageWorker, self).__init__(parent)

        self._windowMode = 'Full'
        self._lastWindowMode = 'Full'
        self._currentMusicManagerPageName = 'ArtistPage'

        self.initConnect()

    def initConnect(self):
        signalManager.simpleFullToggle.connect(self.actionSimpleFullToggle)
        signalManager.miniFullToggle.connect(self.actionMiniFullToggle)
        signalManager.fullMode.connect(self.actionFullMode)
        signalManager.simpleMode.connect(self.actionSimpleMode)

        signalManager.miniMode.connect(self.actionMiniMode)