[gnome-control-center] Port about-me to PolicyKit 1.0



commit a250580a6b5f5b115a3479c518785518376caa12
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Aug 14 12:12:29 2009 +0100

    Port about-me to PolicyKit 1.0
    
    Remove the polkit-gnome dependency. It's unlikely that admins
    would require a password for the user to enroll themselves,
    and we can't modify other users' fingerprints either.

 capplets/about-me/Makefile.am      |    3 +-
 capplets/about-me/gnome-about-me.c |   37 ------------------------------------
 configure.in                       |    5 ----
 3 files changed, 1 insertions(+), 44 deletions(-)
---
diff --git a/capplets/about-me/Makefile.am b/capplets/about-me/Makefile.am
index 32ebdaa..ab2d8df 100644
--- a/capplets/about-me/Makefile.am
+++ b/capplets/about-me/Makefile.am
@@ -23,7 +23,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)
+gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS)
 gnome_about_me_LDFLAGS = -export-dynamic
 
 @INTLTOOL_DESKTOP_RULE@
@@ -37,7 +37,6 @@ ui_DATA = $(ui_files)
 INCLUDES = \
 	$(GNOMECC_CAPPLETS_CFLAGS) \
 	$(LIBEBOOK_CFLAGS) \
-	$(POLKIT_GNOME_CFLAGS) \
 	-DDATADIR="\"$(datadir)\"" \
 	-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
 	-DGNOMECC_UI_DIR="\"$(uidir)\"" \
diff --git a/capplets/about-me/gnome-about-me.c b/capplets/about-me/gnome-about-me.c
index cd977fe..af5c579 100644
--- a/capplets/about-me/gnome-about-me.c
+++ b/capplets/about-me/gnome-about-me.c
@@ -33,10 +33,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 "gnome-about-me-password.h"
 #include "gnome-about-me-fingerprint.h"
@@ -165,28 +161,6 @@ about_me_error (GtkWindow *parent, gchar *str)
 	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)
@@ -965,19 +939,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 --git a/configure.in b/configure.in
index d3cd6bb..eefca87 100644
--- a/configure.in
+++ b/configure.in
@@ -228,11 +228,6 @@ if test "x$enable_aboutme" = "xyes"; then
   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
 
 AM_CONDITIONAL(BUILD_ABOUTME, test "x$enable_aboutme" = "xyes")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]