Hello community,

here is the log from the commit of package gnome-tweak-tool for openSUSE:Factory
checked in at Fri Jul 8 12:38:18 CEST 2011.



--------
--- GNOME/gnome-tweak-tool/gnome-tweak-tool.changes     2011-05-26 
22:42:11.000000000 +0200
+++ /mounts/work_src_done/STABLE/gnome-tweak-tool/gnome-tweak-tool.changes      
2011-06-22 18:29:18.000000000 +0200
@@ -1,0 +2,21 @@
+Wed Jun 22 18:27:06 CEST 2011 - [email protected]
+
+- Update to version 3.0.5:
+  + More autostart desktop file fixes. Try harder to autostart
+    nautilus when tweaking desktop handling.
+  + Appearance improvements (theme install, sorted combo boxes)
+  + Tweak window focus mode (focus follows mouse)
+  + Tweak desktop item visibility with more control (show trash,
+    show computer etc.)
+  + Dont offer to restart shell multiple times when enabling
+    extensions.
+
+-------------------------------------------------------------------
+Fri Jun  3 13:55:36 UTC 2011 - [email protected]
+
+- Add gobject-introspection BuildRequires to automatically get
+  typelib()-style Requires.
+- Drop libgtk-3-0 and gconf2 Requires. They are now added as
+  typelib()-style Requires
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  gnome-tweak-tool-3.0.4.tar.bz2

New:
----
  gnome-tweak-tool-3.0.5.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gnome-tweak-tool.spec ++++++
--- /var/tmp/diff_new_pack.bNHRBC/_old  2011-07-08 12:36:08.000000000 +0200
+++ /var/tmp/diff_new_pack.bNHRBC/_new  2011-07-08 12:36:08.000000000 +0200
@@ -19,7 +19,7 @@
 
 
 Name:           gnome-tweak-tool
-Version:        3.0.4
+Version:        3.0.5
 Release:        1
 License:        GPLv3+
 Summary:        A tool to customize advanced GNOME 3 options
@@ -27,15 +27,13 @@
 Url:            http://live.gnome.org/GnomeTweakTool
 Source0:        %{name}-%{version}.tar.bz2
 BuildRequires:  fdupes
+# Needed to have typelib() Requires
+BuildRequires:  gobject-introspection
 BuildRequires:  intltool
 BuildRequires:  pkgconfig(gconf-2.0)
 BuildRequires:  pkgconfig(gsettings-desktop-schemas)
 BuildRequires:  pkgconfig(pygobject-2.0)
 BuildRequires:  update-desktop-files
-# We need a Requires on the typelib (bnc#590025#c1)
-Requires:       gconf2
-# We need a Requires on the typelib (bnc#590025#c1)
-Requires:       libgtk-3-0
 Requires:       gnome-shell
 Recommends:     %{name}-lang
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ gnome-tweak-tool-3.0.4.tar.bz2 -> gnome-tweak-tool-3.0.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/NEWS 
new/gnome-tweak-tool-3.0.5/NEWS
--- old/gnome-tweak-tool-3.0.4/NEWS     2011-05-22 11:27:40.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/NEWS     2011-06-21 23:35:45.000000000 +0200
@@ -1,3 +1,11 @@
+3.0.5
+   * More autostart desktop file fixes. Try harder to autostart nautilus when
+     tweaking desktop handling.
+   * Appearance improvements (theme install, sorted combo boxes)
+   * Tweak window focus mode (focus follows mouse)
+   * Tweak desktop item visibility with more control (show trash, show 
computer etc)
+   * Dont offer to restart shell multiple times when enabling extensions
+
 3.0.4
    * Support system wide themes (bug 648751)
    * Fix duplicate themes (bug 649687)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/configure 
new/gnome-tweak-tool-3.0.5/configure
--- old/gnome-tweak-tool-3.0.4/configure        2011-05-22 11:24:04.000000000 
+0200
+++ new/gnome-tweak-tool-3.0.5/configure        2011-06-21 23:37:03.000000000 
+0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for gnome-tweak-tool 3.0.4.
+# Generated by GNU Autoconf 2.67 for gnome-tweak-tool 3.0.5.
 #
 # Report bugs to <[email protected]>.
 #
