Ejemplo n.º 1
0
def _enable(eventname, exaile, nothing):

    global plugin
    if plugin is None:
        plugin = BPMCounterPlugin()
    
    event.remove_callback(_enable, 'gui_loaded')
def disable(exaile):
    global MPRIS2
    MPRIS2.unregister_events()
    MPRIS2.release()
    event.remove_callback(_clean_tmp, 'quit_application')
    if _WINDOW_STATE_HANDLER is not None:
        exaile.gui.main.window.disconnect(_WINDOW_STATE_HANDLER)
Ejemplo n.º 3
0
    def set_auto_update(self, auto_update):
        """
            Sets whether the info pane shall
            be automatically updated or not

            :param auto_update: enable or disable
                automatic updating
            :type auto_update: bool
        """
        if auto_update != self.__auto_update:
            self.__auto_update = auto_update

            p_evts = ['playback_player_end', 'playback_track_start',
                      'playback_toggle_pause', 'playback_error']
            events = ['track_tags_changed', 'cover_set', 'cover_removed']

            if auto_update:
                for e in p_evts:
                    event.add_ui_callback(getattr(self, 'on_%s' % e), e, self.__player)
                for e in events:
                    event.add_ui_callback(getattr(self, 'on_%s' % e), e)

                self.set_track(self.__player.current)
            else:
                for e in p_evts:
                    event.remove_callback(getattr(self, 'on_%s' % e), e, self.__player)
                for e in events:
                    event.remove_callback(getattr(self, 'on_%s' % e), e)
Ejemplo n.º 4
0
    def set_auto_update(self, auto_update):
        """
            Sets whether the info pane shall
            be automatically updated or not

            :param auto_update: enable or disable
                automatic updating
            :type auto_update: bool
        """
        if auto_update != self.__auto_update:
            self.__auto_update = auto_update

            p_evts = ['playback_player_end', 'playback_track_start',
                      'playback_toggle_pause', 'playback_error']
            events = ['track_tags_changed', 'cover_set', 'cover_removed']

            if auto_update:
                for e in p_evts:
                    event.add_ui_callback(getattr(self, 'on_%s' % e), e, self.__player)
                for e in events:
                    event.add_ui_callback(getattr(self, 'on_%s' % e), e)

                self.set_track(self.__player.current)
            else:
                for e in p_evts:
                    event.remove_callback(getattr(self, 'on_%s' % e), e, self.__player)
                for e in events:
                    event.remove_callback(getattr(self, 'on_%s' % e), e)
Ejemplo n.º 5
0
def disable(exaile):
    global ExaileModbar
    ExaileModbar.changeModToBar()
    event.remove_callback(ExaileModbar.play_start, 'playback_track_start', player.PLAYER)
    event.remove_callback(ExaileModbar.play_end, 'playback_player_end', player.PLAYER)
    ExaileModbar.destroy()
    ExaileModbar = None
Ejemplo n.º 6
0
 def remove_callbacks(self):
     event.remove_callback(self.playback_cb, "playback_track_start")
     event.remove_callback(self.on_track_tags_changed, "track_tags_changed")
     event.remove_callback(self.end_cb, "playback_player_end")
     event.remove_callback(self.search_method_added_cb, "lyrics_search_method_added")
     event.remove_callback(self.on_option_set, "plugin_lyricsviewer_option_set")
     self.notebook.disconnect(self.style_handler)
Ejemplo n.º 7
0
    def destroy(self):
        """
            Cleanups
        """
        event.remove_callback(self.on_option_set, 'player_option_set')

        ButtonControl.destroy(self)
        Gtk.VolumeButton.destroy(self)
Ejemplo n.º 8
0
    def destroy(self):
        """
            Cleanups
        """
        event.remove_callback(self.on_option_set, 'player_option_set')

        ButtonControl.destroy(self)
        Gtk.VolumeButton.destroy(self)
Ejemplo n.º 9
0
 def _seek_delayed(self, type, object, value):
     """
         internal code used if seek is called before the stream is ready
     """
     if self._settle_flag == 1 or object != self:
         return
     event.remove_callback(self._seek_delayed, type, object)
     self._seek_event.set()
Ejemplo n.º 10
0
 def remove_callbacks(self):
     event.remove_callback(self.playback_cb, 'playback_track_start')
     event.remove_callback(self.on_track_tags_changed, 'track_tags_changed')
     event.remove_callback(self.end_cb, 'playback_player_end')
     event.remove_callback(self.search_method_added_cb,
             'lyrics_search_method_added')
     event.remove_callback(self.on_option_set,
             'plugin_lyricsviewer_option_set')
