[arch-commits] Commit in gnome-tweak-tool/repos (4 files)

Ionut Biru ibiru at archlinux.org
Mon Apr 23 05:07:43 EDT 2012


    Date: Monday, April 23, 2012 @ 05:07:42
  Author: ibiru
Revision: 156858

db-move: moved gnome-tweak-tool from [testing] to [extra] (any)

Added:
  gnome-tweak-tool/repos/extra-any/PKGBUILD
    (from rev 156695, gnome-tweak-tool/repos/testing-any/PKGBUILD)
  gnome-tweak-tool/repos/extra-any/schema-crash.patch
    (from rev 156695, gnome-tweak-tool/repos/testing-any/schema-crash.patch)
Deleted:
  gnome-tweak-tool/repos/extra-any/PKGBUILD
  gnome-tweak-tool/repos/testing-any/

--------------------+
 PKGBUILD           |   68 +++++++--------
 schema-crash.patch |  225 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 259 insertions(+), 34 deletions(-)

Deleted: extra-any/PKGBUILD
===================================================================
--- extra-any/PKGBUILD	2012-04-23 09:07:41 UTC (rev 156857)
+++ extra-any/PKGBUILD	2012-04-23 09:07:42 UTC (rev 156858)
@@ -1,34 +0,0 @@
-# $Id$
-# Maintainer: Ionut Biru <ibiru at archlinux.org>
-
-pkgname=gnome-tweak-tool
-pkgver=3.2.2
-pkgrel=2
-pkgdesc="A tool to customize advanced GNOME 3 options."
-arch=(any)
-url="https://live.gnome.org/GnomeTweakTool"
-license=('GPL')
-depends=('gconf' 'gsettings-desktop-schemas' 'python2-gobject' 'gnome-shell')
-makedepends=('intltool')
-optdepends=('gnome-shell-extension-user-theme: Shell theme selector')
-source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
-sha256sums=('57ad08b813ca2f5ea2e131b22cb365d33788d051b80f3f6decc04e3a5404f8f5')
-
-build() {
-  cd "$srcdir/$pkgname-$pkgver"
-
-  # Fix user-theme extension name
-  sed -i '/THEME_EXT_NAME =/s/gnome.org/gcampax.github.com/' gtweak/tweaks/tweak_shell.py
-
-  ./configure --prefix=/usr
-  make
-}
-
-package() {
-  cd "$srcdir/$pkgname-$pkgver"
-
-  make DESTDIR="$pkgdir" install
-  sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir"/usr/bin/gnome-tweak-tool
-}
-
-# vim:set ts=2 sw=2 et:

Copied: gnome-tweak-tool/repos/extra-any/PKGBUILD (from rev 156695, gnome-tweak-tool/repos/testing-any/PKGBUILD)
===================================================================
--- extra-any/PKGBUILD	                        (rev 0)
+++ extra-any/PKGBUILD	2012-04-23 09:07:42 UTC (rev 156858)
@@ -0,0 +1,34 @@
+# $Id$
+# Maintainer: Ionut Biru <ibiru at archlinux.org>
+
+pkgname=gnome-tweak-tool
+pkgver=3.3.4
+pkgrel=2
+pkgdesc="A tool to customize advanced GNOME 3 options."
+arch=(any)
+url="https://live.gnome.org/GnomeTweakTool"
+license=('GPL')
+depends=('gnome-settings-daemon' 'python2-gobject')
+makedepends=('intltool')
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz
+        schema-crash.patch)
+sha256sums=('de18bf67e44af1b6757cf8e3a78c480b84286658be3d5d9ba7c13f5c49763dc6'
+            '32add78601b30a93a4bd753f6a3bb99927f5ae8a68c94c0f75a0f3497e7032df')
+
+build() {
+  cd "$pkgname-$pkgver"
+
+  patch -p1 -i ../schema-crash.patch
+
+  ./configure --prefix=/usr
+  make
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+
+  make DESTDIR="$pkgdir" install
+  sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir"/usr/bin/gnome-tweak-tool
+}
+
+# vim:set ts=2 sw=2 et:

