rpms/control-center/devel polkit1.patch, NONE, 1.1 control-center.spec, 1.448, 1.449 gnome-control-center-2.26.0-support-touchpads.patch, 1.1, 1.2

Matthias Clasen mclasen at fedoraproject.org
Tue Jun 9 17:47:08 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/control-center/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32385

Modified Files:
	control-center.spec 
	gnome-control-center-2.26.0-support-touchpads.patch 
Added Files:
	polkit1.patch 
Log Message:
Port to PolicyKit-1


polkit1.patch:

--- NEW FILE polkit1.patch ---
diff -up gnome-control-center-2.26.0/capplets/about-me/gnome-about-me.c.polkit1 gnome-control-center-2.26.0/capplets/about-me/gnome-about-me.c
--- gnome-control-center-2.26.0/capplets/about-me/gnome-about-me.c.polkit1	2009-05-11 22:54:13.917355711 -0400
+++ gnome-control-center-2.26.0/capplets/about-me/gnome-about-me.c	2009-05-11 22:54:13.933355351 -0400
@@ -36,10 +36,6 @@
 #define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnomeui/gnome-desktop-thumbnail.h>
 
-#ifdef HAVE_POLKIT
-#include <polkit-gnome/polkit-gnome.h>
-#endif
-
 #include "e-image-chooser.h"
 #include "eel-editable-label.h"
 #include <gdk/gdkkeysyms.h>
@@ -169,28 +165,6 @@ about_me_error (GtkWindow *parent, gchar
 	gtk_widget_destroy (dialog);
 }
 
-#ifdef HAVE_POLKIT
-static GtkWidget *
-create_fingerprint_button (const char *msg, const char *name)
-{
-	GtkWidget *button;
-	PolKitAction *action;
-	PolKitGnomeAction *gaction;
-
-	action = polkit_action_new_from_string_representation ("net.reactivated.fprint.device.enroll");
-	gaction = polkit_gnome_action_new_default (name,
-						   action,
-						   msg,
-						   NULL);
-	polkit_action_unref (action);
-
-	button = polkit_gnome_action_create_button (gaction);
-	g_object_unref (gaction);
-
-	return button;
-}
-#endif /* HAVE_POLKIT */
-
 /********************/
 static void
 about_me_destroy (GnomeAboutMe *me)
@@ -1194,19 +1168,8 @@ about_me_setup_dialog (void)
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (about_me_image_clicked_cb), me);
 
-#ifdef HAVE_POLKIT
-	gtk_widget_destroy (WID ("enable_fingerprint_button"));
-	gtk_widget_destroy (WID ("disable_fingerprint_button"));
-
-	me->enable_fingerprint_button = create_fingerprint_button (_("Enable _Fingerprint Login..."), "enable-action");
-	gtk_container_add (GTK_CONTAINER (WID("buttons_vbox")), me->enable_fingerprint_button);
-
-	me->disable_fingerprint_button = create_fingerprint_button (_("Disable _Fingerprint Login..."), "disable-action");
-	gtk_container_add (GTK_CONTAINER (WID("buttons_vbox")), me->disable_fingerprint_button);
-#else
 	me->enable_fingerprint_button = WID ("enable_fingerprint_button");
 	me->disable_fingerprint_button = WID ("disable_fingerprint_button");
-#endif /* HAVE_POLKIT */
 
 	g_signal_connect (me->enable_fingerprint_button, "clicked",
 			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), me);
diff -up gnome-control-center-2.26.0/capplets/about-me/Makefile.am.polkit1 gnome-control-center-2.26.0/capplets/about-me/Makefile.am
--- gnome-control-center-2.26.0/capplets/about-me/Makefile.am.polkit1	2009-05-11 22:54:13.921378826 -0400
+++ gnome-control-center-2.26.0/capplets/about-me/Makefile.am	2009-05-11 22:54:13.932381403 -0400
@@ -26,7 +26,7 @@ gnome_about_me_SOURCES =	 	\
 if BUILD_ABOUTME
 bin_PROGRAMS = gnome-about-me
 
-gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS) $(POLKIT_GNOME_LIBS) $(GAIL_LIBS)
+gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS) $(GAIL_LIBS)
 gnome_about_me_LDFLAGS = -export-dynamic
 
 @INTLTOOL_DESKTOP_RULE@