Ejemplo n.º 11
0
    def destroy(self):
        """
            Cleanups
        """
        event.remove_callback(self.on_option_set, 'plugin_osd_option_set')
        event.remove_callback(self.on_track_tags_changed, 'track_tags_changed')

        gtk.Window.destroy(self)
Ejemplo n.º 12
0
    def destroy(self):
        """
            Cleanups
        """
        event.remove_callback(self.on_option_set, 'plugin_osd_option_set')
        event.remove_callback(self.on_track_tags_changed, 'track_tags_changed')

        Gtk.Window.destroy(self)
Ejemplo n.º 13
0
 def remove_callbacks(self):
     event.remove_callback(self.playback_cb, 'playback_track_start')
     event.remove_callback(self.on_track_tags_changed, 'track_tags_changed')
     event.remove_callback(self.end_cb, 'playback_player_end')
     event.remove_callback(self.search_method_added_cb,
                           'lyrics_search_method_added')
     event.remove_callback(self.on_option_set,
                           'plugin_lyricsviewer_option_set')
Ejemplo n.º 14
0
def disable(exaile):
    global _PLUGIN

    for signal in PLAYBACK_START_CALLBACKS:
        event.remove_callback(_PLUGIN.on_playback_start, signal)
    for signal in PLAYBACK_STOP_CALLBACKS:
        event.remove_callback(_PLUGIN.on_playback_stop, signal)

    _PLUGIN.stop()
Ejemplo n.º 15
0
    def destroy(self):
        """
            Cleanups
        """
        if self.filename is not None and os.path.exists(self.filename):
            os.remove(self.filename)
            self.filename = None

        event.remove_callback(self.on_quit_application, "quit-application")
Ejemplo n.º 16
0
    def destroy(self):
        """
            Cleanups
        """
        if self.filename is not None and os.path.exists(self.filename):
            os.remove(self.filename)
            self.filename = None

        event.remove_callback(self.on_quit_application, 'quit-application')
Ejemplo n.º 17
0
def disable(exaile):
    _disable_main_moodbar()

    event.remove_callback(_enable_preview_moodbar, 'preview_device_enabled')
    event.remove_callback(_disable_preview_moodbar, 'preview_device_disabling')

    preview_plugin = _get_preview_plugin_if_active(exaile)
    if getattr(preview_plugin, 'hooked', False):
        _disable_preview_moodbar('', preview_plugin, None)
Ejemplo n.º 18
0
def disable(exaile):
    global TRAY_CONTROL
    event.remove_callback(TRAY_CONTROL.onPlay, TRACK_START_CALLBACK)
    event.remove_callback(TRAY_CONTROL.onPlay, RESUME_CALLBACK)
    event.remove_callback(TRAY_CONTROL.onEnd, END_CALLBACK)
    event.remove_callback(TRAY_CONTROL.onPause, PAUSE_CALLBACK)
    event.remove_callback(TRAY_CONTROL.on_setting_change, OPTIONS_CALLBACK)
    for icon in TRAY_CONTROL.icons:
        del icon.icon
    print "TrayControl plugin disabled"
Ejemplo n.º 19
0
def disable(exaile):
    global TRAY_CONTROL
    event.remove_callback(TRAY_CONTROL.onPlay, TRACK_START_CALLBACK)
    event.remove_callback(TRAY_CONTROL.onPlay, RESUME_CALLBACK)
    event.remove_callback(TRAY_CONTROL.onEnd, END_CALLBACK)
    event.remove_callback(TRAY_CONTROL.onPause, PAUSE_CALLBACK)
    event.remove_callback(TRAY_CONTROL.on_setting_change, OPTIONS_CALLBACK)
    for icon in TRAY_CONTROL.icons:
        del icon.icon
    print "TrayControl plugin disabled"
Ejemplo n.º 20
0
 def run(self):
     """
         Runs the thread
     """
     event.add_callback(self.on_track_transfer_progress,
         'track_transfer_progress', self.device.transfer)
     try:
         self.device.start_transfer()
     finally:
         event.remove_callback(self.on_track_transfer_progress,
             'track_transfer_progress', self.device.transfer)
