# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#*************************************************************************/
-# Last modified: 21st April 2010
+# Last modified: 14th June 2010
import pygtk
pygtk.require('2.0')
# Project information
NAME = "tintwizard"
AUTHORS = ["Euan Freeman <euan04@gmail.com>"]
-VERSION = "0.3.3b"
+VERSION = "0.3.4"
COMMENTS = "tintwizard generates config files for the lightweight panel replacement tint2"
WEBSITE = "http://code.google.com/p/tintwizard/"
PANEL_PADDING_X = "0"
PANEL_PADDING_Y = "0"
PANEL_MONITOR = "all"
+PANEL_ITEMS = "TSC"
PANEL_AUTOHIDE_SHOW = "0.0"
PANEL_AUTOHIDE_HIDE = "0.0"
PANEL_AUTOHIDE_HEIGHT = "0"
def __init__(self, tw):
"""Create and shows the window."""
self.tw = tw
-
+
# Create top-level window
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
-
+
self.set_title("Preferences")
self.connect("delete_event", self.quit)
-
+
self.layout = gtk.Table(2, 2, False)
-
+
self.table = gtk.Table(5, 2, False)
self.table.set_row_spacings(5)
self.table.set_col_spacings(5)
-
+
createLabel(self.table, text="Default Font", gridX=0, gridY=0)
self.font = gtk.FontButton(self.tw.defaults["font"])
self.font.set_alignment(0, 0.5)
self.table.attach(self.font, 1, 2, 0, 1, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
+
createLabel(self.table, text="Default Background Color", gridX=0, gridY=1)
self.bgColor = gtk.ColorButton(gtk.gdk.color_parse(self.tw.defaults["bgColor"]))
self.bgColor.set_alignment(0, 0.5)
self.table.attach(self.bgColor, 1, 2, 1, 2, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
+
createLabel(self.table, text="Default Foreground Color", gridX=0, gridY=2)
self.fgColor = gtk.ColorButton(gtk.gdk.color_parse(self.tw.defaults["fgColor"]))
self.fgColor.set_alignment(0, 0.5)
self.table.attach(self.fgColor, 1, 2, 2, 3, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
+
createLabel(self.table, text="Default Border Color", gridX=0, gridY=3)
self.borderColor = gtk.ColorButton(gtk.gdk.color_parse(self.tw.defaults["borderColor"]))
self.borderColor.set_alignment(0, 0.5)
self.bgCount = createEntry(self.table, maxSize=6, width=8, text=str(self.tw.defaults["bgCount"]), gridX=1, gridY=4, xExpand=True, yExpand=True)
self.layout.attach(self.table, 0, 2, 0, 1, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND, xpadding=20, ypadding=5)
-
+
createButton(self.layout, text="Save", stock=gtk.STOCK_SAVE, name="save", gridX=0, gridY=1, xExpand=True, yExpand=True, handler=self.save)
createButton(self.layout, text="Cancel", stock=gtk.STOCK_CANCEL, name="cancel", gridX=1, gridY=1, xExpand=True, yExpand=True, handler=self.quit)
-
+
self.add(self.layout)
self.show_all()
# self.table is our main layout manager
self.table = gtk.Table(4, 1, False)
-
+
# Set up the dictionary to hold all registered widgets
self.propUI = {}
# Add buttons for adding/deleting background styles
createButton(self.tableBgs, text="New Background", stock=gtk.STOCK_NEW, name="addBg", gridX=0, gridY=1, xExpand=True, yExpand=True, handler=self.addBgClick)
createButton(self.tableBgs, text="Delete Background", stock=gtk.STOCK_DELETE, name="delBg", gridX=1, gridY=1, xExpand=True, yExpand=True, handler=self.delBgClick)
-
+
# Panel
self.createPanelDisplayWidgets()
self.createPanelSettingsWidgets()
self.createPanelAutohideWidgets()
-
+
# Taskbar
self.createTaskbarWidgets()
-
+
# Tasks
self.createTaskSettingsWidgets()
self.createNormalTasksWidgets()
self.createActiveTasksWidgets()
self.createUrgentTasksWidgets()
self.createIconifiedTasksWidgets()
-
+
# System Tray
self.createSystemTrayWidgets()
-
+
# Clock
self.createClockDisplayWidgets()
self.createClockSettingsWidgets()
-
+
# Mouse
self.createMouseWidgets()
-
+
# Tooltips
self.createTooltipsWidgets()
-
+
# Battery
self.createBatteryWidgets()
-
+
# View Config
self.configArea = gtk.ScrolledWindow()
self.configBuf = gtk.TextBuffer()
self.panelNotebook = gtk.Notebook()
self.panelNotebook.set_tab_pos(gtk.POS_TOP)
self.panelNotebook.set_current_page(0)
-
+
self.panelNotebook.append_page(self.tablePanelDisplay, gtk.Label("Panel Display"))
self.panelNotebook.append_page(self.tablePanelSettings, gtk.Label("Panel Settings"))
self.panelNotebook.append_page(self.tablePanelAutohide, gtk.Label("Panel Autohide"))
-
+
self.taskNotebook = gtk.Notebook()
self.taskNotebook.set_tab_pos(gtk.POS_TOP)
self.taskNotebook.set_current_page(0)
self.taskNotebook.append_page(self.tableTaskActive, gtk.Label("Active Tasks"))
self.taskNotebook.append_page(self.tableTaskUrgent, gtk.Label("Urgent Tasks"))
self.taskNotebook.append_page(self.tableTaskIconified, gtk.Label("Iconified Tasks"))
-
+
self.clockNotebook = gtk.Notebook()
self.clockNotebook.set_tab_pos(gtk.POS_TOP)
self.clockNotebook.set_current_page(0)
self.add(self.table)
self.show_all()
-
+
# If tintwizard was launched with a tint2 config filename
# as an argument, load that config.
if self.oneConfigFile:
self.readTint2Config()
self.generateConfig()
-
+
def createPanelDisplayWidgets(self):
"""Create the Panel Display widgets."""
- self.tablePanelDisplay = gtk.Table(rows=6, columns=3, homogeneous=False)
+ self.tablePanelDisplay = gtk.Table(rows=7, columns=3, homogeneous=False)
self.tablePanelDisplay.set_row_spacings(5)
self.tablePanelDisplay.set_col_spacings(5)
-
+
createLabel(self.tablePanelDisplay, text="Position", gridX=0, gridY=0, xPadding=10)
self.panelPosY = createComboBox(self.tablePanelDisplay, ["bottom", "top", "center"], gridX=1, gridY=0, handler=self.changeOccurred)
self.panelPosX = createComboBox(self.tablePanelDisplay, ["left", "right", "center"], gridX=2, gridY=0, handler=self.changeOccurred)
# Note: registered below
-
+
createLabel(self.tablePanelDisplay, text="Panel Orientation", gridX=0, gridY=1, xPadding=10)
self.panelOrientation = createComboBox(self.tablePanelDisplay, ["horizontal", "vertical"], gridX=1, gridY=1, handler=self.changeOccurred)
self.registerComponent("panel_position", (self.panelPosY, self.panelPosX, self.panelOrientation))
-
- self.panelSizeLabel = createLabel(self.tablePanelDisplay, text="Size (width, height)", gridX=0, gridY=2, xPadding=10)
- self.panelSizeX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_SIZE_X, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.panelSizeY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_SIZE_Y, gridX=2, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
+
+ createLabel(self.tablePanelDisplay, text="Panel Items", gridX=0, gridY=2, xPadding=10)
+ self.panelItems = createEntry(self.tablePanelDisplay, maxSize=7, width=8, text=PANEL_ITEMS, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.registerComponent("panel_items", self.panelItems)
+
+ self.panelSizeLabel = createLabel(self.tablePanelDisplay, text="Size (width, height)", gridX=0, gridY=3, xPadding=10)
+ self.panelSizeX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_SIZE_X, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.panelSizeY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_SIZE_Y, gridX=2, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_size", (self.panelSizeX, self.panelSizeY))
-
- createLabel(self.tablePanelDisplay, text="Margin (x, y)", gridX=0, gridY=3, xPadding=10)
- self.panelMarginX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_MARGIN_X, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.panelMarginY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_MARGIN_Y, gridX=2, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
+
+ createLabel(self.tablePanelDisplay, text="Margin (x, y)", gridX=0, gridY=4, xPadding=10)
+ self.panelMarginX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_MARGIN_X, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.panelMarginY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_MARGIN_Y, gridX=2, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_margin", (self.panelMarginX, self.panelMarginY))
-
- createLabel(self.tablePanelDisplay, text="Padding (x, y)", gridX=0, gridY=4, xPadding=10)
- self.panelPadX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_PADDING_X, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.panelPadY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_PADDING_Y, gridX=2, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
+
+ createLabel(self.tablePanelDisplay, text="Padding (x, y)", gridX=0, gridY=5, xPadding=10)
+ self.panelPadX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_PADDING_X, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
+ self.panelPadY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_PADDING_Y, gridX=2, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
- createLabel(self.tablePanelDisplay, text="Horizontal Spacing", gridX=0, gridY=5, xPadding=10)
- self.panelSpacing = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=TASKBAR_SPACING, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
+
+ createLabel(self.tablePanelDisplay, text="Horizontal Spacing", gridX=0, gridY=6, xPadding=10)
+ self.panelSpacing = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=TASKBAR_SPACING, gridX=1, gridY=6, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_padding", (self.panelPadX, self.panelPadY, self.panelSpacing))
-
- createLabel(self.tablePanelDisplay, text="Panel Background ID", gridX=0, gridY=6, xPadding=10)
- self.panelBg = createComboBox(self.tablePanelDisplay, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=6, handler=self.changeOccurred)
+
+ createLabel(self.tablePanelDisplay, text="Panel Background ID", gridX=0, gridY=7, xPadding=10)
+ self.panelBg = createComboBox(self.tablePanelDisplay, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=7, handler=self.changeOccurred)
self.registerComponent("panel_background_id", self.panelBg)
-
+
def createPanelSettingsWidgets(self):
"""Create the Panel Settings widgets."""
self.tablePanelSettings = gtk.Table(rows=5, columns=3, homogeneous=False)
self.tablePanelSettings.set_row_spacings(5)
self.tablePanelSettings.set_col_spacings(5)
-
+
createLabel(self.tablePanelSettings, text="Window Manager Menu", gridX=0, gridY=0, xPadding=10)
self.panelMenu = createCheckButton(self.tablePanelSettings, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("wm_menu", self.panelMenu)
-
+
createLabel(self.tablePanelSettings, text="Place In Window Manager Dock", gridX=0, gridY=1, xPadding=10)
self.panelDock = createCheckButton(self.tablePanelSettings, active=False, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_dock", self.panelDock)
-
+
createLabel(self.tablePanelSettings, text="Panel Layer", gridX=0, gridY=2, xPadding=10)
self.panelLayer = createComboBox(self.tablePanelSettings, ["bottom", "top", "normal"], gridX=1, gridY=2, handler=self.changeOccurred)
self.registerComponent("panel_layer", self.panelLayer)
-
+
createLabel(self.tablePanelSettings, text="Strut Policy", gridX=0, gridY=3, xPadding=10)
self.panelAutohideStrut = createComboBox(self.tablePanelSettings, ["none", "minimum", "follow_size"], gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("strut_policy", self.panelAutohideStrut)
-
+
createLabel(self.tablePanelSettings, text="Panel Monitor (all, 1, 2, ...)", gridX=0, gridY=4, xPadding=10)
self.panelMonitor = createEntry(self.tablePanelSettings, maxSize=6, width=8, text=PANEL_MONITOR, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_monitor", self.panelMonitor)
-
+
def createPanelAutohideWidgets(self):
"""Create the Panel Autohide widgets."""
self.tablePanelAutohide = gtk.Table(rows=4, columns=3, homogeneous=False)
self.tablePanelAutohide.set_row_spacings(5)
self.tablePanelAutohide.set_col_spacings(5)
-
+
createLabel(self.tablePanelAutohide, text="Autohide Panel", gridX=0, gridY=0, xPadding=10)
self.panelAutohide = createCheckButton(self.tablePanelAutohide, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide", self.panelAutohide)
-
+
createLabel(self.tablePanelAutohide, text="Autohide Show Timeout (seconds)", gridX=0, gridY=1, xPadding=10)
self.panelAutohideShow = createEntry(self.tablePanelAutohide, maxSize=6, width=8, text=PANEL_AUTOHIDE_SHOW, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide_show_timeout", self.panelAutohideShow)
-
+
createLabel(self.tablePanelAutohide, text="Autohide Hide Timeout (seconds)", gridX=0, gridY=2, xPadding=10)
self.panelAutohideHide = createEntry(self.tablePanelAutohide, maxSize=6, width=8, text=PANEL_AUTOHIDE_HIDE, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide_hide_timeout", self.panelAutohideHide)
-
+
createLabel(self.tablePanelAutohide, text="Autohide Hidden Height", gridX=0, gridY=3, xPadding=10)
self.panelAutohideHeight = createEntry(self.tablePanelAutohide, maxSize=6, width=8, text=PANEL_AUTOHIDE_HEIGHT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide_height", self.panelAutohideHeight)
-
+
def createTaskbarWidgets(self):
"""Create the Taskbar widgets."""
self.tableTaskbar = gtk.Table(rows=5, columns=3, homogeneous=False)
self.tableTaskbar.set_row_spacings(5)
self.tableTaskbar.set_col_spacings(5)
-
+
createLabel(self.tableTaskbar, text="Taskbar Mode", gridX=0, gridY=0, xPadding=10)
self.taskbarMode = createComboBox(self.tableTaskbar, ["single_desktop", "multi_desktop"], gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("taskbar_mode", self.taskbarMode)
-
+
createLabel(self.tableTaskbar, text="Padding (x, y)", gridX=0, gridY=1, xPadding=10)
self.taskbarPadX = createEntry(self.tableTaskbar, maxSize=6, width=8, text=TASKBAR_PADDING_X, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.taskbarPadY = createEntry(self.tableTaskbar, maxSize=6, width=8, text=TASKBAR_PADDING_Y, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskbar, text="Horizontal Spacing", gridX=0, gridY=2, xPadding=10)
self.taskbarSpacing = createEntry(self.tableTaskbar, maxSize=6, width=8, text=TASK_SPACING, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("taskbar_padding", (self.taskbarPadX, self.taskbarPadY, self.taskbarSpacing))
-
+
createLabel(self.tableTaskbar, text="Taskbar Background ID", gridX=0, gridY=3, xPadding=10)
self.taskbarBg = createComboBox(self.tableTaskbar, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("taskbar_background_id", self.taskbarBg)
-
+
createLabel(self.tableTaskbar, text="Active Taskbar Background ID", gridX=0, gridY=4, xPadding=10)
self.taskbarActiveBg = createComboBox(self.tableTaskbar, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=4, handler=self.changeOccurred)
- self.taskbarActiveBgEnable = createCheckButton(self.tableTaskbar, text="Enable", active=False, gridX=2, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("taskbar_active_background_id", self.taskbarActiveBg)
-
+
def createTaskSettingsWidgets(self):
"""Create the Task Settings widgets."""
self.tableTask = gtk.Table(rows=12, columns=3, homogeneous=False)
self.tableTask.set_row_spacings(5)
self.tableTask.set_col_spacings(5)
-
+
createLabel(self.tableTask, text="Number of 'Blinks' on Urgent Event", gridX=0, gridY=0, xPadding=10)
self.taskBlinks = createEntry(self.tableTask, maxSize=6, width=8, text=TASK_BLINKS, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("urgent_nb_of_blink", self.taskBlinks)
-
+
createLabel(self.tableTask, text="Show Icons", gridX=0, gridY=1, xPadding=10)
self.taskIconCheckButton = createCheckButton(self.tableTask, active=True, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_icon", self.taskIconCheckButton)
-
+
createLabel(self.tableTask, text="Show Text", gridX=0, gridY=2, xPadding=10)
self.taskTextCheckButton = createCheckButton(self.tableTask, active=True, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_text", self.taskTextCheckButton)
-
+
createLabel(self.tableTask, text="Centre Text", gridX=0, gridY=3, xPadding=10)
self.taskCentreCheckButton = createCheckButton(self.tableTask, active=True, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_centered", self.taskCentreCheckButton)
-
+
createLabel(self.tableTask, text="Font", gridX=0, gridY=4, xPadding=10)
self.fontButton = gtk.FontButton()
-
+
if self.defaults["font"] in [None, "None"]: # If there was no font specified in the config file
self.defaults["font"] = self.fontButton.get_font_name() # Use the gtk default
-
+
self.fontButton = createFontButton(self.tableTask, font=self.defaults["font"], gridX=1, gridY=4, handler=self.changeOccurred)
self.registerComponent("task_font", self.fontButton)
-
+
createLabel(self.tableTask, text="Show Font Shadow", gridX=0, gridY=5, xPadding=10)
self.fontShadowCheckButton = createCheckButton(self.tableTask, active=False, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("font_shadow", self.fontShadowCheckButton)
-
+
createLabel(self.tableTask, text="Maximum Size (x, y)", gridX=0, gridY=6, xPadding=10)
self.taskMaxSizeX = createEntry(self.tableTask, maxSize=6, width=8, text=TASK_MAXIMUM_SIZE_X, gridX=1, gridY=6, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.taskMaxSizeY = createEntry(self.tableTask, maxSize=6, width=8, text=TASK_MAXIMUM_SIZE_Y, gridX=2, gridY=6, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_maximum_size", (self.taskMaxSizeX, self.taskMaxSizeY))
-
+
createLabel(self.tableTask, text="Padding (x, y)", gridX=0, gridY=7, xPadding=10)
self.taskPadX = createEntry(self.tableTask, maxSize=6, width=8, text=TASK_PADDING_X, gridX=1, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.taskPadY = createEntry(self.tableTask, maxSize=6, width=8, text=TASK_PADDING_Y, gridX=2, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_padding", (self.taskPadX, self.taskPadY))
-
+
def createNormalTasksWidgets(self):
"""Create the Normal Tasks widgets."""
self.tableTaskDefault = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskDefault.set_row_spacings(5)
self.tableTaskDefault.set_col_spacings(5)
-
+
createLabel(self.tableTaskDefault, text="Normal Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskBg = createComboBox(self.tableTaskDefault, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_background_id", self.taskBg)
-
+
createLabel(self.tableTaskDefault, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
-
+
createLabel(self.tableTaskDefault, text="Normal Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.iconHue = createEntry(self.tableTaskDefault, maxSize=6, width=8, text=ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskDefault, text="Normal Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.iconSat = createEntry(self.tableTaskDefault, maxSize=6, width=8, text=ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskDefault, text="Normal Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.iconBri = createEntry(self.tableTaskDefault, maxSize=6, width=8, text=ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_icon_asb", (self.iconHue, self.iconSat, self.iconBri))
-
+
createLabel(self.tableTaskDefault, text="Normal Font Color", gridX=0, gridY=5, xPadding=10)
self.fontCol = createEntry(self.tableTaskDefault, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontCol")
self.fontCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.fontCol.connect("changed", self.changeOccurred)
self.registerComponent("task_font_color", (self.fontCol, self.fontColButton))
-
+
def createActiveTasksWidgets(self):
"""Create the Active Tasks widgets."""
self.tableTaskActive = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskActive.set_row_spacings(5)
self.tableTaskActive.set_col_spacings(5)
-
+
createLabel(self.tableTaskActive, text="Active Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskActiveBg = createComboBox(self.tableTaskActive, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_active_background_id", self.taskActiveBg)
-
+
createLabel(self.tableTaskActive, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
-
+
createLabel(self.tableTaskActive, text="Active Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.activeIconHue = createEntry(self.tableTaskActive, maxSize=6, width=8, text=ACTIVE_ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskActive, text="Active Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.activeIconSat = createEntry(self.tableTaskActive, maxSize=6, width=8, text=ACTIVE_ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskActive, text="Active Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.activeIconBri = createEntry(self.tableTaskActive, maxSize=6, width=8, text=ACTIVE_ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_active_icon_asb", (self.activeIconHue, self.activeIconSat, self.activeIconBri))
-
+
createLabel(self.tableTaskActive, text="Active Font Color", gridX=0, gridY=5, xPadding=10)
self.fontActiveCol = createEntry(self.tableTaskActive, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontActiveCol")
self.fontActiveCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.fontActiveCol.connect("changed", self.changeOccurred)
self.registerComponent("task_active_font_color", (self.fontActiveCol, self.fontActiveColButton))
-
+
def createUrgentTasksWidgets(self):
"""Create the Urgent Tasks widgets."""
self.tableTaskUrgent = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskUrgent.set_row_spacings(5)
self.tableTaskUrgent.set_col_spacings(5)
-
+
createLabel(self.tableTaskUrgent, text="Urgent Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskUrgentBg = createComboBox(self.tableTaskUrgent, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_urgent_background_id", self.taskUrgentBg)
-
+
createLabel(self.tableTaskUrgent, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
-
+
createLabel(self.tableTaskUrgent, text="Urgent Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.urgentIconHue = createEntry(self.tableTaskUrgent, maxSize=6, width=8, text=URGENT_ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskUrgent, text="Urgent Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.urgentIconSat = createEntry(self.tableTaskUrgent, maxSize=6, width=8, text=URGENT_ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskUrgent, text="Urgent Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.urgentIconBri = createEntry(self.tableTaskUrgent, maxSize=6, width=8, text=URGENT_ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_urgent_icon_asb", (self.urgentIconHue, self.urgentIconSat, self.urgentIconBri))
-
+
createLabel(self.tableTaskUrgent, text="Urgent Font Color", gridX=0, gridY=5, xPadding=10)
self.fontUrgentCol = createEntry(self.tableTaskUrgent, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontUrgentCol")
self.fontUrgentCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.fontUrgentCol.connect("changed", self.changeOccurred)
self.registerComponent("task_urgent_font_color", (self.fontUrgentCol, self.fontUrgentColButton))
-
+
def createIconifiedTasksWidgets(self):
"""Create the Iconified Tasks widgets."""
self.tableTaskIconified = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskIconified.set_row_spacings(5)
self.tableTaskIconified.set_col_spacings(5)
-
+
createLabel(self.tableTaskIconified, text="Iconified Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskIconifiedBg = createComboBox(self.tableTaskIconified, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_iconified_background_id", self.taskIconifiedBg)
-
+
createLabel(self.tableTaskIconified, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
-
+
createLabel(self.tableTaskIconified, text="Iconified Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.iconifiedIconHue = createEntry(self.tableTaskIconified, maxSize=6, width=8, text=ICONIFIED_ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskIconified, text="Iconified Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.iconifiedIconSat = createEntry(self.tableTaskIconified, maxSize=6, width=8, text=ICONIFIED_ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTaskIconified, text="Iconified Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.iconifiedIconBri = createEntry(self.tableTaskIconified, maxSize=6, width=8, text=ICONIFIED_ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_iconified_icon_asb", (self.iconifiedIconHue, self.iconifiedIconSat, self.iconifiedIconBri))
-
+
createLabel(self.tableTaskIconified, text="Iconified Font Color", gridX=0, gridY=5, xPadding=10)
self.fontIconifiedCol = createEntry(self.tableTaskIconified, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontIconifiedCol")
self.fontIconifiedCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.fontIconifiedCol.connect("changed", self.changeOccurred)
self.registerComponent("task_iconified_font_color", (self.fontIconifiedCol, self.fontIconifiedColButton))
-
+
def createSystemTrayWidgets(self):
"""Create the System Tray widgets."""
self.tableTray = gtk.Table(rows=9, columns=3, homogeneous=False)
self.tableTray.set_row_spacings(5)
self.tableTray.set_col_spacings(5)
-
- createLabel(self.tableTray, text="Show System Tray", gridX=0, gridY=0, xPadding=10)
- self.trayShow = createCheckButton(self.tableTray, active=True, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.registerComponent("systray", self.trayShow)
-
+
createLabel(self.tableTray, text="Padding (x, y)", gridX=0, gridY=1, xPadding=10)
self.trayPadX = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_PADDING_X, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.trayPadY = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_PADDING_Y, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTray, text="Horizontal Spacing", gridX=0, gridY=2, xPadding=10)
self.traySpacing = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_SPACING, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("systray_padding", (self.trayPadX, self.trayPadY, self.traySpacing))
-
+
createLabel(self.tableTray, text="System Tray Background ID", gridX=0, gridY=3, xPadding=10)
self.trayBg = createComboBox(self.tableTray, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("systray_background_id", self.trayBg)
-
+
createLabel(self.tableTray, text="Icon Ordering", gridX=0, gridY=4, xPadding=10)
self.trayOrder = createComboBox(self.tableTray, ["ascending", "descending", "left2right", "right2left"], gridX=1, gridY=4, handler=self.changeOccurred)
self.registerComponent("systray_sort", self.trayOrder)
-
+
createLabel(self.tableTray, text="Maximum Icon Size (0 for automatic size)", gridX=0, gridY=5, xPadding=10)
self.trayMaxIconSize = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_MAX_ICON_SIZE, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("systray_icon_size", self.trayMaxIconSize)
-
+
createLabel(self.tableTray, text="System Tray Icon Alpha (0 to 100)", gridX=0, gridY=6, xPadding=10)
self.trayIconHue = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_ICON_ALPHA, gridX=1, gridY=6, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTray, text="System Tray Icon Saturation (-100 to 100)", gridX=0, gridY=7, xPadding=10)
self.trayIconSat = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_ICON_SAT, gridX=1, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
-
+
createLabel(self.tableTray, text="System Tray Icon Brightness (-100 to 100)", gridX=0, gridY=8, xPadding=10)
self.trayIconBri = createEntry(self.tableTray, maxSize=6, width=8, text=TRAY_ICON_BRI, gridX=1, gridY=8, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("systray_icon_asb", (self.trayIconHue, self.trayIconSat, self.trayIconBri))
-
+
def createClockDisplayWidgets(self):
"""Create the Clock Display widgets."""
self.tableClockDisplays = gtk.Table(rows=3, columns=3, homogeneous=False)
self.tableClockDisplays.set_row_spacings(5)
self.tableClockDisplays.set_col_spacings(5)
-
- createLabel(self.tableClockDisplays, text="Show", gridX=0, gridY=0, xPadding=10)
- self.clockCheckButton = createCheckButton(self.tableClockDisplays, active=True, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
-
+
createLabel(self.tableClockDisplays, text="Time 1 Format", gridX=0, gridY=1, xPadding=10)
self.clock1Format = createEntry(self.tableClockDisplays, maxSize=50, width=20, text=CLOCK_FMT_1, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.clock1CheckButton = createCheckButton(self.tableClockDisplays, text="Show", active=True, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("time1_format", self.clock1Format)
-
+
createLabel(self.tableClockDisplays, text="Time 1 Font", gridX=0, gridY=2, xPadding=10)
self.clock1FontButton = createFontButton(self.tableClockDisplays, font=self.defaults["font"], gridX=1, gridY=2, handler=self.changeOccurred)
self.registerComponent("time1_font", self.clock1FontButton)
-
+
createLabel(self.tableClockDisplays, text="Time 2 Format", gridX=0, gridY=3, xPadding=10)
self.clock2Format = createEntry(self.tableClockDisplays, maxSize=50, width=20, text=CLOCK_FMT_2, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.clock2CheckButton = createCheckButton(self.tableClockDisplays, text="Show", active=True, gridX=2, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("time2_format", self.clock2Format)
-
+
createLabel(self.tableClockDisplays, text="Time 2 Font", gridX=0, gridY=4, xPadding=10)
self.clock2FontButton = createFontButton(self.tableClockDisplays, font=self.defaults["font"], gridX=1, gridY=4, handler=self.changeOccurred)
self.registerComponent("time2_font", self.clock2FontButton)
-
+
createLabel(self.tableClockDisplays, text="Tooltip Format", gridX=0, gridY=5, xPadding=10)
self.clockTooltipFormat = createEntry(self.tableClockDisplays, maxSize=50, width=20, text=CLOCK_TOOLTIP, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.clockTooltipCheckButton = createCheckButton(self.tableClockDisplays, text="Show", active=True, gridX=2, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("clock_tooltip", self.clockTooltipFormat)
-
+
self.clockArea = gtk.ScrolledWindow()
self.clockBuf = gtk.TextBuffer()
self.clockTextView = gtk.TextView(self.clockBuf)
self.clockTextView.set_editable(False)
self.clockArea.add_with_viewport(self.clockTextView)
self.tableClockDisplays.attach(self.clockArea, 0, 3, 6, 7, xpadding=10)
-
+
def createClockSettingsWidgets(self):
"""Create the Clock Settings widgets."""
self.tableClockSettings = gtk.Table(rows=3, columns=3, homogeneous=False)
self.tableClockSettings.set_row_spacings(5)
self.tableClockSettings.set_col_spacings(5)
-
+
createLabel(self.tableClockSettings, text="Clock Font Color", gridX=0, gridY=0, xPadding=10)
self.clockFontCol = createEntry(self.tableClockSettings, maxSize=7, width=9, text="", gridX=1, gridY=0, xExpand=True, yExpand=False, handler=None, name="clockFontCol")
self.clockFontCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.clockFontCol.connect("changed", self.changeOccurred)
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."""
self.tableMouse = gtk.Table(rows=4, columns=3, homogeneous=False)
self.tableMouse.set_row_spacings(5)
self.tableMouse.set_col_spacings(5)
-
+
mouseCmds = ["none", "close", "toggle", "iconify", "shade", "toggle_iconify", "maximize_restore", "desktop_left", "desktop_right", "next_task", "prev_task"]
-
+
createLabel(self.tableMouse, text="Middle Mouse Click Action", gridX=0, gridY=0, xPadding=10)
self.mouseMiddle = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("mouse_middle", self.mouseMiddle)
-
+
createLabel(self.tableMouse, text="Right Mouse Click Action", gridX=0, gridY=1, xPadding=10)
self.mouseRight = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=1, handler=self.changeOccurred)
self.registerComponent("mouse_right", self.mouseRight)
-
+
createLabel(self.tableMouse, text="Mouse Wheel Scroll Up Action", gridX=0, gridY=2, xPadding=10)
self.mouseUp = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=2, handler=self.changeOccurred)
self.registerComponent("mouse_scroll_up", self.mouseUp)
-
+
createLabel(self.tableMouse, text="Mouse Wheel Scroll Down Action", gridX=0, gridY=3, xPadding=10)
self.mouseDown = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("mouse_scroll_down", self.mouseDown)
-
+
def createTooltipsWidgets(self):
"""Creates the Tooltips widgets."""
self.tableTooltip = gtk.Table(rows=7, columns=3, homogeneous=False)
self.tableTooltip.set_row_spacings(5)
self.tableTooltip.set_col_spacings(5)
-
+
createLabel(self.tableTooltip, text="Show Tooltips", gridX=0, gridY=0, xPadding=10)
self.tooltipShow = createCheckButton(self.tableTooltip, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip", self.tooltipShow)
-
+
createLabel(self.tableTooltip, text="Padding (x, y)", gridX=0, gridY=1, xPadding=10)
self.tooltipPadX = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_PADDING_X, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.tooltipPadY = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_PADDING_Y, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip_padding", (self.tooltipPadX, self.tooltipPadY))
-
+
createLabel(self.tableTooltip, text="Tooltip Show Timeout (seconds)", gridX=0, gridY=2, xPadding=10)
self.tooltipShowTime = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_SHOW_TIMEOUT, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip_show_timeout", self.tooltipShowTime)
-
+
createLabel(self.tableTooltip, text="Tooltip Hide Timeout (seconds)", gridX=0, gridY=3, xPadding=10)
self.tooltipHideTime = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_HIDE_TIMEOUT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip_hide_timeout", self.tooltipHideTime)
-
+
createLabel(self.tableTooltip, text="Tooltip Background ID", gridX=0, gridY=4, xPadding=10)
self.tooltipBg = createComboBox(self.tableTooltip, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=4, handler=self.changeOccurred)
self.registerComponent("tooltip_background_id", self.tooltipBg)
-
+
createLabel(self.tableTooltip, text="Tooltip Font", gridX=0, gridY=5, xPadding=10)
self.tooltipFont = createFontButton(self.tableTooltip, font=self.defaults["font"], gridX=1, gridY=5, handler=self.changeOccurred)
self.registerComponent("tooltip_font", self.tooltipFont)
-
+
createLabel(self.tableTooltip, text="Tooltip Font Color", gridX=0, gridY=6, xPadding=10)
self.tooltipFontCol = createEntry(self.tableTooltip, maxSize=7, width=9, text="", gridX=1, gridY=6, xExpand=True, yExpand=False, handler=None, name="tooltipFontCol")
self.tooltipFontCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.tooltipFontCol.connect("changed", self.changeOccurred)
self.registerComponent("tooltip_font_color", (self.tooltipFontCol, self.tooltipFontColButton))
-
+
def createBatteryWidgets(self):
"""Creates the Battery widgets."""
self.tableBattery = gtk.Table(rows=8, columns=3, homogeneous=False)
self.tableBattery.set_row_spacings(5)
self.tableBattery.set_col_spacings(5)
-
- createLabel(self.tableBattery, text="Show Battery Applet", gridX=0, gridY=0, xPadding=10)
- self.batteryCheckButton = createCheckButton(self.tableBattery, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
- self.registerComponent("battery", self.batteryCheckButton)
-
+
createLabel(self.tableBattery, text="Battery Low Status (%)", gridX=0, gridY=1, xPadding=10)
self.batteryLow = createEntry(self.tableBattery, maxSize=6, width=8, text=BATTERY_LOW, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("battery_low_status", self.batteryLow)
-
+
createLabel(self.tableBattery, text="Battery Low Action", gridX=0, gridY=2, xPadding=10)
self.batteryLowAction = createEntry(self.tableBattery, maxSize=150, width=32, text=BATTERY_ACTION, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("battery_low_cmd", self.batteryLowAction)
-
+
createLabel(self.tableBattery, text="Battery Hide (0 to 100)", gridX=0, gridY=3, xPadding=10)
self.batteryHide = createEntry(self.tableBattery, maxSize=6, width=8, text=BATTERY_HIDE, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("battery_hide", self.batteryHide)
-
+
createLabel(self.tableBattery, text="Battery 1 Font", gridX=0, gridY=4, xPadding=10)
self.bat1FontButton = createFontButton(self.tableBattery, font=self.defaults["font"], gridX=1, gridY=4, handler=self.changeOccurred)
self.registerComponent("bat1_font", self.bat1FontButton)
-
+
createLabel(self.tableBattery, text="Battery 2 Font", gridX=0, gridY=5, xPadding=10)
self.bat2FontButton = createFontButton(self.tableBattery, font=self.defaults["font"], gridX=1, gridY=5, handler=self.changeOccurred)
self.registerComponent("bat2_font", self.bat2FontButton)
-
+
createLabel(self.tableBattery, text="Battery Font Color", gridX=0, gridY=6, xPadding=10)
self.batteryFontCol = createEntry(self.tableBattery, maxSize=7, width=9, text="", gridX=1, gridY=6, xExpand=True, yExpand=False, handler=None, name="batteryFontCol")
self.batteryFontCol.connect("activate", self.colorTyped)
# Add this AFTER we set color to avoid "changed" event
self.batteryFontCol.connect("changed", self.changeOccurred)
self.registerComponent("battery_font_color", (self.batteryFontCol, self.batteryFontColButton))
-
+
createLabel(self.tableBattery, text="Padding (x, y)", gridX=0, gridY=7, xPadding=10)
self.batteryPadX = createEntry(self.tableBattery, maxSize=6, width=8, text=BATTERY_PADDING_X, gridX=1, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.batteryPadY = createEntry(self.tableBattery, maxSize=6, width=8, text=BATTERY_PADDING_Y, gridX=2, gridY=7, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("battery_padding", (self.batteryPadX, self.batteryPadY))
-
+
createLabel(self.tableBattery, text="Battery Background ID", gridX=0, gridY=8, xPadding=10)
self.batteryBg = createComboBox(self.tableBattery, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=8, handler=self.changeOccurred)
self.registerComponent("battery_background_id", self.batteryBg)
-
+
def registerComponent(self, configProperty, component):
"""Registers a component with a particular property from
a tint2 config. Note: a component may be a double or
triple if that property has more than one value associated
with it."""
self.propUI[configProperty] = component
-
+
def getComponent(self, configProperty):
"""Fetches the component associated with a tint2 property."""
return self.propUI[configProperty] if configProperty in self.propUI else None
-
+
def about(self, action=None):
"""Displays the About dialog."""
about = gtk.AboutDialog()
def addBg(self):
"""Adds a new background to the list of backgrounds."""
self.bgs += [gtk.Table(4, 3, False)]
-
+
createLabel(self.bgs[-1], text="Corner Rounding (px)", gridX=0, gridY=0, xPadding=10)
createEntry(self.bgs[-1], maxSize=7, width=9, text=BG_ROUNDING, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred, name="rounded")
-
+
createLabel(self.bgs[-1], text="Background Color", gridX=0, gridY=1, xPadding=10)
temp = gtk.Entry(7)
temp.set_width_chars(9)
temp.set_name("bgCol")
temp.connect("color-set", self.colorChange)
self.bgs[-1].attach(temp, 2, 3, 1, 2, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
-
+
createLabel(self.bgs[-1], text="Border Width (px)", gridX=0, gridY=2, xPadding=10)
createEntry(self.bgs[-1], maxSize=7, width=9, text=BG_BORDER, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred, name="border")
-
+
createLabel(self.bgs[-1], text="Border Color", gridX=0, gridY=3, xPadding=10)
temp = gtk.Entry(7)
temp.set_width_chars(9)
if not init:
self.changeOccurred()
-
+
def addBgDefs(self, bgDefs):
"""Add interface elements for a list of background style definitions. bgDefs
should be a list containing dictionaries with the following keys: rounded,
self.updateComboBoxes(newId-1, "add")
self.bgNotebook.set_current_page(newId)
-
+
def apply(self, widget, event=None, confirmChange=True):
"""Applies the current config to tint2."""
# Check if tint2 is running
- procs = os.popen('pidof "tint2"') # Check list of active processes for tint2
+ procs = os.popen('pgrep -x "tint2"') # Check list of active processes for tint2
pids = [] # List of process ids for tint2
for proc in procs.readlines():
self.configBuf.insert(self.configBuf.get_end_iter(), "wm_menu = %s\n" % int(self.panelMenu.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "panel_layer = %s\n" % (self.panelLayer.get_active_text()))
self.configBuf.insert(self.configBuf.get_end_iter(), "panel_background_id = %s\n" % (self.panelBg.get_active()))
-
+
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Panel Autohide\n")
self.configBuf.insert(self.configBuf.get_end_iter(), "autohide = %s\n" % int(self.panelAutohide.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "autohide_show_timeout = %s\n" % (self.panelAutohideShow.get_text() if self.panelAutohideShow.get_text() else PANEL_AUTOHIDE_SHOW))
self.configBuf.insert(self.configBuf.get_end_iter(), "autohide_hide_timeout = %s\n" % (self.panelAutohideHide.get_text() if self.panelAutohideHide.get_text() else PANEL_AUTOHIDE_HIDE))
self.configBuf.insert(self.configBuf.get_end_iter(), "autohide_height = %s\n" % (self.panelAutohideHeight.get_text() if self.panelAutohideHeight.get_text() else PANEL_AUTOHIDE_HEIGHT))
self.configBuf.insert(self.configBuf.get_end_iter(), "strut_policy = %s\n" % (self.panelAutohideStrut.get_active_text() if self.panelAutohideStrut.get_active_text() else PANEL_AUTOHIDE_STRUT))
-
+
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Taskbar\n")
self.configBuf.insert(self.configBuf.get_end_iter(), "taskbar_mode = %s\n" % (self.taskbarMode.get_active_text()))
self.configBuf.insert(self.configBuf.get_end_iter(), "taskbar_padding = %s %s %s\n" % (self.taskbarPadX.get_text() if self.taskbarPadX.get_text() else TASKBAR_PADDING_X,
self.taskbarPadY.get_text() if self.taskbarPadY.get_text() else TASKBAR_PADDING_X,
self.taskbarSpacing.get_text() if self.taskbarSpacing.get_text() else TASK_SPACING))
self.configBuf.insert(self.configBuf.get_end_iter(), "taskbar_background_id = %s\n" % (self.taskbarBg.get_active()))
- # Comment out the taskbar_active_background_id if user has "disabled" it
- if self.taskbarActiveBgEnable.get_active() == 0:
- self.configBuf.insert(self.configBuf.get_end_iter(), "#")
self.configBuf.insert(self.configBuf.get_end_iter(), "taskbar_active_background_id = %s\n" % (self.taskbarActiveBg.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Tasks\n")
self.configBuf.insert(self.configBuf.get_end_iter(), "task_active_background_id = %s\n" % (self.taskActiveBg.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "task_urgent_background_id = %s\n" % (self.taskUrgentBg.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "task_iconified_background_id = %s\n" % (self.taskIconifiedBg.get_active()))
-
+
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Task Icons\n")
self.configBuf.insert(self.configBuf.get_end_iter(), "task_icon_asb = %s %s %s\n" % (self.iconHue.get_text() if self.iconHue.get_text() else ICON_ALPHA,
self.iconSat.get_text() if self.iconSat.get_text() else ICON_SAT,
self.configBuf.insert(self.configBuf.get_end_iter(), "task_iconified_icon_asb = %s %s %s\n" % (self.iconifiedIconHue.get_text() if self.iconifiedIconHue.get_text() else ICONIFIED_ICON_ALPHA,
self.iconifiedIconSat.get_text() if self.iconifiedIconSat.get_text() else ICONIFIED_ICON_SAT,
self.iconifiedIconBri.get_text() if self.iconifiedIconBri.get_text() else ICONIFIED_ICON_BRI))
-
+
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Fonts\n")
self.configBuf.insert(self.configBuf.get_end_iter(), "task_font = %s\n" % (self.fontButton.get_font_name()))
self.configBuf.insert(self.configBuf.get_end_iter(), "task_font_color = %s %s\n" % (self.getHexFromWidget(self.fontColButton),
self.configBuf.insert(self.configBuf.get_end_iter(), "font_shadow = %s\n" % int(self.fontShadowCheckButton.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# System Tray\n")
- self.configBuf.insert(self.configBuf.get_end_iter(), "systray = %s\n" % int(self.trayShow.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "systray_padding = %s %s %s\n" % (self.trayPadX.get_text() if self.trayPadX.get_text() else TRAY_PADDING_X,
self.trayPadY.get_text() if self.trayPadY.get_text() else TRAY_PADDING_Y,
self.traySpacing.get_text() if self.traySpacing.get_text() else TRAY_SPACING))
self.configBuf.insert(self.configBuf.get_end_iter(), "systray_icon_asb = %s %s %s\n" % (self.trayIconHue.get_text() if self.trayIconHue.get_text() else TRAY_ICON_ALPHA,
self.trayIconSat.get_text() if self.trayIconSat.get_text() else TRAY_ICON_SAT,
self.trayIconBri.get_text() if self.trayIconBri.get_text() else TRAY_ICON_BRI))
-
- if self.clockCheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Clock\n")
- if self.clock1CheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "time1_format = %s\n" % (self.clock1Format.get_text() if self.clock1Format.get_text() else CLOCK_FMT_1))
- self.configBuf.insert(self.configBuf.get_end_iter(), "time1_font = %s\n" % (self.clock1FontButton.get_font_name()))
- if self.clock2CheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "time2_format = %s\n" % (self.clock2Format.get_text() if self.clock2Format.get_text() else CLOCK_FMT_2))
- self.configBuf.insert(self.configBuf.get_end_iter(), "time2_font = %s\n" % (self.clock2FontButton.get_font_name()))
-
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_font_color = %s %s\n" % (self.getHexFromWidget(self.clockFontColButton),
- int(self.clockFontColButton.get_alpha() / 65535.0 * 100)))
-
- if self.clockTooltipCheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_tooltip = %s\n" % (self.clockTooltipFormat.get_text() if self.clockTooltipFormat.get_text() else CLOCK_TOOLTIP))
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_padding = %s %s\n" % (self.clockPadX.get_text() if self.clockPadX.get_text() else CLOCK_PADDING_X,
- self.clockPadY.get_text() if self.clockPadY.get_text() else CLOCK_PADDING_Y))
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_background_id = %s\n" % (self.clockBg.get_active()))
- if self.clockLClick.get_text():
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_lclick_command = %s\n" % (self.clockLClick.get_text()))
- if self.clockRClick.get_text():
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_rclick_command = %s\n" % (self.clockRClick.get_text()))
- if self.clockTimezone1CheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "time1_timezone = %s\n" % (self.clockTime1Timezone.get_text() if self.clockTime1Timezone.get_text() else CLOCK_TIME1_TIMEZONE))
- if self.clockTimezone2CheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "time2_timezone = %s\n" % (self.clockTime2Timezone.get_text() if self.clockTime2Timezone.get_text() else CLOCK_TIME2_TIMEZONE))
- if self.clockTimezoneTooltipCheckButton.get_active():
- self.configBuf.insert(self.configBuf.get_end_iter(), "clock_tooltip_timezone = %s\n" % (self.clockTooltipTimezone.get_text() if self.clockTooltipTimezone.get_text() else CLOCK_TOOLTIP_TIMEZONE))
-
-
+
+ self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Clock\n")
+ self.configBuf.insert(self.configBuf.get_end_iter(), "time1_format = %s\n" % (self.clock1Format.get_text() if self.clock1Format.get_text() else CLOCK_FMT_1))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "time1_font = %s\n" % (self.clock1FontButton.get_font_name()))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "time2_format = %s\n" % (self.clock2Format.get_text() if self.clock2Format.get_text() else CLOCK_FMT_2))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "time2_font = %s\n" % (self.clock2FontButton.get_font_name()))
+
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_font_color = %s %s\n" % (self.getHexFromWidget(self.clockFontColButton),
+ int(self.clockFontColButton.get_alpha() / 65535.0 * 100)))
+
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_tooltip = %s\n" % (self.clockTooltipFormat.get_text() if self.clockTooltipFormat.get_text() else CLOCK_TOOLTIP))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_padding = %s %s\n" % (self.clockPadX.get_text() if self.clockPadX.get_text() else CLOCK_PADDING_X,
+ self.clockPadY.get_text() if self.clockPadY.get_text() else CLOCK_PADDING_Y))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_background_id = %s\n" % (self.clockBg.get_active()))
+ if self.clockLClick.get_text():
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_lclick_command = %s\n" % (self.clockLClick.get_text()))
+ if self.clockRClick.get_text():
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_rclick_command = %s\n" % (self.clockRClick.get_text()))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "time1_timezone = %s\n" % (self.clockTime1Timezone.get_text() if self.clockTime1Timezone.get_text() else CLOCK_TIME1_TIMEZONE))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "time2_timezone = %s\n" % (self.clockTime2Timezone.get_text() if self.clockTime2Timezone.get_text() else CLOCK_TIME2_TIMEZONE))
+ self.configBuf.insert(self.configBuf.get_end_iter(), "clock_tooltip_timezone = %s\n" % (self.clockTooltipTimezone.get_text() if self.clockTooltipTimezone.get_text() else CLOCK_TOOLTIP_TIMEZONE))
+
+
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Tooltips\n")
self.configBuf.insert(self.configBuf.get_end_iter(), "tooltip = %s\n" % int(self.tooltipShow.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "tooltip_padding = %s %s\n" % (self.tooltipPadX.get_text() if self.tooltipPadX.get_text() else TOOLTIP_PADDING_Y,
self.configBuf.insert(self.configBuf.get_end_iter(), "mouse_scroll_down = %s\n" % (self.mouseDown.get_active_text()))
self.configBuf.insert(self.configBuf.get_end_iter(), "\n# Battery\n")
- self.configBuf.insert(self.configBuf.get_end_iter(), "battery = %s\n" % int(self.batteryCheckButton.get_active()))
self.configBuf.insert(self.configBuf.get_end_iter(), "battery_low_status = %s\n" % (self.batteryLow.get_text() if self.batteryLow.get_text() else BATTERY_LOW))
self.configBuf.insert(self.configBuf.get_end_iter(), "battery_low_cmd = %s\n" % (self.batteryLowAction.get_text() if self.batteryLowAction.get_text() else BATTERY_ACTION))
self.configBuf.insert(self.configBuf.get_end_iter(), "battery_hide = %s\n" % (self.batteryHide.get_text() if self.batteryHide.get_text() else BATTERY_HIDE))
webbrowser.open("http://code.google.com/p/tintwizard/wiki/Help")
except:
errorDialog(self, "Your default web-browser could not be opened.\nPlease visit http://code.google.com/p/tintwizard/wiki/Help")
-
+
def main(self):
"""Enters the main loop."""
gtk.main()
-
+
def new(self, action=None):
"""Prepares a new config."""
if self.toSave:
self.savePrompt()
-
+
self.toSave = True
self.filename = None
string = string.strip() # Remove whitespace from the VALUE
eType = type(prop) # Get widget type
- if special: # 'Special' properties are those which are optional
- if propType == "time1":
- self.clockCheckButton.set_active(True)
- self.clock1CheckButton.set_active(True)
- elif propType == "time2":
- self.clockCheckButton.set_active(True)
- self.clock2CheckButton.set_active(True)
- elif propType == "clock_tooltip":
- self.clockCheckButton.set_active(True)
- self.clockTooltipCheckButton.set_active(True)
- elif propType == "time1_timezone":
- self.clockTimezone1CheckButton.set_active(True)
- elif propType == "time2_timezone":
- self.clockTimezone2CheckButton.set_active(True)
- elif propType == "tooltip_timezone":
- self.clockTimezoneTooltipCheckButton.set_active(True)
- elif propType == "tray":
- self.trayShow.set_active(True)
- elif propType == "activeBg":
- self.taskbarActiveBgEnable.set_active(True)
-
if eType == gtk.Entry:
prop.set_text(string)
prop.activate()
f.close()
- # Deselect the optional stuff, and we'll re-check them if the config has them enabled
- self.clockCheckButton.set_active(False)
- self.clock1CheckButton.set_active(False)
- self.clock2CheckButton.set_active(False)
- self.clockTooltipCheckButton.set_active(False)
- self.clockTimezone1CheckButton.set_active(False)
- self.clockTimezone2CheckButton.set_active(False)
- self.clockTimezoneTooltipCheckButton.set_active(False)
- self.trayShow.set_active(False)
- self.taskbarActiveBgEnable.set_active(False)
-
# Remove all background styles so we can create new ones as we read them
for i in range(len(self.bgs)):
self.delBgClick(None, False)
noBgDefs = self.parseBgs(string)
self.parseConfig(noBgDefs)
-
+
def reportBug(self, action=None):
"""Opens the bug report page in the default web browser."""
try:
except:
errorDialog(self, "Your default web-browser could not be opened.\nPlease visit http://code.google.com/p/tintwizard/issues/entry")
-
+
def resetConfig(self):
"""Resets all the widgets to their default values."""
# Backgrounds
self.panelPosY.set_active(0)
self.panelPosX.set_active(0)
self.panelOrientation.set_active(0)
+ self.panelItems.set_text(PANEL_ITEMS)
self.panelSizeX.set_text(PANEL_SIZE_X)
self.panelSizeY.set_text(PANEL_SIZE_Y)
self.panelMarginX.set_text(PANEL_MARGIN_X)
self.taskbarSpacing.set_text(TASK_SPACING)
self.taskbarBg.set_active(0)
self.taskbarActiveBg.set_active(0)
- self.taskbarActiveBgEnable.set_active(0)
# Tasks
self.taskBlinks.set_text(TASK_BLINKS)
self.taskCentreCheckButton.set_active(True)
self.fontIconifiedCol.set_text(self.defaults["fgColor"])
self.fontShadowCheckButton.set_active(False)
# System Tray
- self.trayShow.set_active(True)
self.trayPadX.set_text(TRAY_PADDING_X)
self.trayPadY.set_text(TRAY_PADDING_X)
self.traySpacing.set_text(TRAY_SPACING)
self.trayIconSat.set_text(TRAY_ICON_SAT)
self.trayIconBri.set_text(TRAY_ICON_BRI)
# Clock
- self.clockCheckButton.set_active(True)
self.clock1Format.set_text(CLOCK_FMT_1)
- self.clock1CheckButton.set_active(True)
self.clock1FontButton.set_font_name(self.defaults["font"])
self.clock2Format.set_text(CLOCK_FMT_2)
- self.clock2CheckButton.set_active(True)
self.clockTooltipFormat.set_text(CLOCK_TOOLTIP)
- self.clockTooltipCheckButton.set_active(False)
self.clock2FontButton.set_font_name(self.defaults["font"])
self.clockFontColButton.set_alpha(65535)
self.clockFontColButton.set_color(gtk.gdk.color_parse(self.defaults["fgColor"]))
self.clockLClick.set_text(CLOCK_LCLICK)
self.clockRClick.set_text(CLOCK_RCLICK)
self.clockTime1Timezone.set_text(CLOCK_TIME1_TIMEZONE)
- self.clockTimezone1CheckButton.set_active(False)
self.clockTime2Timezone.set_text(CLOCK_TIME2_TIMEZONE)
- self.clockTimezone2CheckButton.set_active(False)
self.clockTooltipTimezone.set_text(CLOCK_TOOLTIP_TIMEZONE)
- self.clockTimezoneTooltipCheckButton.set_active(False)
# Tooltips
self.tooltipShow.set_active(False)
self.tooltipPadX.set_text(TOOLTIP_PADDING_X)
self.mouseUp.set_active(0)
self.mouseDown.set_active(0)
# Battery
- self.batteryCheckButton.set_active(False)
self.batteryLow.set_text(BATTERY_LOW)
self.batteryLowAction.set_text(BATTERY_ACTION)
self.batteryHide.set_text(BATTERY_HIDE)
self.batteryPadX.set_text(BATTERY_PADDING_Y)
self.batteryPadY.set_text(BATTERY_PADDING_Y)
self.batteryBg.set_active(0)
-
+
def save(self, widget=None, event=None):
"""Saves the generated config file."""
for key in self.defaults:
confStr += "%s = %s\n" % (key, str(self.defaults[key]))
-
+
confStr += "#End\n"
-
+
pathName = os.path.expandvars("${HOME}") + "/.config/tint2/"
-
+
f = open(pathName+"tintwizard.conf", "w")
-
+
f.write(confStr)
-
+
f.close()
def writeFile(self):
# General use functions
def createLabel(parent, text="", gridX=0, gridY=0, sizeX=1, sizeY=1, xPadding=0):
"""Creates a label and adds it to a parent widget."""
-
+
temp = gtk.Label(text)
temp.set_alignment(0, 0.5)
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xpadding=xPadding)
def createComboBox(parent, choices=["null"], active=0, gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None):
"""Creates a combo box with text choices and adds it to a parent widget."""
temp = gtk.combo_box_new_text()
-
+
for choice in choices:
temp.append_text(choice)
-
+
temp.set_active(active)
-
+
if handler != None:
temp.connect("changed", handler)
-
+
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
-
+
return temp
def createEntry(parent, maxSize, width, text="", gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None, name=""):
temp.set_width_chars(width)
temp.set_text(text)
temp.set_name(name)
-
+
if handler != None:
temp.connect("changed", handler)
-
+
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
-
+
return temp
def createCheckButton(parent, text="", active=False, gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None):
temp = gtk.CheckButton(text if text != "" else None)
temp.set_active(active)
temp.connect("toggled", handler)
-
+
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
-
+
return temp
def createButton(parent, text="", stock=None, name="", gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None):
temp = gtk.Button(text, stock)
else:
temp = gtk.Button(text)
-
+
temp.set_name(name)
temp.connect("clicked", handler)
-
+
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
-
+
return temp
def createFontButton(parent, font, gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None):
temp = gtk.FontButton()
temp.set_font_name(font)
temp.connect("font-set", handler)
-
+
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
-
+
return temp
def createColorButton(parent, color="#000000", useAlpha=True, name="", gridX=0, gridY=0, sizeX=1, sizeY=1, xExpand=True, yExpand=True, handler=None):
temp.set_use_alpha(useAlpha)
temp.set_name(name)
temp.connect("color-set", handler)
-
+
parent.attach(temp, gridX, gridX+sizeX, gridY, gridY+sizeY, xoptions=gtk.EXPAND if xExpand else 0, yoptions=gtk.EXPAND if yExpand else 0)
-
+
return temp
def confirmDialog(parent, message):
if len(sys.argv) > 1 and sys.argv[1] == "-version":
print NAME, VERSION
exit()
-
+
tw = TintWizardGUI()
tw.main()
+