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-06-09 13:45:16.935332926 -0400
+++ gnome-control-center-2.26.0/capplets/about-me/gnome-about-me.c 2009-06-09 13:45:17.007312663 -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-06-09 13:45:16.942317965 -0400
+++ gnome-control-center-2.26.0/capplets/about-me/Makefile.am 2009-06-09 13:45:17.009313427 -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-06-09 13:45:16.982323819 -0400
+++ gnome-control-center-2.26.0/capplets/appearance/appearance-desktop.c 2009-06-12 13:05:41.315839883 -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;
+ 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);
@@ -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-06-09 13:45:16.996323092 -0400
+++ gnome-control-center-2.26.0/capplets/appearance/Makefile.am 2009-06-09 13:45:17.012313001 -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-06-09 13:45:16.943314331 -0400
+++ gnome-control-center-2.26.0/configure.in 2009-06-09 13:45:17.014319004 -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])