Blob Blame History Raw
diff -up gnome-control-center-2.27.4/capplets/about-me/gnome-about-me.c.polkit1 gnome-control-center-2.27.4/capplets/about-me/gnome-about-me.c
--- gnome-control-center-2.27.4/capplets/about-me/gnome-about-me.c.polkit1	2009-07-29 23:03:00.921501104 -0400
+++ gnome-control-center-2.27.4/capplets/about-me/gnome-about-me.c	2009-07-29 23:03:01.006500314 -0400
@@ -169,28 +169,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 +1172,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.27.4/capplets/appearance/appearance-desktop.c.polkit1 gnome-control-center-2.27.4/capplets/appearance/appearance-desktop.c
--- gnome-control-center-2.27.4/capplets/appearance/appearance-desktop.c.polkit1	2009-07-29 23:03:00.942500211 -0400
+++ gnome-control-center-2.27.4/capplets/appearance/appearance-desktop.c	2009-07-29 23:03:01.008501058 -0400
@@ -32,7 +32,6 @@
 #include <libgnomeui/gnome-bg.h>
 
 #include <dbus/dbus-glib.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 enum {
   TARGET_URI_LIST,
@@ -995,6 +994,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)
 {
@@ -1002,15 +1011,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);
 
@@ -1031,24 +1031,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;
+  guint result;
+
+  result = 0;
+
+  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_UINT, &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 != 0);
+}
+
 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);
@@ -1173,18 +1219,18 @@ desktop_init (AppearanceData *data,
   widget = appearance_capplet_get_widget (data, "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.27.4/configure.in.polkit1 gnome-control-center-2.27.4/configure.in
--- gnome-control-center-2.27.4/configure.in.polkit1	2009-07-29 23:03:00.926500063 -0400
+++ gnome-control-center-2.27.4/configure.in	2009-07-29 23:08:09.582750857 -0400
@@ -98,7 +98,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`
@@ -224,11 +223,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])