def __init__(self, pubsub_gateway, player_kwargs=None): CliApp.__init__(self, pubsub_gateway, player_kwargs=player_kwargs) QWidget.__init__(self) self.request = Request(self) self.tips_manager = TipsManager(self) self.hotkey_manager = Hotkey(self) #: collections manager self.coll_mgr = CollectionManager(self) self.img_ctl = ImgController(self) self.playlists = PlaylistsModel(parent=self) self.histories = HistoriesModel(parent=self) self.providers = ProvidersModel(parent=self) self.my_music = MyMusicModel(parent=self) self.collections = CollectionsModel(parent=self) self.ui = Ui(self) self.player_pixmap = None self.show_msg = self.ui.magicbox.show_msg self.resize(1000, 618) self.setObjectName('app') QApplication.setWindowIcon(QIcon(APP_ICON)) self.bind_signal()
def __init__(self): super().__init__() self.player = Player() self.playlist = self.player.playlist self.request = Request(self) self.tips_manager = TipsManager(self) self.hotkey_manager = Hotkey(self) self.img_ctl = ImgController(self) self.plugins_manager = PluginsManager(self) self.version_manager = VersionManager(self) self.playlists = PlaylistsModel(parent=self) self.histories = HistoriesModel(parent=self) self.libraries = LibrariesModel(parent=self) self.ui = Ui(self) self._init_managers() self.player_pixmap = None self.resize(1000, 618) self.setObjectName('app') QApplication.setWindowIcon(QIcon(APP_ICON)) self.bind_signal() self.initialize()
def attach_attrs(app, **player_kwargs): """初始化 app 属性""" app.library = Library() app.live_lyric = LiveLyric() app.protocol = FuoProcotol(app) app.plugin_mgr = PluginsManager(app) app.version_mgr = VersionManager(app) app.request = Request() app._g = {} app.player = Player(app=app, **(player_kwargs or {})) app.playlist = app.player.playlist if app.mode & app.GuiMode: from feeluown.components.history import HistoriesModel from feeluown.components.provider import ProvidersModel from feeluown.components.playlists import PlaylistsModel from feeluown.components.my_music import MyMusicModel from feeluown.components.collections import CollectionsModel from feeluown.protocol import CollectionManager from .browser import Browser from .hotkey import HotkeyManager from .image import ImgManager from .theme import ThemeManager from .tips import TipsManager from .ui import Ui app.coll_mgr = CollectionManager(app) app.theme_mgr = ThemeManager(app) app.tips_mgr = TipsManager(app) app.hotkey_mgr = HotkeyManager(app) app.img_mgr = ImgManager(app) app.playlists = PlaylistsModel(parent=app) app.histories = HistoriesModel(parent=app) app.providers = ProvidersModel(parent=app) app.my_music = MyMusicModel(parent=app) app.collections = CollectionsModel(parent=app) app.browser = Browser(app) app.ui = Ui(app) app.show_msg = app.ui.magicbox.show_msg
def __init__(self, pubsub_gateway, player=None): CliApp.__init__(self, pubsub_gateway, player=None) QWidget.__init__(self) self.request = Request(self) self.tips_manager = TipsManager(self) self.hotkey_manager = Hotkey(self) self.img_ctl = ImgController(self) self.playlists = PlaylistsModel(parent=self) self.histories = HistoriesModel(parent=self) self.providers = ProvidersModel(parent=self) self.ui = Ui(self) self.player_pixmap = None self.resize(1000, 618) self.setObjectName('app') QApplication.setWindowIcon(QIcon(APP_ICON)) self.bind_signal()
def set_playlists(self, playlists): model = PlaylistsModel(playlists, self) self.playlists_view.setModel(model)