-
- temp = gtk.Label("Padding (x, y)")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 1, 2, xpadding=10)
- self.clockPadX = gtk.Entry(6)
- self.clockPadX.set_width_chars(8)
- self.clockPadX.set_text(CLOCK_PADDING_X)
- self.clockPadX.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockPadX, 1, 2, 1, 2, xoptions=gtk.EXPAND)
- self.clockPadY = gtk.Entry(6)
- self.clockPadY.set_width_chars(8)
- self.clockPadY.set_text(CLOCK_PADDING_Y)
- self.clockPadY.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockPadY, 2, 3, 1, 2, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Clock Background ID")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 2, 3, xpadding=10)
- self.clockBg = gtk.combo_box_new_text()
- self.clockBg.append_text("0 (fully transparent)")
- for i in range(len(self.bgs)):
- self.clockBg.append_text(str(i+1))
- self.clockBg.set_active(0)
- self.clockBg.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockBg, 1, 2, 2, 3, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
- temp = gtk.Label("Left Click Command")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 3, 4, xpadding=10)
- self.clockLClick = gtk.Entry(50)
- self.clockLClick.set_width_chars(20)
- self.clockLClick.set_text(CLOCK_LCLICK)
- self.clockLClick.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockLClick, 1, 2, 3, 4, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Right Click Command")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 4, 5, xpadding=10)
- self.clockRClick = gtk.Entry(50)
- self.clockRClick.set_width_chars(20)
- self.clockRClick.set_text(CLOCK_RCLICK)
- self.clockRClick.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockRClick, 1, 2, 4, 5, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Time 1 Timezone")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 5, 6, xpadding=10)
- self.clockTime1Timezone = gtk.Entry(50)
- self.clockTime1Timezone.set_width_chars(20)
- self.clockTime1Timezone.set_text(CLOCK_TIME1_TIMEZONE)
- self.clockTime1Timezone.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockTime1Timezone, 1, 2, 5, 6, xoptions=gtk.EXPAND)
- self.clockTimezone1CheckButton = gtk.CheckButton("Enable")
- self.clockTimezone1CheckButton.set_active(False)
- self.clockTimezone1CheckButton.connect("toggled", self.changeOccurred)
- self.tableClockSettings.attach(self.clockTimezone1CheckButton, 2, 3, 5, 6, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Time 2 Timezone")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 6, 7, xpadding=10)
- self.clockTime2Timezone = gtk.Entry(50)
- self.clockTime2Timezone.set_width_chars(20)
- self.clockTime2Timezone.set_text(CLOCK_TIME2_TIMEZONE)
- self.clockTime2Timezone.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockTime2Timezone, 1, 2, 6, 7, xoptions=gtk.EXPAND)
- self.clockTimezone2CheckButton = gtk.CheckButton("Enable")
- self.clockTimezone2CheckButton.set_active(False)
- self.clockTimezone2CheckButton.connect("toggled", self.changeOccurred)
- self.tableClockSettings.attach(self.clockTimezone2CheckButton, 2, 3, 6, 7, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Tooltip Timezone")
- temp.set_alignment(0, 0.5)
- self.tableClockSettings.attach(temp, 0, 1, 7, 8, xpadding=10)
- self.clockTooltipTimezone = gtk.Entry(50)
- self.clockTooltipTimezone.set_width_chars(20)
- self.clockTooltipTimezone.set_text(CLOCK_TOOLTIP_TIMEZONE)
- self.clockTooltipTimezone.connect("changed", self.changeOccurred)
- self.tableClockSettings.attach(self.clockTooltipTimezone, 1, 2, 7, 8, xoptions=gtk.EXPAND)
- self.clockTimezoneTooltipCheckButton = gtk.CheckButton("Enable")
- self.clockTimezoneTooltipCheckButton.set_active(False)
- self.clockTimezoneTooltipCheckButton.connect("toggled", self.changeOccurred)
- self.tableClockSettings.attach(self.clockTimezoneTooltipCheckButton, 2, 3, 7, 8, xoptions=gtk.EXPAND)
-
- # Tooltip Options
- self.tableTooltip = gtk.Table(rows=7, columns=3, homogeneous=False)
- self.tableTooltip.set_row_spacings(5)
- self.tableTooltip.set_col_spacings(5)
-
- temp = gtk.Label("Show Tooltips")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 0, 1, xpadding=10)
- self.tooltipShow = gtk.CheckButton()
- self.tooltipShow.set_active(False)
- self.tooltipShow.connect("toggled", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipShow, 1, 2, 0, 1, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Padding (x, y)")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 1, 2, xpadding=10)
- self.tooltipPadX = gtk.Entry(6)
- self.tooltipPadX.set_width_chars(8)
- self.tooltipPadX.set_text(TOOLTIP_PADDING_X)
- self.tooltipPadX.connect("changed", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipPadX, 1, 2, 1, 2, xoptions=gtk.EXPAND)
- self.tooltipPadY = gtk.Entry(6)
- self.tooltipPadY.set_width_chars(8)
- self.tooltipPadY.set_text(TOOLTIP_PADDING_Y)
- self.tooltipPadY.connect("changed", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipPadY, 2, 3, 1, 2, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Tooltip Show Timeout (seconds)")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 2, 3, xpadding=10)
- self.tooltipShowTime = gtk.Entry(6)
- self.tooltipShowTime.set_width_chars(8)
- self.tooltipShowTime.set_text(TOOLTIP_SHOW_TIMEOUT)
- self.tooltipShowTime.connect("changed", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipShowTime, 1, 2, 2, 3, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Tooltip Hide Timeout (seconds)")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 3, 4, xpadding=10)
- self.tooltipHideTime = gtk.Entry(6)
- self.tooltipHideTime.set_width_chars(8)
- self.tooltipHideTime.set_text(TOOLTIP_HIDE_TIMEOUT)
- self.tooltipHideTime.connect("changed", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipHideTime, 1, 2, 3, 4, xoptions=gtk.EXPAND)
-
- temp = gtk.Label("Tooltip Background ID")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 4, 5, xpadding=10)
- self.tooltipBg = gtk.combo_box_new_text()
- self.tooltipBg.append_text("0 (fully transparent)")
- for i in range(len(self.bgs)):
- self.tooltipBg.append_text(str(i+1))
- self.tooltipBg.set_active(0)
- self.tooltipBg.connect("changed", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipBg, 1, 2, 4, 5, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
- temp = gtk.Label("Tooltip Font")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 5, 6, xpadding=10)
- self.tooltipFont = gtk.FontButton()
- self.tooltipFont.set_font_name(self.defaults["font"])
- self.tooltipFont.connect("font-set", self.changeOccurred)
- self.tableTooltip.attach(self.tooltipFont, 1, 2, 5, 6, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
- temp = gtk.Label("Tooltip Font Color")
- temp.set_alignment(0, 0.5)
- self.tableTooltip.attach(temp, 0, 1, 6, 7, xpadding=10)
- self.tooltipFontCol = gtk.Entry(7)
- self.tooltipFontCol.set_width_chars(9)
- self.tooltipFontCol.set_name("tooltipFontCol")
- self.tooltipFontCol.connect("activate", self.colorTyped)
- self.tableTooltip.attach(self.tooltipFontCol, 1, 2, 6, 7, xoptions=gtk.EXPAND)
- self.tooltipFontColButton = gtk.ColorButton(gtk.gdk.color_parse(self.defaults["fgColor"]))
- self.tooltipFontColButton.set_use_alpha(True)
- self.tooltipFontColButton.set_name("tooltipFontCol")
- self.tooltipFontColButton.connect("color-set", self.colorChange)
- self.tableTooltip.attach(self.tooltipFontColButton, 2, 3, 6, 7, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
- self.tooltipFontCol.set_text(self.defaults["fgColor"])
- # Add this AFTER we set color to avoid "changed" event
- self.clockFontCol.connect("changed", self.changeOccurred)
-
- # Mouse Options
+ self.registerComponent("clock_font_color", (self.clockFontCol, self.clockFontColButton))
+
+ createLabel(self.tableClockSettings, text="Padding (x, y)", gridX=0, gridY=1, xPadding=10)
+ self.clockPadX = createEntry(self.tableClockSettings, maxSize=6, width=8, text=CLOCK_PADDING_X, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.clockPadY = createEntry(self.tableClockSettings, maxSize=6, width=8, text=CLOCK_PADDING_Y, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("clock_padding", (self.clockPadX, self.clockPadY))
+
+ createLabel(self.tableClockSettings, text="Clock Background ID", gridX=0, gridY=2, xPadding=10)
+ self.clockBg = createComboBox(self.tableClockSettings, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=2, handler=self.changeOccurred)
+ self.registerComponent("clock_background_id", self.clockBg)
+
+ createLabel(self.tableClockSettings, text="Left Click Command", gridX=0, gridY=3, xPadding=10)
+ self.clockLClick = createEntry(self.tableClockSettings, maxSize=50, width=20, text=CLOCK_LCLICK, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("clock_lclick_command", self.clockLClick)
+
+ createLabel(self.tableClockSettings, text="Right Click Command", gridX=0, gridY=4, xPadding=10)
+ self.clockRClick = createEntry(self.tableClockSettings, maxSize=50, width=20, text=CLOCK_RCLICK, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("clock_rclick_command", self.clockRClick)
+
+ createLabel(self.tableClockSettings, text="Time 1 Timezone", gridX=0, gridY=5, xPadding=10)
+ self.clockTime1Timezone = createEntry(self.tableClockSettings, maxSize=50, width=20, text=CLOCK_TIME1_TIMEZONE, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.clockTimezone1CheckButton = createCheckButton(self.tableClockSettings, text="Enable", active=False, gridX=2, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("time1_timezone", self.clockTime1Timezone)
+
+ createLabel(self.tableClockSettings, text="Time 2 Timezone", gridX=0, gridY=6, xPadding=10)
+ self.clockTime2Timezone = createEntry(self.tableClockSettings, maxSize=50, width=20, text=CLOCK_TIME2_TIMEZONE, gridX=1, gridY=6, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.clockTimezone2CheckButton = createCheckButton(self.tableClockSettings, text="Enable", active=False, gridX=2, gridY=6, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("time2_timezone", self.clockTime2Timezone)
+
+ createLabel(self.tableClockSettings, text="Tooltip Timezone", gridX=0, gridY=7, xPadding=10)
+ self.clockTooltipTimezone = createEntry(self.tableClockSettings, maxSize=50, width=20, text=CLOCK_TOOLTIP_TIMEZONE, gridX=1, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.clockTimezoneTooltipCheckButton = createCheckButton(self.tableClockSettings, text="Enable", active=False, gridX=2, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("clock_tooltip_timezone", self.clockTooltipTimezone)
+
+ def createMouseWidgets(self):
+ """Creates the Mouse widgets."""