Ejemplo n.º 21
0
 def load(self, page):
     if self.currentpage != page:
         event.remove_callback(self.on_field_refresh, 'field_refresh', self.currentpage)
         event.remove_callback(self.on_page_loaded, 'loading_finished', self.currentpage)
         event.add_callback(self.on_field_refresh, 'field_refresh', page)
         event.add_callback(self.on_page_loaded, 'loading_finished', page)
     self.currentpage = page
     self.refresh_button.set_sensitive(False)
     self.refresh_button_image.set_from_animation(self.refresh_animation)
     self.loaded = False
     self.load_string(self.currentpage.get_html(), "text/html", "utf-8", "file://%s" % self.theme.path)
Ejemplo n.º 22
0
 def run(self):
     """
         Runs the thread
     """
     event.add_ui_callback(self.on_track_transfer_progress,
                           'track_transfer_progress', self.device.transfer)
     try:
         self.device.start_transfer()
     finally:
         event.remove_callback(self.on_track_transfer_progress,
                               'track_transfer_progress', self.device.transfer)
Ejemplo n.º 23
0
    def on_playlist_tracks_added(self, event_name, playlist, tracks):
        """
            Starts playing the newly added tracks
        """
        if tracks:
            position, track = tracks[0]
            playlist.current_position = position
            player.QUEUE.play(track)

        event.remove_callback(self.on_playlist_tracks_added,
                              'playlist_tracks_added')
Ejemplo n.º 24
0
 def remove_callbacks(self):
     event.remove_callback(
         self.play_start,
         'playback_track_start',
         self.player
     )
     event.remove_callback(
         self.play_end,
         'playback_player_end',
         self.player
     )
Ejemplo n.º 25
0
    def run(self):
        """
            Runs the thread
        """
        event.add_callback(self.on_scan_progress_update,
            'scan_progress_update')

        self.collection.rescan_libraries(startup_only=self.startup_scan)

        event.remove_callback(self.on_scan_progress_update,
            'scan_progress_update')
Ejemplo n.º 26
0
    def on_playlist_tracks_added(self, event_name, playlist, tracks):
        """
            Starts playing the newly added tracks
        """
        if tracks:
            position, track = tracks[0]
            playlist.current_position = position
            player.QUEUE.play(track)

        event.remove_callback(self.on_playlist_tracks_added,
            'playlist_tracks_added')
Ejemplo n.º 27
0
    def run(self):
        """
        Runs the thread
        """
        event.add_callback(self.on_scan_progress_update,
                           'scan_progress_update')

        self.collection.rescan_libraries(startup_only=self.startup_scan,
                                         force_update=self.force_update)

        event.remove_callback(self.on_scan_progress_update,
                              'scan_progress_update')
Ejemplo n.º 28
0
 def teardown(self, _exaile):
     """
         Shuts down the on screen display plugin
     """
     do_assert(self.__window is not None)
     self.__window.destroy_osd()
     event.remove_callback(self.__on_option_set, 'plugin_osd_option_set')
     event.remove_callback(self.__on_playback_track_start, 'playback_track_start')
     event.remove_callback(self.__on_playback_toggle_pause, 'playback_toggle_pause')
     event.remove_callback(self.__on_playback_player_end, 'playback_player_end')
     event.remove_callback(self.__on_playback_error, 'playback_error')
     self.__window = None
Ejemplo n.º 29
0
    def destroy(self):
        """
            Cleans up
        """
        if self.countdown is not None:
            GLib.source_remove(self.countdown)

        event.remove_callback(self.on_playback_player_end, "playback_player_end")
        for item in providers.get("menubar-tools-menu"):
            if item.name == "shutdown":
                providers.unregister("menubar-tools-menu", item)
                break
Ejemplo n.º 30
0
    def destroy(self):
        """
            Cleans up
        """
        if self.countdown is not None:
            glib.source_remove(self.countdown)

        event.remove_callback(self.on_playback_player_end, 'playback_player_end')
        for item in providers.get('menubar-tools-menu'):
            if item.name == 'shutdown':
                providers.unregister('menubar-tools-menu', item)
                break
Ejemplo n.º 31
0
    def destroy(self):
        """
            Cleans up
        """
        if self.countdown is not None:
            GLib.source_remove(self.countdown)

        event.remove_callback(self.on_playback_player_end, 'playback_player_end')
        for item in providers.get('menubar-tools-menu'):
            if item.name == 'shutdown':
                providers.unregister('menubar-tools-menu', item)
                break