@@ -552,8 +552,8 @@
 # Identity of this package.
 PACKAGE_NAME='gnome-tweak-tool'
 PACKAGE_TARNAME='gnome-tweak-tool'
-PACKAGE_VERSION='3.0.4'
-PACKAGE_STRING='gnome-tweak-tool 3.0.4'
+PACKAGE_VERSION='3.0.5'
+PACKAGE_STRING='gnome-tweak-tool 3.0.5'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 
@@ -1287,7 +1287,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gnome-tweak-tool 3.0.4 to adapt to many kinds of 
systems.
+\`configure' configures gnome-tweak-tool 3.0.5 to adapt to many kinds of 
systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1358,7 +1358,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gnome-tweak-tool 3.0.4:";;
+     short | recursive ) echo "Configuration of gnome-tweak-tool 3.0.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1473,7 +1473,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gnome-tweak-tool configure 3.0.4
+gnome-tweak-tool configure 3.0.5
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1720,7 +1720,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gnome-tweak-tool $as_me 3.0.4, which was
+It was created by gnome-tweak-tool $as_me 3.0.5, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -2537,7 +2537,7 @@
 
 # Define the identity of the package.
  PACKAGE='gnome-tweak-tool'
- VERSION='3.0.4'
+ VERSION='3.0.5'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7828,7 +7828,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gnome-tweak-tool $as_me 3.0.4, which was
+This file was extended by gnome-tweak-tool $as_me 3.0.5, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7885,7 +7885,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gnome-tweak-tool config.status 3.0.4
+gnome-tweak-tool config.status 3.0.5
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/configure.ac 
new/gnome-tweak-tool-3.0.5/configure.ac
--- old/gnome-tweak-tool-3.0.4/configure.ac     2011-04-27 21:59:58.000000000 
+0200
+++ new/gnome-tweak-tool-3.0.5/configure.ac     2011-06-21 23:35:46.000000000 
+0200
@@ -1,4 +1,4 @@
-AC_INIT([gnome-tweak-tool], [3.0.4], [[email protected]])
+AC_INIT([gnome-tweak-tool], [3.0.5], [[email protected]])
 
 AM_INIT_AUTOMAKE([foreign])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/gtweak/defs.py 
new/gnome-tweak-tool-3.0.5/gtweak/defs.py
--- old/gnome-tweak-tool-3.0.4/gtweak/defs.py   2011-05-22 11:29:56.000000000 
+0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/defs.py   2011-06-21 23:37:35.000000000 
+0200
@@ -2,4 +2,4 @@
 PKG_DATA_DIR = "/usr/local/share/gnome-tweak-tool"
 GSETTINGS_SCHEMA_DIR = "/usr/local/share/glib-2.0/schemas"
 TWEAK_DIR = "/usr/local/lib/python2.7/dist-packages/gtweak/tweaks"
-VERSION = "3.0.4"
+VERSION = "3.0.5"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/gtweak/tweakmodel.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweakmodel.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweakmodel.py     2011-05-10 
22:13:28.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweakmodel.py     2011-06-21 
23:34:45.000000000 +0200
@@ -76,12 +76,8 @@
         self._tweak_dir = gtweak.TWEAK_DIR
         assert(os.path.exists(self._tweak_dir))
 
-        self.set_sort_func(self.COLUMN_NAME, self._sort_tweak_groups)
         self.set_sort_column_id(self.COLUMN_NAME, Gtk.SortType.ASCENDING)
 
-    def _sort_tweak_groups(self, model, iter1, iter2, user_data):
-        return cmp(model.get_value(iter1, self.COLUMN_NAME), 
model.get_value(iter2, self.COLUMN_NAME))
-
     @property
     def tweaks(self):
         return [t for row in self for t in row[TweakModel.COLUMN_TWEAK].tweaks]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_interface.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_interface.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_interface.py 2011-05-03 
08:18:50.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_interface.py 2011-06-21 
23:34:45.000000000 +0200
@@ -20,7 +20,7 @@
 from gi.repository import Gtk
 
 import gtweak
-from gtweak.utils import walk_directories
+from gtweak.utils import walk_directories, make_combo_list_with_default
 from gtweak.tweakmodel import TweakGroup
 from gtweak.widgets import GSettingsSwitchTweak, GSettingsComboTweak, 
build_horizontal_sizegroup
 
@@ -29,7 +29,7 @@
         GSettingsComboTweak.__init__(self,
             "org.gnome.desktop.interface",
             "gtk-theme",
-            [(t, t) for t in self._get_valid_themes()],
+            make_combo_list_with_default(self._get_valid_themes(), "Adwaita"),
             **options)
 
     def _get_valid_themes(self):
@@ -46,7 +46,7 @@
         GSettingsComboTweak.__init__(self,
             "org.gnome.desktop.interface",
             "icon-theme",
-            [(t, t) for t in self._get_valid_icon_themes()],
+            make_combo_list_with_default(self._get_valid_icon_themes(), 
"gnome"),
             **options)
 
     def _get_valid_icon_themes(self):
@@ -62,7 +62,7 @@
         GSettingsComboTweak.__init__(self,
             "org.gnome.desktop.interface",
             "cursor-theme",
-            [(t, t) for t in self._get_valid_cursor_themes()],
+            make_combo_list_with_default(self._get_valid_cursor_themes(), 
"Adwaita"),
             **options)
 
     def _get_valid_cursor_themes(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_nautilus.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_nautilus.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_nautilus.py  2011-04-27 
10:10:41.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_nautilus.py  2011-06-21 
23:34:45.000000000 +0200
@@ -31,8 +31,13 @@
 
         #when the user enables nautilus to draw the desktop icons, set nautilus
         #to autostart
-        self.nautilus = AutostartManager(gtweak.DATA_DIR, "nautilus.desktop", 
"nautilus -n")
-        self.settings.connect('changed::'+self.key_name, 
self._on_setting_changed)
+        self.nautilus = AutostartManager("nautilus.desktop",
+                            
autostart_desktop_filename="nautilus-autostart.desktop",
+                            exec_cmd="nautilus -n")
+        #we only need to install the desktop file on old versions of 
nautilus/gnome-session.
+        #new ones use the new AutostartCondition and watch the gsettings key 
automatically
+        if not self.nautilus.uses_autostart_condition("GSettings"):
+            self.settings.connect('changed::'+self.key_name, 
self._on_setting_changed)
 
     def _on_setting_changed(self, setting, key):
         self.nautilus.update_start_at_login(
@@ -41,5 +46,10 @@
 TWEAK_GROUPS = (
         TweakGroup(
             "File Manager",
-            DesktopIconTweak()),
+            DesktopIconTweak(),
+            GSettingsSwitchTweak("org.gnome.nautilus.desktop", 
"computer-icon-visible", schema_filename="org.gnome.nautilus.gschema.xml"),
+            GSettingsSwitchTweak("org.gnome.nautilus.desktop", 
"home-icon-visible", schema_filename="org.gnome.nautilus.gschema.xml"),
+            GSettingsSwitchTweak("org.gnome.nautilus.desktop", 
"network-icon-visible", schema_filename="org.gnome.nautilus.gschema.xml"),
+            GSettingsSwitchTweak("org.gnome.nautilus.desktop", 
"trash-icon-visible", schema_filename="org.gnome.nautilus.gschema.xml"),
+            ),
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_shell.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_shell.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_shell.py     2011-05-22 
11:19:00.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_shell.py     2011-06-21 
23:34:45.000000000 +0200
@@ -97,22 +97,22 @@
                         os.path.exists(os.path.join(d, "gnome-shell")) and \
                         os.path.exists(os.path.join(d, "gnome-shell", 
"gnome-shell.css")))
 
+            chooser = ZipFileChooserButton("Select a theme file")
+            chooser.connect("file-set", self._on_file_set)
+            hb.pack_start(chooser, False, False, 5)
+
             #build a combo box with all the valid theme options
             #manually add Adwaita to represent the default
             cb = build_combo_box_text(
                     
self._settings.get_string(ShellThemeTweak.THEME_GSETTINGS_NAME),
-                    ("", "Adwaita"),
+                    ("", "default"),
                     *[(v,v) for v in valid])
             cb.connect('changed', self._on_combo_changed)
-            hb.pack_start(cb, False, False, 5)
+            hb.pack_start(cb, False, False, 0)
             self.combo = cb
 
-            chooser = ZipFileChooserButton("Select a theme file")
-            chooser.connect("file-set", self._on_file_set)
-            hb.pack_start(chooser, False, False, 0)
-
             self.widget = build_label_beside_widget(self.name, hb)
-            self.widget_for_size_group = chooser
+            self.widget_for_size_group = cb
     
     def _on_file_set(self, chooser):
         f = chooser.get_filename()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_shell_extensions.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_shell_extensions.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_shell_extensions.py  
2011-05-22 11:28:18.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_shell_extensions.py  
2011-06-21 23:34:45.000000000 +0200
@@ -47,7 +47,7 @@
         self.notify_action_required(
             "The shell must be restarted for changes to take effect",
             "Restart",
-            lambda: self._shell.restart())
+            self._shell.restart)
 
 class _ShellExtensionInstallerTweak(Tweak):
 
@@ -113,7 +113,7 @@
                     self.notify_action_required(
                         verb,
                         "Restart",
-                        lambda: self._shell.restart())
+                        self._shell.restart)
 
                 else:
                     self.notify_error("Error installing extension")
@@ -137,8 +137,8 @@
             shell = GnomeShell()
 
             #add the extension installer
-            #extension_tweaks.append(
-            #    _ShellExtensionInstallerTweak(shell, size_group=sg))
+            extension_tweaks.append(
+                _ShellExtensionInstallerTweak(shell, size_group=sg))
 
             try:
                 settings = GSettingsSetting("org.gnome.shell")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_windows.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_windows.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweaks/tweak_windows.py   2011-04-27 
10:10:42.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweaks/tweak_windows.py   2011-06-21 
23:34:45.000000000 +0200
@@ -18,7 +18,7 @@
 import os.path
 
 import gtweak
-from gtweak.utils import walk_directories
+from gtweak.utils import walk_directories, make_combo_list_with_default
 from gtweak.tweakmodel import TweakGroup
 from gtweak.widgets import GConfComboTweak, build_horizontal_sizegroup
 from gtweak.gconf import GConfSetting
@@ -36,12 +36,20 @@
             [(o, o.replace("_"," ").title()) for o in schema_options],
             **options)
 
+class FocusModeTweak(GConfComboTweak):
+    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,
-            [(t, t) for t in self._get_valid_themes()],
+            make_combo_list_with_default(self._get_valid_themes(), "Adwaita"),
             **options)
 
         #also need to change the fallback (metacity) window theme
@@ -71,5 +79,6 @@
             WindowThemeSwitcher(size_group=sg),
             
ActionClickTitlebarTweak("/apps/metacity/general/action_double_click_titlebar", 
size_group=sg),
             
ActionClickTitlebarTweak("/apps/metacity/general/action_middle_click_titlebar", 
size_group=sg),
-            
ActionClickTitlebarTweak("/apps/metacity/general/action_right_click_titlebar", 
size_group=sg)),
+            
ActionClickTitlebarTweak("/apps/metacity/general/action_right_click_titlebar", 
size_group=sg),
+            FocusModeTweak(size_group=sg)),
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/gtweak/tweakview.py 
new/gnome-tweak-tool-3.0.5/gtweak/tweakview.py
--- old/gnome-tweak-tool-3.0.4/gtweak/tweakview.py      2011-05-04 
23:54:00.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/tweakview.py      2011-06-21 
23:34:45.000000000 +0200
@@ -15,6 +15,8 @@
 # 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, GObject
 
 import gtweak
@@ -63,6 +65,9 @@
             tweak_box.pack_start(t.widget, False, False, 0)
             t.set_notify_cb(self._on_tweak_notify)
 
+        #dict of pending notifications, the key is the function to be called
+        self._notification_functions = {}
+
     def run(self):
         self._main_window.show_all()
         self.hide_tweaks(self._model.tweaks)
@@ -87,11 +92,14 @@
     def _on_tweak_notify_response(self, info, response, func):
         self._detail_vbox.remove(info)
         func()
+        try:
+            del(self._notification_functions[func])
+        except KeyError:
+            logging.warning("Could not remove notification function")
 
     def _on_tweak_notify(self, tweak, desc, error, btn, func):
         info = Gtk.InfoBar()
         info.get_content_area().add(Gtk.Label(desc))
-        self._detail_vbox.pack_end(info, False, False, 0)
 
         if error:
             info.props.message_type = Gtk.MessageType.ERROR
@@ -99,11 +107,16 @@
             info.props.message_type = Gtk.MessageType.INFO
 
         if btn and func:
+            if func in self._notification_functions:
+                return
+            self._notification_functions[func] = True
             info.add_button(btn, Gtk.ResponseType.OK)
             info.connect("response", self._on_tweak_notify_response, func)
         else:
             GObject.timeout_add_seconds(2, lambda box, widget: 
box.remove(widget), self._detail_vbox, info)
 
+        self._detail_vbox.pack_end(info, False, False, 0)
+
         info.show_all()
 
     def _on_search(self, txt):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/gtweak/utils.py 
new/gnome-tweak-tool-3.0.5/gtweak/utils.py
--- old/gnome-tweak-tool-3.0.4/gtweak/utils.py  2011-05-10 23:02:15.000000000 
+0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/utils.py  2011-06-21 23:34:45.000000000 
+0200
@@ -20,8 +20,29 @@
 import tempfile
 import shutil
 
+import gtweak
+from gtweak.gsettings import GSettingsSetting
+from gtweak.gconf import GConfSetting
+
 from gi.repository import GLib
 
+def make_combo_list_with_default(opts, default, title=True):
+    themes = []
+    for t in opts:
+        if t == "default":
+            continue
+
+        if title:
+            name = t[0].upper() + t[1:]
+        else:
+            name = t
+
+        if t == default:
+            name ="%s <i>(default)</i>" % name
+
+        themes.append((t, name))
+    return themes
+
 def walk_directories(dirs, filter_func):
     valid = []
     try:
@@ -57,45 +78,108 @@
     return ok, updated
 
 class AutostartManager:
-    def __init__(self, DATA_DIR, desktop_filename, exec_cmd="", 
extra_exec_args=""):
-        self._desktop_filename = desktop_filename
-        self._desktop_file = os.path.join(DATA_DIR, "applications", 
desktop_filename)
+    def __init__(self, desktop_filename, autostart_desktop_filename="", 
exec_cmd="", extra_exec_args=""):
+        self.desktop_filename = desktop_filename
+        self._autostart_desktop_filename = autostart_desktop_filename or 
desktop_filename
         self._exec_cmd = exec_cmd
         self._extra_exec_args = " %s\n" % extra_exec_args
-        
+
         user_autostart_dir = os.path.join(GLib.get_user_config_dir(), 
"autostart")
         if not os.path.isdir(user_autostart_dir):
             try:
                 os.makedirs(user_autostart_dir)
             except:
                 logging.critical("Could not create autostart dir: %s" % 
user_autostart_dir)
-        self._autostart_file = os.path.join(user_autostart_dir, 
desktop_filename)
+
+        #find the desktop file
+        self._desktop_file = ""
+        for f in self._get_desktop_files():
+            if os.path.exists(f):
+                self._desktop_file = f
+        self._user_autostart_file = os.path.join(user_autostart_dir, 
self._autostart_desktop_filename)
+
+        logging.debug("Found desktop file: %s" % self._desktop_file)
+        logging.debug("User autostart desktop file: %s" % 
self._user_autostart_file)
+
+    def _get_system_autostart_files(self):
+        return [
+            os.path.join(d, "autostart", self._autostart_desktop_filename)
+                for d in GLib.get_system_config_dirs()]
+
+    def _get_desktop_files(self):
+        dirs = [gtweak.DATA_DIR, GLib.get_user_data_dir()]
+        dirs.extend(GLib.get_system_data_dirs())
+        return [os.path.join(d, "applications", self.desktop_filename) for d 
in dirs]
+
+    def get_autostart_condition(self):
+        for f in self._get_system_autostart_files():
+            if os.path.exists(f):
+                with open(f, 'r') as f:
+                    for l in f.readlines():
+                        if l.startswith("AutostartCondition="):
+                            return l.split("=")[-1].strip()
+        return None
+
+    def uses_autostart_condition(self, autostart_type=None):
+        asc = self.get_autostart_condition()
+        try:
+            if autostart_type:
+                return asc.split(" ", 1)[0] == autostart_type
+            else:
+                return asc != None
+        except:
+            logging.warning("Testing for expected AutostartCondition failed: 
Got (%s)" % asc, exc_info=True)
+            return False
 
     def is_start_at_login_enabled(self):
-        if os.path.exists(self._autostart_file):
+        if os.path.exists(self._user_autostart_file):
+            #prefer user directories first
             #if it contains X-GNOME-Autostart-enabled=false then it has
             #has been disabled by the user in the session applet, otherwise
             #it is enabled
-            return 
open(self._autostart_file).read().find("X-GNOME-Autostart-enabled=false") == -1
+            return 
open(self._user_autostart_file).read().find("X-GNOME-Autostart-enabled=false") 
== -1
         else:
-            return False
+            #check the system directories
+            for f in self._get_system_autostart_files():
+                if os.path.exists(f):
+                    return True
+        return False
 
     def update_start_at_login(self, update):
-        logging.debug("Updating autostart %s -> %s" % (self._desktop_filename, 
update))
 
-        if os.path.exists(self._autostart_file):
-            logging.info("Removing autostart %s" % self._autostart_file)
-            os.remove(self._autostart_file)
+        if os.path.exists(self._user_autostart_file):
+            logging.info("Removing user autostart file %s" % 
self._user_autostart_file)
+            os.remove(self._user_autostart_file)
+
+        asc = self.get_autostart_condition()
+        if asc:
+            #AutostartCondition=GNOME /desktop/gnome/interface/accessibility
+            #AutostartCondition=GNOME3 if-session gnome-fallback
+            #AutostartCondition=GSettings org.gnome.desktop.background 
show-desktop-icons
+            method, value = asc.split(" ", 1)
+            try:
+                logging.info("Changing AutostartCondition %s -> %s" % (method, 
update))
+                if method == "GSettings":
+                    schema, key = value.split(" ")
+                    GSettingsSetting(schema).set_boolean(key, update)
+                elif method == "GNOME":
+                    GConfSetting(shema, bool).set_value(update)
+                else:
+                    raise Exception("Method not supported")
+            except:
+                logging.warning("Autostart desktop file unsupported 
AutostartCondition (%s)" % asc, exc_info=True)
+
+            return
 
         if update:
-            if not os.path.exists(self._desktop_file):
+            if (not self._desktop_file) or (not 
os.path.exists(self._desktop_file)):
                 logging.critical("Could not find desktop file: %s" % 
self._desktop_file)
                 return
 
-            logging.info("Adding autostart %s" % self._autostart_file)
+            logging.info("Adding autostart %s" % self._user_autostart_file)
             #copy the original file to the new file, but add the extra exec 
args
             old = open(self._desktop_file, "r")
-            new = open(self._autostart_file, "w")
+            new = open(self._user_autostart_file, "w")
 
             for l in old.readlines():         
                 if l.startswith("Exec="):
@@ -109,3 +193,31 @@
 
             old.close()
             new.close()
+
+if __name__ == "__main__":
+    gtweak.DATA_DIR = "/usr/share"
+    gtweak.GSETTINGS_SCHEMA_DIR = "/usr/share/glib-2.0/schemas/"
+
+    logging.basicConfig(format="%(levelname)-8s: %(message)s", 
level=logging.DEBUG)
+
+    d = AutostartManager("matlab.desktop")
+    print d.desktop_filename, "uses autostartcondition", 
d.uses_autostart_condition()
+    print d.desktop_filename, "autostarts", d.is_start_at_login_enabled()
+    d.update_start_at_login(True)
+    print d.desktop_filename, "autostarts", d.is_start_at_login_enabled()
+    d.update_start_at_login(False)
+    print d.desktop_filename, "autostarts", d.is_start_at_login_enabled()
+
+    d = AutostartManager("orca.desktop", "orca-autostart.desktop")
+    print d.desktop_filename, "uses autostartcondition", 
d.uses_autostart_condition()
+    print d.desktop_filename, "autostartcondition is:", 
d.get_autostart_condition()
+    print d.desktop_filename, "uses GSettings autostartcondition", 
d.uses_autostart_condition("GSettings")
+    print d.desktop_filename, "autostarts", d.is_start_at_login_enabled()
+
+    d = AutostartManager("dropbox.desktop")
+    print d.desktop_filename, "uses autostartcondition", 
d.uses_autostart_condition()
+    print d.desktop_filename, "autostarts", d.is_start_at_login_enabled()
+
+    d = AutostartManager("nautilus.desktop", "nautilus-autostart.desktop")
+    print d.desktop_filename, "uses autostartcondition", 
d.uses_autostart_condition()
+    d.update_start_at_login(False)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/gtweak/widgets.py 
new/gnome-tweak-tool-3.0.5/gtweak/widgets.py
--- old/gnome-tweak-tool-3.0.4/gtweak/widgets.py        2011-05-10 
22:47:29.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/gtweak/widgets.py        2011-06-21 
23:34:45.000000000 +0200
@@ -36,6 +36,7 @@
     @values: a list of 2-tuples (value, name)
     """
     store = Gtk.ListStore(str, str)
+    store.set_sort_column_id(1, Gtk.SortType.ASCENDING)
 
     selected_iter = None
     for (val, name) in values:
@@ -46,7 +47,7 @@
     combo = Gtk.ComboBox(model=store)
     renderer = Gtk.CellRendererText()
     combo.pack_start(renderer, True)
-    combo.add_attribute(renderer, 'text', 1)
+    combo.add_attribute(renderer, 'markup', 1)
     if selected_iter:
         combo.set_active_iter(selected_iter)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gnome-tweak-tool-3.0.4/po/nb.po 
new/gnome-tweak-tool-3.0.5/po/nb.po
--- old/gnome-tweak-tool-3.0.4/po/nb.po 2011-04-27 21:59:24.000000000 +0200
+++ new/gnome-tweak-tool-3.0.5/po/nb.po 2011-06-21 23:34:45.000000000 +0200
@@ -7,8 +7,8 @@
 msgstr ""
 "Project-Id-Version: gnome-tweak-tool 0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-03-17 22:58+0100\n"
-"PO-Revision-Date: 2011-03-17 22:59+0100\n"
+"POT-Creation-Date: 2011-06-07 21:29+0200\n"
+"PO-Revision-Date: 2011-06-07 21:30+0200\n"
 "Last-Translator: Kjartan Maraas <[email protected]>\n"
 "Language-Team: Norwegian bokmål <[email protected]>\n"
 "Language: \n"
@@ -18,11 +18,11 @@
 
 #: ../data/shell.ui.h:1
 msgid "Tweak Tool"
-msgstr ""
+msgstr "Konfigurasjonsverktøy"
 
 #: ../data/shell.ui.h:2
 msgid "tweaks"
-msgstr ""
+msgstr "Konfigurasjon"
 
 #: ../data/shell.ui.h:3
 msgid "welcome"


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to