[gnome-tweak-tool] Port Metacity/Mutter/Shell to GSettings
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Port Metacity/Mutter/Shell to GSettings
- Date: Wed, 23 Nov 2011 20:01:22 +0000 (UTC)
commit 617b6f4d5bc5aa9a6b20fc198937a2094ac868e2
Author: John Stowers <john stowers gmail com>
Date: Thu Nov 24 09:01:01 2011 +1300
Port Metacity/Mutter/Shell to GSettings
NEWS | 3 ++
configure.ac | 2 +-
gtweak/tweaks/tweak_font.py | 4 +-
gtweak/tweaks/tweak_shell.py | 10 ++++----
gtweak/tweaks/tweak_windows.py | 52 +++++++---------------------------------
5 files changed, 20 insertions(+), 51 deletions(-)
---
diff --git a/NEWS b/NEWS
index 67e6553..e657f43 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+3.3.0
+ * Adapt to Metacity/Mutter/Shell ported to GSettings
+
3.2.2
* Dont die on malformed schemas
diff --git a/configure.ac b/configure.ac
index 34cf8a7..4f05de5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ AM_INIT_AUTOMAKE([foreign tar-ustar dist-xz no-dist-gzip])
AM_PATH_PYTHON([2.6])
GLIB_GSETTINGS
-DESKTOP_SCHEMAS_REQUIRED_VERSION=3.0.0
+DESKTOP_SCHEMAS_REQUIRED_VERSION=3.3.2
PYGOBJECT_REQUIRED_VERSION=2.90.0
PKG_CHECK_MODULES([GSETTINGS_DESKTOP_SCHEMAS], [gsettings-desktop-schemas >= $DESKTOP_SCHEMAS_REQUIRED_VERSION])
diff --git a/gtweak/tweaks/tweak_font.py b/gtweak/tweaks/tweak_font.py
index 7af313f..7f4b92a 100644
--- a/gtweak/tweaks/tweak_font.py
+++ b/gtweak/tweaks/tweak_font.py
@@ -18,14 +18,14 @@
from gi.repository import Gtk
from gtweak.tweakmodel import Tweak, TWEAK_GROUP_FONTS
-from gtweak.widgets import GSettingsRangeTweak, GSettingsFontButtonTweak, GConfFontButtonTweak, GSettingsComboTweak
+from gtweak.widgets import GSettingsRangeTweak, GSettingsFontButtonTweak, GSettingsComboTweak
TWEAKS = (
GSettingsRangeTweak("org.gnome.desktop.interface", "text-scaling-factor", adjustment_step=0.1, group_name=TWEAK_GROUP_FONTS),
GSettingsFontButtonTweak("org.gnome.desktop.interface", "font-name", group_name=TWEAK_GROUP_FONTS),
GSettingsFontButtonTweak("org.gnome.desktop.interface", "document-font-name", group_name=TWEAK_GROUP_FONTS),
GSettingsFontButtonTweak("org.gnome.desktop.interface", "monospace-font-name", group_name=TWEAK_GROUP_FONTS),
- GConfFontButtonTweak("/apps/metacity/general/titlebar_font", str, group_name=TWEAK_GROUP_FONTS),
+ GSettingsFontButtonTweak("org.gnome.desktop.wm.preferences", "titlebar-font", group_name=TWEAK_GROUP_FONTS),
GSettingsComboTweak("org.gnome.settings-daemon.plugins.xsettings", "hinting",
[(i, i.title()) for i in ("none", "slight", "medium", "full")], group_name=TWEAK_GROUP_FONTS),
GSettingsComboTweak("org.gnome.settings-daemon.plugins.xsettings", "antialiasing",
diff --git a/gtweak/tweaks/tweak_shell.py b/gtweak/tweaks/tweak_shell.py
index 75dc5d8..76c930c 100644
--- a/gtweak/tweaks/tweak_shell.py
+++ b/gtweak/tweaks/tweak_shell.py
@@ -28,13 +28,13 @@ from gtweak.utils import walk_directories, extract_zip_file, make_combo_list_wit
from gtweak.gsettings import GSettingsSetting
from gtweak.gshellwrapper import GnomeShellFactory
from gtweak.tweakmodel import Tweak, TweakGroup, TWEAK_GROUP_THEME
-from gtweak.widgets import ZipFileChooserButton, GConfComboTweak, GSettingsComboEnumTweak, GSettingsSwitchTweak, build_label_beside_widget, build_horizontal_sizegroup, build_combo_box_text
+from gtweak.widgets import ZipFileChooserButton, GSettingsComboTweak, GSettingsComboEnumTweak, GSettingsSwitchTweak, build_label_beside_widget, build_horizontal_sizegroup, build_combo_box_text
-class ShowWindowButtons(GConfComboTweak):
+class ShowWindowButtons(GSettingsComboTweak):
def __init__(self, **options):
- GConfComboTweak.__init__(self,
- "/desktop/gnome/shell/windows/button_layout",
- str,
+ GSettingsComboTweak.__init__(self,
+ "org.gnome.shell.overrides",
+ "button-layout",
((':close', 'Close Only'),
(':minimize,close', 'Minimize and Close'),
(':maximize,close', 'Maximize and Close'),
diff --git a/gtweak/tweaks/tweak_windows.py b/gtweak/tweaks/tweak_windows.py
index bab2808..90af82a 100644
--- a/gtweak/tweaks/tweak_windows.py
+++ b/gtweak/tweaks/tweak_windows.py
@@ -20,42 +20,17 @@ import os.path
import gtweak
from gtweak.utils import walk_directories, make_combo_list_with_default
from gtweak.tweakmodel import TWEAK_GROUP_WINDOWS, TWEAK_GROUP_THEME
-from gtweak.widgets import GConfComboTweak
-from gtweak.gconf import GConfSetting
+from gtweak.widgets import GSettingsComboTweak, GSettingsComboEnumTweak
-class ActionClickTitlebarTweak(GConfComboTweak):
- def __init__(self, key_name, **options):
-
- #from the metacity schema
- schema_options = ('toggle_shade', 'toggle_maximize', 'toggle_maximize_horizontally',
- 'toggle_maximize_vertically', 'minimize', 'shade', 'menu', 'lower', 'none')
-
- GConfComboTweak.__init__(self,
- key_name,
- str,
- [(o, o.replace("_"," ").title()) for o in schema_options],
- **options)
-
-class FocusModeTweak(GConfComboTweak):
+class WindowThemeSwitcher(GSettingsComboTweak):
def __init__(self, **options):
- GConfComboTweak.__init__(self,
- "/apps/metacity/general/focus_mode",
- str,
- [(o, o.title()) for o in ("click","sloppy","mouse")],
- **options)
-
-class WindowThemeSwitcher(GConfComboTweak):
- def __init__(self, **options):
- GConfComboTweak.__init__(self,
- "/desktop/gnome/shell/windows/theme",
- str,
+ GSettingsComboTweak.__init__(self,
+ "org.gnome.desktop.wm.preferences",
+ "theme",
make_combo_list_with_default(self._get_valid_themes(), "Adwaita"),
summary=_("Window theme"),
**options)
- #also need to change the fallback (metacity) window theme
- self.gconf_metacity = GConfSetting("/apps/metacity/general/theme", str)
-
def _get_valid_themes(self):
dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
os.path.join(os.path.expanduser("~"), ".themes"))
@@ -63,19 +38,10 @@ class WindowThemeSwitcher(GConfComboTweak):
os.path.exists(os.path.join(d, "metacity-1")))
return valid
- def _on_combo_changed(self, combo):
- #its probbably not too nice to dupe this function here, but i'm lazy
- #and the real cause is the hidious gconf/shell/metacity override business
- _iter = combo.get_active_iter()
- if _iter:
- value = combo.get_model().get_value(_iter, 0)
- self.gconf.set_value(value)
- self.gconf_metacity.set_value(value)
-
TWEAKS = (
WindowThemeSwitcher(group_name=TWEAK_GROUP_THEME),
- ActionClickTitlebarTweak("/apps/metacity/general/action_double_click_titlebar", group_name=TWEAK_GROUP_WINDOWS),
- ActionClickTitlebarTweak("/apps/metacity/general/action_middle_click_titlebar", group_name=TWEAK_GROUP_WINDOWS),
- ActionClickTitlebarTweak("/apps/metacity/general/action_right_click_titlebar", group_name=TWEAK_GROUP_WINDOWS),
- FocusModeTweak(group_name=TWEAK_GROUP_WINDOWS),
+ GSettingsComboEnumTweak("org.gnome.desktop.wm.preferences", "action-double-click-titlebar", group_name=TWEAK_GROUP_WINDOWS),
+ GSettingsComboEnumTweak("org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", group_name=TWEAK_GROUP_WINDOWS),
+ GSettingsComboEnumTweak("org.gnome.desktop.wm.preferences", "action-right-click-titlebar", group_name=TWEAK_GROUP_WINDOWS),
+ GSettingsComboEnumTweak("org.gnome.desktop.wm.preferences", "focus-mode", group_name=TWEAK_GROUP_WINDOWS),
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]