Ejemplo n.º 32
0
 def stop(self):
     """
         Stops submitting
     """
     logger.info("Stopping AudioScrobbler submissions")
     if self.use_menu:
         self.remove_menu()
     if self.connected:
         event.remove_callback(self.on_play, 'playback_track_start', player.PLAYER)
         event.remove_callback(self.on_stop, 'playback_track_end', player.PLAYER)
         self.connected = False
         self.save_cache()
     providers.unregister('mainwindow-accelerators',self.accelerator)
Ejemplo n.º 33
0
    def _destroy_gui(self):
        event.remove_callback(self._on_option_set, 'option_set')

        for provide in self.preview_provides:
            providers.unregister(provide, self.preview_menuitem)
        providers.unregister('menubar-view-menu', self.menu)

        self.info_area.destroy()
        self.playpause_button.destroy()

        self.pane2_box.destroy()
        self.pane1_box.destroy()
        self.pane.destroy()
Ejemplo n.º 34
0
 def stop(self):
     """
         Stops submitting
     """
     logger.info("Stopping AudioScrobbler submissions")
     if self.use_menu:
         self.remove_menu()
     if self.connected:
         event.remove_callback(self.on_play, "playback_track_start", player.PLAYER)
         event.remove_callback(self.on_stop, "playback_track_end", player.PLAYER)
         self.connected = False
         self.save_cache()
     providers.unregister("mainwindow-accelerators", self.accelerator)
Ejemplo n.º 35
0
    def _destroy_gui(self):
        event.remove_callback(self._on_option_set, 'option_set')

        for provide in self.preview_provides:
            providers.unregister(provide, self.preview_menuitem)
        providers.unregister('menubar-view-menu', self.menu)

        self.info_area.destroy()
        self.playpause_button.destroy()

        self.pane2_box.destroy()
        self.pane1_box.destroy()
        self.pane.destroy()
Ejemplo n.º 36
0
    def destroy(self):
        """
            Cleanups
        """
        event.remove_callback(self.on_option_set, 'plugin_lastfmlove_option_set')

        providers.unregister('tray-icon-context', self.tray_menu_item)
        providers.unregister('playlist-context-menu', self.menu_item)
        providers.unregister('playlist-columns-menu', self.column_menu_item)
        providers.unregister('playlist-columns', LoveColumn)

        if self.timer is not None and self.timer.is_alive():
            self.timer.cancel()
Ejemplo n.º 37
0
 def load(self, page):
     if self.currentpage != page:
         event.remove_callback(self.on_field_refresh, 'field_refresh',
                               self.currentpage)
         event.remove_callback(self.on_page_loaded, 'loading_finished',
                               self.currentpage)
         event.add_callback(self.on_field_refresh, 'field_refresh', page)
         event.add_callback(self.on_page_loaded, 'loading_finished', page)
     self.currentpage = page
     self.refresh_button.set_sensitive(False)
     self.refresh_button_image.set_from_animation(self.refresh_animation)
     self.loaded = False
     self.load_string(self.currentpage.get_html(), "text/html", "utf-8",
                      "file://%s" % self.theme.path)
Ejemplo n.º 38
0
def disable(exaile):
    event.remove_callback(on_stop_action, 'quit_application')
    event.remove_callback(on_stop_action, 'playback_player_end', player.PLAYER)
    event.remove_callback(on_begin_action, 'playback_track_start',
                          player.PLAYER)
    event.remove_callback(on_pause_action, 'playback_toggle_pause',
                          player.PLAYER)
Ejemplo n.º 39
0
def disable(exaile):
    '''
        Plugin Disabled.
    '''
    # disconnect from active shares
    if MANAGER is not None:
#        MANAGER.clear()
        MANAGER.close(True)

    for item in providers.get('menubar-tools-menu'):
        if item.name == 'daap':
            providers.unregister('menubar-tools-menu', item)
            break

    event.remove_callback(__enb, 'gui_loaded')
Ejemplo n.º 40
0
 def disconnect_events(self):
     """
         Disconnects various callbacks from events
     """
     event.remove_callback(self.on_playback_change_state, 'playback_player_end', player.PLAYER)
     event.remove_callback(self.on_playback_change_state, 'playback_track_start', player.PLAYER)
     event.remove_callback(self.on_playback_change_state, 'playback_toggle_pause', player.PLAYER)
     event.remove_callback(self.on_playback_change_state, 'playback_error', player.PLAYER)
