def load_configuration(self): self.take_over_macro_keys = g15gconf.get_bool_or_default( self.gconf_client, "%s/take_over_macro_keys" % self.gconf_key, True) if g15gconf.get_bool_or_default( self.gconf_client, "%s/use_custom_foreground" % self.gconf_key, False): col = g15gconf.get_rgb_or_default( self.gconf_client, "%s/custom_foreground" % self.gconf_key, (255, 255, 255)) self.palette = [0 for n in range(768)] self.palette[765] = col[0] self.palette[766] = col[1] self.palette[767] = col[2] else: foreground_control = self.screen.driver.get_control("foreground") if foreground_control is None: self.palette = None else: self.palette = [0 for n in range(768)] self.palette[765] = foreground_control.value[0] self.palette[766] = foreground_control.value[1] self.palette[767] = foreground_control.value[2] backlight_control = self.screen.driver.get_control_for_hint( g15driver.HINT_DIMMABLE) self.default_backlight = backlight_control.value if backlight_control is not None else None lcd_brightness_control = self.screen.driver.get_control_for_hint( g15driver.HINT_SHADEABLE) self.default_lcd_brightness = lcd_brightness_control.value if lcd_brightness_control is not None else None
def _load_configuration(self): self.respect_timeout = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/respect_timeout", False) self.allow_actions = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/allow_actions", False) self.allow_cancel = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/allow_cancel", True) self.on_keyboard_screen = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/on_keyboard_screen", True) self.on_desktop = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/on_desktop", True) self.blink_keyboard_backlight = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/blink_keyboard_backlight", True) self.blink_memory_bank = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/blink_memory_bank", True) self.change_keyboard_backlight_color = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/change_keyboard_backlight_color", False) self.enable_sounds = g15gconf.get_bool_or_default( self._gconf_client, self._gconf_key + "/enable_sounds", True) self.blink_delay = g15gconf.get_int_or_default( self._gconf_client, self._gconf_key + "/blink_delay", 500) self.keyboard_backlight_color = g15gconf.get_rgb_or_default( self._gconf_client, self._gconf_key + "/keyboard_backlight_color", (128, 128, 128))
def _load_configuration(self): self.respect_timeout = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/respect_timeout", False) self.allow_actions = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/allow_actions", False) self.allow_cancel = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/allow_cancel", True) self.on_keyboard_screen = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/on_keyboard_screen", True) self.on_desktop = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/on_desktop", True) self.blink_keyboard_backlight = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/blink_keyboard_backlight", True) self.blink_memory_bank = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/blink_memory_bank", True) self.change_keyboard_backlight_color = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/change_keyboard_backlight_color", False) self.enable_sounds = g15gconf.get_bool_or_default(self._gconf_client, self._gconf_key + "/enable_sounds", True) self.blink_delay = g15gconf.get_int_or_default(self._gconf_client, self._gconf_key + "/blink_delay", 500) self.keyboard_backlight_color = g15gconf.get_rgb_or_default(self._gconf_client, self._gconf_key + "/keyboard_backlight_color", ( 128, 128, 128 ))
def load_configuration(self): self.take_over_macro_keys = g15gconf.get_bool_or_default(self.gconf_client, "%s/take_over_macro_keys" % self.gconf_key, True) if g15gconf.get_bool_or_default(self.gconf_client, "%s/use_custom_foreground" % self.gconf_key, False): col = g15gconf.get_rgb_or_default(self.gconf_client, "%s/custom_foreground" % self.gconf_key, (255,255,255)) self.palette = [0 for n in range(768)] self.palette[765] = col[0] self.palette[766] = col[1] self.palette[767] = col[2] else: foreground_control = self.screen.driver.get_control("foreground") if foreground_control is None: self.palette = None else: self.palette = [0 for n in range(768)] self.palette[765] = foreground_control.value[0] self.palette[766] = foreground_control.value[1] self.palette[767] = foreground_control.value[2] backlight_control = self.screen.driver.get_control_for_hint(g15driver.HINT_DIMMABLE) self.default_backlight = backlight_control.value if backlight_control is not None else None lcd_brightness_control = self.screen.driver.get_control_for_hint(g15driver.HINT_SHADEABLE) self.default_lcd_brightness = lcd_brightness_control.value if lcd_brightness_control is not None else None
def get_rgb_or_default(gconf_client, key, default=None): return g15gconf.get_rgb_or_default(gconf_client, key, default)