示例#1
0
def show_preferences(parent, driver, gconf_client, gconf_key):
    widget_tree = gtk.Builder()
    widget_tree.add_from_file(
        os.path.join(os.path.dirname(__file__), "g15daemon-server.ui"))

    dialog = widget_tree.get_object("G15DaemonServerDialog")
    dialog.set_transient_for(parent)

    g15uigconf.configure_adjustment_from_gconf(gconf_client,
                                               gconf_key + "/port",
                                               "PortAdjustment", 15550,
                                               widget_tree)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/keep_aspect_ratio",
                                             "KeepAspectRatio", False,
                                             widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(
        gconf_client, gconf_key + "/take_over_macro_keys", "TakeOverMacroKeys",
        True, widget_tree, True)

    g15uigconf.configure_checkbox_from_gconf(
        gconf_client, gconf_key + "/use_custom_foreground",
        "UseCustomForeground", False, widget_tree)
    g15uigconf.configure_colorchooser_from_gconf(
        gconf_client, gconf_key + "/custom_foreground", "CustomForeground",
        (255, 255, 255), widget_tree)

    dialog.run()
    dialog.hide()
示例#2
0
def show_preferences(parent, driver, gconf_client, gconf_key):
    widget_tree = gtk.Builder()
    widget_tree.add_from_file(
        os.path.join(os.path.dirname(__file__), "notify-lcd.ui"))
    dialog = widget_tree.get_object("NotifyLCDDialog")
    dialog.set_transient_for(parent)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/respect_timeout",
                                             "RespectTimeout", False,
                                             widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/allow_actions",
                                             "AllowActions", False,
                                             widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/allow_cancel",
                                             "AllowCancel", True, widget_tree,
                                             True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/on_keyboard_screen",
                                             "OnKeyboardScreen", True,
                                             widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/on_desktop",
                                             "OnDesktop", True, widget_tree,
                                             True)
    g15uigconf.configure_checkbox_from_gconf(
        gconf_client, gconf_key + "/blink_keyboard_backlight",
        "BlinkKeyboardBacklight", True, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/blink_memory_bank",
                                             "BlinkMemoryBank", True,
                                             widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(
        gconf_client, gconf_key + "/change_keyboard_backlight_color",
        "ChangeKeyboardBacklightColor", False, widget_tree, True)
    g15uigconf.configure_adjustment_from_gconf(gconf_client,
                                               gconf_key + "/blink_delay",
                                               "DelayAdjustment", 500,
                                               widget_tree)
    g15uigconf.configure_checkbox_from_gconf(gconf_client,
                                             gconf_key + "/enable_sounds",
                                             "EnableSounds", True, widget_tree,
                                             True)
    g15uigconf.configure_colorchooser_from_gconf(
        gconf_client, gconf_key + "/keyboard_backlight_color",
        "KeyboardBacklightColor", (128, 128, 128), widget_tree, None)

    set_available(None, widget_tree)
    widget_tree.get_object("ChangeKeyboardBacklightColor").connect(
        "toggled", set_available, widget_tree)
    widget_tree.get_object("BlinkKeyboardBacklight").connect(
        "toggled", set_available, widget_tree)

    dialog.run()
    dialog.hide()
示例#3
0
def show_preferences(parent, driver, gconf_client, gconf_key):
    widget_tree = Gtk.Builder()
    widget_tree.add_from_file(os.path.join(os.path.dirname(__file__), "panel.ui"))
    dialog = widget_tree.get_object("PanelDialog")
    dialog.set_transient_for(parent)
    g15uigconf.configure_adjustment_from_gconf(gconf_client, gconf_key + "/size", "SizeAdjustment", 24, widget_tree)
    g15uigconf.configure_combo_from_gconf(gconf_client, gconf_key + "/position", "PositionCombo", "bottom", widget_tree)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/stretch", "Stretch", False, widget_tree)
    g15uigconf.configure_colorchooser_from_gconf(gconf_client, gconf_key + "/color", "Color", ( 128, 128, 128 ), widget_tree, default_alpha = 128)
    dialog.run()
    dialog.hide()
示例#4
0
文件: panel.py 项目: FPar/gnome15
def show_preferences(parent, driver, gconf_client, gconf_key):
    widget_tree = gtk.Builder()
    widget_tree.add_from_file(os.path.join(os.path.dirname(__file__), "panel.ui"))
    dialog = widget_tree.get_object("PanelDialog")
    dialog.set_transient_for(parent)
    g15uigconf.configure_adjustment_from_gconf(gconf_client, gconf_key + "/size", "SizeAdjustment", 24, widget_tree)
    g15uigconf.configure_combo_from_gconf(gconf_client, gconf_key + "/position", "PositionCombo", "bottom", widget_tree)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/stretch", "Stretch", False, widget_tree)
    g15uigconf.configure_colorchooser_from_gconf(gconf_client, gconf_key + "/color", "Color", ( 128, 128, 128 ), widget_tree, default_alpha = 128)
    dialog.run()
    dialog.hide()
示例#5
0
def show_preferences(parent, driver, gconf_client, gconf_key):
    widget_tree = gtk.Builder()
    widget_tree.add_from_file(os.path.join(os.path.dirname(__file__), "g15daemon-server.ui"))
    
    dialog = widget_tree.get_object("G15DaemonServerDialog")
    dialog.set_transient_for(parent)
    
    g15uigconf.configure_adjustment_from_gconf(gconf_client, gconf_key + "/port", "PortAdjustment", 15550, widget_tree)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/keep_aspect_ratio", "KeepAspectRatio", False, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/take_over_macro_keys", "TakeOverMacroKeys", True, widget_tree, True)
    
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/use_custom_foreground", "UseCustomForeground", False, widget_tree)
    g15uigconf.configure_colorchooser_from_gconf(gconf_client, gconf_key + "/custom_foreground", "CustomForeground", ( 255, 255, 255 ), widget_tree)
    
    dialog.run()
    dialog.hide()