@@ -40,7 +40,6 @@ glade_DATA = $(glade_files)
 INCLUDES = \
 	$(GNOMECC_CAPPLETS_CFLAGS) \
 	$(LIBEBOOK_CFLAGS) \
-	$(POLKIT_GNOME_CFLAGS) \
 	$(GAIL_CFLAGS) \
 	-DDATADIR="\"$(datadir)\"" \
 	-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
diff -up gnome-control-center-2.26.0/capplets/appearance/appearance-desktop.c.polkit1 gnome-control-center-2.26.0/capplets/appearance/appearance-desktop.c
--- gnome-control-center-2.26.0/capplets/appearance/appearance-desktop.c.polkit1	2009-05-11 22:54:13.928355424 -0400
+++ gnome-control-center-2.26.0/capplets/appearance/appearance-desktop.c	2009-05-12 14:18:32.590345296 -0400
@@ -33,7 +33,6 @@
 #include <libgnomeui/gnome-bg.h>
 
 #include <dbus/dbus-glib.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 enum {
   TARGET_URI_LIST,
@@ -991,6 +990,16 @@ wp_select_after_realize (GtkWidget *widg
   select_item (data, item, TRUE);
 }
 
+static char *background_keys[7] = {
+  "/desktop/gnome/background/picture_filename",
+  "/desktop/gnome/background/picture_opacity",
+  "/desktop/gnome/background/picture_options",
+  "/desktop/gnome/background/color_shading_type",
+  "/desktop/gnome/background/primary_color",
+  "/desktop/gnome/background/secondary_color",
+  NULL
+};
+
 static void
 set_background (GtkAction *action, gpointer data)
 {
@@ -998,15 +1007,6 @@ set_background (GtkAction *action, gpoin
   DBusGProxy *proxy;
   DBusGConnection *connection;
   GError *error;
-  char *keys[7] = {
-    "/desktop/gnome/background/picture_filename",
-    "/desktop/gnome/background/picture_opacity",
-    "/desktop/gnome/background/picture_options",
-    "/desktop/gnome/background/color_shading_type",
-    "/desktop/gnome/background/primary_color",
-    "/desktop/gnome/background/secondary_color",
-    NULL
-  };
 
   gconf_client_suggest_sync (adata->client, NULL);
 
@@ -1027,24 +1027,70 @@ set_background (GtkAction *action, gpoin
     return;
   }
 
-  dbus_g_proxy_call (proxy, "SetSystem",
-                     &error,
-                     G_TYPE_STRV, keys,
-                     G_TYPE_STRV, NULL,
-                     G_TYPE_INVALID,
-                     G_TYPE_INVALID);
+  if (!dbus_g_proxy_call (proxy, "SetSystem",
+                          &error,
+                          G_TYPE_STRV, background_keys,
+                          G_TYPE_STRV, NULL,
+                          G_TYPE_INVALID,
+                          G_TYPE_INVALID)) {
+    g_warning ("error calling SetSystem: %s\n", error->message);
+    g_error_free (error);
+  }
 
   g_object_unref (proxy);
 }
 
+static void
+check_can_set_background (GtkAction *action)
+{
+  DBusGProxy *proxy;
+  DBusGConnection *connection;
+  GError *error;
+  gboolean result;
+
+  result = FALSE;
+
+  error = NULL;
+  connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
+  if (error != NULL) {
+    g_warning ("failed to get system bus connection: %s", error->message);
+    g_error_free (error);
+    goto out;
+  }
+
+  proxy = dbus_g_proxy_new_for_name (connection,
+                                     "org.gnome.GConf.Defaults",
+                                     "/",
+                                     "org.gnome.GConf.Defaults");
+  if (proxy == NULL) {
+    g_warning ("Cannot connect to defaults mechanism");
+    goto out;
+  }
+
+  if (!dbus_g_proxy_call (proxy, "CanSetSystem",
+                          &error,
+                          G_TYPE_STRV, background_keys,
+                          G_TYPE_INVALID,
+		          G_TYPE_BOOLEAN, &result,
+                          G_TYPE_INVALID)) {
+    g_warning ("error calling CanSetSystem: %s\n", error->message);
+    g_error_free (error);
+  }
+
+  g_print ("calling CanSetSystem: %d\n", result);
+  g_object_unref (proxy);
+
+out:
+  gtk_action_set_visible (action, result);
+}
+
 void
 desktop_init (AppearanceData *data,
 	      const gchar **uris)
 {
   GtkWidget *add_button;
   GtkCellRenderer *cr;
-  PolKitAction *pk_action;
-  PolKitGnomeAction *action;
+  GtkAction *action;
   GtkWidget *widget, *box, *button;
 
   g_object_set (gtk_settings_get_default (), "gtk-tooltip-timeout", 500, NULL);
@@ -1169,18 +1215,18 @@ desktop_init (AppearanceData *data,
   widget = glade_xml_get_widget (data->xml, "background_vbox");
   box = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_end (GTK_BOX (widget), box, FALSE, FALSE, 0);
- 
-  pk_action = polkit_action_new ();
-  polkit_action_set_action_id (pk_action, "org.gnome.gconf.defaults.set-default-background");
- 
-  action = polkit_gnome_action_new_default ("set-system", 
-                                            pk_action,
-                                            _("Make Default"),
-                                            _("Set the current background as the system-wide default"));
-  g_object_set (action, "no-visible", FALSE, NULL);
+
+  action = gtk_action_new ("set-system",
+                           _("Make Default"),
+                           _("Set the current background as the system-wide default"),
+                           NULL);
+  check_can_set_background (action);
           
-  polkit_action_unref (pk_action);
-  button = polkit_gnome_action_create_button (action);
+  button = gtk_button_new ();
+  gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action);
+  gtk_widget_set_no_show_all (button, TRUE);
+  g_object_unref (action);
+
   gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0);
 
   g_signal_connect (action, "activate", G_CALLBACK (set_background), data);
diff -up gnome-control-center-2.26.0/capplets/appearance/Makefile.am.polkit1 gnome-control-center-2.26.0/capplets/appearance/Makefile.am
--- gnome-control-center-2.26.0/capplets/appearance/Makefile.am.polkit1	2009-05-11 22:54:13.928355424 -0400
+++ gnome-control-center-2.26.0/capplets/appearance/Makefile.am	2009-05-11 22:54:13.934355141 -0400
@@ -44,8 +44,7 @@ gnome_appearance_properties_LDADD = \
 	$(top_builddir)/capplets/common/libcommon.la \
 	$(GNOMECC_CAPPLETS_LIBS) \
 	$(FONT_CAPPLET_LIBS) \
-	$(METACITY_LIBS) \
-	$(POLKIT_GNOME_LIBS) 
+	$(METACITY_LIBS) 
 gnome_appearance_properties_LDFLAGS = -export-dynamic
 
 gladedir = $(pkgdatadir)/glade
@@ -56,7 +55,6 @@ INCLUDES = \
 	$(METACITY_CFLAGS) \
 	$(GNOMECC_CAPPLETS_CFLAGS) \
 	$(FONT_CAPPLET_CFLAGS) \
-	$(POLKIT_GNOME_CFLAGS) \
 	-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
 	-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
 	-DGNOMECC_GLADE_DIR="\"$(gladedir)\"" \
diff -up gnome-control-center-2.26.0/configure.in.polkit1 gnome-control-center-2.26.0/configure.in
--- gnome-control-center-2.26.0/configure.in.polkit1	2009-05-11 22:54:13.922355708 -0400
+++ gnome-control-center-2.26.0/configure.in	2009-05-11 22:54:13.931382241 -0400
@@ -102,7 +102,6 @@ PKG_CHECK_MODULES(METACITY, libmetacity-
 PKG_CHECK_MODULES(TYPING, glib-2.0 > 2.11 gconf-2.0 gtk+-2.0)
 PKG_CHECK_MODULES(GSD_DBUS, gnome-settings-daemon)
 PKG_CHECK_MODULES(GIO, gio-2.0)
-PKG_CHECK_MODULES(POLKIT_GNOME, polkit-gnome)
 
 gtk_lib_dir=`$PKG_CONFIG --variable libdir gtk+-2.0`
 gtk_binary_version=`$PKG_CONFIG --variable gtk_binary_version gtk+-2.0`
@@ -204,11 +203,6 @@ if test "x$enable_aboutme" = "xyes"; the
   PKG_CHECK_MODULES(LIBEBOOK, [libebook-1.2 >= 1.7.90],
                     [AC_DEFINE([HAVE_LIBEBOOK], 1,
                     [Define if evolution-data-server libebook-1.2 is available])])
-  dnl PolicyKit-gnome is optional
-  PKG_CHECK_MODULES(POLKIT_GNOME, [polkit-gnome],
-  		    [AC_DEFINE([HAVE_POLKIT], 1,
-  		    [Define if PolicyKit-gnome is available])],
-  		    has_polkit=false)
 fi
 
 PKG_CHECK_MODULES(GAIL, [gail])


Index: control-center.spec
===================================================================
RCS file: /cvs/pkgs/rpms/control-center/devel/control-center.spec,v
retrieving revision 1.448
retrieving revision 1.449
diff -u -p -r1.448 -r1.449
--- control-center.spec	8 Jun 2009 10:02:22 -0000	1.448
+++ control-center.spec	9 Jun 2009 17:46:37 -0000	1.449
@@ -23,7 +23,7 @@
 Summary: Utilities to configure the GNOME desktop
 Name: control-center
 Version: 2.26.0
-Release: 7%{?dist}
+Release: 8%{?dist}
 Epoch: 1
 License: GPLv2+ and GFDL
 Group: User Interface/Desktops
@@ -60,6 +60,9 @@ Patch35: gnome-control-center-2.26.0-sup
 # http://bugzilla.gnome.org/show_bug.cgi?id=578572
 Patch36: display-capplet-mnemonics.patch
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=498365
+Patch37: polkit1.patch
+
 # call the Fedora/RHEL graphical passwd changing apps
 Patch95: gnome-control-center-2.25.2-passwd.patch
 Patch96: gnome-control-center-2.25.2-gecos.patch
@@ -195,6 +198,7 @@ popd
 %patch99 -p1 -b .default-apps
 
 %patch7 -p1 -b .make-default
+%patch37 -p1 -b .polkit1
 
 autoreconf -f -i
 
@@ -360,6 +364,9 @@ fi
 %dir %{_datadir}/gnome-control-center/keybindings
 
 %changelog
+* Mon Jun  9 2009 Matthias Clasen <mclasen at redhat.com> - 2.26.0-8
+- Port to PolicyKit 1
+
 * Mon Jun 08 2009 Bastien Nocera <bnocera at redhat.com> 2.26.0-7
 - Remove arora patch for default applications, it should drop-in
   its own XML file instead

gnome-control-center-2.26.0-support-touchpads.patch:

Index: gnome-control-center-2.26.0-support-touchpads.patch
===================================================================
RCS file: /cvs/pkgs/rpms/control-center/devel/gnome-control-center-2.26.0-support-touchpads.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gnome-control-center-2.26.0-support-touchpads.patch	9 Apr 2009 03:03:46 -0000	1.1
+++ gnome-control-center-2.26.0-support-touchpads.patch	9 Jun 2009 17:46:37 -0000	1.2
@@ -426,3 +426,18 @@ diff -up gnome-control-center-2.26.0/cap
            </widget>
            <packing>
              <property name="position">1</property>
+diff -up gnome-control-center-2.26.0/configure.in.support-touchpads gnome-control-center-2.26.0/configure.in
+--- gnome-control-center-2.26.0/configure.in.support-touchpads	2009-05-11 22:37:08.934391502 -0400
++++ gnome-control-center-2.26.0/configure.in	2009-05-11 22:41:03.615357973 -0400
+@@ -173,6 +173,11 @@ fi
+ 
+ CAPPLET_LIBS="$CAPPLET_LIBS $XCURSOR_LIBS"
+ 
++PKG_CHECK_MODULES(XI, xi)
++
++
++CAPPLET_LIBS="$CAPPLET_LIBS $XI_LIBS"
++
+ dnl ==============
+ dnl gswitchit
+ dnl ==============




More information about the fedora-extras-commits mailing list