def setup_window_preference(self): table = self.worker.get_object('table1') height, width = TweakSettings.get_window_size() win_width = WidgetFactory.create('GconfSpinButton', key = 'window_width', min = 640, max = 1280, step = 1) win_width.show() win_width.connect('value-changed', self.on_value_changed) table.attach(win_width, 1, 3, 0, 1) win_height = WidgetFactory.create('GconfSpinButton', key = 'window_height', min = 480, max = 1280, step = 1) win_height.show() win_height.connect('value-changed', self.on_value_changed) table.attach(win_height, 1, 3, 1, 2) toolbar_size = WidgetFactory.create('GconfSpinButton', key = 'toolbar_size', min = 100, max = 500, step = 1) toolbar_size.show() toolbar_size.connect('value-changed', self.on_value_changed) table.attach(toolbar_size, 1, 3, 2, 3)
def __init__(self): TweakPage.__init__(self) box = TablePack(_('Window Decorate Effect'), [ [WidgetFactory.create('GconfCheckButton', label = _('Use Metacity window theme'), key = 'use_metacity_theme')], [WidgetFactory.create('GconfCheckButton', label = _('Enable active window transparency'), key = 'metacity_theme_active_shade_opacity')], [gtk.Label(_('Active window transparency level')), WidgetFactory.create('GconfScale', key = 'metacity_theme_active_opacity', min = 0, max = 1, digits = 2)], [WidgetFactory.create('GconfCheckButton', label = _('Enable inactive window transparency'), key = 'metacity_theme_shade_opacity')], [gtk.Label(_('Inactive window shade transparency level')), WidgetFactory.create('GconfScale', key = 'metacity_theme_opacity', min = 0, max = 1, digits = 2)], ]) self.pack_start(box, False, False, 0) table = TablePack(_('Window Titlebar Action'), [ [gtk.Label(_('Titlebar mouse wheel action')), WidgetFactory.create('GconfComboBox', key = 'mouse_wheel_action', texts = [_('None'), _('Roll up')], values = ['none', 'shade'])], [gtk.Label(_('Titlebar double-click action')), WidgetFactory.create('GconfComboBox', key = 'action_double_click_titlebar', texts = [_('None'), _('Maximize'), _('Minimize'), _('Roll up'), _('Lower'), _('Menu')], values = ['none', 'toggle_maximize', 'minimize', 'toggle_shade', 'lower', 'menu'])], [gtk.Label(_('Titlebar middle-click action')), WidgetFactory.create('GconfComboBox', key = 'action_middle_click_titlebar', texts = [_('None'), _('Maximize'), _('Minimize'), _('Roll up'), _('Lower'), _('Menu')], values = ['none', 'toggle_maximize', 'minimize', 'toggle_shade', 'lower', 'menu'])], [gtk.Label(_('Titlebar right-click action')), WidgetFactory.create('GconfComboBox', key = 'action_right_click_titlebar', texts = [_('None'), _('Maximize'), _('Minimize'), _('Roll up'), _('Lower'), _('Menu')], values = ['none', 'toggle_maximize', 'minimize', 'toggle_shade', 'lower', 'menu'])], ]) self.pack_start(table, False, False, 0) button = WidgetFactory.create('GconfCheckButton', label = _("Enable Metacity's Compositing feature"), key = 'compositing_manager') if button: box = ListPack(_('Compositing Manager'), (button,)) button.connect('toggled', self.on_compositing_button_toggled) self.pack_start(box, False, False, 0)
def __init__(self): TweakPage.__init__(self) box = TablePack(_("Advanced Power Management Settings"), [ [WidgetFactory.create("GconfCheckButton", label = _('Enable "Hibernation"'), key = "can_hibernate")], [WidgetFactory.create("GconfCheckButton", label = _('Enable "Suspend"'), key = "can_suspend")], [WidgetFactory.create("GconfCheckButton", label = _('Show "CPU frequency control option" in Power Management Preferences'), key = "cpufreq_show")], [WidgetFactory.create("GconfCheckButton", label = _("Disable Network Manager when asleep"), key = "network_sleep")], [WidgetFactory.create("GconfCheckButton", label = _('Enable "Lock screen" when "Blank Screen" activates'), key = "blank_screen")], [gtk.Label(_('Display "Power Manager" panel item')), WidgetFactory.create("GconfComboBox", key = "icon_policy", texts = [_("Never display"), _("When charging"), _("Always display")], values = ["never", "charge", "always"])], ]) self.pack_start(box, False, False, 0) if module_check.get_gnome_version() < 24: cpu_policy_text = [_("Normal"), _("On Demand"), _("Power Save"), _("Performance")] cpu_policy_value = ["nothing", "ondemand", "powersave", "performance"] box = TablePack(_("CPU Policy"), [ [gtk.Label(_("The Performance value when on AC power")), WidgetFactory.create("GconfScale", key = "performance_ac", min = 0, max = 100, digits = 0)], [gtk.Label(_("The Performance value when on battery power")), WidgetFactory.create("GconfScale", key = "performance_battery", min = 0, max = 100, digits = 0)], [gtk.Label(_("The CPU frequency policy when on AC power")), WidgetFactory.create("GconfComboBox", key = "policy_ac", texts = cpu_policy_text, values = cpu_policy_value)], [gtk.Label(_("The CPU frequency policy when on battery power")), WidgetFactory.create("GconfComboBox", key = "policy_battery", texts = cpu_policy_text, values = cpu_policy_value)], ]) self.pack_start(box, False, False, 0)
def setup_other_features(self): vbox = self.worker.get_object('vbox5') button = WidgetFactory.create('GconfCheckButton', label = _('Enable Check Update'), key = 'check_update', default = False) vbox.pack_start(button, False, False, 0) button = WidgetFactory.create('GconfCheckButton', label = _('Enable PowerUser Mode'), key = 'power_user', default = False) vbox.pack_start(button, False, False, 0) vbox.show_all()
def session_control_box(self): button = WidgetFactory.create("GconfCheckButton", label = _("Automatically save open applications when logging out"), key = "auto_save_session") button2 = WidgetFactory.create("GconfCheckButton", label = _("Show logout prompt"), key = "logout_prompt") button3 = WidgetFactory.create("GconfCheckButton", label = _("Allow TCP Connections (Remote Desktop Connect)"), key = "allow_tcp_connections") self.show_splash_button = WidgetFactory.create("GconfCheckButton", label = _("Show splash screen"), key = "show_splash_screen") self.show_splash_button.connect('toggled', self.colleague_changed) box = ListPack(_("Session Control"), (button, button2, button3, self.show_splash_button)) return box
def create_notify_hbox(self): hbox = gtk.HBox(False, 10) label = gtk.Label(_("Notification-daemon popup location")) label.set_alignment(0, 0.5) combobox = WidgetFactory.create("GconfComboBox", key = "popup_location", texts = [_("Top Left"), _("Top Right"), _("Bottom Left"), _("Bottom Right")], values= ["top_left", "top_right", "bottom_left", "bottom_right"]) if combobox: hbox.pack_start(label, False, False, 0) hbox.pack_start(combobox) return hbox else: return None
def __init__(self): TweakPage.__init__(self) self.__setting = TweakSettings() notify_hbox = self.create_notify_hbox() changeicon_hbox = self.create_change_icon_hbox() box = ListPack(_("Panel and Menu"), ( WidgetFactory.create("GconfCheckButton", label = _("Display warning when removing a panel"), key = "confirm_panel_remove"), WidgetFactory.create("GconfCheckButton", label = _("Complete lockdown of all panels"), key = "locked_down"), WidgetFactory.create("GconfCheckButton", label = _("Enable panel animations"), key = "enable_animations"), WidgetFactory.create("GconfCheckButton", label = _("Show Input Method menu on the context menu"), key = "show_input_method_menu"), WidgetFactory.create("GconfCheckButton", label = _("Show Unicode Method menu on the context menu"), key = "show_unicode_menu"), changeicon_hbox, notify_hbox, )) self.pack_start(box, False, False, 0) box = ListPack(_("Screensaver"), ( WidgetFactory.create("GconfCheckButton", label = _("Enable user switching when screen is locked."), key = "user_switch_enabled"), )) self.pack_start(box, False, False, 0) self.recently_used = gtk.CheckButton(_('Enable system-wide "Recently Documents" list')) self.recently_used.connect('toggled', self.colleague_changed) self.recently_used.set_active(self.get_state()) box = ListPack(_("History"), ( self.recently_used, )) self.pack_start(box, False, False, 0)
def __init__(self): TweakPage.__init__(self) box = ListPack( _("System Security options"), ( WidgetFactory.create( "GconfCheckButton", label=_('Disable "Run Application" dialog (Alt+F2)'), key="disable_command_line" ), WidgetFactory.create("GconfCheckButton", label=_('Disable "Lock Screen"'), key="disable_lock_screen"), WidgetFactory.create("GconfCheckButton", label=_("Disable printing"), key="disable_printing"), WidgetFactory.create("GconfCheckButton", label=_("Disable print setup"), key="disable_print_setup"), WidgetFactory.create("GconfCheckButton", label=_("Disable save to disk"), key="disable_save_to_disk"), WidgetFactory.create( "GconfCheckButton", label=_('Disable "Fast User Switching"'), key="disable_user_switching" ), ), ) self.pack_start(box, False, False, 0)
def __init__(self): TweakPage.__init__(self) button = WidgetFactory.create("GconfCheckButton", label = _('Show advanced permissions in the Nautilus "File Properties" window'), key = "show_advanced_permissions") box = ListPack(_("File Browser"), (button, )) self.pack_start(box, False, False, 0) boxes = [] hbox1 = gtk.HBox(False, 5) label = gtk.Label(_('Default thumbnail icon size (pixels)')) hbox1.pack_start(label, False, False, 0) boxes.append(hbox1) button = WidgetFactory.create('GconfSpinButton', key = 'thumbnail_size', min = 16, max = 512, step = 16) hbox1.pack_end(button, False, False, 0) button = WidgetFactory.create('GconfSpinButton', key = 'maximum_size', min = -1, max = 512, step = 1) if button: hbox2 = gtk.HBox(False, 5) label = gtk.Label(_('Maximum size of the thumbnail cache (megabytes)')) hbox2.pack_start(label, False, False, 0) hbox2.pack_end(button, False, False, 0) boxes.append(hbox2) button = WidgetFactory.create('GconfSpinButton', key = 'maximum_age', min = -1, max = 180, step = 1) if button: hbox3 = gtk.HBox(False, 5) label = gtk.Label(_('Maximum age for the thumbnail in the cache (days)')) hbox3.pack_start(label, False, False, 0) hbox3.pack_end(button, False, False, 0) boxes.append(hbox3) hbox4 = gtk.HBox(False, 5) button = gtk.Button(stock = gtk.STOCK_CLEAR) self.set_clean_button_label(button) button.connect('clicked', self.on_clean_thumbnails_clicked) hbox4.pack_end(button, False, False, 0) boxes.append(hbox4) box = ListPack(_('Thumbnails Settings'), boxes) self.pack_start(box, False, False, 0) if not DISABLE: update_apt_cache(True) self.packageWorker = PackageWorker() self.nautilus_terminal = AptCheckButton(_('Nautilus with Open Terminal'), 'nautilus-open-terminal') self.nautilus_terminal.connect('toggled', self.colleague_changed) self.nautilus_root = AptCheckButton(_('Nautilus with Root Privileges'), 'nautilus-gksu') self.nautilus_root.connect('toggled', self.colleague_changed) self.nautilus_wallpaper = AptCheckButton(_('Nautilus with Wallpaper'), 'nautilus-wallpaper') self.nautilus_wallpaper.connect('toggled', self.colleague_changed) box = ListPack(_("Nautilus Extensions"), ( self.nautilus_terminal, self.nautilus_root, self.nautilus_wallpaper, )) self.button = gtk.Button(stock = gtk.STOCK_APPLY) self.button.connect("clicked", self.on_apply_clicked, box) self.button.set_sensitive(False) hbox = gtk.HBox(False, 0) hbox.pack_end(self.button, False, False, 0) box.vbox.pack_start(hbox, False, False, 0) self.pack_start(box, False, False, 0)