summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2008-04-27 10:58:46 +0800
committerSam Spilsbury <smspillaz@gmail.com>2008-04-27 10:58:46 +0800
commit0b36a7c9763f14bef761a8efe0d613f72923f84b (patch)
tree8f38cba2508ed966fb304ce5322e67e5df45a3d9
parent62d09f51a83b1fec2b982cf6dbb786457840a3cb (diff)
downloadcompiz-tools-0b36a7c9763f14bef761a8efe0d613f72923f84b.tar.gz
compiz-tools-0b36a7c9763f14bef761a8efe0d613f72923f84b.tar.bz2
* R.I.P. Plane plugin
-rwxr-xr-xCompiz-Fusion-Preferences/compiz-fusion-settings.in2285
1 files changed, 1112 insertions, 1173 deletions
diff --git a/Compiz-Fusion-Preferences/compiz-fusion-settings.in b/Compiz-Fusion-Preferences/compiz-fusion-settings.in
index 91648e4..abaf992 100755
--- a/Compiz-Fusion-Preferences/compiz-fusion-settings.in
+++ b/Compiz-Fusion-Preferences/compiz-fusion-settings.in
@@ -36,1221 +36,1159 @@ import os
class Base:
- def SystemInfoCheck(self):
+ def SystemInfoCheck(self):
- self.glxinfo = run('glxinfo', 'output')
- self.xvinfo = run('xvinfo', 'output')
- self.xdpyinfo = run('xdpyinfo', 'output')
+ self.glxinfo = run('glxinfo', 'output')
+ self.xvinfo = run('xvinfo', 'output')
+ self.xdpyinfo = run('xdpyinfo', 'output')
- self.StartupCommand = ""
+ self.StartupCommand = ""
- if "GNOME_DESKTOP_SESSION_ID" in os.environ:
- self.desktop = "GNOME"
- elif "KDE_FULL_SESSION" in os.environ:
- self.desktop = "KDE"
- else:
- self.desktop = 'Unknown'
-
- # We need to check if TFP is direct or Indirect
-
- self.tfp = False
- if self.glxinfo.count('GLX_EXT_texture_from_pixmap') == 0:
- self.tfp = 'none'
- elif self.glxinfo.count('GLX_EXT_texture_from_pixmap') < 3:
- self.tfp = 'indirect'
- else:
- self.tfp = 'direct'
-
-
- # Because Xgl is an entirely new server, we need to check for it first
-
- if 'Xgl' in self.xvinfo:
- self.XglIsActive = True
- self.possible = True
- self.StartupCommand = "compiz --replace ccp"
- else:
- self.XglIsActive = False
+ if "GNOME_DESKTOP_SESSION_ID" in os.environ:
+ self.desktop = "GNOME"
+ elif "KDE_FULL_SESSION" in os.environ:
+ self.desktop = "KDE"
+ else:
+ self.desktop = 'Unknown'
+
+ # We need to check if TFP is direct or Indirect
+
+ self.tfp = False
+ if self.glxinfo.count('GLX_EXT_texture_from_pixmap') == 0:
+ self.tfp = 'none'
+ elif self.glxinfo.count('GLX_EXT_texture_from_pixmap') < 3:
+ self.tfp = 'indirect'
+ else:
+ self.tfp = 'direct'
+
+
+ # Because Xgl is an entirely new server, we need to check for it first
+
+ if 'Xgl' in self.xvinfo:
+ self.XglIsActive = True
+ self.possible = True
+ self.StartupCommand = "compiz --replace ccp"
+ else:
+ self.XglIsActive = False
+
+ if self.XglIsActive == True:
+ self.RenderingPathString = '<b>Xgl</b>. Desktop effects are provided by an OpenGL overlay. You may notice slowness with 3D applications and Video'
+ else:
+ if self.tfp == 'direct':
+ self.RenderingPathString = '<b>Direct Rendering.</b> Desktop effects are provided by your graphics card. You may experience driver glitches.'
+ self.possible = True
+ elif self.tfp == 'indirect':
+ self.RenderingPathString = 'X.org <b>AIGLX</b>. Some 3D applications and video may not display correctly when desktop effects are enabled'
+ self.possible = True
+ elif self.tfp == 'none':
+ self.RenderingPathString = 'Desktop effects cannot be enabled. You will need to configure your X server'
+ self.possible = False
+
+ line = [l for l in self.glxinfo.splitlines() if 'OpenGL renderer string:' in l]
+ if line:
+ self.GlxRenderer = ' '.join(line[0].split()[3:])
+
+ if 'Intel' in self.GlxRenderer:
+ self.StartupCommand = "INTEL_BATCH=1 LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp"
+
+ elif 'Radeon' in self.GlxRenderer:
+ self.StartupCommand = "LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp"
+
+ elif 'NVIDIA' in self.GlxRenderer:
+ if self.tfp == "direct":
+ self.StartupCommand = "__GL_YEILD='NOTHING' compiz --replace --loose-binding ccp"
+ elif self.tfp == "indirect":
+ self.StartupCommand = "LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp"
+
+ print "For reference, your startup command is: %s" %self.StartupCommand
+
+ def delete(self, widget, event=None):
+ gtk.main_quit()
+ return False
+
+ def openccsm(self, widget, event=None):
+ run("ccsm")
+ gtk.main_quit()
+ return False
+
+ def openthemer(self, widget, event=None):
+ if self.InterTheme.get_active() == True:
+
+ if self.desktop == "GNOME":
+ run(["gnome-theme-manager"])
+ if self.desktop == "KDE":
+ run(["kcmshell", "kwindecoration"])
+ else:
+ run("emerald-theme-manager")
+
+ def EnableDisableCompiz(self, widget, event=None):
+
+ # First, we need to check if we are enabling or disabling
+
+ EnabledOrDisabled = self.EnableEffects.get_active()
+
+ # If it is disabled, we kill compiz, wait - then (FIXME) execute metacity
+
+ if EnabledOrDisabled == False:
+ run(['killall', 'compiz'])
+ run(['metacity', '--replace'])
+ elif EnabledOrDisabled == True:
+ run(['killall', 'metacity'])
+ run("compiz-manager")
+
+ def IntegrateTheme(self, widget, event=None):
- if self.XglIsActive == True:
- self.RenderingPathString = '<b>Xgl</b>. Desktop effects are provided by an OpenGL overlay. You may notice slowness with 3D applications and Video'
- else:
- if self.tfp == 'direct':
- self.RenderingPathString = '<b>Direct Rendering.</b> Desktop effects are provided by your graphics card. You may experience driver glitches.'
- self.possible = True
- elif self.tfp == 'indirect':
- self.RenderingPathString = 'X.org <b>AIGLX</b>. Some 3D applications and video may not display correctly when desktop effects are enabled'
- self.possible = True
- elif self.tfp == 'none':
- self.RenderingPathString = 'Desktop effects cannot be enabled. You will need to configure your X server'
- self.possible = False
+ # Are we integrating or not?
+
+ Integrate = self.InterTheme.get_active()
- line = [l for l in self.glxinfo.splitlines() if 'OpenGL renderer string:' in l]
- if line:
- self.GlxRenderer = ' '.join(line[0].split()[3:])
-
- if 'Intel' in self.GlxRenderer:
- self.StartupCommand = "INTEL_BATCH=1 LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp"
-
- elif 'Radeon' in self.GlxRenderer:
- self.StartupCommand = "LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp"
-
- elif 'NVIDIA' in self.GlxRenderer:
- if self.tfp == "direct":
- self.StartupCommand = "__GL_YEILD='NOTHING' compiz --replace --loose-binding ccp"
- elif self.tfp == "indirect":
- self.StartupCommand = "LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp"
-
- print "For reference, your startup command is: %s" %self.StartupCommand
-
- def delete(self, widget, event=None):
- gtk.main_quit()
- return False
-
- def openccsm(self, widget, event=None):
- run("ccsm")
- gtk.main_quit()
- return False
-
- def openthemer(self, widget, event=None):
- if self.InterTheme.get_active() == True:
-
- if self.desktop == "GNOME":
- run(["gnome-theme-manager"])
- if self.desktop == "KDE":
- run(["kcmshell", "kwindecoration"])
- else:
- run("emerald-theme-manager")
-
- def EnableDisableCompiz(self, widget, event=None):
-
- # First, we need to check if we are enabling or disabling
-
- EnabledOrDisabled = self.EnableEffects.get_active()
-
- # If it is disabled, we kill compiz, wait - then (FIXME) execute metacity
-
- if EnabledOrDisabled == False:
- run(['killall', 'compiz'])
- run(['metacity', '--replace'])
- elif EnabledOrDisabled == True:
- run(['killall', 'metacity'])
- run("compiz-manager")
-
- def IntegrateTheme(self, widget, event=None):
-
- # Are we integrating or not?
-
- Integrate = self.InterTheme.get_active()
-
- if Integrate == True:
- if self.desktop == "GNOME":
- run(["killall", "kde-window-decorator", "emerald", "gtk-window-decorator"])
- run(["gtk-window-decorator", "--replace"])
- elif self.desktop == "KDE":
- run(["killall", "kde-window-decorator", "emerald", "gtk-window-decorator"])
- run(["kde-window-decorator", "--replace"])
- else:
- print "Check box should be disabled, this should not happen!"
-
- else:
- run(["killall", "kde-window-decorator", "emerald", "gtk-window-decorator"])
- run(["emerald", "--replace"])
-
- def RunFusionIcon(self, widget):
- Running = self.TrayIcon.get_active()
- if Running == True:
- run(["fusion-icon", "--no-start"])
- else:
- run(["killall", "fusion-icon"])
-
- def __init__(self):
- self.SystemInfoCheck()
-
- self.gladefile = gtk.glade.XML('@prefix@/share/compiz-fusion-settings/compiz-fusion-settings.glade')
-
- self.context = compizconfig.Context()
-
- names = ["core", "text", "switcher", "ring", "shift", "scale", "scalefilter", "scaleaddon", "thumbnail", "group", "extrawm", "widget", "expo", "move", "cube", "rotate", "wall", "plane", "cubereflex", "3d", "gears", "atlantis", "vpswitch", "wobbly", "animation", "resize", "snow", "water", "firepaint", "reflex", "blur", "trailfocus", "bs", "ezoom", "colorfilter", "annotate", "showdesktop", "fadedesktop"]
-
- self.plugins = []
-
- for plugin in names:
- if plugin in self.context.Plugins:
- self.plugin = self.context.Plugins[plugin]
- self.plugins.append(self.plugin)
-
- self.pluginnames = []
-
- for plugin in self.plugins:
- name = plugin.Name
- self.pluginnames.append(name)
-
- # Sanity Check
-
- for pluginname in self.pluginnames:
- index = self.pluginnames.index(pluginname)
- if self.pluginnames[index] == self.plugins[index].Name:
- continue
- else:
- print "This should not happen"
- print pluginname
- print names[index] + " Names index"
- print self.plugins[index].Name + " Plugins index"
- raise KeyError
-
- # When the window is closed, the app is closed.
- self.Window = self.gladefile.get_widget('CompizFusionConfigWindow')
- self.Window.connect("delete_event", self.delete)
- self.Window.set_icon_from_file('@prefix@/share/icons/hicolor/scalable/apps/fusion-icon-settings.svg')
-
- # When we click the button, the app is closed
- self.QuitButton = self.gladefile.get_widget('QuitButton')
- self.QuitButton.connect("clicked", self.delete)
-
- # When we click 'Open CCSM,' this window closes
- self.OpenCCSMButton = self.gladefile.get_widget('OpenCCSMButton')
- self.OpenCCSMButton.connect("clicked", self.openccsm)
-
- ## Other Stuff
-
- # We need to import the notebook, and grab the tab to set some text and stuff
-
- ## The "General" Tab
-
- # Enable Desktop Effects
-
- self.EnableEffects = self.gladefile.get_widget('EnableFXCheckButton')
- if run(['pgrep', 'compiz'], 'call', quiet=True) == 0:
- EffectsAreEnabled = True
- else:
- EffectsAreEnabled = False
-
- self.EnableEffects.set_active(EffectsAreEnabled)
- self.EnableEffects.connect("clicked", self.EnableDisableCompiz)
-
- # The Desktop Identifier
-
- self.DEIdentifier = self.gladefile.get_widget("DELabel")
- self.DEIdentifier.set_text(self.desktop)
-
- self.DEImage = self.gladefile.get_widget("DEImage")
- DEImages = [["KDE", "@prefix@/share/pixmaps/KDE.png"], ["GNOME", "@prefix@/share/pixmaps/GNOME.png"], ["Unknown", "@prefix@/share/pixmaps/general.png"]]
- for info in DEImages:
- if self.desktop == info[0]:
- self.DEImage.set_from_file(info[1])
+ if Integrate == True:
+ if self.desktop == "GNOME":
+ run(["killall", "kde-window-decorator", "emerald", "gtk-window-decorator"])
+ run(["gtk-window-decorator", "--replace"])
+ elif self.desktop == "KDE":
+ run(["killall", "kde-window-decorator", "emerald", "gtk-window-decorator"])
+ run(["kde-window-decorator", "--replace"])
+ else:
+ print "Check box should be disabled, this should not happen!"
+
+ else:
+ run(["killall", "kde-window-decorator", "emerald", "gtk-window-decorator"])
+ run(["emerald", "--replace"])
+
+ def RunFusionIcon(self, widget):
+ Running = self.TrayIcon.get_active()
+ if Running == True:
+ run(["fusion-icon", "--no-start"])
+ else:
+ run(["killall", "fusion-icon"])
+
+ def __init__(self):
+
+ self.SystemInfoCheck()
+
+ self.gladefile = gtk.glade.XML('@prefix@/share/compiz-fusion-settings/compiz-fusion-settings.glade')
+
+ self.context = compizconfig.Context()
+
+ names = ["core", "text", "switcher", "ring", "shift", "scale", "scalefilter", "scaleaddon", "thumbnail", "group", "extrawm", "widget", "expo", "move", "cube", "rotate", "wall", "cubereflex", "3d", "gears", "atlantis", "vpswitch", "wobbly", "animation", "resize", "snow", "water", "firepaint", "reflex", "blur", "trailfocus", "bs", "ezoom", "colorfilter", "annotate"]
+
+ self.plugins = []
+
+ for plugin in names:
+ if plugin in self.context.Plugins:
+ self.plugin = self.context.Plugins[plugin]
+ self.plugins.append(self.plugin)
- # The Rendering Path Identifier
-
- self.RenderingPathIdentifier = self.gladefile.get_widget('RenderingMethod')
- self.RenderingPathIdentifier.set_text(self.RenderingPathString)
- self.RenderingPathIdentifier.set_use_markup(True)
-
- # The "Configure" Button
-
- self.gladefile.get_widget('CompizFusionConfigWindow').show_all()
-
- if self.possible == False:
- self.EnableEffects.set_sensitive(False)
+ self.pluginnames = []
+
+ for plugin in self.plugins:
+ name = plugin.Name
+ self.pluginnames.append(name)
+
+ # Sanity Check
+
+ for pluginname in self.pluginnames:
+ index = self.pluginnames.index(pluginname)
+ if self.pluginnames[index] == self.plugins[index].Name:
+ continue
+ else:
+ print "This should not happen"
+ print pluginname
+ print names[index] + " Names index"
+ print self.plugins[index].Name + " Plugins index"
+
+ # When the window is closed, the app is closed.
+ self.Window = self.gladefile.get_widget('CompizFusionConfigWindow')
+ self.Window.connect("delete_event", self.delete)
+ self.Window.set_icon_from_file("@prefix@/share/pixmaps/fusion-icon.svg")
- # Gfx card identifier
-
- self.GraphicsAdaptorIdentifier = self.gladefile.get_widget('GraphicsCard')
- self.GraphicsAdaptorIdentifier.set_use_markup(True)
- # Xgl screws up some stuff in glxinfo, putting "Generic Graphics Card" there.
- # We need to notify the user that the graphics card cannot be displayed at the
- # moment
- if self.XglIsActive == True:
- self.GraphicsAdaptorIdentifier.set_text("Xgl is currently enabled. Therefore, your graphics card cannot be determined at this time. If you want to know your graphics card's model, disable Xgl")
- else:
- self.GraphicsAdaptorIdentifier.set_text(self.GlxRenderer)
-
- # Gfx Card Image
-
- self.DisplayImage = self.gladefile.get_widget('MonitorImage')
- self.DisplayImage.set_from_file('@prefix@/share/pixmaps/display.png')
-
- # Rendering Path Image
-
- self.RenderImage = self.gladefile.get_widget('RenderingMethodImage')
- self.RenderImage.set_from_file('@prefix@/share/pixmaps/Rendering.svg')
-
- # Intergration Check Box
-
- self.Integration = self.gladefile.get_widget('InterSettings')
- if self.desktop == "GNOME":
- if self.context.CurrentBackend.Name == "gconf":
- self.Integration.set_active(True)
- else:
- self.Integration.set_active(False)
- elif self.desktop == "KDE":
- if self.context.CurrentBackend.Name == "kconfig":
- self.Integration.set_active(True)
- else:
- self.Integration.set_active(False)
- else:
- self.Integration.set_sensitive(False)
- self.Integration.connect('clicked', self.IntegrationToggled)
-
- # Theme integration
-
- self.InterTheme = self.gladefile.get_widget("InterTheme")
- if self.desktop == "GNOME":
- # For some reason, pgrep won't pick up on gtk-w-d if you put in gtk-window-decorator. 'gtk-window-deco' is close enough :)
- if run(['pgrep', 'gtk-window-deco'], 'call', quiet=True) == 0:
- self.InterTheme.set_active(True)
- else:
- self.InterTheme.set_active(False)
- elif self.desktop == "KDE":
- if run(['pgrep', 'kde-window-deco'], 'call', quiet=True) == 0:
- self.InterTheme.set_active(True)
- else:
- self.InterTheme.set_active(False)
- else:
- self.InterTheme.set_active(False)
- self.InterTheme.set_sensitive(False)
- self.InterTheme.connect('clicked', self.IntegrateTheme)
-
- # The "Theme" Button
-
- self.ThemeButton = self.gladefile.get_widget('ThemeButton')
- self.ThemeButton.connect("clicked", self.openthemer)
-
- # Tray Icon
-
- self.TrayIcon = self.gladefile.get_widget("TrayIconCheck")
- if run(["pgrep", "fusion-icon"], mode='call') == 0:
- self.TrayIcon.set_active(True)
- else:
- self.TrayIcon.set_active(False)
- self.TrayIcon.connect('clicked', self.RunFusionIcon)
-
- self.BoolSettings = [['EnableLighting', ['core', 'lighting']], ['VSyncEnable', ['core', 'sync_to_vblank']], ['AllowTabbingCheckBox', ['group', 'autotab_create']], ["EdgeFlipDrag", ["rotate", "edge_flip_window"]], ["EdgeFlipPointer", ["rotate", "edge_flip_pointer"]], ["ReflectionCheck", ["expo", "reflection"]], ["FocusTrack", ["ezoom", "follow_focus"]], ["ZoomToWindow", ["ezoom", "focus_fit_window"]], ['Skydome', ['cube', 'skydome']], ['ShowDesktopScale', ['scale', 'show_desktop']]]
-
- self.PluginEnableDisables = [["AllowGroupingCheckBox", "group"], ["TextScale", "scaleaddon"], ["SearchScale", "scalefilter"], ["Thumbnails", "thumbnail"], ["CubeReflectionCheck", "cubereflex"], ["3DCheck", "3d"], ["VPSwitchCheck", "vpswitch"], ["WaterCheck", "water"], ["FireCheck", "firepaint"], ["SnowCheck", "snow"], ["BlurCheck", "blur"], ["ReflexCheck", "reflex"], ["TrailfocusCheck", "trailfocus"]]
-
- self.ValueSettings = [['DesktopSizeX', ['core', 'hsize']], ['DesktopSizeY', ['core', 'vsize']], ['OpacityMovingWindows', ['move', 'opacity']], ['CubeZoom', ['rotate', 'zoom']], ['CubeTransparency', ['cube', 'active_opacity']]]
-
- self.TextSettings = [['FullscreenEntry', ['extrawm', 'toggle_fullscreen_key']], ['StickEntry', ['extrawm', 'toggle_sticky_key']], ['CursorWaterKey', ['water', 'initiate_key']], ['CursorFireKey', ['firepaint', 'initiate_button']], ['SnowKey', ['snow', 'toggle_key']], ['SelectZoomAreaButton', ['zoom', 'initiate_button']], ['FilterKey', ['colorfilter', 'toggle_window_key']], ['SwitchFilterKey', ['colorfilter', 'switch_filter_key']], ['DrawWithEntry', ['annotate', 'initiate_button']], ['ClearWithEntry', ['annotate', 'clear_key']], ['ActivateWindowPicker', ['scale', 'initiate_key']], ['ToggleExpo', ['expo', 'expo_key']]]
-
- for x in range(0, len(self.PluginEnableDisables)):
- pluginname = self.PluginEnableDisables[x][1]
- if pluginname not in self.pluginnames:
- sensitive = False
- self.CreatePluginSetting(self.PluginEnableDisables[x][0], 0, sensitive)
- else:
- sensitive = True
- name = self.PluginEnableDisables[x][1]
- name2 = None
- self.CreatePluginSetting(self.PluginEnableDisables[x][0], name, sensitive, name2)
-
- for x in range(0, len(self.BoolSettings)):
- if self.BoolSettings[x][1][0] not in self.pluginnames:
- sensitive = False
- self.CreateBoolSetting(self.BoolSettings[x][0], 0, 0, sensitive)
- else:
- sensitive = True
- self.CreateBoolSetting(self.BoolSettings[x][0], self.BoolSettings[x][1][0], self.BoolSettings[x][1][1], sensitive)
-
- for x in range(0, len(self.ValueSettings)):
- if self.ValueSettings[x][1][0] not in self.pluginnames:
- sensitive = False
- self.CreateValueSetting(self.ValueSettings[x][0], 0, 0, sensitive)
- else:
- sensitive = True
- self.CreateValueSetting(self.ValueSettings[x][0], self.ValueSettings[x][1][0], self.ValueSettings[x][1][1], sensitive)
-
- for x in range(0, len(self.TextSettings)):
- if self.TextSettings[x][1][0] not in self.pluginnames:
- sensitive = False
- self.CreateTextSetting(self.TextSettings[x][0], 0, 0, sensitive)
- else:
- sensitive = True
- self.CreateTextSetting(self.TextSettings[x][0], self.TextSettings[x][1][0], self.TextSettings[x][1][1], sensitive)
-
- # Now for the hard part - The Texture Filter
- self.TextureFilterCombo = self.gladefile.get_widget('TextureFilteringCombo')
- self.OldTextureFilteringComboValue = self.plugins[self.pluginnames.index('core')].Display["texture_filter"].Value
- self.TextureFilterCombo.set_active(self.OldTextureFilteringComboValue)
- self.TextureFilterCombo.connect("changed", self.TextureFilterModified)
-
- ## The 'Windows' Tab
-
- # Which Switcher to use
-
- # Here, we determine which of the switchers is the 'Active'
- # one, and hence we set the key. The only problem is that
- # flat switcher must be active by default if all switchers are enabled
- # already.
-
- self.switchers = [[0, None], [1, 'switcher'], [2, 'ring'], [3, ['shift', 0]], [4, ['shift', 1]]]
- self.SwitcherChooser = self.gladefile.get_widget('SwitcherTypeCombo')
- switcherplugins = []
- self.ShiftFunctionIsReady = False
- for i in self.switchers:
- if i[1] == None:
- pass
- else:
- if 'list' in str(type(i[1])):
- self.switchPlugin = self.context.Plugins[i[1][0]]
- index = i[0]
- shift_type = i[1][1]
- switcherplugins.append(plugin)
- else:
- self.switchPlugin = self.context.Plugins[i[1]]
- index = i[0]
- shift_type = None
- switcherplugins.append(plugin)
-
- if self.switchPlugin.Enabled == True:
- if shift_type != None:
- if shift_type == 0:
- index = 3
- elif shift_type == 1:
- index = 4
- self.CreateSwitcherKey(self.switchPlugin.Name)
- self.SwitcherChooser.set_active(index)
- self.SwitcherChooser.connect('changed', self.SwitcherChanged)
- if self.SwitcherChooser.get_active() == -1:
- self.SwitcherChooser.set_active(0)
-
- # CHEAP HACK! Sue me...
- # We have to correct shift detection as it keeps on crapping up
- # read : Calling the 'changed' function for no apparant reason
- self.ShiftFunctionIsReady = True
-
- # Show Desktop Mode
- ShowDesktopMode = self.gladefile.get_widget('showDesktopMode')
- # Check active mode
- if self.plugins[self.pluginnames.index('showdesktop')].Enabled == True:
- ShowDesktopMode.set_active(1)
- elif self.plugins[self.pluginnames.index('fadedesktop')].Enabled == True:
- ShowDesktopMode.set_active(2)
- else:
- ShowDesktopMode.set_active(0)
-
- ShowDesktopMode.connect('changed', self.ShowDesktopModeChanged)
-
-
-
- # Here we are going to do the screencorners. What we need to do here is
- # check every possible option to see if a screencorner is set for that widget
-
- # Now we need to create a list that relates the option names back to the numbers
-
- self.NewScreenCornerPlugins = [[None, None], ["scale", "initiate_edge"], ["scale", "initiate_all_edge"], ["scale", "initiate_group_edge"], ["expo", "expo_edge"], ["core", "show_desktop_edge"], ["widget", "toggle_edge"]]
-
- self.Edges = ["TopLeft", "TopRight", "BottomLeft", "BottomRight", "Left", "Right", "Top", "Bottom"]
- self.CurrentEdges = []
-
- for Edge in self.Edges:
- # When this reaches 6, there musn't be any setting on the edge
- MissingEdgeCount = 0
- for i in self.NewScreenCornerPlugins:
- if i[0] != None:
- if self.context.Plugins[i[0]].Display[i[1]].Value == Edge:
- if i[1] != None:
- self.CurrentEdges.append([self.NewScreenCornerPlugins.index(i), Edge])
- break
- else:
- MissingEdgeCount = MissingEdgeCount + 1
- if MissingEdgeCount == 6:
- self.CurrentEdges.append([None, "Disabled"])
-
-
- EdgeWidgets = ['TopLeftEdgeSelect', 'TopRightEdgeSelect', 'BottomLeftEdgeSelect', 'BottomRightEdgeSelect', 'LeftEdgeSelect', 'RightEdgeSelect', 'TopEdgeSelect', 'BottomEdgeSelect']
-
- for Edge in EdgeWidgets:
- self.Widget = self.gladefile.get_widget(Edge)
- for x in range(0, len(self.CurrentEdges)):
- if Edge in EdgeWidgets[x]:
- if self.CurrentEdges[x][0] != None:
- self.Widget.set_active(self.CurrentEdges[x][0])
- else:
- self.Widget.set_active(0)
- self.Widget.connect("changed", self.EdgeChanged, self.Edges[EdgeWidgets.index(Edge)])
-
- # Treeview for keybindings,
-
- self.KeyBindingsStore = gtk.TreeStore(
- str, # Name of object
- bool, # Does it have a keybinding?
- str, # Keybinding setting
- object, # The object that holds the keybinding,
- bool, # Does it have a mousebinding?
- str, # Mousebinding setting
- object, # The object that holds the mousebinding,
- )
-
- settingActions = { 'General' :
- [["Show the desktop", "core", "show_desktop", True, False],
- ["Shade a window", "core", "toggle_window_shaded", True, False],
- ["Slow Motion Animations", "core", "slow_animations", True, False],
- ["Maximise Horizontally",'core', 'toggle_window_maximized_horizontally', True, False],
- ["Maximise Vertically", 'core', 'toggle_window_maximized_vertically', True, False],
- ["Increase Opactiy", 'core', 'opacity_increase', False, True],
- ["Decrease Opactiy", 'core', 'opacity_decrease', False, True]
- ],
- 'Application Switcher' :
- [["Flip to the next window", "switcher", "next", True, True],
- ["Flip to the previous window", "switcher", "prev", True, True],
- ["Flip to the next window in all desktops", "switcher", "next_all", True, True],
- ["Flip to the previous window in all desktops", 'switcher', "prev_all", True, True],
- ],
- 'Ring Switcher' :
- [["Flip to the next window", "ring", "next", True, True],
- ["Flip to the previous window", "ring", "prev", True, True],
- ["Flip to the next window in all desktops", "ring", "next_all", True, True],
- ["Flip to the previous window in all desktops", 'ring', "prev_all", True, True],
- ],
- 'Shift Switcher' :
- [["Flip to the next window", "shift", "next", True, True],
- ["Flip to the previous window", "shift", "prev", True, True],
- ["Flip to the next window in all desktops", "shift", "next_all", True, True],
- ["Flip to the previous window in all desktops", 'shift', "prev_all", True, True],
- ],
- 'Window Picker' :
- [['Pick from current viewport', 'scale', 'initiate', True, False],
- ['Pick from all viewports', 'scale', 'initiate_all', True, False],
- ['Pick from current application', 'scale', 'initiate_group', False, False]
- ],
- 'Window Grouper' :
- [['Select a window', 'group', 'select_single', True, False],
- ['Group Selected Windows', 'group', 'group', True, False],
- ['Ungroup window group', 'group', 'ungroup', True, False],
- ['(Un)Tab selected or grouped windows', 'group', 'tabmode', True, False]
- ],
- 'Desktop Cube' : [
- ['Free Rotation', 'rotate', 'initiate', False, True],
- ['Rotate Left', 'rotate', 'rotate_left', True, True],
- ['Rotate Right', 'rotate', 'rotate_right', True, True],
- ['Rotate Left with Window', 'rotate', 'rotate_left_window', True, True],
- ['Rotate Right', 'rotate', 'rotate_right_window', True, True]
- ],
- 'Desktop Wall' : [
- ['Move Left', 'wall', 'left', True, True],
- ['Move Right', 'wall', 'right', True, True],
- ['Move Up', 'wall', 'up', True, True],
- ['Move Down', 'wall', 'down', True, True],
- ['Move Left with Window', 'wall', 'left_window', True, False],
- ['Move Right with Window', 'wall', 'right_window', True, False],
- ['Move Up with Window', 'wall', 'up_window', True, False],
- ['Move Down with Window', 'wall', 'down_window', True, False]
- ]
- }
- for category, actionS in settingActions.items():
- categoryiter = self.KeyBindingsStore.append(None, [category, False, '', None, False, '', None])
- for action in actionS:
- actionString = action[0]
- actionPluginName = action[1]
- if actionPluginName not in self.pluginnames:
- print "Plugin doesn't exist!"
- break
- else:
- actionPlugin = self.plugins[self.pluginnames.index(actionPluginName)]
- actionSetting = action[2]
- actionHasKB = action[3]
- if actionHasKB == True:
- actionKBSetting = self.GetSetting(actionPlugin, "Display", actionSetting+"_key")
- actionKBValue = actionKBSetting.Value
- else:
- actionKBValue = "None"
- actionKBSetting = None
- actionHasMouse = action[4]
- if actionHasMouse == True:
- actionMouseSetting = self.GetSetting(actionPlugin, "Display", actionSetting+"_button")
- actionMouseValue = actionMouseSetting.Value
- else:
- actionMouseSetting = None
- actionMouseValue = "None"
- self.KeyBindingsStore.append(categoryiter, [actionString,
- actionHasKB,
- actionKBValue,
- actionKBSetting,
- actionHasMouse,
- actionMouseValue,
- actionMouseSetting
- ]
- )
-
- self.KeyBindingsView = self.gladefile.get_widget('KeybindingTreeview')
- self.KeyBindingsView.set_model(self.KeyBindingsStore)
-
- NameColumn = gtk.TreeViewColumn('Action Name')
- self.KeyBindingsView.append_column(NameColumn)
- NameCell = gtk.CellRendererText()
- NameColumn.pack_start(NameCell, True)
- NameColumn.add_attribute(NameCell, 'text', 0)
-
- KeyColumn = gtk.TreeViewColumn('Key Shortcut')
- self.KeyBindingsView.append_column(KeyColumn)
- KeyCell = gtk.CellRendererText()
- KeyCell.connect('edited', self.ActionKeyEdited)
- KeyColumn.pack_start(KeyCell, True)
- KeyColumn.add_attribute(KeyCell, 'text', 2)
- KeyColumn.add_attribute(KeyCell, 'sensitive', 1)
- KeyColumn.add_attribute(KeyCell, 'editable', 1)
-
- MouseColumn = gtk.TreeViewColumn('Mouse Button')
- self.KeyBindingsView.append_column(MouseColumn)
- MouseCell = gtk.CellRendererText()
- MouseCell.connect('edited', self.ActionButtonEdited)
- MouseColumn.pack_start(MouseCell, True)
- MouseColumn.add_attribute(MouseCell, 'text', 5)
- MouseColumn.add_attribute(MouseCell, 'sensitive', 4)
- MouseColumn.add_attribute(MouseCell, 'editable', 4)
-
- # The 'App switch with' entry
-
- # Desktop Appearance
- self.DesktopPlugins = []
- for plugin in self.context.Plugins.values():
- if "largedesktop" in plugin.Features:
- self.DesktopPlugins.append([plugin, plugin.ShortDesc])
- self.FillDesktopAppearance()
-
- # Effects Settings
-
- # Move Effect Combo
- self.MoveEffect = self.gladefile.get_widget('MoveCombo')
- if 'Normal' or 'Dialog' or 'ModalDialog' in self.context.Plugins['wobbly'].Screens[0]['move_window_match'].Value:
- self.MoveEffect.set_active(1)
- else:
- self.MoveEffect.set_active(0)
- self.MoveEffect.connect("changed", self.MoveEffectChanged)
-
- # Maximise Effect Combo
- self.MaximiseEffect = self.gladefile.get_widget('MaximiseCombo')
- if self.plugins[self.pluginnames.index('wobbly')].Screens[0]["maximize_effect"].Value == True:
- self.MaximiseEffect.set_active(1)
- else:
- self.MaximiseEffect.set_active(0)
- self.MaximiseEffect.connect('changed', self.MaximiseEffectChanged)
-
- # Resize Effect Combo
-
- self.ResizeEffect = self.gladefile.get_widget('ResizeCombo')
- self.OldResizeEffectValue = self.plugins[self.pluginnames.index('resize')].Display["mode"].Value
- self.ResizeEffect.set_active(self.OldResizeEffectValue)
- self.ResizeEffect.connect("changed", self.ResizeEffectChanged)
-
- # Animation Boxes. Thanks to marex for the functions
-
- self.FillAnimationBoxes()
-
- self.CreateCombo = self.gladefile.get_widget('CreateCombo')
- self.CreateCombo.connect('changed', self.AnimationBoxChanged, "open_effects")
-
- self.CloseCombo = self.gladefile.get_widget('CloseCombo')
- self.CloseCombo.connect('changed', self.AnimationBoxChanged, "close_effects")
-
- self.MinimizeCombo = self.gladefile.get_widget('MinimizeCombo')
- self.MinimizeCombo.connect('changed', self.AnimationBoxChanged, "minimize_effects")
-
- self.ShadeCombo = self.gladefile.get_widget('ShadeCombo')
- self.ShadeCombo.connect('changed', self.AnimationBoxChanged, "shade_effects")
-
- self.FocusCombo = self.gladefile.get_widget('FocusCombo')
- self.FocusCombo.connect('changed', self.AnimationBoxChanged, "focus_effects")
-
-
- # Accessibility
- # Opacity Brightness and Saturation
-
- self.OBSModifiers = [["OpacityModifiers", ["core", "opacity_increase_button"]], ["BrightnessModifiers", ["bs", "brightness_increase_button"]], ["SaturationModifiers", ["bs", "saturation_increase_button"]]]
-
- self.PossibleButtons = ["Button1", "Button2", "Button3", "Button4", "Button5", "Button6", "Button7"]
-
- for i in self.OBSModifiers:
- self.OBSWidget = self.gladefile.get_widget(i[0])
- if i[1][0] not in self.context.Plugins:
- self.OBSWidget.set_sensitive(False)
- else:
- NameOfWidget = i[0]
- OBSTempString = self.context.Plugins[i[1][0]].Display[i[1][1]].Value
- for Button in self.PossibleButtons:
- if Button in OBSTempString:
- self.OBSWidgetText = OBSTempString.replace(Button, "")
- self.OBSWidget.set_text(self.OBSWidgetText)
- self.OBSWidget.connect("activate", self.OBSModifierChanged, self.OBSWidget, i[1][1], i[1][0], NameOfWidget)
-
- # Zoom keys
- zoomPluginExists = False
- ZoomButton = None
- zoomPlugin = None
-
- ZoomButton = None # Initialize the variable *cough*
-
- self.ZoomButtonEntry = self.gladefile.get_widget("ZoomIn")
- if self.context.Plugins['zoom'].Enabled == True:
- ZoomButton = self.context.Plugins['zoom'].Display["zoom_in_button"]
- zoomPlugin = "zoom"
- zoomPluginExists = True
- elif self.context.Plugins['ezoom'].Enabled == True:
- ZoomButton = self.context.Plugins['ezoom'].Display["zoom_in"]
- zoomPlugin = "ezoom"
- zoomPluginExists = True
-
- print zoomPluginExists
- print ZoomButton
- print zoomPlugin
- if zoomPluginExists == True:
- self.CreateZoomKey(zoomPluginExists, zoomPlugin, ZoomButton)
-
- # Zoom Mode
+ # When we click the button, the app is closed
+ self.QuitButton = self.gladefile.get_widget('QuitButton')
+ self.QuitButton.connect("clicked", self.delete)
+
+ # When we click 'Open CCSM,' this window closes
+ self.OpenCCSMButton = self.gladefile.get_widget('OpenCCSMButton')
+ self.OpenCCSMButton.connect("clicked", self.openccsm)
+
+ ## Other Stuff
- self.ZoomMode = self.gladefile.get_widget("ZoomModeCombo")
- # Here begins a series of checks to determine what zoom mode is in use.
- if self.context.Plugins['zoom'].Enabled == True:
- self.ZoomMode.set_active(2)
- else:
- if self.context.Plugins['ezoom'].Screens[0]["sync_mouse"].Value == True:
- self.ZoomMode.set_active(1)
- else:
- self.ZoomMode.set_active(0)
+ # We need to import the notebook, and grab the tab to set some text and stuff
+
+ ## The "General" Tab
+
+ # Enable Desktop Effects
+
+ self.EnableEffects = self.gladefile.get_widget('EnableFXCheckButton')
+ if run(['pgrep', 'compiz'], 'call', quiet=True) == 0:
+ EffectsAreEnabled = True
+ else:
+ EffectsAreEnabled = False
+
+ self.EnableEffects.set_active(EffectsAreEnabled)
+ self.EnableEffects.connect("clicked", self.EnableDisableCompiz)
+
+ # The Desktop Identifier
+
+ self.DEIdentifier = self.gladefile.get_widget("DELabel")
+ self.DEIdentifier.set_text(self.desktop)
+
+ self.DEImage = self.gladefile.get_widget("DEImage")
+ DEImages = [["KDE", "@prefix@/share/pixmaps/KDE.png"], ["GNOME", "@prefix@/share/pixmaps/GNOME.png"], ["Unknown", "@prefix@/share/pixmaps/general.png"]]
+ for info in DEImages:
+ if self.desktop == info[0]:
+ self.DEImage.set_from_file(info[1])
+
+ # The Rendering Path Identifier
+
+ self.RenderingPathIdentifier = self.gladefile.get_widget('RenderingMethod')
+ self.RenderingPathIdentifier.set_text(self.RenderingPathString)
+ self.RenderingPathIdentifier.set_use_markup(True)
+
+ # The "Configure" Button
+
+ self.gladefile.get_widget('CompizFusionConfigWindow').show_all()
+
+ if self.possible == False:
+ self.EnableEffects.set_sensitive(False)
+
+ # Gfx card identifier
+
+ self.GraphicsAdaptorIdentifier = self.gladefile.get_widget('GraphicsCard')
+ self.GraphicsAdaptorIdentifier.set_use_markup(True)
+ # Xgl screws up some stuff in glxinfo, putting "Generic Graphics Card" there.
+ # We need to notify the user that the graphics card cannot be displayed at the
+ # moment
+ if self.XglIsActive == True:
+ self.GraphicsAdaptorIdentifier.set_text("Xgl is currently enabled. Therefore, your graphics card cannot be determined at this time. If you want to know your graphics card's model, disable Xgl")
+ else:
+ self.GraphicsAdaptorIdentifier.set_text(self.GlxRenderer)
+
+ # Gfx Card Image
+
+ self.DisplayImage = self.gladefile.get_widget('MonitorImage')
+ self.DisplayImage.set_from_file('@prefix@/share/pixmaps/display.png')
+
+ # Rendering Path Image
+
+ self.RenderImage = self.gladefile.get_widget('RenderingMethodImage')
+ self.RenderImage.set_from_file('@prefix@/share/pixmaps/Rendering.svg')
+
+ # Intergration Check Box
+
+ self.Integration = self.gladefile.get_widget('InterSettings')
+ if self.desktop == "GNOME":
+ if self.context.CurrentBackend.Name == "gconf":
+ self.Integration.set_active(True)
+ else:
+ self.Integration.set_active(False)
+ elif self.desktop == "KDE":
+ if self.context.CurrentBackend.Name == "kconfig":
+ self.Integration.set_active(True)
+ else:
+ self.Integration.set_active(False)
+ else:
+ self.Integration.set_sensitive(False)
+ self.Integration.connect('clicked', self.IntegrationToggled)
+
+ # Theme integration
+
+ self.InterTheme = self.gladefile.get_widget("InterTheme")
+ if self.desktop == "GNOME":
+ # For some reason, pgrep won't pick up on gtk-w-d if you put in gtk-window-decorator. 'gtk-window-deco' is close enough :)
+ if run(['pgrep', 'gtk-window-deco'], 'call', quiet=True) == 0:
+ self.InterTheme.set_active(True)
+ else:
+ self.InterTheme.set_active(False)
+ elif self.desktop == "KDE":
+ if run(['pgrep', 'kde-window-deco'], 'call', quiet=True) == 0:
+ self.InterTheme.set_active(True)
+ else:
+ self.InterTheme.set_active(False)
+ else:
+ self.InterTheme.set_active(False)
+ self.InterTheme.set_sensitive(False)
+ self.InterTheme.connect('clicked', self.IntegrateTheme)
- self.ZoomMode.connect("changed", self.ZoomModeChanged)
+ # The "Theme" Button
+ self.ThemeButton = self.gladefile.get_widget('ThemeButton')
+ self.ThemeButton.connect("clicked", self.openthemer)
+
+ # Tray Icon
+
+ self.TrayIcon = self.gladefile.get_widget("TrayIconCheck")
+ if run(["pgrep", "fusion-icon"], mode='call') == 0:
+ self.TrayIcon.set_active(True)
+ else:
+ self.TrayIcon.set_active(False)
+ self.TrayIcon.connect('clicked', self.RunFusionIcon)
+
+ self.BoolSettings = [['EnableLighting', ['core', 'lighting']], ['VSyncEnable', ['core', 'sync_to_vblank']], ['AllowTabbingCheckBox', ['group', 'autotab_create']], ["EdgeFlipDrag", ["rotate", "edge_flip_window"]], ["EdgeFlipPointer", ["rotate", "edge_flip_pointer"]], ["ReflectionCheck", ["expo", "reflection"]], ["FocusTrack", ["ezoom", "follow_focus"]], ["ZoomToWindow", ["ezoom", "focus_fit_window"]], ['Skydome', ['cube', 'skydome']], ['ShowDesktopScale', ['scale', 'show_desktop']]]
+
+ self.PluginEnableDisables = [["AllowGroupingCheckBox", "group"], ["TextScale", "scaleaddon"], ["SearchScale", "scalefilter"], ["Thumbnails", "thumbnail"], ["CubeReflectionCheck", "cubereflex"], ["3DCheck", "3d"], ["VPSwitchCheck", "vpswitch"], ["WaterCheck", "water"], ["FireCheck", "firepaint"], ["SnowCheck", "snow"], ["BlurCheck", "blur"], ["ReflexCheck", "reflex"], ["TrailfocusCheck", "trailfocus"]]
+
+ self.ValueSettings = [['DesktopSizeX', ['core', 'hsize']], ['DesktopSizeY', ['core', 'vsize']], ['OpacityMovingWindows', ['move', 'opacity']], ['CubeZoom', ['rotate', 'zoom']], ['CubeTransparency', ['cube', 'active_opacity']]]
+
+ self.TextSettings = [['FullscreenEntry', ['extrawm', 'toggle_fullscreen_key']], ['StickEntry', ['extrawm', 'toggle_sticky_key']], ['CursorWaterKey', ['water', 'initiate_key']], ['CursorFireKey', ['firepaint', 'initiate_button']], ['SnowKey', ['snow', 'toggle_key']], ['SelectZoomAreaButton', ['zoom', 'initiate_button']], ['FilterKey', ['colorfilter', 'toggle_window_key']], ['SwitchFilterKey', ['colorfilter', 'switch_filter_key']], ['DrawWithEntry', ['annotate', 'initiate_button']], ['ClearWithEntry', ['annotate', 'clear_key']], ['ActivateWindowPicker', ['scale', 'initiate_key']], ['ToggleExpo', ['expo', 'expo_key']]]
+
+ for x in range(0, len(self.PluginEnableDisables)):
+ pluginname = self.PluginEnableDisables[x][1]
+ if pluginname not in self.pluginnames:
+ sensitive = False
+ self.CreatePluginSetting(self.PluginEnableDisables[x][0], 0, sensitive)
+ else:
+ sensitive = True
+ name = self.PluginEnableDisables[x][1]
+ name2 = None
+ self.CreatePluginSetting(self.PluginEnableDisables[x][0], name, sensitive, name2)
+
+ for x in range(0, len(self.BoolSettings)):
+ if self.BoolSettings[x][1][0] not in self.pluginnames:
+ sensitive = False
+ self.CreateBoolSetting(self.BoolSettings[x][0], 0, 0, sensitive)
+ else:
+ sensitive = True
+ self.CreateBoolSetting(self.BoolSettings[x][0], self.BoolSettings[x][1][0], self.BoolSettings[x][1][1], sensitive)
+
+ for x in range(0, len(self.ValueSettings)):
+ if self.ValueSettings[x][1][0] not in self.pluginnames:
+ sensitive = False
+ self.CreateValueSetting(self.ValueSettings[x][0], 0, 0, sensitive)
+ else:
+ sensitive = True
+ self.CreateValueSetting(self.ValueSettings[x][0], self.ValueSettings[x][1][0], self.ValueSettings[x][1][1], sensitive)
+
+ for x in range(0, len(self.TextSettings)):
+ if self.TextSettings[x][1][0] not in self.pluginnames:
+ sensitive = False
+ self.CreateTextSetting(self.TextSettings[x][0], 0, 0, sensitive)
+ else:
+ sensitive = True
+ self.CreateTextSetting(self.TextSettings[x][0], self.TextSettings[x][1][0], self.TextSettings[x][1][1], sensitive)
+
+ # Now for the hard part - The Texture Filter
+ self.TextureFilterCombo = self.gladefile.get_widget('TextureFilteringCombo')
+ self.OldTextureFilteringComboValue = self.plugins[self.pluginnames.index('core')].Display["texture_filter"].Value
+ self.TextureFilterCombo.set_active(self.OldTextureFilteringComboValue)
+ self.TextureFilterCombo.connect("changed", self.TextureFilterModified)
+
+ ## The 'Windows' Tab
+
+ # Which Switcher to use
+
+ # Here, we determine which of the switchers is the 'Active'
+ # one, and hence we set the key. The only problem is that
+ # flat switcher must be active by default if all switchers are enabled
+ # already.
+
+ self.switchers = [[0, None], [1, 'switcher'], [2, 'ring'], [3, ['shift', 0]], [4, ['shift', 1]]]
+ self.SwitcherChooser = self.gladefile.get_widget('SwitcherTypeCombo')
+ switcherplugins = []
+ self.ShiftFunctionIsReady = False
+ for i in self.switchers:
+ if i[1] == None:
+ pass
+ else:
+ if 'list' in str(type(i[1])):
+ self.switchPlugin = self.context.Plugins[i[1][0]]
+ index = i[0]
+ shift_type = i[1][1]
+ switcherplugins.append(plugin)
+ else:
+ self.switchPlugin = self.context.Plugins[i[1]]
+ index = i[0]
+ shift_type = None
+ switcherplugins.append(plugin)
+
+ if self.switchPlugin.Enabled == True:
+ if shift_type != None:
+ if shift_type == 0:
+ index = 3
+ elif shift_type == 1:
+ index = 4
+ self.CreateSwitcherKey(self.switchPlugin.Name)
+ self.SwitcherChooser.set_active(index)
+ self.SwitcherChooser.connect('changed', self.SwitcherChanged)
+ if self.SwitcherChooser.get_active() == -1:
+ self.SwitcherChooser.set_active(0)
+
+ # CHEAP HACK! Sue me...
+ # We have to correct shift detection as it keeps on crapping up
+ # read : Calling the 'changed' function for no apparant reason
+ self.ShiftFunctionIsReady = True
+
+ # Show Desktop Mode
+ ShowDesktopMode = self.gladefile.get_widget('showDesktopMode')
+ ShowDesktopMode
- # Speed Controller. I am putting this here after plugins have been initialized
-
- self.SpeedControl = self.gladefile.get_widget('EffectsSpeed')
- self.RateSpeed()
- SpeedControlSpeed = self.Speed / 11
- self.SpeedControl.set_value(SpeedControlSpeed)
- self.SpeedControl.connect('value-changed', self.SpeedControlChanged)
-
- # Here begins the area where widgets are and options are checked if
- # they are unequal and if so, the option is changed to match the widget.
- # Some areas may require conversion of intergers to strings, so that both
- # the widget and the settings value can make sense
- # Core Options
+ # Here we are going to do the screencorners. What we need to do here is
+ # check every possible option to see if a screencorner is set for that widget
- def TextureFilterModified(self, widget):
+ # Now we need to create a list that relates the option names back to the numbers
- TextureFilterModifiedCurrentValue = self.TextureFilterCombo.get_active()
- TextureFilterModifiedCompizValue = self.plugins[self.pluginnames.index('core')].Display["texture_filter"].Value
+ self.NewScreenCornerPlugins = [[None, None], ["scale", "initiate_edge"], ["scale", "initiate_all_edge"], ["scale", "initiate_group_edge"], ["expo", "expo_edge"], ["core", "show_desktop_edge"], ["widget", "toggle_edge"]]
+
+ self.Edges = ["TopLeft", "TopRight", "BottomLeft", "BottomRight", "Left", "Right", "Top", "Bottom"]
+ self.CurrentEdges = []
+
+ for Edge in self.Edges:
+ # When this reaches 6, there musn't be any setting on the edge
+ MissingEdgeCount = 0
+ for i in self.NewScreenCornerPlugins:
+ if i[0] != None:
+ if self.context.Plugins[i[0]].Display[i[1]].Value == Edge:
+ if i[1] != None:
+ self.CurrentEdges.append([self.NewScreenCornerPlugins.index(i), Edge])
+ break
+ else:
+ MissingEdgeCount = MissingEdgeCount + 1
+ if MissingEdgeCount == 6:
+ self.CurrentEdges.append([None, "Disabled"])
+
+
+ EdgeWidgets = ['TopLeftEdgeSelect', 'TopRightEdgeSelect', 'BottomLeftEdgeSelect', 'BottomRightEdgeSelect', 'LeftEdgeSelect', 'RightEdgeSelect', 'TopEdgeSelect', 'BottomEdgeSelect']
+
+ for Edge in EdgeWidgets:
+ self.Widget = self.gladefile.get_widget(Edge)
+ for x in range(0, len(self.CurrentEdges)):
+ if Edge in EdgeWidgets[x]:
+ if self.CurrentEdges[x][0] != None:
+ self.Widget.set_active(self.CurrentEdges[x][0])
+ else:
+ self.Widget.set_active(0)
+ self.Widget.connect("changed", self.EdgeChanged, self.Edges[EdgeWidgets.index(Edge)])
+
+ # Treeview for keybindings,
+
+ self.KeyBindingsStore = gtk.TreeStore(
+ str, # Name of object
+ bool, # Does it have a keybinding?
+ str, # Keybinding setting
+ object, # The object that holds the keybinding,
+ bool, # Does it have a mousebinding?
+ str, # Mousebinding setting
+ object, # The object that holds the mousebinding,
+ )
+
+ settingActions = { 'General' :
+ [["Show the desktop", "core", "show_desktop", True, False],
+ ["Shade a window", "core", "toggle_window_shaded", True, False],
+ ["Slow Motion Animations", "core", "slow_animations", True, False],
+ ["Maximise Horizontally",'core', 'toggle_window_maximized_horizontally', True, False],
+ ["Maximise Vertically", 'core', 'toggle_window_maximized_vertically', True, False],
+ ["Increase Opactiy", 'core', 'opacity_increase', False, True],
+ ["Decrease Opactiy", 'core', 'opacity_decrease', False, True]
+ ],
+ 'Application Switcher' :
+ [["Flip to the next window", "switcher", "next", True, True],
+ ["Flip to the previous window", "switcher", "prev", True, True],
+ ["Flip to the next window in all desktops", "switcher", "next_all", True, True],
+ ["Flip to the previous window in all desktops", 'switcher', "prev_all", True, True],
+ ],
+ 'Ring Switcher' :
+ [["Flip to the next window", "ring", "next", True, True],
+ ["Flip to the previous window", "ring", "prev", True, True],
+ ["Flip to the next window in all desktops", "ring", "next_all", True, True],
+ ["Flip to the previous window in all desktops", 'ring', "prev_all", True, True],
+ ],
+ 'Shift Switcher' :
+ [["Flip to the next window", "shift", "next", True, True],
+ ["Flip to the previous window", "shift", "prev", True, True],
+ ["Flip to the next window in all desktops", "shift", "next_all", True, True],
+ ["Flip to the previous window in all desktops", 'shift', "prev_all", True, True],
+ ],
+ 'Window Picker' :
+ [['Pick from current viewport', 'scale', 'initiate', True, False],
+ ['Pick from all viewports', 'scale', 'initiate_all', True, False],
+ ['Pick from current application', 'scale', 'initiate_group', False, False]
+ ],
+ 'Window Grouper' :
+ [['Select a window', 'group', 'select_single', True, False],
+ ['Group Selected Windows', 'group', 'group', True, False],
+ ['Ungroup window group', 'group', 'ungroup', True, False],
+ ['(Un)Tab selected or grouped windows', 'group', 'tabmode', True, False]
+ ],
+ 'Desktop Cube' : [
+ ['Free Rotation', 'rotate', 'initiate', False, True],
+ ['Rotate Left', 'rotate', 'rotate_left', True, True],
+ ['Rotate Right', 'rotate', 'rotate_right', True, True],
+ ['Rotate Left with Window', 'rotate', 'rotate_left_window', True, True],
+ ['Rotate Right', 'rotate', 'rotate_right_window', True, True]
+ ],
+ 'Desktop Wall' : [
+ ['Move Left', 'wall', 'left', True, True],
+ ['Move Right', 'wall', 'right', True, True],
+ ['Move Up', 'wall', 'up', True, True],
+ ['Move Down', 'wall', 'down', True, True],
+ ['Move Left with Window', 'wall', 'left_window', True, False],
+ ['Move Right with Window', 'wall', 'right_window', True, False],
+ ['Move Up with Window', 'wall', 'up_window', True, False],
+ ['Move Down with Window', 'wall', 'down_window', True, False]
+ ]
+ }
+ for category, actionS in settingActions.items():
+ categoryiter = self.KeyBindingsStore.append(None, [category, False, '', None, False, '', None])
+ for action in actionS:
+ actionString = action[0]
+ actionPluginName = action[1]
+ if actionPluginName not in self.pluginnames:
+ print "Plugin doesn't exist!"
+ break
+ else:
+ actionPlugin = self.plugins[self.pluginnames.index(actionPluginName)]
+ actionSetting = action[2]
+ actionHasKB = action[3]
+ if actionHasKB == True:
+ actionKBSetting = self.GetSetting(actionPlugin, "Display", actionSetting+"_key")
+ actionKBValue = actionKBSetting.Value
+ else:
+ actionKBValue = "None"
+ actionKBSetting = None
+ actionHasMouse = action[4]
+ if actionHasMouse == True:
+ actionMouseSetting = self.GetSetting(actionPlugin, "Display", actionSetting+"_button")
+ actionMouseValue = actionMouseSetting.Value
+ else:
+ actionMouseSetting = None
+ actionMouseValue = "None"
+ self.KeyBindingsStore.append(categoryiter, [actionString,
+ actionHasKB,
+ actionKBValue,
+ actionKBSetting,
+ actionHasMouse,
+ actionMouseValue,
+ actionMouseSetting
+ ]
+ )
+
+ self.KeyBindingsView = self.gladefile.get_widget('KeybindingTreeview')
+ self.KeyBindingsView.set_model(self.KeyBindingsStore)
+
+ NameColumn = gtk.TreeViewColumn('Action Name')
+ self.KeyBindingsView.append_column(NameColumn)
+ NameCell = gtk.CellRendererText()
+ NameColumn.pack_start(NameCell, True)
+ NameColumn.add_attribute(NameCell, 'text', 0)
+
+ KeyColumn = gtk.TreeViewColumn('Key Shortcut')
+ self.KeyBindingsView.append_column(KeyColumn)
+ KeyCell = gtk.CellRendererText()
+ KeyCell.connect('edited', self.ActionKeyEdited)
+ KeyColumn.pack_start(KeyCell, True)
+ KeyColumn.add_attribute(KeyCell, 'text', 2)
+ KeyColumn.add_attribute(KeyCell, 'sensitive', 1)
+ KeyColumn.add_attribute(KeyCell, 'editable', 1)
+
+ MouseColumn = gtk.TreeViewColumn('Mouse Button')
+ self.KeyBindingsView.append_column(MouseColumn)
+ MouseCell = gtk.CellRendererText()
+ MouseCell.connect('edited', self.ActionButtonEdited)
+ MouseColumn.pack_start(MouseCell, True)
+ MouseColumn.add_attribute(MouseCell, 'text', 5)
+ MouseColumn.add_attribute(MouseCell, 'sensitive', 4)
+ MouseColumn.add_attribute(MouseCell, 'editable', 4)
+
+ # The 'App switch with' entry
+
+ # Desktop Appearance
+ self.DesktopPlugins = []
+ for plugin in self.context.Plugins.values():
+ if "largedesktop" in plugin.Features:
+ self.DesktopPlugins.append([plugin, plugin.ShortDesc])
+ self.FillDesktopAppearance()
+
+ # Effects Settings
+
+ # Move Effect Combo
+ self.MoveEffect = self.gladefile.get_widget('MoveCombo')
+ if 'Normal' or 'Dialog' or 'ModalDialog' in self.context.Plugins['wobbly'].Screens[0]['move_window_match'].Value:
+ self.MoveEffect.set_active(1)
+ else:
+ self.MoveEffect.set_active(0)
+ self.MoveEffect.connect("changed", self.MoveEffectChanged)
+
+ # Maximise Effect Combo
+ self.MaximiseEffect = self.gladefile.get_widget('MaximiseCombo')
+ if self.plugins[self.pluginnames.index('wobbly')].Screens[0]["maximize_effect"].Value == True:
+ self.MaximiseEffect.set_active(1)
+ else:
+ self.MaximiseEffect.set_active(0)
+ self.MaximiseEffect.connect('changed', self.MaximiseEffectChanged)
+
+ # Resize Effect Combo
+
+ self.ResizeEffect = self.gladefile.get_widget('ResizeCombo')
+ self.OldResizeEffectValue = self.plugins[self.pluginnames.index('resize')].Display["mode"].Value
+ self.ResizeEffect.set_active(self.OldResizeEffectValue)
+ self.ResizeEffect.connect("changed", self.ResizeEffectChanged)
+
+ # Animation Boxes. Thanks to marex for the functions
+
+ self.FillAnimationBoxes()
+
+ self.CreateCombo = self.gladefile.get_widget('CreateCombo')
+ self.CreateCombo.connect('changed', self.AnimationBoxChanged, "open_effects")
+
+ self.CloseCombo = self.gladefile.get_widget('CloseCombo')
+ self.CloseCombo.connect('changed', self.AnimationBoxChanged, "close_effects")
+
+ self.MinimizeCombo = self.gladefile.get_widget('MinimizeCombo')
+ self.MinimizeCombo.connect('changed', self.AnimationBoxChanged, "minimize_effects")
+
+ self.ShadeCombo = self.gladefile.get_widget('ShadeCombo')
+ self.ShadeCombo.connect('changed', self.AnimationBoxChanged, "shade_effects")
+
+ self.FocusCombo = self.gladefile.get_widget('FocusCombo')
+ self.FocusCombo.connect('changed', self.AnimationBoxChanged, "focus_effects")
+
- if (TextureFilterModifiedCurrentValue != TextureFilterModifiedCompizValue):
- self.plugins[self.pluginnames.index('core')].Display["texture_filter"].Value = TextureFilterModifiedCurrentValue
- self.context.Write()
+ # Accessibility
+ # Opacity Brightness and Saturation
+
+ self.OBSModifiers = [["OpacityModifiers", ["core", "opacity_increase_button"]], ["BrightnessModifiers", ["bs", "brightness_increase_button"]], ["SaturationModifiers", ["bs", "saturation_increase_button"]]]
+
+ self.PossibleButtons = ["Button1", "Button2", "Button3", "Button4", "Button5", "Button6", "Button7"]
+
+ for i in self.OBSModifiers:
+ self.OBSWidget = self.gladefile.get_widget(i[0])
+ if i[1][0] not in self.context.Plugins:
+ self.OBSWidget.set_sensitive(False)
+ else:
+ NameOfWidget = i[0]
+ OBSTempString = self.context.Plugins[i[1][0]].Display[i[1][1]].Value
+ for Button in self.PossibleButtons:
+ if Button in OBSTempString:
+ self.OBSWidgetText = OBSTempString.replace(Button, "")
+ self.OBSWidget.set_text(self.OBSWidgetText)
+ self.OBSWidget.connect("activate", self.OBSModifierChanged, self.OBSWidget, i[1][1], i[1][0], NameOfWidget)
+
+ # Zoom keys
+
+ self.ZoomButtonEntry = self.gladefile.get_widget("ZoomIn")
+ if self.context.Plugins['zoom'].Enabled == True:
+ ZoomButton = self.context.Plugins['zoom'].Display["zoom_in_button"]
+ elif self.context.Plugins['ezoom'].Enabled == True:
+ ZoomButton = self.context.Plugins['ezoom'].Display["zoom_in"]
+ for Button in self.PossibleButtons:
+ if Button in ZoomButton.Value:
+ TempValue = ZoomButton.Value
+ UseZoomButton = TempValue.replace(Button, "")
+ self.ZoomModifiers = UseZoomButton
+ self.ZoomButtonEntry.set_text(self.ZoomModifiers)
+ self.ZoomButtonEntry.connect("activate", self.ZoomModifierChanged)
+
+ # Zoom Mode
+
+ self.ZoomMode = self.gladefile.get_widget("ZoomModeCombo")
+ # Here begins a series of checks to determine what zoom mode is in use.
+ if self.context.Plugins['zoom'].Enabled == True:
+ self.ZoomMode.set_active(2)
+ else:
+ if self.context.Plugins['ezoom'].Screens[0]["sync_mouse"].Value == True:
+ self.ZoomMode.set_active(1)
+ else:
+ self.ZoomMode.set_active(0)
+
+ self.ZoomMode.connect("changed", self.ZoomModeChanged)
- def FillDesktopAppearance(self):
- ComboBox = self.gladefile.get_widget("DesktopAppearanceCombo")
- for i in self.DesktopPlugins:
- ComboBox.append_text(i[1])
- if i[0].Enabled == True:
- ComboBox.set_active(self.DesktopPlugins.index(i))
- ComboBox.connect("changed", self.DesktopAppearanceChanged)
-
- def CreateSwitcherKey(self, plugin):
- self.SwitcherKey = self.gladefile.get_widget('AppSwitcherKey')
- self.SwitcherKey.set_text(self.context.Plugins[plugin].Display["next_key"].Value)
- self.SwitcherKey.connect('activate', self.SwitcherKeyChanged, plugin, self.SwitcherKey)
-
- def SwitcherChanged(self, widget):
- # Continued from CHEAP HACK
- if self.ShiftFunctionIsReady != True:
- pass
- else:
- active = self.SwitcherChooser.get_active()
- if active == 0:
- for i in range(1, len(self.switchers)):
- if self.switchers[i][1] == None:
- pass
- else:
- if 'list' in str(type(self.switchers[i][1])):
- self.context.Plugins[self.switchers[i][1][0]].Enabled = False
- else:
- self.context.Plugins[self.switchers[i][1]].Enabled = False
- else:
- if self.switchers[active][1] == None:
- pass
- else:
- if 'list' in str(type(self.switchers[active][1])):
- # This means we are working with a shift switcher
- self.context.Plugins[self.switchers[active][1][0]].Enabled = True
- if active == 3:
- self.context.Plugins[self.switchers[active][1][0]].Screens[0]["mode"].Value = 1
- else:
- self.context.Plugins[self.switchers[active][1][0]].Screens[0]["mode"].Value = 0
- else:
- self.context.Plugins[self.switchers[active][1]].Enabled = True
-
- self.context.Write()
-
- #Disable the rest
- for i in range(1, len(self.switchers)):
- if 'list' in str(type(self.switchers[i][1])):
- if self.switchers[i][0] != active:
- if active == 3 or 4:
- # Flip sees cover /(vice-versa) and disables itself -_-
- pass
- else:
- self.context.Plugins[self.switchers[i][1][0]].Enabled = False
- elif self.switchers[i][0] != active:
- self.context.Plugins[self.switchers[i][1]].Enabled = False
- self.context.Write()
-
- # Set the keybinding
- if 'list' in str(type(self.switchers[active][1])):
- self.CreateSwitcherKey(self.switchers[active][1][0])
- else:
- self.CreateSwitcherKey(self.switchers[active][1])
-
-
-
- def SwitcherKeyChanged(self, widget, plugin):
- self.context.Plugins[plugin].Display["next_key"].Value = widget.get_text()
- self.context.Write()
+ # Speed Controller. I am putting this here after plugins have been initialized
- def ShowDesktopModeChanged(self, widget):
- active = widget.get_active()
- if active is 0:
- self.plugins[self.pluginnames.index('showdesktop')].Enabled = False
- self.plugins[self.pluginnames.index('fadedesktop')].Enabled = False
- elif active is 1:
- self.plugins[self.pluginnames.index('showdesktop')].Enabled = True
- self.plugins[self.pluginnames.index('fadedesktop')].Enabled = False
- elif active is 2:
- self.plugins[self.pluginnames.index('showdesktop')].Enabled = False
- self.plugins[self.pluginnames.index('fadedesktop')].Enabled = True
- self.context.Write()
-
-
- def EdgeChanged(self, Widget, Edge):
+ self.SpeedControl = self.gladefile.get_widget('EffectsSpeed')
+ self.RateSpeed()
+ SpeedControlSpeed = self.Speed / 11
+ self.SpeedControl.set_value(SpeedControlSpeed)
+ self.SpeedControl.connect('value-changed', self.SpeedControlChanged)
+
+ # Here begins the area where widgets are and options are checked if
+ # they are unequal and if so, the option is changed to match the widget.
+ # Some areas may require conversion of intergers to strings, so that both
+ # the widget and the settings value can make sense
+
+ # Core Options
+
+ def TextureFilterModified(self, widget):
+
+ TextureFilterModifiedCurrentValue = self.TextureFilterCombo.get_active()
+ TextureFilterModifiedCompizValue = self.plugins[self.pluginnames.index('core')].Display["texture_filter"].Value
+
+ if (TextureFilterModifiedCurrentValue != TextureFilterModifiedCompizValue):
+ self.plugins[self.pluginnames.index('core')].Display["texture_filter"].Value = TextureFilterModifiedCurrentValue
+ self.context.Write()
+
+ def FillDesktopAppearance(self):
+ ComboBox = self.gladefile.get_widget("DesktopAppearanceCombo")
+ for i in self.DesktopPlugins:
+ ComboBox.append_text(i[1])
+ if i[0].Enabled == True:
+ ComboBox.set_active(self.DesktopPlugins.index(i))
+ ComboBox.connect("changed", self.DesktopAppearanceChanged)
- self.GlobalUpdater = ccm.Utils.Updater()
- ActionConflict = ccm.Conflicts.ActionConflict
-
- CurrentValue = Widget.get_active()
- OldOptionDisabled = False
- for Option in self.NewScreenCornerPlugins:
- if Option[0] != None:
- # First Disable the Old Option
- if self.context.Plugins[Option[0]].Display[Option[1]].Value == Edge:
- self.context.Plugins[Option[0]].Display[Option[1]].Value[2] = "Disabled"
- self.context.Write()
- OldOptionDisabled = True
- else:
- OldOptionDisabled = True
- if OldOptionDisabled == True:
- for Option in self.NewScreenCornerPlugins:
- if self.NewScreenCornerPlugins.index(Option) == CurrentValue:
- if CurrentValue != 0:
- Setting = self.context.Plugins[Option[0]].Display[Option[1]]
- # Enable the plugin
- Conflict = ccm.EdgeConflict(Setting, Edge, autoResolve = True)
- if Conflict.Resolve(self.GlobalUpdater):
- self.context.Plugins[Option[0]].Display[Option[1]].Value = Edge
- self.context.Plugins[Option[0]].Enabled = True
- self.context.Write()
- break
- else:
- break
+ def CreateSwitcherKey(self, plugin):
+ self.SwitcherKey = self.gladefile.get_widget('AppSwitcherKey')
+ self.SwitcherKey.set_text(self.context.Plugins[plugin].Display["next_key"].Value)
+ self.SwitcherKey.connect('activate', self.SwitcherKeyChanged, plugin, self.SwitcherKey)
+
+ def SwitcherChanged(self, widget):
+ # Continued from CHEAP HACK
+ if self.ShiftFunctionIsReady != True:
+ pass
+ else:
+ active = self.SwitcherChooser.get_active()
+ if active == 0:
+ for i in range(1, len(self.switchers)):
+ if self.switchers[i][1] == None:
+ pass
+ else:
+ if 'list' in str(type(self.switchers[i][1])):
+ self.context.Plugins[self.switchers[i][1][0]].Enabled = False
+ else:
+ self.context.Plugins[self.switchers[i][1]].Enabled = False
+ else:
+ if self.switchers[active][1] == None:
+ pass
+ else:
+ if 'list' in str(type(self.switchers[active][1])):
+ # This means we are working with a shift switcher
+ self.context.Plugins[self.switchers[active][1][0]].Enabled = True
+ if active == 3:
+ self.context.Plugins[self.switchers[active][1][0]].Screens[0]["mode"].Value = 1
+ else:
+ self.context.Plugins[self.switchers[active][1][0]].Screens[0]["mode"].Value = 0
+ else:
+ self.context.Plugins[self.switchers[active][1]].Enabled = True
+
+ self.context.Write()
- def DesktopAppearanceChanged(self, widget):
-
- CurrentValue = widget.get_active()
-
- # First, disable other plugins
- for i in self.DesktopPlugins:
- if self.DesktopPlugins.index(i) != CurrentValue:
- # resolve conflicts
- conflicts = i[0].DisableConflicts
- conflict = ccm.PluginConflict(i[0], conflicts, autoResolve=True)
- if conflict.Resolve():
- i[0].Enabled = False
- else:
- print "Oops..."
+ #Disable the rest
+
+ for i in range(1, len(self.switchers)):
+ if 'list' in str(type(self.switchers[i][1])):
+ if self.switchers[i][0] != active:
+ if active == 3 or 4:
+ # Flip sees cover /(vice-versa) and disables itself -_-
+ pass
+ else:
+ self.context.Plugins[self.switchers[i][1][0]].Enabled = False
+ elif self.switchers[i][0] != active:
+ self.context.Plugins[self.switchers[i][1]].Enabled = False
+
+ self.context.Write()
+
+ # Set the keybinding
+ if 'list' in str(type(self.switchers[active][1])):
+ self.CreateSwitcherKey(self.switchers[active][1][0])
+ else:
+ self.CreateSwitcherKey(self.switchers[active][1])
- self.context.Write()
-
- # Now enable our plugin
- for i in self.DesktopPlugins:
- if self.DesktopPlugins.index(i) == CurrentValue:
- i[0].Enabled = True
- self.context.Write()
- if i[0].Name == "cube":
- self.context.Plugins["rotate"].Enabled = True
- self.context.Write()
- # Effects Options
+
+ def SwitcherKeyChanged(self, widget, plugin):
+ self.context.Plugins[plugin].Display["next_key"].Value = widget.get_text()
+ self.context.Write()
+
+ def EdgeChanged(self, Widget, Edge):
+
+ self.GlobalUpdater = ccm.Utils.Updater()
+ ActionConflict = ccm.Conflicts.ActionConflict
+
+ CurrentValue = Widget.get_active()
+ OldOptionDisabled = False
+ for Option in self.NewScreenCornerPlugins:
+ if Option[0] != None:
+ # First Disable the Old Option
+ if self.context.Plugins[Option[0]].Display[Option[1]].Value == Edge:
+ self.context.Plugins[Option[0]].Display[Option[1]].Value = "Disabled"
+ self.context.Write()
+ OldOptionDisabled = True
+ else:
+ OldOptionDisabled = True
+ if OldOptionDisabled == True:
+ for Option in self.NewScreenCornerPlugins:
+ if self.NewScreenCornerPlugins.index(Option) == CurrentValue:
+ if CurrentValue != 0:
+ Setting = self.context.Plugins[Option[0]].Display[Option[1]]
+ # Enable the plugin
+ Conflict = ccm.ActionConflict(Setting, edges = Edge)
+ if Conflict.Resolve(self.GlobalUpdater):
+ self.context.Plugins[Option[0]].Display[Option[1]].Value = Edge
+ self.context.Plugins[Option[0]].Enabled = True
+ self.context.Write()
+ break
+ else:
+ break
+
+ def DesktopAppearanceChanged(self, widget):
+
+ CurrentValue = widget.get_active()
+
+ # First, disable other plugins
+ for i in self.DesktopPlugins:
+ if self.DesktopPlugins.index(i) != CurrentValue:
+ # resolve conflicts
+ conflicts = i[0].DisableConflicts
+ conflict = ccm.PluginConflict(i[0], conflicts, autoResolve=True)
+ if conflict.Resolve():
+ i[0].Enabled = False
+ else:
+ print "Oops..."
+
+ self.context.Write()
+
+ # Now enable our plugin
+ for i in self.DesktopPlugins:
+ if self.DesktopPlugins.index(i) == CurrentValue:
+ i[0].Enabled = True
+ self.context.Write()
+ if i[0].Name == "cube":
+ self.context.Plugins["rotate"].Enabled = True
+ self.context.Write()
+
+ # Effects Options
- def MoveEffectChanged(self, widget):
+ def MoveEffectChanged(self, widget):
- option = self.context.Plugins['wobbly'].Screens[0]['move_window_match']
+ option = self.context.Plugins['wobbly'].Screens[0]['move_window_match']
- if self.MoveEffect.get_active() == 0:
- option.Value = ''
- self.context.Write()
- elif self.MoveEffect.get_active() == 1:
- option.Value = 'Toolbar | Menu | Utility | Dialog | Normal | Unknown'
- self.context.Write()
+ if self.MoveEffect.get_active() == 0:
+ option.Value = ''
+ self.context.Write()
+ elif self.MoveEffect.get_active() == 1:
+ option.Value = 'Toolbar | Menu | Utility | Dialog | Normal | Unknown'
+ self.context.Write()
- def MaximiseEffectChanged(self, widget):
+ def MaximiseEffectChanged(self, widget):
- if self.MaximiseEffect.get_active() == 0:
- self.context.Plugins['wobbly'].Screens[0]["maximize_effect"].Value = False
- self.context.Write()
- elif self.MaximiseEffect.get_active() == 1:
- self.context.Plugins['wobbly'].Screens[0]["maximize_effect"].Value = True
- self.context.Write()
+ if self.MaximiseEffect.get_active() == 0:
+ self.context.Plugins['wobbly'].Screens[0]["maximize_effect"].Value = False
+ self.context.Write()
+ elif self.MaximiseEffect.get_active() == 1:
+ self.context.Plugins['wobbly'].Screens[0]["maximize_effect"].Value = True
+ self.context.Write()
- def ResizeEffectChanged(self, widget):
+ def ResizeEffectChanged(self, widget):
- self.plugins[self.pluginnames.index('resize')].Display["mode"].Value = self.ResizeEffect.get_active()
- self.context.Write()
+ self.plugins[self.pluginnames.index('resize')].Display["mode"].Value = self.ResizeEffect.get_active()
+ self.context.Write()
- # Animation Boxes. Thanks to marex's 'simple-ccsm' for these
+ # Animation Boxes. Thanks to marex's 'simple-ccsm' for these
- def SetupBoxModel(self, box):
- store = gtk.ListStore(gobject.TYPE_STRING)
- box.set_model(store)
- cell = gtk.CellRendererText()
- box.pack_start(cell, True)
- box.add_attribute(cell, 'text', 0)
+ def SetupBoxModel(self, box):
+ store = gtk.ListStore(gobject.TYPE_STRING)
+ box.set_model(store)
+ cell = gtk.CellRendererText()
+ box.pack_start(cell, True)
+ box.add_attribute(cell, 'text', 0)
+
+ def FillAnimationBoxes(self):
+ plugin = self.context.Plugins['animation']
+
+ boxes = {}
+ boxes['CloseCombo'] = "close_effects"
+ boxes['CreateCombo'] = "open_effects"
+ boxes['MinimizeCombo'] = "minimize_effects"
+ boxes['ShadeCombo'] = "shade_effects"
+ boxes['FocusCombo'] = "focus_effects"
+
+ for boxName, settingName in boxes.items():
+ box = self.gladefile.get_widget(boxName)
+ setting = plugin.Screens[0][settingName]
+ items = sorted(setting.Info[1][2].items(), ccm.EnumSettingSortCompare)
+ self.SetupBoxModel(box)
+ for key, value in items:
+ box.append_text(key)
+ if len(setting.Value):
+ box.set_active(setting.Value[0])
+ else:
+ box.set_active(0)
+
+ def AnimationBoxChanged(self, widget, settingName):
+ newval = widget.get_active_text()
+ plugin = self.context.Plugins['animation']
+ if self.context.Plugins["minimize"].Enabled == True:
+ self.context.Plugins["minimize"].Enabled = False
+ self.context.Write()
+ if self.plugin.Enabled == False:
+ self.plugin.Enabled = True
+ self.context.Write()
+ setting = plugin.Screens[0][settingName]
+ value = setting.Value
+ if len(value) >= 1:
+ value[0] = setting.Info[1][2][newval]
+ setting.Value = value
+ self.context.Write()
+ else:
+ for setting in plugin.Groups[setting.Group][setting.SubGroup].Screens[0].values():
+ setting.Reset()
+ self.context.Write()
+ self.AnimationBoxChanged(widget, settingName)
+
+ # Accessibility
+
+ def OBSModifierChanged(self, widget, WidgetName, OptionName, pluginName, NameOfWidget):
+ CurValue = WidgetName.get_text()
+ NewIncrValue = CurValue + "Button4"
+ NewDecrValue = CurValue + "Button5"
+ for i in self.OBSModifiers:
+ if i[0] == NameOfWidget:
+ self.plugins[self.pluginnames.index(pluginName)].Display[OptionName] = NewIncrValue
+ self.plugins[self.pluginnames.index(pluginName)].Display[OptionName.replace("_increase", "_decrease")].Value = NewDecrValue
+ self.context.Write()
+
+ def ZoomModifierChanged(self, widget):
+ if self.ezoom.Enabled == True:
+ self.ezoom.Display["zoom_in"].Value = self.ZoomButtonEntry.get_text() + "Button4"
+ self.ezoom.Display["zoom_out"].Value = self.ZoomButtonEntry.get_text() + "Button5"
+ elif self.zoom.Enabled == True:
+ self.zoom.Display["zoom_in_button"].Value = self.ZoomButtonEntry.get_text() + "Button4"
+ self.zoom.Display["zoom_out_button"].Value = self.ZoomButtonEntry.get_text() + "Button5"
+
+ self.context.Write()
+
+
+
+ def ZoomModeChanged(self, widget):
+ CurrentValue = self.ZoomMode.get_active()
+ zoom = self.context.Plugins['zoom']
+ ezoom = self.context.Plugins['ezoom']
+ if CurrentValue == 0:
+ zoom.Enabled = False
+ ezoom.Enabled = True
+ self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(False)
+ self.gladefile.get_widget('FocusTrack').set_sensitive(True)
+ self.gladefile.get_widget('ZoomToWindow').set_sensitive(True)
+ ezoom.Screens[0]["sync_mouse"].Value = False
+ ezoom.Screens[0]["scale_mouse"].Value = True
+ ezoom.Screens[0]["mouse_pan"].Value = True
+ ezoom.Screens[0]["hide_original_mouse"].Value = True
+ self.context.Write()
+ elif CurrentValue == 1:
+ zoom.Enabled = False
+ ezoom.Enabled = True
+ self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(False)
+ self.gladefile.get_widget('FocusTrack').set_sensitive(True)
+ self.gladefile.get_widget('ZoomToWindow').set_sensitive(True)
+ ezoom.Screens[0]["sync_mouse"].Value = True
+ ezoom.Screens[0]["scale_mouse"].Value = False
+ ezoom.Screens[0]["mouse_pan"].Value = False
+ ezoom.Screens[0]["hide_original_mouse"].Value = False
+ self.context.Write()
+ elif CurrentValue == 2:
+ self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(True)
+ self.gladefile.get_widget('FocusTrack').set_sensitive(False)
+ self.gladefile.get_widget('ZoomToWindow').set_sensitive(False)
+ zoom.Enabled = True
+ ezoom.Enabled = False
+ self.context.Write()
+
+ # Integration
+
+ def IntegrationToggled(self, widget):
+ integrationsettings = {"GNOME" : "gconf", "KDE" : "kconfig"}
+ for Desktop, Backend in integrationsettings.items():
+ if self.Integration.get_active() == True:
+ if self.desktop == Desktop:
+ self.context.CurrentBackend = self.context.Backends[Backend]
+ self.context.Integration = True
+ else:
+ self.context.CurrentBackend = self.context.Backends["ini"]
+ else:
+ self.context.CurrentBackend = self.context.Backends["ini"]
+
+ def RateSpeed(self):
+ speedplugins = [['rotate', "speed"], ['scale', "speed"], ['wobbly', "spring_k"], ['switcher', "speed"], ['ring', "speed"], ['shift', "shift_speed"]]
+ self.speedplugins = []
+ for i in speedplugins:
+ if i[0] in self.pluginnames:
+ self.speedplugins.append(self.plugins[self.pluginnames.index(i[0])].Screens[0][i[1]])
+
+ durationplugins = [['wall', "slide_duration"], ['animation', "open_durations"], ['animation', "close_durations"], ['animation', "focus_durations"], ['animation', "minimize_durations"], ['animation', "shade_durations"]]
+ self.durationplugins =[]
+
+ for i in durationplugins:
+ if i[0] in self.pluginnames:
+ if i[0] == 'wall':
+ self.durationplugins.append(self.context.Plugins[i[0]].Display[i[1]])
+ else:
+ self.durationplugins.append(self.context.Plugins[i[0]].Screens[0][i[1]])
+
+ BaseSpeed = 0
+
+ for i in self.speedplugins:
+ # If i is more than 5, it will break this
+ if i.Value > 5:
+ i.Value = 5
+ # Wobbly is a special case
+ if i == self.speedplugins[2]:
+ NewSpeed = BaseSpeed + ((i.Value - 3) / 2)
+ BaseSpeed = NewSpeed
+ else:
+ NewSpeed = BaseSpeed + i.Value
+ BaseSpeed = NewSpeed
+
+ for i in self.durationplugins:
+ # Wall is special
+ if i == self.durationplugins[0]:
+ NewSpeed = BaseSpeed + (5 - i.Value)
+ BaseSpeed = NewSpeed
+ else:
+ Val = float(i.Value[0]) + 2000
+ if Val > 4000:
+ Val = 4000
+ NewSpeed = BaseSpeed + (5 - (Val / 800))
+ BaseSpeed = NewSpeed
- def FillAnimationBoxes(self):
- plugin = self.context.Plugins['animation']
- boxes = {}
- boxes['CloseCombo'] = "close_effects"
- boxes['CreateCombo'] = "open_effects"
- boxes['MinimizeCombo'] = "minimize_effects"
- boxes['ShadeCombo'] = "shade_effects"
- boxes['FocusCombo'] = "focus_effects"
-
- for boxName, settingName in boxes.items():
- box = self.gladefile.get_widget(boxName)
- setting = plugin.Screens[0][settingName]
- items = sorted(setting.Info[1][2].items(), key=ccm.EnumSettingKeyFunc)
- self.SetupBoxModel(box)
- for key, value in items:
- box.append_text(key)
- if len(setting.Value):
- box.set_active(setting.Value[0])
- else:
- box.set_active(0)
-
- def AnimationBoxChanged(self, widget, settingName):
- newval = widget.get_active_text()
- plugin = self.context.Plugins['animation']
- if self.context.Plugins["minimize"].Enabled == True:
- self.context.Plugins["minimize"].Enabled = False
- self.context.Write()
- if self.plugin.Enabled == False:
- self.plugin.Enabled = True
- self.context.Write()
- setting = plugin.Screens[0][settingName]
- value = setting.Value
- if len(value) >= 1:
- value[0] = setting.Info[1][2][newval]
- setting.Value = value
- self.context.Write()
- else:
- for setting in plugin.Groups[setting.Group][setting.SubGroup].Screens[0].values():
- setting.Reset()
- self.context.Write()
- self.AnimationBoxChanged(widget, settingName)
-
- # Accessibility
-
- def OBSModifierChanged(self, widget, WidgetName, OptionName, pluginName, NameOfWidget):
- CurValue = WidgetName.get_text()
- NewIncrValue = CurValue + "Button4"
- NewDecrValue = CurValue + "Button5"
- for i in self.OBSModifiers:
- if i[0] == NameOfWidget:
- self.plugins[self.pluginnames.index(pluginName)].Display[OptionName] = NewIncrValue
- self.plugins[self.pluginnames.index(pluginName)].Display[OptionName.replace("_increase", "_decrease")].Value[1] = NewDecrValue
- self.context.Write()
-
-
- def ZoomModifierChanged(self, widget):
- if self.context.Plugins['ezoom'].Enabled == True:
- self.context.Plugins['ezoom'].Display["zoom_in"].Value = self.ZoomButtonEntry.get_text() + "Button4"
- self.context.Plugins['ezoom'].Display["zoom_out"].Value = self.ZoomButtonEntry.get_text() + "Button5"
- self.context.Write()
- elif self.context.Plugins['zoom'].Enabled == True:
- self.context.Plugins['zoom'].Display["zoom_in_button"].Value = self.ZoomButtonEntry.get_text() + "Button4"
- self.context.Plugins['zoom'].Display["zoom_out_button"].Value = self.ZoomButtonEntry.get_text() + "Button5"
- self.context.Write()
-
- def CreateZoomKey(self, zoomPluginExists, zoomPlugin, ZoomButton):
- if zoomPluginExists == True:
- for Button in self.PossibleButtons:
- if Button in ZoomButton.Value:
- TempValue = ZoomButton.Value
- UseZoomButton = TempValue.replace(Button, "")
- else:
- UseZoomButton = "Enable Zoom Plugin"
- zoomPlugin = None
- self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(False)
- self.ZoomModifiers = UseZoomButton
- self.ZoomButtonEntry.set_text(self.ZoomModifiers)
- self.ZoomButtonEntry.connect("activate", self.ZoomModifierChanged)
-
-
-
- def ZoomModeChanged(self, widget):
- CurrentValue = self.ZoomMode.get_active()
- zoom = self.context.Plugins['zoom']
- ezoom = self.context.Plugins['ezoom']
- if CurrentValue == 0:
- zoom.Enabled = False
- ezoom.Enabled = True
- self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(False)
- self.gladefile.get_widget('FocusTrack').set_sensitive(True)
- self.gladefile.get_widget('ZoomToWindow').set_sensitive(True)
- ezoom.Screens[0]["sync_mouse"].Value = False
- ezoom.Screens[0]["scale_mouse"].Value = True
- ezoom.Screens[0]["mouse_pan"].Value = True
- ezoom.Screens[0]["hide_original_mouse"].Value = True
- zoomPlugin = "ezoom"
- ZoomButton = self.context.Plugins['ezoom'].Display["zoom_in"]
- self.context.Write()
- elif CurrentValue == 1:
- zoom.Enabled = False
- ezoom.Enabled = True
- self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(False)
- self.gladefile.get_widget('FocusTrack').set_sensitive(True)
- self.gladefile.get_widget('ZoomToWindow').set_sensitive(True)
- ezoom.Screens[0]["sync_mouse"].Value = True
- ezoom.Screens[0]["scale_mouse"].Value = False
- ezoom.Screens[0]["mouse_pan"].Value = False
- ezoom.Screens[0]["hide_original_mouse"].Value = False
- zoomPlugin = "ezoom"
- ZoomButton = self.context.Plugins['ezoom'].Display["zoom_in"]
- self.context.Write()
- elif CurrentValue == 2:
- self.gladefile.get_widget('SelectZoomAreaButton').set_sensitive(True)
- self.gladefile.get_widget('FocusTrack').set_sensitive(False)
- self.gladefile.get_widget('ZoomToWindow').set_sensitive(False)
- zoom.Enabled = True
- ezoom.Enabled = False
- zoomPlugin = "zoom"
- ZoomButton = self.context.Plugins['zoom'].Display["zoom_in_button"]
- self.context.Write()
- self.CreateZoomKey(True, zoomPlugin, ZoomButton)
-
- # Integration
-
- def IntegrationToggled(self, widget):
- integrationsettings = {"GNOME" : "gconf", "KDE" : "kconfig"}
- for Desktop, Backend in integrationsettings.items():
- if self.Integration.get_active() == True:
- if self.desktop == Desktop:
- self.context.CurrentBackend = self.context.Backends[Backend]
- self.context.Integration = True
- else:
- self.context.CurrentBackend = self.context.Backends["ini"]
- else:
- self.context.CurrentBackend = self.context.Backends["ini"]
+ self.Speed = BaseSpeed
+
+ def SpeedControlChanged(self, widget):
+ CurrentSpeed = self.SpeedControl.get_value()
+ # Now we need to break that up and give each part equally to each speed control interface
+
+ for i in self.speedplugins:
+ if i == self.speedplugins[2]:
+ # Wobbly is special
+ i.Value = CurrentSpeed * 2 + 3
+ if i.Value > 10:
+ i.Value = 10
+ else:
+ i.Value = CurrentSpeed
+
+ for i in self.durationplugins:
+ # Wall is special
+ if i == self.durationplugins[0]:
+ i.Value = 5 - CurrentSpeed
+ self.context.Write()
+
+ else:
+ Value = i.Value
+ Val = (4000 - (CurrentSpeed * 800))
+ Value[0] = int(Val)
+ # We dont want it to be too slow
+ Value[0] = Value[0] - 2000
+ # Leave it if it hits 100
+ if Value[0] < 100:
+ Value[0] = 100
+ i.Value = Value
+ self.context.Write()
+
+ def PluginEnableDisable(self, widget, name, name2=None):
+ self.plugins[self.pluginnames.index(name)].Enabled = widget.get_active()
+ if name2 is not None:
+ self.plugins[self.pluginnames.index(name2)].Enabled = widget.get_active()
+ self.context.Write()
+ if name == 'group':
+ self.gladefile.get_widget('AllowTabbingCheckBox').set_sensitive(widget.get_active())
+
+ def SettingBoolToggled(self, widget, plugin, settingName, settingType):
+ if settingType == "Screen":
+ plugin.Screens[0][settingName].Value = widget.get_active()
+ else:
+ plugin.Display[settingName].Value = widget.get_active()
- def RateSpeed(self):
- speedplugins = [['rotate', "speed"], ['scale', "speed"], ['wobbly', "spring_k"], ['switcher', "speed"], ['ring', "speed"], ['shift', "shift_speed"]]
- self.speedplugins = []
- for i in speedplugins:
- if i[0] in self.pluginnames:
- self.speedplugins.append(self.plugins[self.pluginnames.index(i[0])].Screens[0][i[1]])
-
- durationplugins = [['wall', "slide_duration"], ['animation', "open_durations"], ['animation', "close_durations"], ['animation', "focus_durations"], ['animation', "minimize_durations"], ['animation', "shade_durations"]]
- self.durationplugins =[]
-
- for i in durationplugins:
- if i[0] in self.pluginnames:
- if i[0] == 'wall':
- self.durationplugins.append(self.context.Plugins[i[0]].Display[i[1]])
- else:
- self.durationplugins.append(self.context.Plugins[i[0]].Screens[0][i[1]])
-
- BaseSpeed = 0
-
- for i in self.speedplugins:
- # If i is more than 5, it will break this
- if i.Value > 5:
- i.Value = 5
- # Wobbly is a special case
- if i == self.speedplugins[2]:
- NewSpeed = BaseSpeed + ((i.Value - 3) / 2)
- BaseSpeed = NewSpeed
- else:
- NewSpeed = BaseSpeed + i.Value
- BaseSpeed = NewSpeed
-
- for i in self.durationplugins:
- # Wall is special
- if i == self.durationplugins[0]:
- NewSpeed = BaseSpeed + (5 - i.Value)
- BaseSpeed = NewSpeed
- else:
- Val = float(i.Value[0]) + 2000
- if Val > 4000:
- Val = 4000
- NewSpeed = BaseSpeed + (5 - (Val / 800))
- BaseSpeed = NewSpeed
-
-
- self.Speed = BaseSpeed
-
- def SpeedControlChanged(self, widget):
- CurrentSpeed = self.SpeedControl.get_value()
- # Now we need to break that up and give each part equally to each speed control interface
-
- for i in self.speedplugins:
- if i == self.speedplugins[2]:
- # Wobbly is special
- i.Value = CurrentSpeed * 2 + 3
- if i.Value > 10:
- i.Value = 10
- else:
- i.Value = CurrentSpeed
-
- for i in self.durationplugins:
- # Wall is special
- if i == self.durationplugins[0]:
- i.Value = 5 - CurrentSpeed
- self.context.Write()
-
- else:
- Value = i.Value
- Val = (4000 - (CurrentSpeed * 800))
- Value[0] = int(Val)
- # We dont want it to be too slow
- Value[0] = Value[0] - 2000
- # Leave it if it hits 100
- if Value[0] < 100:
- Value[0] = 100
- i.Value = Value
- self.context.Write()
+ self.context.Write()
- def PluginEnableDisable(self, widget, name, name2=None):
- self.plugins[self.pluginnames.index(name)].Enabled = widget.get_active()
- if name2 is not None:
- self.plugins[self.pluginnames.index(name2)].Enabled = widget.get_active()
- self.context.Write()
- if name == 'group':
- self.gladefile.get_widget('AllowTabbingCheckBox').set_sensitive(widget.get_active())
-
- def SettingBoolToggled(self, widget, plugin, settingName, settingType):
- if settingType == "Screen":
- plugin.Screens[0][settingName].Value = widget.get_active()
- else:
- plugin.Display[settingName].Value = widget.get_active()
-
- self.context.Write()
-
- def SettingValueChanged(self, widget, plugin, settingName, settingType):
- if settingType == "Screen":
- plugin.Screens[0][settingName].Value = widget.get_value()
- else:
- plugin.Display[settingName].Value = widget.get_value()
+ def SettingValueChanged(self, widget, plugin, settingName, settingType):
+ if settingType == "Screen":
+ plugin.Screens[0][settingName].Value = widget.get_value()
+ else:
+ plugin.Display[settingName].Value = widget.get_value()
+
+ self.context.Write()
- self.context.Write()
-
-
- def SettingTextChanged(self, widget, plugin, settingName, settingType):
- if settingType == "Screen":
- plugin.Screens[0][settingName].Value = widget.get_text()
- else:
- plugin.Display[settingName].Value = widget.get_text()
- self.context.Write()
-
- def SettingButtonChanged(self, signal, name, settingName, settingType, widget):
- if settingType == "Screen":
- self.plugins[self.pluginnames.index(name)].Screens[0][settingName].Value[1] = widget.get_text()
- else:
- plugin.Display[settingName].Value = widget.get_text()
-
- self.context.Write()
-
- def CreatePluginSetting(self, widgetName, name, sensitive, name2=None):
- self.Widget = self.gladefile.get_widget(widgetName)
- self.Widget.set_sensitive(sensitive)
- if sensitive == False:
- pass
- else:
- self.Widget.set_active(self.plugins[self.pluginnames.index(name)].Enabled)
- self.Widget.connect('clicked', self.PluginEnableDisable, name, name2)
+ def SettingTextChanged(self, widget, plugin, settingName, settingType):
+ if settingType == "Screen":
+ plugin.Screens[0][settingName].Value = widget.get_text()
+ else:
+ plugin.Display[settingName].Value = widget.get_text()
+
+ self.context.Write()
- def CreateBoolSetting(self, widgetName, name, settingName, sensitive=True):
- self.Widget = self.gladefile.get_widget(widgetName)
- self.Widget.set_sensitive(sensitive)
- if sensitive == False:
- pass
- else:
- if settingName in self.plugins[self.pluginnames.index(name)].Screens[0]:
- settingType = "Screen"
- else:
- settingType = "Display"
- # We first need to check to see whether the setting is screen or display
- name = self.plugins[self.pluginnames.index(name)]
- self.Widget.set_active(self.GetSetting(name, settingType, settingName).Value)
+ def CreatePluginSetting(self, widgetName, name, sensitive, name2=None):
+ self.Widget = self.gladefile.get_widget(widgetName)
+ self.Widget.set_sensitive(sensitive)
+ if sensitive == False:
+ pass
+ else:
+ self.Widget.set_active(self.plugins[self.pluginnames.index(name)].Enabled)
+ self.Widget.connect('clicked', self.PluginEnableDisable, name, name2)
+
+ def CreateBoolSetting(self, widgetName, name, settingName, sensitive=True):
+ self.Widget = self.gladefile.get_widget(widgetName)
+ self.Widget.set_sensitive(sensitive)
+ if sensitive == False:
+ pass
+ else:
+ if settingName in self.plugins[self.pluginnames.index(name)].Screens[0]:
+ settingType = "Screen"
+ else:
+ settingType = "Display"
+ # We first need to check to see whether the setting is screen or display
+ name = self.plugins[self.pluginnames.index(name)]
+ self.Widget.set_active(self.GetSetting(name, settingType, settingName).Value)
+
+ self.Widget.connect('clicked', self.SettingBoolToggled, name, settingName, settingType)
+ if widgetName == 'AllowTabbingCheckBox':
+ self.Widget.set_sensitive(self.gladefile.get_widget('AllowGroupingCheckBox').get_active())
- self.Widget.connect('clicked', self.SettingBoolToggled, name, settingName, settingType)
- if widgetName == 'AllowTabbingCheckBox':
- self.Widget.set_sensitive(self.gladefile.get_widget('AllowGroupingCheckBox').get_active())
-
- def CreateValueSetting(self, widgetName, name, settingName, sensitive):
- self.Widget = self.gladefile.get_widget(widgetName)
- self.Widget.set_sensitive(sensitive)
- if sensitive == False:
- pass
- else:
- print name
- print settingName
- if settingName in self.plugins[self.pluginnames.index(name)].Screens[0]:
- settingType = "Screen"
- else:
- settingType = "Display"
- # We first need to check to see whether the setting is screen or display
- name = self.plugins[self.pluginnames.index(name)]
- self.Widget.set_value(self.GetSetting(name, settingType, settingName).Value)
- self.Widget.connect('value-changed', self.SettingValueChanged, name, settingName, settingType)
-
- def CreateTextSetting(self, widgetName, name, settingName, sensitive):
- self.Widget = self.gladefile.get_widget(widgetName)
- self.Widget.set_sensitive(sensitive)
- if sensitive == False:
- pass
- else:
- if settingName in self.plugins[self.pluginnames.index(name)].Screens[0]:
- settingType = "Screen"
- else:
- settingType = "Display"
- # We first need to check to see whether the setting is screen or display
- name = self.plugins[self.pluginnames.index(name)]
- self.Widget.set_text(self.GetSetting(name, settingType, settingName).Value)
- self.Widget.connect('activate', self.SettingTextChanged, name, settingName, settingType)
+ def CreateValueSetting(self, widgetName, name, settingName, sensitive):
+ self.Widget = self.gladefile.get_widget(widgetName)
+ self.Widget.set_sensitive(sensitive)
+ if sensitive == False:
+ pass
+ else:
+ if settingName in self.plugins[self.pluginnames.index(name)].Screens[0]:
+ settingType = "Screen"
+ else:
+ settingType = "Display"
+ # We first need to check to see whether the setting is screen or display
+ name = self.plugins[self.pluginnames.index(name)]
+ self.Widget.set_value(self.GetSetting(name, settingType, settingName).Value)
+ self.Widget.connect('value-changed', self.SettingValueChanged, name, settingName, settingType)
+
+ def CreateTextSetting(self, widgetName, name, settingName, sensitive):
+ self.Widget = self.gladefile.get_widget(widgetName)
+ self.Widget.set_sensitive(sensitive)
+ if sensitive == False:
+ pass
+ else:
+ if settingName in self.plugins[self.pluginnames.index(name)].Screens[0]:
+ settingType = "Screen"
+ else:
+ settingType = "Display"
+ # We first need to check to see whether the setting is screen or display
+ name = self.plugins[self.pluginnames.index(name)]
+ self.Widget.set_text(self.GetSetting(name, settingType, settingName).Value)
+ self.Widget.connect('activate', self.SettingTextChanged, name, settingName, settingType)
+
+ def ActionKeyEdited(self, cell, path, text):
+ keyIter = self.KeyBindingsStore.get_iter(path)
+ settingObject = self.KeyBindingsStore.get_value(keyIter, 3)
+ settingObject.Value = text
+ self.context.Write()
+ self.KeyBindingsStore.set_value(keyIter, 2, settingObject.Value)
+
+ def ActionButtonEdited(self, cell, path, text):
+ mouseIter = self.KeyBindingsStore.get_iter(path)
+ settingObject = self.KeyBindingsStore.get_value(mouseIter, 6)
+ settingObject.Value = text
+ self.context.Write()
+ self.KeyBindingsStore.set_value(mouseIter, 5, settingObject.Value)
- def ActionKeyEdited(self, cell, path, text):
- keyIter = self.KeyBindingsStore.get_iter(path)
- settingObject = self.KeyBindingsStore.get_value(keyIter, 3)
- settingObject.Value[0] = text
- self.context.Write()
- self.KeyBindingsStore.set_value(keyIter, 2, settingObject.Value)
-
- def ActionButtonEdited(self, cell, path, text):
- mouseIter = self.KeyBindingsStore.get_iter(path)
- settingObject = self.KeyBindingsStore.get_value(mouseIter, 6)
- settingObject.Value[1] = text
- self.context.Write()
- self.KeyBindingsStore.set_value(mouseIter, 5, settingObject.Value)
-
- def GetSetting(self, plugin, settingType, settingName):
- #print "GetSetting"
- if settingType == "Display":
- #print "Returning plugin.Display[settingName]"
- return plugin.Display[settingName]
- elif settingType == "Screen":
- return plugin.Screens[0][settingName]
+ def GetSetting(self, plugin, settingType, settingName):
+ #print "GetSetting"
+ if settingType == "Display":
+ #print "Returning plugin.Display[settingName]"
+ return plugin.Display[settingName]
+ elif settingType == "Screen":
+ return plugin.Screens[0][settingName]
if __name__=='__main__':
Base()
@@ -1260,6 +1198,7 @@ if __name__=='__main__':
# Make the rest of the GUI
# Connect signals - (fairly easy)
# Try and figure out a way to detect graphics hardware and rendering method... hmmm.....
-# This is the master version of CFCapplet. Use it only with 0.6 compiz
-
+# This is the MASTER version of CFCapplet
+# This file should execute on its own now
+