Beispiel #1
0
    def update_monitor_views(self):
        """
        Updates all of our MonitorViews based on the power
        or Awake states.
        """
        low_power = not self.power_client.plugged_in
        if not status.Awake:
            if (not settings.should_show_plugin()) or (settings.should_show_plugin() and low_power):
                if self.clock_widget != None and settings.get_show_clock():
                    self.clock_widget.start_positioning()
                if self.albumart_widget != None and settings.get_show_albumart():
                    self.albumart_widget.start_positioning()
            else:
                if self.clock_widget != None:
                    self.clock_widget.stop_positioning()
                    self.clock_widget.hide()
                if self.albumart_widget != None:
                    self.albumart_widget.stop_positioning()
                    self.albumart_widget.hide()

        for monitor in self.monitors:
            monitor.update_view(status.Awake, low_power)

            if not monitor.get_reveal_child():
                monitor.reveal()
    def setup_clock(self):
        self.clock_widget = ClockWidget(self.screen, self.away_message, utils.get_mouse_monitor())
        self.add_child_widget(self.clock_widget)

        if not settings.should_show_plugin() and settings.get_show_clock():
            self.put_on_top(self.clock_widget)
            self.clock_widget.start_positioning()
Beispiel #3
0
    def after_transitioned_back_to_sleep(self, monitor, data=None):
        """
        Called after the MonitorViews have updated - re-show the clock (if desired)
        and the InfoPanel (if required.)
        """
        trackers.con_tracker_get().disconnect(monitor,
                                              "current-view-change-complete",
                                              self.after_transitioned_back_to_sleep)

        self.info_panel.update_revealed()

        if (not settings.should_show_plugin()) or (settings.should_show_plugin() and not self.power_client.plugged_in):
            if settings.get_show_clock():
                self.clock_widget.start_positioning()
            if settings.get_show_albumart():
                self.albumart_widget.start_positioning()
    def update_view(self, awake, low_power):
        self.kill_plugin()

        if not awake and not low_power and settings.should_show_plugin():
            self.show_plugin()
        else:
            self.show_wallpaper()
Beispiel #5
0
    def setup_albumart(self):
        """
        Construct the AlbumArt widget and add it to the overlay, but only actually
        show it if we're a) Not running a plug-in, and b) The user wants it via
        preferences.

        Initially invisible, regardless - its visibility is controlled via its
        own positioning timer.
        """
        self.albumart_widget = AlbumArt(None, status.screen.get_mouse_monitor())
        self.add_child_widget(self.albumart_widget)

        self.floaters.append(self.clock_widget)

        if (not settings.should_show_plugin()) or (settings.should_show_plugin() and not self.power_client.plugged_in):
            if settings.get_show_albumart():
                self.albumart_widget.start_positioning()
    def setup_clock(self):
        """
        Construct the clock widget and add it to the overlay, but only actually
        show it if we're a) Not running a plug-in, and b) The user wants it via
        preferences.

        Initially invisible, regardless - its visibility is controlled via its
        own positioning timer.
        """
        self.clock_widget = ClockWidget(self.screen, self.away_message, self.screen.get_mouse_monitor())
        self.add_child_widget(self.clock_widget)

        self.floaters.append(self.clock_widget)

        if self.mplayer.fs:
            return
        if (not settings.should_show_plugin()) or (settings.should_show_plugin() and not self.power_client.plugged_in):
            if settings.get_show_clock():
                self.clock_widget.start_positioning()
    def update_view(self, awake, low_power):
        """
        Syncs the current MonitorView state to whatever is appropriate, depending
        on whether we're awake and whether a plugin should be visible instead.
        """
        self.kill_plugin()

        if not awake and not low_power and settings.should_show_plugin():
            self.show_plugin()
        else:
            self.show_wallpaper()
Beispiel #8
0
    def update_view(self, awake, low_power):
        """
        Syncs the current MonitorView state to whatever is appropriate, depending
        on whether we're awake and whether a plugin should be visible instead.
        """
        self.kill_plugin()

        if not awake and not low_power and settings.should_show_plugin():
            self.show_plugin()
        else:
            self.show_wallpaper()
    def update_monitor_views(self):
        """
        Updates all of our MonitorViews based on the power
        or Awake states.
        """
        low_power = not self.power_client.plugged_in
        if ((not settings.should_show_plugin()) or (settings.should_show_plugin() and low_power)) and not self.mplayer.fs:
            if self.clock_widget != None and settings.get_show_clock():
                self.clock_widget.start_positioning()
            if self.albumart_widget != None and settings.get_show_albumart():
                self.albumart_widget.start_positioning()
        else:
            if self.clock_widget != None:
                self.clock_widget.stop_positioning()
                self.clock_widget.hide()
            if self.albumart_widget != None:
                self.albumart_widget.stop_positioning()
                self.albumart_widget.hide()

        for monitor in self.monitors:
            monitor.update_view(status.Awake, low_power)

            if not monitor.get_reveal_child():
                monitor.reveal()
Beispiel #10
0
    def setup_clock(self):
        """
        Construct the clock widget and add it to the overlay, but only actually
        show it if we're a) Not running a plug-in, and b) The user wants it via
        preferences.

        Initially invisible, regardless - its visibility is controlled via its
        own positioning timer.
        """
        self.clock_widget = ClockWidget(self.screen, self.away_message, utils.get_mouse_monitor())
        self.add_child_widget(self.clock_widget)

        self.floaters.append(self.clock_widget)

        if not settings.should_show_plugin() and settings.get_show_clock():
            self.clock_widget.start_positioning()
    def setup_albumart(self):
        """
        Construct the AlbumArt widget and add it to the overlay, but only actually
        show it if we're a) Not running a plug-in, and b) The user wants it via
        preferences.

        Initially invisible, regardless - its visibility is controlled via its
        own positioning timer.
        """
        self.albumart_widget = AlbumArt(self.screen, self.away_message,
                                        utils.get_mouse_monitor())
        self.add_child_widget(self.albumart_widget)

        self.floaters.append(self.clock_widget)

        if not settings.should_show_plugin() and settings.get_show_albumart():
            self.albumart_widget.start_positioning()
def shouldShowPlugin():
    from util import settings
    import singletons

    return settings.should_show_plugin() and singletons.UPowerClient.plugged_in