Ejemplo n.º 41
0
def disable(exaile):
    global TUNE_TO_PSI
    event.remove_callback(TUNE_TO_PSI.tune, "playback_track_start")
    event.remove_callback(TUNE_TO_PSI.GoFree, "playback_player_end")
    event.remove_callback(TUNE_TO_PSI.onPause, "playback_player_pause")
    event.remove_callback(TUNE_TO_PSI.GoFree, "quit_application")
    TUNE_TO_PSI.GoFree(None, None, None)
    print "TuneToPsi plugin disabled"
Ejemplo n.º 42
0
def disable(exaile):
    global TUNE_TO_PSI
    event.remove_callback(TUNE_TO_PSI.tune, 'playback_track_start')
    event.remove_callback(TUNE_TO_PSI.GoFree,'playback_player_end')
    event.remove_callback(TUNE_TO_PSI.onPause,'playback_player_pause')
    event.remove_callback(TUNE_TO_PSI.GoFree, 'quit_application')
    TUNE_TO_PSI.GoFree(None, None, None)
    print "TuneToPsi plugin disabled"
Ejemplo n.º 43
0
 def disconnect_events(self):
     """
         Disconnects various callbacks from events
     """
     event.remove_callback(self.on_playback_change_state, 'playback_player_end', player.PLAYER)
     event.remove_callback(self.on_playback_change_state, 'playback_track_start', player.PLAYER)
     event.remove_callback(self.on_playback_change_state, 'playback_toggle_pause', player.PLAYER)
     event.remove_callback(self.on_playback_change_state, 'playback_error', player.PLAYER)
Ejemplo n.º 44
0
def disable(exaile):
    '''
        Plugin Disabled.
    '''
    # disconnect from active shares
    if MANAGER is not None:
        #        MANAGER.clear()
        MANAGER.close(True)

    for item in providers.get('menubar-tools-menu'):
        if item.name == 'daap':
            providers.unregister('menubar-tools-menu', item)
            break

    event.remove_callback(__enb, 'gui_loaded')
Ejemplo n.º 45
0
    def disable_shutdown(self):
        self.do_shutdown = False
        event.remove_callback(self.on_playback_player_end, 'playback_player_end')

        # Stop possible countdown
        if self.countdown is not None:
            GLib.source_remove(self.countdown)
            self.countdown = None

        # Prepare for a new run
        self.counter = 10

        # Reset message button layout
        self.message.hide()
        self.message.clear_buttons()
        self.message.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
Ejemplo n.º 46
0
    def disable_shutdown(self):
        self.do_shutdown = False
        event.remove_callback(self.on_playback_player_end, "playback_player_end")

        # Stop possible countdown
        if self.countdown is not None:
            GLib.source_remove(self.countdown)
            self.countdown = None

        # Prepare for a new run
        self.counter = 10

        # Reset message button layout
        self.message.hide()
        self.message.clear_buttons()
        self.message.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
Ejemplo n.º 47
0
    def rescan_libraries(self, startup_only=False, force_update=False):
        """
        Rescans all libraries associated with this Collection
        """
        if self._scanning:
            raise Exception("Collection is already being scanned")
        if len(self.libraries) == 0:
            event.log_event('scan_progress_update', self, 100)
            return  # no libraries, no need to scan :)

        self._scanning = True
        self._scan_stopped = False

        self.file_count = -1  # negative means we dont know it yet

        self.__count_files()

        scan_interval = 20

        for library in self.libraries.values():

            if (not force_update and startup_only
                    and not (library.monitored and library.startup_scan)):
                continue

            event.add_callback(self._progress_update, 'tracks_scanned',
                               library)
            library.rescan(notify_interval=scan_interval,
                           force_update=force_update)
            event.remove_callback(self._progress_update, 'tracks_scanned',
                                  library)
            self._running_total_count += self._running_count
            if self._scan_stopped:
                break
        else:  # didnt break
            try:
                if self.location is not None:
                    self.save_to_location()
            except AttributeError:
                logger.exception("Exception occurred while saving")

        event.log_event('scan_progress_update', self, 100)

        self._running_total_count = 0
        self._running_count = 0
        self._scanning = False
        self.file_count = -1