Copied: gnome-tweak-tool/repos/extra-any/schema-crash.patch (from rev 156695, gnome-tweak-tool/repos/testing-any/schema-crash.patch)
===================================================================
--- extra-any/schema-crash.patch	                        (rev 0)
+++ extra-any/schema-crash.patch	2012-04-23 09:07:42 UTC (rev 156858)
@@ -0,0 +1,225 @@
+From 89c320bbb9ec6cf1542c75e5c35c79e6604301b6 Mon Sep 17 00:00:00 2001
+From: Robin Stocker <robin at nibor.org>
+Date: Tue, 17 Jan 2012 12:24:04 +0000
+Subject: Change widget for text-scaling-factor to SpinButton
+
+https://bugzilla.gnome.org/show_bug.cgi?id=650660
+
+Conflicts:
+
+	gtweak/tweaks/tweak_font.py
+---
+diff --git a/gtweak/tweaks/tweak_font.py b/gtweak/tweaks/tweak_font.py
+index 7f4b92a..1ace035 100644
+--- a/gtweak/tweaks/tweak_font.py
++++ b/gtweak/tweaks/tweak_font.py
+@@ -18,10 +18,10 @@
+ from gi.repository import Gtk
+ 
+ from gtweak.tweakmodel import Tweak, TWEAK_GROUP_FONTS
+-from gtweak.widgets import GSettingsRangeTweak, GSettingsFontButtonTweak, GSettingsComboTweak
++from gtweak.widgets import GSettingsSpinButtonTweak, GSettingsFontButtonTweak, GSettingsComboTweak
+ 
+ TWEAKS = (
+-    GSettingsRangeTweak("org.gnome.desktop.interface", "text-scaling-factor", adjustment_step=0.1, group_name=TWEAK_GROUP_FONTS),
++    GSettingsSpinButtonTweak("org.gnome.desktop.interface", "text-scaling-factor", adjustment_step=0.1, digits=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),
+diff --git a/gtweak/widgets.py b/gtweak/widgets.py
+index 9aa0cd2..4a7646f 100644
+--- a/gtweak/widgets.py
++++ b/gtweak/widgets.py
+@@ -134,6 +134,21 @@ class GSettingsRangeTweak(_GSettingsTweak):
+         self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
+         self.widget_for_size_group = w
+ 
++class GSettingsSpinButtonTweak(_GSettingsTweak):
++    def __init__(self, schema_name, key_name, **options):
++        _GSettingsTweak.__init__(self, schema_name, key_name, **options)
++
++        #returned variant is range:(min, max)
++        _min, _max = self.settings.get_range(key_name)[1]
++
++        adjustment = Gtk.Adjustment(0, _min, _max, options.get('adjustment_step', 1))
++        w = Gtk.SpinButton()
++        w.set_adjustment(adjustment)
++        w.set_digits(options.get('digits', 0))
++        self.settings.bind(key_name, adjustment, "value", Gio.SettingsBindFlags.DEFAULT)
++        self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
++        self.widget_for_size_group = w
++
+ class GSettingsComboEnumTweak(_GSettingsTweak):
+     def __init__(self, schema_name, key_name, **options):
+         _GSettingsTweak.__init__(self, schema_name, key_name, **options)
+--
+cgit v0.9.0.2
+----
+From 81ee17f1b0352347b1bf5f2bdad25e0fc2c7c3eb Mon Sep 17 00:00:00 2001
+From: John Stowers <john.stowers at gmail.com>
+Date: Wed, 18 Jan 2012 08:10:45 +0000
+Subject: Dont crash on missing schemas
+
+---
+diff --git a/gtweak/gsettings.py b/gtweak/gsettings.py
+index 9ab8749..e334637 100644
+--- a/gtweak/gsettings.py
++++ b/gtweak/gsettings.py
+@@ -23,6 +23,12 @@ import gtweak
+ 
+ from gi.repository import Gio, GLib
+ 
++_SCHEMA_CACHE = {}
++_GSETTINGS_SCHEMAS = set(Gio.Settings.list_schemas())
++
++class GSettingsMissingError(Exception):
++    pass
++
+ class _GSettingsSchema:
+     def __init__(self, schema_name, schema_dir=None, schema_filename=None, **options):
+         if not schema_dir:
+@@ -64,10 +70,25 @@ class _GSettingsSchema:
+     def __repr__(self):
+         return "<gtweak.gsettings._GSettingsSchema: %s>" % self._schema_name
+ 
+-_SCHEMA_CACHE = {}
++class GSettingsFakeSetting:
++    def __init__(self):
++        pass
++
++    def get_range(self, *args, **kwargs):
++        return False, []
++
++    def get_string(self, *args, **kwargs):
++        return ""
++
++    def __getattr__(self, name):
++        def noop(*args, **kwargs):
++            pass
++        return noop
+ 
+ class GSettingsSetting(Gio.Settings):
+     def __init__(self, schema_name, **options):
++        if schema_name not in _GSETTINGS_SCHEMAS:
++            raise GSettingsMissingError(schema_name)
+         Gio.Settings.__init__(self, schema_name)
+         if schema_name not in _SCHEMA_CACHE:
+             _SCHEMA_CACHE[schema_name] = _GSettingsSchema(schema_name, **options)
+diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
+index d67ce5a..558a329 100644
+--- a/gtweak/tweakmodel.py
++++ b/gtweak/tweakmodel.py
+@@ -35,6 +35,7 @@ class Tweak:
+         self.name = name
+         self.description = description
+         self.group_name = options.get("group_name",_("Miscellaneous"))
++        self.loaded = True
+ 
+         self._search_cache = None
+ 
+@@ -148,6 +149,8 @@ class TweakModel(Gtk.ListStore):
+         self._tweak_group_names[tweakgroup.name] = tweakgroup
+ 
+     def add_tweak_auto_to_group(self, tweak):
++        if not tweak.loaded:
++            return
+         name = tweak.group_name
+         try:
+             group = self._tweak_group_names[name]
+diff --git a/gtweak/widgets.py b/gtweak/widgets.py
+index 4a7646f..c915a17 100644
+--- a/gtweak/widgets.py
++++ b/gtweak/widgets.py
+@@ -15,10 +15,12 @@
+ # You should have received a copy of the GNU General Public License
+ # along with gnome-tweak-tool.  If not, see <http://www.gnu.org/licenses/>.
+ 
++import logging
++
+ from gi.repository import Gtk, Gdk, Gio, Pango
+ 
+ from gtweak.tweakmodel import Tweak
+-from gtweak.gsettings import GSettingsSetting
++from gtweak.gsettings import GSettingsSetting, GSettingsFakeSetting, GSettingsMissingError
+ from gtweak.gconf import GConfSetting
+ 
+ def build_label_beside_widget(txt, *widget, **kwargs):
+@@ -97,11 +99,17 @@ class _GSettingsTweak(Tweak):
+     def __init__(self, schema_name, key_name, **options):
+         self.schema_name = schema_name
+         self.key_name = key_name
+-        self.settings = GSettingsSetting(schema_name, **options)
+-        Tweak.__init__(self,
+-            options.get("summary",self.settings.schema_get_summary(key_name)),
+-            options.get("description",self.settings.schema_get_description(key_name)),
+-            **options)
++        try:
++            self.settings = GSettingsSetting(schema_name, **options)
++            Tweak.__init__(self,
++                options.get("summary",self.settings.schema_get_summary(key_name)),
++                options.get("description",self.settings.schema_get_description(key_name)),
++                **options)
++        except GSettingsMissingError, e:
++            self.settings = GSettingsFakeSetting()
++            Tweak.__init__(self,"","")
++            self.loaded = False
++            logging.info("Missing gsettings %s (key %s)" % (e.message, key_name))
+ 
+ class GSettingsSwitchTweak(_GSettingsTweak):
+     def __init__(self, schema_name, key_name, **options):
+@@ -109,7 +117,7 @@ class GSettingsSwitchTweak(_GSettingsTweak):
+ 
+         w = Gtk.Switch()
+         self.settings.bind(key_name, w, "active", Gio.SettingsBindFlags.DEFAULT)
+-        self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
++        self.widget = build_label_beside_widget(self.name, w)
+         # never change the size of a switch
+         self.widget_for_size_group = None
+ 
+@@ -119,7 +127,7 @@ class GSettingsFontButtonTweak(_GSettingsTweak):
+ 
+         w = Gtk.FontButton()
+         self.settings.bind(key_name, w, "font-name", Gio.SettingsBindFlags.DEFAULT)
+-        self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
++        self.widget = build_label_beside_widget(self.name, w)
+         self.widget_for_size_group = w
+ 
+ class GSettingsRangeTweak(_GSettingsTweak):
+@@ -131,7 +139,7 @@ class GSettingsRangeTweak(_GSettingsTweak):
+ 
+         w = Gtk.HScale.new_with_range(_min, _max, options.get('adjustment_step', 1))
+         self.settings.bind(key_name, w.get_adjustment(), "value", Gio.SettingsBindFlags.DEFAULT)
+-        self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
++        self.widget = build_label_beside_widget(self.name, w)
+         self.widget_for_size_group = w
+ 
+ class GSettingsSpinButtonTweak(_GSettingsTweak):
+@@ -146,7 +154,7 @@ class GSettingsSpinButtonTweak(_GSettingsTweak):
+         w.set_adjustment(adjustment)
+         w.set_digits(options.get('digits', 0))
+         self.settings.bind(key_name, adjustment, "value", Gio.SettingsBindFlags.DEFAULT)
+-        self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
++        self.widget = build_label_beside_widget(self.name, w)
+         self.widget_for_size_group = w
+ 
+ class GSettingsComboEnumTweak(_GSettingsTweak):
+@@ -161,7 +169,7 @@ class GSettingsComboEnumTweak(_GSettingsTweak):
+         w.connect('changed', self._on_combo_changed)
+         self.combo = w
+ 
+-        self.widget = build_label_beside_widget(self.settings.schema_get_summary(key_name), w)
++        self.widget = build_label_beside_widget(self.name, w)
+         self.widget_for_size_group = w
+ 
+ 
+@@ -246,7 +254,7 @@ class GConfFontButtonTweak(_GConfTweak):
+         w = Gtk.FontButton()
+         w.props.font_name = self.gconf.get_value()
+         w.connect("notify::font-name", self._on_fontbutton_changed)
+-        self.widget = build_label_beside_widget(self.gconf.schema_get_summary(), w)
++        self.widget = build_label_beside_widget(self.name, w)
+         self.widget_for_size_group = w
+ 
+     def _on_fontbutton_changed(self, btn, param):
+--
+cgit v0.9.0.2



More information about the arch-commits mailing list