示例#6
0
def show_preferences(parent, driver, gconf_client, gconf_key):
    widget_tree = gtk.Builder()
    widget_tree.add_from_file(os.path.join(os.path.dirname(__file__), "impulse15.ui"))
    
    dialog = widget_tree.get_object("ImpulseDialog")
    dialog.set_transient_for(parent)
    
    # Set up the audio source model  
    audio_source_model = widget_tree.get_object("AudioSourceModel")
    status, output = g15os.get_command_output("pacmd list-sources")
    source_name = "0"
    if status == 0 and len(output) > 0:
        i = 0
        for line in output.split("\n"):
            line = line.strip()
            if line.startswith("index: "):
                i = int(line[7:])
                source_name = str(i)
            elif line.startswith("name: "):
                source_name = line[7:-1]
            elif line.startswith("device.description = "):
                audio_source_model.append((source_name, line[22:-1]))
    else:
        for i in range(0, 9):
            audio_source_model.append((str(i), "Source %d" % i))

    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/disco", "Disco", False, widget_tree)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/animate_mkeys", "AnimateMKeys", False, widget_tree)
    g15uigconf.configure_combo_from_gconf(gconf_client, gconf_key + "/mode", "ModeCombo", "spectrum", widget_tree)
    g15uigconf.configure_combo_from_gconf(gconf_client, gconf_key + "/paint", "PaintCombo", "screen", widget_tree)
    g15uigconf.configure_spinner_from_gconf(gconf_client, gconf_key + "/bars", "BarsSpinner", 16, widget_tree)
    g15uigconf.configure_combo_from_gconf(gconf_client, gconf_key + "/audio_source_name", "AudioSource", source_name, widget_tree)
    g15uigconf.configure_spinner_from_gconf(gconf_client, gconf_key + "/bar_width", "BarWidthSpinner", 16, widget_tree)
    g15uigconf.configure_spinner_from_gconf(gconf_client, gconf_key + "/spacing", "SpacingSpinner", 0, widget_tree)
    g15uigconf.configure_spinner_from_gconf(gconf_client, gconf_key + "/rows", "RowsSpinner", 16, widget_tree)
    g15uigconf.configure_spinner_from_gconf(gconf_client, gconf_key + "/bar_height", "BarHeightSpinner", 2, widget_tree)
    g15uigconf.configure_colorchooser_from_gconf(gconf_client, gconf_key + "/col1", "Color1", ( 255, 0, 0 ), widget_tree, default_alpha = 255)
    g15uigconf.configure_colorchooser_from_gconf(gconf_client, gconf_key + "/col2", "Color2", ( 0, 0, 255 ), widget_tree, default_alpha = 255)
    g15uigconf.configure_adjustment_from_gconf(gconf_client, gconf_key + "/frame_rate", "FrameRateAdjustment", 10.0, widget_tree)
    g15uigconf.configure_adjustment_from_gconf(gconf_client, gconf_key + "/gain", "GainAdjustment", 1.0, widget_tree)
    
    if driver.get_bpp() == 0:
        widget_tree.get_object("LCDTable").set_visible(False)

    
    dialog.run()
    dialog.hide() 
示例#7
0
def show_preferences(parent, gconf_client, gconf_key):
    widget_tree = gtk.Builder()
    widget_tree.add_from_file(os.path.join(os.path.dirname(__file__), "notify-lcd.ui"))
    dialog = widget_tree.get_object("NotifyLCDDialog")
    dialog.set_transient_for(parent)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/respect_timeout", "RespectTimeout", False, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/allow_actions", "AllowActions", False, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/allow_cancel", "AllowCancel", False, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/enable_sounds", "EnableSounds", True, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/lcd_only", "LCDOnly", False, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/blink_keyboard", "BlinkKeyboard", False, widget_tree, True)
    g15uigconf.configure_checkbox_from_gconf(gconf_client, gconf_key + "/change_keyboard_color", "ChangeKeyboardColor", False, widget_tree, True)
    g15uigconf.configure_adjustment_from_gconf(gconf_client, gconf_key + "/blink_delay", "DelayAdjustment", 500, widget_tree)
    g15uigconf.configure_colorchooser_from_gconf(gconf_client, gconf_key + "/color", "Color", ( 128, 128, 128 ), widget_tree, None)
    
    set_available(None, widget_tree)
    widget_tree.get_object("ChangeKeyboardColor").connect("toggled", set_available, widget_tree)
    widget_tree.get_object("BlinkKeyboard").connect("toggled", set_available, widget_tree)
    
    dialog.run()
    dialog.hide()