Ejemplo n.º 48
0
    def rescan_libraries(self, startup_only=False, force_update=False):
        """
            Rescans all libraries associated with this Collection
        """
        if self._scanning:
            raise Exception("Collection is already being scanned")
        if len(self.libraries) == 0:
            event.log_event('scan_progress_update', self, 100)
            return # no libraries, no need to scan :)

        self._scanning = True
        self._scan_stopped = False

        self.file_count = -1 # negative means we dont know it yet

        self.__count_files()

        scan_interval = 20

        for library in self.libraries.itervalues():
            
            if not force_update and startup_only and not (library.monitored and library.startup_scan):
                continue
            
            event.add_callback(self._progress_update, 'tracks_scanned',
                library)
            library.rescan(notify_interval=scan_interval, force_update=force_update)
            event.remove_callback(self._progress_update, 'tracks_scanned',
                library)
            self._running_total_count += self._running_count
            if self._scan_stopped:
                break
        else: # didnt break
            try:
                if self.location is not None:
                    self.save_to_location()
            except AttributeError:
                logger.exception("Exception occurred while saving")

        event.log_event('scan_progress_update', self, 100)

        self._running_total_count = 0
        self._running_count = 0
        self._scanning = False
        self.file_count = -1
Ejemplo n.º 49
0
 def destroy(self):
     """
         Cleanups
     """
     event.remove_callback(self.on_queue_current_playlist_changed,
         'queue_current_playlist_changed', self.__queue)
     event.remove_callback(self.__on_playlist_current_position_changed,
         'playlist_current_position_changed')
     event.remove_callback(self.__on_playlist_tracks_added,
         'playlist_tracks_added')
     event.remove_callback(self.__on_playlist_tracks_removed,
         'playlist_tracks_removed')
Ejemplo n.º 50
0
 def destroy(self):
     """
         Cleanups
     """
     event.remove_callback(self.on_queue_current_playlist_changed,
                           'queue_current_playlist_changed', self.__queue)
     event.remove_callback(self.__on_playlist_current_position_changed,
                           'playlist_current_position_changed')
     event.remove_callback(self.__on_playlist_tracks_added,
                           'playlist_tracks_added')
     event.remove_callback(self.__on_playlist_tracks_removed,
                           'playlist_tracks_removed')
Ejemplo n.º 51
0
    def disable(self, exaile):
        '''Called when the plugin is disabled'''

        if self.tools_menuitem:
            providers.unregister('menubar-tools-menu', self.tools_menuitem)
            for item in self.provider_items:
                providers.unregister('playlist-context-menu', item)
                providers.unregister('track-panel-menu', item)

            self.tools_menuitem = None
            self.provider_items = []

        if self.tag_dialog:
            self.tag_dialog.destroy()
            self.tag_dialog = None

        # de-register the exaile events
        event.remove_callback(self.on_playback_track_start, 'playback_track_start')
        event.remove_callback(
            self.on_playlist_cursor_changed, 'playlist_cursor_changed'
        )
        event.remove_callback(
            self.on_plugin_options_set, 'plugin_grouptagger_option_set'
        )

        providers.unregister('main-panel', self.panel)
Ejemplo n.º 52
0
    def __unregister_events(self):
        event.remove_callback(self.check_to_load_more, 'playback_track_start')
        event.remove_callback(self.close_playlist, 'quit_application')
        event.remove_callback(self.play_feedback, 'playback_track_end')

        if self.dbus_controller:
            self.dbus_controller.unregister_events()
Ejemplo n.º 53
0
    def __unregister_events(self):
        event.remove_callback(self.check_to_load_more, 'playback_track_start')
        event.remove_callback(self.close_playlist, 'quit_application')
        event.remove_callback(self.play_feedback, 'playback_track_end')

        if self.dbus_controller:
            self.dbus_controller.unregister_events()
Ejemplo n.º 54
0
 def destroy(self):
     """
         Cleanups
     """
     if self._player is not None:
         event.remove_callback( self.on_rating_update, 'playback_track_start', self._player )
         event.remove_callback( self.on_rating_update, 'playback_track_end', self._player )
         event.remove_callback( self.on_rating_update, 'rating_changed')
Ejemplo n.º 55
0
    def destroy(self):
        """
        Cleanups
        """
        for e in self._events:
            if 'playback' in e:
                event.remove_callback(getattr(self, 'on_%s' % e), e, player.PLAYER)
            else:
                event.remove_callback(getattr(self, 'on_%s' % e), e)

        event.remove_callback(self.on_option_set, 'plugin_desktopcover_option_set')

        Gtk.Window.destroy(self)