def activate(self): self._load_surfaces() self.panel_text = g15text.new_text(self.screen) self.time_text = g15text.new_text(self.screen) g15plugin.G15RefreshingPlugin.activate(self) self.watch(None, self.config_changed) self.do_refresh()
def activate(self): self._page_properties = {} self._page_attributes = {} self._weather = None self._config_change_handle = None self._load_config() self._text = g15text.new_text(self.screen) g15plugin.G15RefreshingPlugin.activate(self) self.watch(None, self._loc_changed)
def activate(self): self._debug_service = G15DBUSDebugService(self.screen.service.dbus_service) self.text = g15text.new_text(self.screen) self.memory = 0 self.resident = 0 self.stack = 0 self.only_refresh_when_visible = False g15plugin.G15RefreshingPlugin.activate(self) self.do_refresh()
def activate(self): self._timer = None self._text = g15text.new_text(self.screen) self._notify_timer = None self._timer1 = timer.G15Timer() self._timer1.on_finish = self._on_finish self._timer2 = timer.G15Timer() self._timer2.on_finish = self._on_finish self._load_configuration() g15plugin.G15RefreshingPlugin.activate(self) self.screen.key_handler.action_listeners.append(self) self.watch(None, self._config_changed)
def activate(self): self._load_configuration() self._connect() self.timer = None self.text = g15text.new_text(self.screen) self._reload_theme() self.page = g15theme.G15Page("MPD", self.screen, theme_properties_callback = self._get_properties, # thumbnail_painter = self.paint_thumbnail, panel_painter = self.paint_thumbnail, theme = self.theme) self.page.title = "MPD" self.screen.key_handler.action_listeners.append(self) self.screen.add_page(self.page) self.screen.redraw(self.page) self._schedule_redraw() self.notify_handle = self.gconf_client.notify_add(self.gconf_key, self._config_changed)
def activate(self): ''' The activate function is invoked when gnome15 starts up, or the plugin is re-enabled after it has been disabled. When extending any of the provided base plugin classes, you nearly always want to call the function in the supoer class as well ''' g15plugin.G15Plugin.activate(self) ''' Load our configuration ''' self.timer = None self._load_configuration() ''' We will be drawing text manually in the thumbnail, so it is recommended you use the G15Text class which simplifies drawing and measuring text in an efficient manner ''' self.text = g15text.new_text(self.screen) ''' Most plugins will delegate their drawing to a 'Theme'. A theme usually consists of an SVG file, one for each model that is supported, and optionally a fragment of Python for anything that can't be done with SVG and the built in theme facilities ''' self._reload_theme() ''' Most plugins will usually want to draw on the screen. To do so, a 'page' is created. We also supply a callback here to perform the painting. You can also supply 'on_shown' and 'on_hidden' callbacks here to be notified when your page actually gets shown and hidden. A thumbnail painter function is also provided. This is used by other plugins want a thumbnail representation of the current screen. For example, this could be used in the 'panel', or the 'menu' plugins ''' self.page = g15theme.G15Page( "Clock", self.screen, theme_properties_callback=self._get_properties, thumbnail_painter=self.paint_thumbnail, panel_painter=self.paint_thumbnail, theme=self.theme, originating_plugin=self) self.page.title = "Simple Clock" ''' Add the page to the screen ''' self.screen.add_page(self.page) ''' Once created, we should always ask for the screen to be drawn (even if another higher priority screen is actually active. If the canvas is not displayed immediately, the on_shown function will be invoked when it finally is. ''' self.screen.redraw(self.page) ''' As this is a Clock, we want to redraw at fixed intervals. So, schedule another redraw if appropriate ''' self._schedule_redraw() ''' We want to be notified when the plugin configuration changed, so watch for gconf events. The watch function is used, as this will automatically track the monitor handles and clean them up when the plugin is deactivated ''' self.watch(None, self._config_changed)
def activate(self): ''' The activate function is invoked when gnome15 starts up, or the plugin is re-enabled after it has been disabled. When extending any of the provided base plugin classes, you nearly always want to call the function in the supoer class as well ''' g15plugin.G15Plugin.activate(self) ''' Load our configuration ''' self.timer = None self._load_configuration() ''' We will be drawing text manually in the thumbnail, so it is recommended you use the G15Text class which simplifies drawing and measuring text in an efficient manner ''' self.text = g15text.new_text(self.screen) ''' Most plugins will delegate their drawing to a 'Theme'. A theme usually consists of an SVG file, one for each model that is supported, and optionally a fragment of Python for anything that can't be done with SVG and the built in theme facilities ''' self._reload_theme() ''' Most plugins will usually want to draw on the screen. To do so, a 'page' is created. We also supply a callback here to perform the painting. You can also supply 'on_shown' and 'on_hidden' callbacks here to be notified when your page actually gets shown and hidden. A thumbnail painter function is also provided. This is used by other plugins want a thumbnail representation of the current screen. For example, this could be used in the 'panel', or the 'menu' plugins ''' self.page = g15theme.G15Page("Clock", self.screen, theme_properties_callback = self._get_properties, thumbnail_painter = self.paint_thumbnail, panel_painter = self.paint_thumbnail, theme = self.theme, originating_plugin = self) self.page.title = "Simple Clock" ''' Add the page to the screen ''' self.screen.add_page(self.page) ''' Once created, we should always ask for the screen to be drawn (even if another higher priority screen is actually active. If the canvas is not displayed immediately, the on_shown function will be invoked when it finally is. ''' self.screen.redraw(self.page) ''' As this is a Clock, we want to redraw at fixed intervals. So, schedule another redraw if appropriate ''' self._schedule_redraw() ''' We want to be notified when the plugin configuration changed, so watch for gconf events. The watch function is used, as this will automatically track the monitor handles and clean them up when the plugin is deactivated ''' self.watch(None, self._config_changed)