def testOther(self): PreferencesDialog.addPathPreference('aPathPreference', label="Test Path", section="timeline", description="Test the path widget") PreferencesDialog.addChoicePreference( 'aChoicePreference', label="Swallow Velocity", section="timeline", description= "What is the airspeed velocity of a coconut-laden swallow?", choices=(("42 Knots", 32), ("9 furlongs per fortnight", 42), ("I don't know that!", None))) PreferencesDialog.addChoicePreference( 'aLongChoicePreference', label="Favorite Color", section="timeline", description="What is the color of the parrot's plumage?", choices=(("Mauve", "Mauve"), ("Chartreuse", "Chartreuse"), ("Magenta", "Magenta"), ("Pink", "Pink"), ("Norwegian Blue", "Norwegian Blue"), ("Yellow Ochre", "Yellow Ochre"))) PreferencesDialog.addTogglePreference( 'aTogglePreference', label="Test Toggle", section="timeline", description="Test the toggle widget") PreferencesDialog.addFontPreference('aFontPreference', label="Foo Font", section="timeline", description="Test the font widget")
def testOther(self): section = list(PreferencesDialog.section_names.keys())[0] PreferencesDialog.addPathPreference('aPathPreference', label="Test Path", section=section, description="Test the path widget") PreferencesDialog.addChoicePreference('aChoicePreference', label="Swallow Velocity", section=section, description="What is the airspeed velocity of a coconut-laden swallow?", choices=( ("42 Knots", 32), ("9 furlongs per fortnight", 42), ("I don't know that!", None))) PreferencesDialog.addChoicePreference('aLongChoicePreference', label="Favorite Color", section=section, description="What is the color of the parrot's plumage?", choices=( ("Mauve", "Mauve"), ("Chartreuse", "Chartreuse"), ("Magenta", "Magenta"), ("Pink", "Pink"), ("Norwegian Blue", "Norwegian Blue"), ("Yellow Ochre", "Yellow Ochre"))) PreferencesDialog.addTogglePreference('aTogglePreference', label="Test Toggle", section=section, description="Test the toggle widget") PreferencesDialog.addFontPreference('aFontPreference', label="Foo Font", section=section, description="Test the font widget")
def do_activate(self): api = self.object self.app = api.app try: self.app.settings.addConfigSection("console") except ConfigError: pass try: self.app.settings.addConfigOption(attrname="consoleColor", section="console", key="console-color", notify=True, default=Console.DEFAULT_COLOR) except ConfigError: pass try: self.app.settings.addConfigOption( attrname="consoleErrorColor", section="console", key="console-error-color", notify=True, default=Console.DEFAULT_STDERR_COLOR) except ConfigError: pass try: self.app.settings.addConfigOption( attrname="consoleOutputColor", section="console", key="console-output-color", notify=True, default=Console.DEFAULT_STDOUT_COLOR) except ConfigError: pass try: self.app.settings.addConfigOption( attrname="consoleFont", section="console", key="console-font", notify=True, default=Console.DEFAULT_FONT.to_string()) except ConfigError: pass self.app.settings.reload_attribute_from_file("console", "consoleColor") self.app.settings.reload_attribute_from_file("console", "consoleErrorColor") self.app.settings.reload_attribute_from_file("console", "consoleOutputColor") self.app.settings.reload_attribute_from_file("console", "consoleFont") PreferencesDialog.add_section("console", _("Console")) PreferencesDialog.addColorPreference(attrname="consoleColor", label=_("Color"), description=None, section="console") PreferencesDialog.addColorPreference( attrname="consoleErrorColor", # Translators: The color of the content from stderr. label=_("Standard error color"), description=None, section="console") PreferencesDialog.addColorPreference( attrname="consoleOutputColor", # Translators: The color of the content from stdout. label=_("Standard output color"), description=None, section="console") PreferencesDialog.addFontPreference(attrname="consoleFont", label=_("Font"), description=None, section="console") self._setup_dialog() self.add_menu_item() self.menu_item.show()
default=0x00000077, notify=True) PreferencesDialog.addColorPreference('selectedColor', section=_("Appearance"), label=_("Selection color"), description=_("Selected clips will be tinted with this color.")) GlobalSettings.addConfigOption('clipFontDesc', section='user-interface', key='clip-font-name', default="Sans 9", notify=True) PreferencesDialog.addFontPreference('clipFontDesc', section=_('Appearance'), label=_("Clip font"), description=_("The font to use for clip titles")) GlobalSettings.addConfigOption('clipFontColor', section='user-interface', key='clip-font-color', default=0xFFFFFFAA, notify=True) def text_size(text): logical = Pango.Rectangle() tmp = Pango.Rectangle() text.get_natural_extents(tmp, logical) Pango.extents_to_pixels(logical, tmp) return tmp.width, tmp.height
def do_activate(self): api = self.object self.app = api.app self.app.settings.addConfigSection("console") self.app.settings.addConfigOption(attrname="consoleColor", section="console", key="console-color", notify=True, default=Console.DEFAULT_COLOR) self.app.settings.addConfigOption(attrname="consoleErrorColor", section="console", key="console-error-color", notify=True, default=Console.DEFAULT_STDERR_COLOR) self.app.settings.addConfigOption(attrname="consoleOutputColor", section="console", key="console-output-color", notify=True, default=Console.DEFAULT_STDOUT_COLOR) self.app.settings.addConfigOption( attrname="consoleFont", section="console", key="console-font", notify=True, default=Console.DEFAULT_FONT.to_string()) self.app.settings.reload_attribute_from_file("console", "consoleColor") self.app.settings.reload_attribute_from_file("console", "consoleErrorColor") self.app.settings.reload_attribute_from_file("console", "consoleOutputColor") self.app.settings.reload_attribute_from_file("console", "consoleFont") PreferencesDialog.add_section("console", _("Console")) PreferencesDialog.addColorPreference(attrname="consoleColor", label=_("Color"), description=None, section="console") PreferencesDialog.addColorPreference( attrname="consoleErrorColor", # Translators: The color of the content from stderr. label=_("Standard error color"), description=None, section="console") PreferencesDialog.addColorPreference( attrname="consoleOutputColor", # Translators: The color of the content from stdout. label=_("Standard output color"), description=None, section="console") PreferencesDialog.addFontPreference(attrname="consoleFont", label=_("Font"), description=None, section="console") open_action = Gio.SimpleAction.new("open_console", None) open_action.connect("activate", self.__menu_item_activate_cb) self.app.add_action(open_action) self.app.shortcuts.add("app.open_console", ["<Primary>d"], _("Developer Console")) self._setup_dialog() self.add_menu_item() self.menu_item.show()
def do_activate(self): api = self.object self.app = api.app try: self.app.settings.addConfigSection("console") except ConfigError: pass try: self.app.settings.addConfigOption(attrname="consoleColor", section="console", key="console-color", notify=True, default=Console.DEFAULT_COLOR) except ConfigError: pass try: self.app.settings.addConfigOption(attrname="consoleErrorColor", section="console", key="console-error-color", notify=True, default=Console.DEFAULT_STDERR_COLOR) except ConfigError: pass try: self.app.settings.addConfigOption(attrname="consoleOutputColor", section="console", key="console-output-color", notify=True, default=Console.DEFAULT_STDOUT_COLOR) except ConfigError: pass try: self.app.settings.addConfigOption(attrname="consoleFont", section="console", key="console-font", notify=True, default=Console.DEFAULT_FONT.to_string()) except ConfigError: pass self.app.settings.reload_attribute_from_file("console", "consoleColor") self.app.settings.reload_attribute_from_file("console", "consoleErrorColor") self.app.settings.reload_attribute_from_file("console", "consoleOutputColor") self.app.settings.reload_attribute_from_file("console", "consoleFont") PreferencesDialog.add_section("console", _("Console")) PreferencesDialog.addColorPreference(attrname="consoleColor", label=_("Color"), description=None, section="console") PreferencesDialog.addColorPreference(attrname="consoleErrorColor", # Translators: The color of the content from stderr. label=_("Standard error color"), description=None, section="console") PreferencesDialog.addColorPreference(attrname="consoleOutputColor", # Translators: The color of the content from stdout. label=_("Standard output color"), description=None, section="console") PreferencesDialog.addFontPreference(attrname="consoleFont", label=_("Font"), description=None, section="console") open_action = Gio.SimpleAction.new("open_console", None) open_action.connect("activate", self.__menu_item_activate_cb) self.app.add_action(open_action) self.app.shortcuts.add("app.open_console", ["<Primary>d"], _("Developer Console")) self._setup_dialog() self.add_menu_item() self.menu_item.show()