def __init__(self, applet_name): DockXAppletDialog.__init__(self, applet_name) table = gtk.Table(2, 3) self.vbox.pack_start(table) self.font_button = gtk.FontButton() self.font_button.set_use_font(True) self.font_button.set_use_size(True) self.font_button.set_show_style(True) label = gtk.Label(_("Font:")) table.attach(label, 0, 1, 0, 1) self.font_button.set_title(_("Clock font")) self.font_button.connect("font_set", self.__set_font) table.attach(self.font_button, 1, 2, 0, 1) label = gtk.Label(_("Color:")) table.attach(label, 0, 1, 1, 2) self.color_button = gtk.ColorButton() self.color_button.set_title(_("Font color")) self.color_button.connect("color-set", self.__color_set) table.attach(self.color_button, 1, 2, 1, 2) self.date_cb = gtk.CheckButton(_("Show Date")) self.date_cb.connect("toggled", self.__cb_toggled, "show_date") table.attach(self.date_cb, 1, 2, 2, 3) frame = gtk.Frame() self.vbox.pack_start(frame) vbox = gtk.VBox() frame.add(vbox) self.custom_clock_cb = gtk.CheckButton(_("Use custom clock")) self.custom_clock_cb.connect("toggled", self.__cb_toggled, "use_custom_format") vbox.pack_start(self.custom_clock_cb) hbox = gtk.HBox() vbox.pack_start(hbox) self.cf_entry = gtk.Entry() self.cf_entry.set_tooltip_text("The format is identical to gnome-panel clock's custom format. Google 'gnome-panel custom clock' for exampels.") hbox.pack_start(self.cf_entry) self.cf_button = gtk.Button() image = gtk.image_new_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_SMALL_TOOLBAR) self.cf_button.add(image) self.cf_button.connect("clicked", self.__set_custom_format) hbox.pack_start(self.cf_button) hbox = gtk.HBox() self.vbox.pack_start(hbox) label = gtk.Label(_("Text direction: ")) hbox.pack_start(label) self.td_cbt = gtk.combo_box_new_text() self.td_cbt.append_text(_("default")) self.td_cbt.append_text(_("left-right")) self.td_cbt.append_text(_("top-down")) self.td_cbt.append_text(_("bottom-up")) self.td_cbt.connect("changed", self.__text_direction_changed) hbox.pack_start(self.td_cbt) self.show_all()
def run(self): font = self.get_setting("font", "Sans 14") self.font_button.set_font_name(font) color = gtk.gdk.color_parse(self.get_setting("color", "#FFFFFF")) self.color_button.set_color(color) self.cf_entry.set_text(self.get_setting("custom_format", DEFAULT_CUSTOM_FORMAT)) td = self.get_setting("text_direction", "default") tds = ["default", "left-right", "top-down", "bottom-up"] self.td_cbt.set_active(tds.index(td)) cf = self.get_setting("use_custom_format", False) self.custom_clock_cb.set_active(cf) self.font_button.set_sensitive(not cf) self.color_button.set_sensitive(not cf) self.date_cb.set_sensitive(not cf) self.cf_entry.set_sensitive(cf) self.cf_button.set_sensitive(cf) return DockXAppletDialog.run(self)
def run(self): font = self.get_setting("font", "Sans 14") self.font_button.set_font_name(font) color = gtk.gdk.color_parse(self.get_setting("color", "#FFFFFF")) self.color_button.set_color(color) self.cf_entry.set_text( self.get_setting("custom_format", DEFAULT_CUSTOM_FORMAT)) td = self.get_setting("text_direction", "default") tds = ["default", "left-right", "top-down", "bottom-up"] self.td_cbt.set_active(tds.index(td)) cf = self.get_setting("use_custom_format", False) self.custom_clock_cb.set_active(cf) self.font_button.set_sensitive(not cf) self.color_button.set_sensitive(not cf) self.date_cb.set_sensitive(not cf) self.cf_entry.set_sensitive(cf) self.cf_button.set_sensitive(cf) return DockXAppletDialog.run(self)
def run(self): self.scroll_enabled_btn.set_active(self.get_setting("scroll_enabled", CFG_SCROLL_ENABLED)) col_raw = self.get_setting("color", CFG_COLOR) col = map(float, col_raw.split(',')) self.color_btn.set_color(gtk.gdk.Color(int(col[0] * 65535), int(col[1] * 65535), int(col[2] * 65535))) self.color_btn.set_alpha(int(col[3] * 65535)) acol_raw = self.get_setting("active_color", CFG_ACTIVE_COLOR) acol = map(float, acol_raw.split(',')) self.active_color_btn.set_color(gtk.gdk.Color(int(acol[0] * 65535), int(acol[1] * 65535), int(acol[2] * 65535))) self.active_color_btn.set_alpha(int(acol[3] * 65535)) self.padding_input.set_value(self.get_setting("padding", CFG_PADDING)) self.cell_spacing_input.set_value(self.get_setting("cell_spacing", CFG_CELL_SPACING)) self.aspect_ratio_input.set_value(self.get_setting("aspect_ratio", CFG_ASPECT_RATIO)) self.desk_name_pattern_input.set_text(self.get_setting("desk_name_pattern", CFG_DESK_NAME_PATTERN)) return DockXAppletDialog.run(self)
def __init__(self, applet_name): DockXAppletDialog.__init__(self, applet_name) table = gtk.Table(2, 3) self.vbox.pack_start(table) self.font_button = gtk.FontButton() self.font_button.set_use_font(True) self.font_button.set_use_size(True) self.font_button.set_show_style(True) label = gtk.Label(_("Font:")) table.attach(label, 0, 1, 0, 1) self.font_button.set_title(_("Clock font")) self.font_button.connect("font_set", self.__set_font) table.attach(self.font_button, 1, 2, 0, 1) label = gtk.Label(_("Color:")) table.attach(label, 0, 1, 1, 2) self.color_button = gtk.ColorButton() self.color_button.set_title(_("Font color")) self.color_button.connect("color-set", self.__color_set) table.attach(self.color_button, 1, 2, 1, 2) self.date_cb = gtk.CheckButton(_("Show Date")) self.date_cb.connect("toggled", self.__cb_toggled, "show_date") table.attach(self.date_cb, 1, 2, 2, 3) frame = gtk.Frame() self.vbox.pack_start(frame) vbox = gtk.VBox() frame.add(vbox) self.custom_clock_cb = gtk.CheckButton(_("Use custom clock")) self.custom_clock_cb.connect("toggled", self.__cb_toggled, "use_custom_format") vbox.pack_start(self.custom_clock_cb) hbox = gtk.HBox() vbox.pack_start(hbox) self.cf_entry = gtk.Entry() self.cf_entry.set_tooltip_text( "The format is identical to gnome-panel clock's custom format. Google 'gnome-panel custom clock' for exampels." ) hbox.pack_start(self.cf_entry) self.cf_button = gtk.Button() image = gtk.image_new_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_SMALL_TOOLBAR) self.cf_button.add(image) self.cf_button.connect("clicked", self.__set_custom_format) hbox.pack_start(self.cf_button) hbox = gtk.HBox() self.vbox.pack_start(hbox) label = gtk.Label(_("Text direction: ")) hbox.pack_start(label) self.td_cbt = gtk.combo_box_new_text() self.td_cbt.append_text(_("default")) self.td_cbt.append_text(_("left-right")) self.td_cbt.append_text(_("top-down")) self.td_cbt.append_text(_("bottom-up")) self.td_cbt.connect("changed", self.__text_direction_changed) hbox.pack_start(self.td_cbt) self.show_all()
def __init__(self, applet_name): DockXAppletDialog.__init__(self, applet_name) table = gtk.Table(7, 3) table.set_border_width(5) table.set_homogeneous(True) table.set_col_spacings(15) self.vbox.pack_start(table) self.scroll_enabled_btn = gtk.CheckButton("Change workspaces by mouse scroll") self.scroll_enabled_btn.connect("toggled", self.on_checkbox_toggle, "scroll_enabled") table.attach(self.scroll_enabled_btn, 0, 2, 0, 1) label = gtk.Label("Color") label.set_alignment(0, 0.5) table.attach(label, 0, 2, 1, 2) self.color_btn = gtk.ColorButton() self.color_btn.set_title("Color") self.color_btn.set_use_alpha(True) self.color_btn.connect("color-set", self.on_color_set, "color") table.attach(self.color_btn, 2, 3, 1, 2) label = gtk.Label("Active color") label.set_alignment(0, 0.5) table.attach(label, 0, 2, 2, 3) self.active_color_btn = gtk.ColorButton() self.active_color_btn.set_title("Active color") self.active_color_btn.set_use_alpha(True) self.active_color_btn.connect("color-set", self.on_color_set, "active_color") table.attach(self.active_color_btn, 2, 3, 2, 3) label = gtk.Label("Padding") label.set_alignment(0, 0.5) table.attach(label, 0, 1, 3, 4) self.padding_input = gtk.HScale() self.padding_input.set_digits(0) self.padding_input.set_range(0, 10) self.padding_input.set_increments(1, 5) self.padding_input.connect("change-value", self.on_range_value_set, "padding") table.attach(self.padding_input, 1, 3, 3, 4) label = gtk.Label("Cell spacing") label.set_alignment(0, 0.5) table.attach(label, 0, 1, 4, 5) self.cell_spacing_input = gtk.HScale() self.cell_spacing_input.set_digits(0) self.cell_spacing_input.set_range(0, 10) self.cell_spacing_input.set_increments(1, 5) self.cell_spacing_input.connect("change-value", self.on_range_value_set, "cell_spacing") table.attach(self.cell_spacing_input, 1, 3, 4, 5) label = gtk.Label("Aspect ratio") label.set_alignment(0, 0.5) table.attach(label, 0, 1, 5, 6) self.aspect_ratio_input = gtk.HScale() self.aspect_ratio_input.set_digits(1) self.aspect_ratio_input.set_range(0.3, 3.0) self.aspect_ratio_input.set_increments(0.1, 1) self.aspect_ratio_input.connect("change-value", self.on_range_value_set, "aspect_ratio") table.attach(self.aspect_ratio_input, 1, 3, 5, 6) label = gtk.Label("Workspace name pattern") label.set_alignment(0, 0.5) table.attach(label, 0, 1, 6, 7) self.desk_name_pattern_input = gtk.Entry() self.desk_name_pattern_input.set_tooltip_text("%n - workspace number\n%x - workspace column\n%y - workspace row") self.desk_name_pattern_input.connect("changed", self.on_entry_value_set, "desk_name_pattern") table.attach(self.desk_name_pattern_input, 1, 3, 6, 7) self.show_all()