[gnome-disk-utility] Rip out PolicyKit support and bump version after release



commit 0c6e07148d1ebedc3ee09b9d3da7efbcc5991ff5
Author: David Zeuthen <davidz redhat com>
Date:   Mon May 11 18:26:26 2009 -0400

    Rip out PolicyKit support and bump version after release
---
 configure.ac                                       |    6 +-
 doc/Makefile.am                                    |    3 -
 src/format-tool/Makefile.am                        |    4 -
 src/format-tool/gdu-format-dialog.h                |    1 -
 src/format-tool/gdu-format-tool.c                  |   58 +---
 src/gdu-gtk/Makefile.am                            |    4 -
 src/gdu-gtk/gdu-gtk.c                              |    1 -
 src/gdu/Makefile.am                                |    2 -
 src/gdu/gdu-error.c                                |   53 +---
 src/gdu/gdu-error.h                                |    9 +-
 src/nautilus-extension/Makefile.am                 |    4 -
 src/notification/Makefile.am                       |    2 -
 src/palimpsest/Makefile.am                         |    4 -
 src/palimpsest/gdu-main.c                          |    1 -
 .../gdu-section-create-partition-table.c           |   43 +--
 src/palimpsest/gdu-section-filesystem.c            |   46 +--
 src/palimpsest/gdu-section-health.c                |   97 +-----
 src/palimpsest/gdu-section-job.c                   |   47 +--
 src/palimpsest/gdu-section-linux-md-drive.c        |  107 +-----
 src/palimpsest/gdu-section-partition.c             |   83 +----
 src/palimpsest/gdu-section-swapspace.c             |    1 -
 src/palimpsest/gdu-section-unallocated.c           |   45 +--
 src/palimpsest/gdu-section-unrecognized.c          |   44 +--
 src/palimpsest/gdu-shell.c                         |  371 ++------------------
 src/playground/grid/Makefile.am                    |    4 -
 25 files changed, 124 insertions(+), 916 deletions(-)

diff --git a/configure.ac b/configure.ac
index db2dfd4..88db484 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([GNOME Disk Utility],[0.3],[mailto:david fubar dk],[gnome-disk-utility])
+AC_INIT([GNOME Disk Utility],[0.4],[mailto:david fubar dk],[gnome-disk-utility])
 
 AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip])
 
@@ -121,8 +121,6 @@ GLIB2_REQUIRED=2.16
 GOBJECT2_REQUIRED=2.16
 GIO2_REQUIRED=2.16
 DBUS_GLIB_REQUIRED=0.74
-POLKIT_DBUS_REQUIRED=0.7
-POLKIT_GNOME_REQUIRED=0.7
 GNOME_KEYRING_REQUIRED=2.22
 GTK2_REQUIRED=2.6.0
 LIBSEXY_REQUIRED=0.1.11
@@ -139,8 +137,6 @@ PKG_CHECK_MODULES(GIO2, gio-2.0 >= $GIO2_REQUIRED)
 PKG_CHECK_MODULES(GIO_UNIX2, gio-unix-2.0 >= $GIO2_REQUIRED)
 PKG_CHECK_MODULES(GTHREAD2, gthread-2.0 >= $GLIB2_REQUIRED)
 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
-PKG_CHECK_MODULES(POLKIT_DBUS, polkit-dbus >= $POLKIT_DBUS_REQUIRED)
-PKG_CHECK_MODULES(POLKIT_GNOME, polkit-gnome >= $POLKIT_GNOME_REQUIRED)
 PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED)
 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= $GTK2_REQUIRED)
 PKG_CHECK_MODULES(LIBSEXY, libsexy >= $LIBSEXY_REQUIRED)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 90918f7..6799fda 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -28,8 +28,6 @@ IGNORE_HFILES= 		\
 INCLUDES = 				\
 	$(GTK_CFLAGS)			\
 	$(DBUS_GLIB_CFLAGS)		\
-	$(POLKIT_DBUS_CFLAGS)		\
-	$(POLKIT_GRANT_CFLAGS)		\
 	-I$(top_srcdir) 		\
 	-I$(top_builddir)		\
 	$(NULL)
@@ -39,7 +37,6 @@ GTKDOC_LIBS = \
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(DBUS_GLIB_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
 	$(GNOME_KEYRING_LIBS)				\
 	$(top_builddir)/src/gdu/libgdu.la		\
 	$(NULL)
diff --git a/src/format-tool/Makefile.am b/src/format-tool/Makefile.am
index 3d7f61c..0ccfd42 100644
--- a/src/format-tool/Makefile.am
+++ b/src/format-tool/Makefile.am
@@ -17,9 +17,7 @@ CORE_CFLAGS = 						\
 	$(GIO2_CFLAGS)					\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(GTHREAD2_CFLAGS)				\
-	$(POLKIT_DBUS_CFLAGS)				\
 	$(GTK2_CFLAGS)					\
-	$(POLKIT_GNOME_CFLAGS)				\
 	$(NULL)
 
 CORE_LIBADD = 						\
@@ -28,9 +26,7 @@ CORE_LIBADD = 						\
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(GTHREAD2_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
 	$(GTK2_LIBS)					\
-	$(POLKIT_GNOME_LIBS)				\
 	$(INTLLIBS)					\
 	$(top_builddir)/src/gdu/libgdu.la		\
 	$(top_builddir)/src/gdu-gtk/libgdu-gtk.la	\
diff --git a/src/format-tool/gdu-format-dialog.h b/src/format-tool/gdu-format-dialog.h
index 57e9896..64fcc5d 100644
--- a/src/format-tool/gdu-format-dialog.h
+++ b/src/format-tool/gdu-format-dialog.h
@@ -28,7 +28,6 @@
 
 #include <gtk/gtk.h>
 #include <gdu/gdu.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/format-tool/gdu-format-tool.c b/src/format-tool/gdu-format-tool.c
index 02079d3..a12e846 100644
--- a/src/format-tool/gdu-format-tool.c
+++ b/src/format-tool/gdu-format-tool.c
@@ -246,7 +246,6 @@ main (int argc, char *argv[])
 
         take_ownership = (g_strcmp0 (fs_type, "vfat") != 0);
 
- try_again:
         data.loop = loop;
         data.error = NULL;
         dialog = gdu_format_progress_dialog_new (NULL,
@@ -262,52 +261,17 @@ main (int argc, char *argv[])
                                          &data);
         g_main_loop_run (loop);
         if (data.error != NULL) {
-                PolKitAction *pk_action;
-                PolKitResult pk_result;
-                if (gdu_error_check_polkit_not_authorized (data.error,
-                                                           &pk_action,
-                                                           &pk_result)) {
-                        gtk_widget_destroy (dialog);
-                        dialog = NULL;
-
-                        if (pk_result == POLKIT_RESULT_UNKNOWN ||
-                            pk_result == POLKIT_RESULT_NO) {
-                                show_error_dialog (NULL,
-                                                   _("You are not authorized to format the volume"),
-                                                   _("Contact your system administrator to obtain "
-                                                     "the necessary authorization."));
-                                g_error_free (data.error);
-                                polkit_action_unref (pk_action);
-                                goto out;
-                        } else {
-                                char *action_id;
-                                DBusError dbus_error;
-                                polkit_action_get_action_id (pk_action, &action_id);
-                                dbus_error_init (&dbus_error);
-                                if (!polkit_auth_obtain (action_id, 0, getpid (), &dbus_error)) {
-                                        polkit_action_unref (pk_action);
-                                        dbus_error_free (&dbus_error);
-                                        goto out;
-                                } else {
-                                        g_error_free (data.error);
-                                        /* try again */
-                                        goto try_again;
-                                }
-                        }
-
-                } else {
-                        gtk_widget_destroy (dialog);
-                        dialog = NULL;
-
-                        /* TODO: we could handle things like GDU_ERROR_BUSY here, e.g. unmount
-                         *       and/or tear down LUKS mapping
-                         */
-                        show_error_dialog (NULL,
-                                           _("Error creating filesystem"),
-                                           data.error->message);
-                        g_error_free (data.error);
-                        goto out;
-                }
+                gtk_widget_destroy (dialog);
+                dialog = NULL;
+
+                /* TODO: we could handle things like GDU_ERROR_BUSY here, e.g. unmount
+                 *       and/or tear down LUKS mapping
+                 */
+                show_error_dialog (NULL,
+                                   _("Error creating filesystem"),
+                                   data.error->message);
+                g_error_free (data.error);
+                goto out;
         }
 
         /* ugh, DeviceKit-disks bug - spin around in the mainloop for some time to ensure we
diff --git a/src/gdu-gtk/Makefile.am b/src/gdu-gtk/Makefile.am
index a2c2806..45bbfb3 100644
--- a/src/gdu-gtk/Makefile.am
+++ b/src/gdu-gtk/Makefile.am
@@ -34,10 +34,8 @@ libgdu_gtk_la_CFLAGS = 					\
 	$(GIO2_CFLAGS)					\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(DBUS_GLIB_CFLAGS)				\
-	$(POLKIT_DBUS_CFLAGS)				\
 	$(GNOME_KEYRING_CFLAGS)				\
 	$(GTK2_CFLAGS)					\
-	$(POLKIT_GNOME_CFLAGS)				\
 	$(WARN_CFLAGS)					\
 	$(AM_CFLAGS)
 
@@ -46,10 +44,8 @@ libgdu_gtk_la_LIBADD = 					\
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(DBUS_GLIB_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
 	$(GNOME_KEYRING_LIBS)				\
 	$(GTK2_LIBS)					\
-	$(POLKIT_GNOME_LIBS)				\
 	$(INTLLIBS)
 
 libgdu_gtk_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
diff --git a/src/gdu-gtk/gdu-gtk.c b/src/gdu-gtk/gdu-gtk.c
index 3496d7f..e9fcde3 100644
--- a/src/gdu-gtk/gdu-gtk.c
+++ b/src/gdu-gtk/gdu-gtk.c
@@ -23,7 +23,6 @@
 #include <glib-object.h>
 #include <string.h>
 #include <glib/gi18n.h>
-#include <polkit-gnome/polkit-gnome.h>
 #include <gnome-keyring.h>
 #include <dbus/dbus-glib.h>
 
diff --git a/src/gdu/Makefile.am b/src/gdu/Makefile.am
index 7bd608e..ed890d3 100644
--- a/src/gdu/Makefile.am
+++ b/src/gdu/Makefile.am
@@ -74,7 +74,6 @@ libgdu_la_CFLAGS = 					\
 	$(GIO2_CFLAGS)					\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(DBUS_GLIB_CFLAGS)				\
-	$(POLKIT_DBUS_CFLAGS)				\
 	$(GNOME_KEYRING_CFLAGS)				\
 	$(WARN_CFLAGS)					\
 	$(AM_CFLAGS)
@@ -84,7 +83,6 @@ libgdu_la_LIBADD = 					\
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(DBUS_GLIB_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
 	$(GNOME_KEYRING_LIBS)				\
 	$(INTLLIBS)
 
diff --git a/src/gdu/gdu-error.c b/src/gdu/gdu-error.c
index 992c4d8..6425a6b 100644
--- a/src/gdu/gdu-error.c
+++ b/src/gdu/gdu-error.c
@@ -23,7 +23,6 @@
 
 #include <dbus/dbus-glib.h>
 #include <string.h>
-#include <polkit-dbus/polkit-dbus.h>
 
 #include "gdu-error.h"
 #include "gdu-private.h"
@@ -57,7 +56,6 @@ _gdu_error_fixup (GError *error)
 {
         const char *name;
         gboolean matched;
-        gchar *s;
 
         if (error == NULL)
                 return;
@@ -85,58 +83,11 @@ _gdu_error_fixup (GError *error)
                 error->code = GDU_ERROR_NOT_SUPPORTED;
         else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.AtaSmartWouldWakeup") == 0)
                 error->code = GDU_ERROR_ATA_SMART_WOULD_WAKEUP;
+        else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.PermissionDenied") == 0)
+                error->code = GDU_ERROR_PERMISSION_DENIED;
         else
                 matched = FALSE;
 
         if (matched)
                 error->domain = GDU_ERROR;
-
-        /* Always prepend the D-Bus exception name to the message; we need this in
-         * gdu_error_check_polkit_not_authorized() to determine if it's a PolicyKit
-         * exception... when we port to polkit 1.0 this can go away.
-         */
-        s = g_strdup_printf ("%s: %s", name, error->message);
-        g_free (error->message);
-        error->message = s;
-}
-
-/**
- * gdu_error_check_polkit_not_authorized:
- * @error: A #GError.
- * @pk_action: Return location for a #PolKitAction object.
- * @pk_result: Return location for #PolKitResult value.
- *
- * Checks if an error from a remote method call is of
- * type <literal>org.freedesktop.PolicyKit.Error.NotAuthorized</literal>
- * and if so, extracts the PolicyKit action and result.
- *
- * Returns: #TRUE only if the error is a PolicyKit exception and
- * @pk_action (caller must free this object with polkit_action_unref())
- * and @pk_result are set.
- **/
-gboolean
-gdu_error_check_polkit_not_authorized (GError *error,
-                                       PolKitAction **pk_action,
-                                       PolKitResult *pk_result)
-{
-        gboolean ret;
-
-        g_return_val_if_fail (error != NULL && pk_action != NULL && pk_result != NULL, FALSE);
-
-        ret = FALSE;
-
-        if (error->domain != DBUS_GERROR ||
-            error->code != DBUS_GERROR_REMOTE_EXCEPTION)
-                goto out;
-
-        if (!g_str_has_prefix (error->message, "org.freedesktop.PolicyKit.Error.NotAuthorized: "))
-                goto out;
-
-        ret = polkit_dbus_error_parse_from_strings ("org.freedesktop.PolicyKit.Error.NotAuthorized",
-                                                    error->message + sizeof "org.freedesktop.PolicyKit.Error.NotAuthorized: " - 1,
-                                                    pk_action,
-                                                    pk_result);
-
-out:
-        return ret;
 }
diff --git a/src/gdu/gdu-error.h b/src/gdu/gdu-error.h
index aa39cd3..ce1349b 100644
--- a/src/gdu/gdu-error.h
+++ b/src/gdu/gdu-error.h
@@ -27,7 +27,6 @@
 #define __GDU_ERROR_H
 
 #include <gdu/gdu-types.h>
-#include <polkit/polkit.h>
 
 G_BEGIN_DECLS
 
@@ -40,6 +39,7 @@ G_BEGIN_DECLS
  * @GDU_ERROR_INVALID_OPTION: An invalid option was passed
  * @GDU_ERROR_NOT_SUPPORTED: Operation not supported.
  * @GDU_ERROR_ATA_SMART_WOULD_WAKEUP: Getting S.M.A.R.T. data for the device would require to spin it up.
+ * @GDU_ERROR_PERMISSION_DENIED: Permission denied.
  *
  * Error codes in the #GDU_ERROR domain.
  */
@@ -51,7 +51,8 @@ typedef enum
         GDU_ERROR_INHIBITED,
         GDU_ERROR_INVALID_OPTION,
         GDU_ERROR_NOT_SUPPORTED,
-        GDU_ERROR_ATA_SMART_WOULD_WAKEUP
+        GDU_ERROR_ATA_SMART_WOULD_WAKEUP,
+        GDU_ERROR_PERMISSION_DENIED,
 } GduError;
 
 /**
@@ -66,10 +67,6 @@ typedef enum
 
 GQuark      gdu_error_quark           (void);
 
-gboolean gdu_error_check_polkit_not_authorized (GError        *error,
-                                                PolKitAction **pk_action,
-                                                PolKitResult  *pk_result);
-
 G_END_DECLS
 
 #endif /* __GDU_ERROR_H */
diff --git a/src/nautilus-extension/Makefile.am b/src/nautilus-extension/Makefile.am
index 49f047e..6c2c82c 100644
--- a/src/nautilus-extension/Makefile.am
+++ b/src/nautilus-extension/Makefile.am
@@ -18,9 +18,7 @@ CORE_CFLAGS = 						\
 	$(GIO2_CFLAGS)					\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(GTHREAD2_CFLAGS)				\
-	$(POLKIT_DBUS_CFLAGS)				\
 	$(GTK2_CFLAGS)					\
-	$(POLKIT_GNOME_CFLAGS)				\
 	$(NULL)
 
 CORE_LIBADD = 						\
@@ -29,9 +27,7 @@ CORE_LIBADD = 						\
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(GTHREAD2_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
 	$(GTK2_LIBS)					\
-	$(POLKIT_GNOME_LIBS)				\
 	$(INTLLIBS)					\
 	$(top_builddir)/src/gdu/libgdu.la		\
 	$(top_builddir)/src/gdu-gtk/libgdu-gtk.la	\
diff --git a/src/notification/Makefile.am b/src/notification/Makefile.am
index 5ad1e30..c1d7091 100644
--- a/src/notification/Makefile.am
+++ b/src/notification/Makefile.am
@@ -25,8 +25,6 @@ gdu_notification_daemon_CFLAGS = 			\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(GTK2_CFLAGS)					\
 	$(WARN_CFLAGS)					\
-	$(POLKIT_DBUS_CFLAGS)				\
-	$(POLKIT_GNOME_CFLAGS)				\
 	$(LIBNOTIFY_CFLAGS)				\
 	$(AM_CFLAGS)
 
diff --git a/src/palimpsest/Makefile.am b/src/palimpsest/Makefile.am
index 0dca7ad..3dfdd2e 100644
--- a/src/palimpsest/Makefile.am
+++ b/src/palimpsest/Makefile.am
@@ -34,8 +34,6 @@ palimpsest_CFLAGS = 					\
 	$(GIO2_CFLAGS)					\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(DBUS_GLIB_CFLAGS)				\
-	$(POLKIT_DBUS_CFLAGS)				\
-	$(POLKIT_GNOME_CFLAGS)				\
 	$(GNOME_KEYRING_CFLAGS)				\
 	$(GTK2_CFLAGS)					\
 	$(LIBSEXY_CFLAGS)				\
@@ -51,8 +49,6 @@ palimpsest_LDADD = 					\
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(DBUS_GLIB_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
-	$(POLKIT_GNOME_LIBS)				\
 	$(GNOME_KEYRING_LIBS)				\
 	$(GTK2_LIBS)					\
 	$(LIBSEXY_LIBS)					\
diff --git a/src/palimpsest/gdu-main.c b/src/palimpsest/gdu-main.c
index fc0b9c0..d4251af 100644
--- a/src/palimpsest/gdu-main.c
+++ b/src/palimpsest/gdu-main.c
@@ -24,7 +24,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <glib/gi18n.h>
-#include <polkit-gnome/polkit-gnome.h>
 #include <unique/unique.h>
 
 #include "gdu-shell.h"
diff --git a/src/palimpsest/gdu-section-create-partition-table.c b/src/palimpsest/gdu-section-create-partition-table.c
index 600f919..d79360b 100644
--- a/src/palimpsest/gdu-section-create-partition-table.c
+++ b/src/palimpsest/gdu-section-create-partition-table.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include <gdu-gtk/gdu-gtk.h>
@@ -36,9 +35,6 @@ struct _GduSectionCreatePartitionTablePrivate
 {
         GtkWidget *create_part_table_vbox;
         GtkWidget *create_part_table_type_combo_box;
-        PolKitAction *pk_change_action;
-        PolKitAction *pk_change_system_internal_action;
-        PolKitGnomeAction *create_part_table_action;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -63,7 +59,7 @@ create_partition_table_callback (GduDevice *device,
 }
 
 static void
-create_part_table_callback (GtkAction *action, gpointer user_data)
+on_create_part_table_clicked (GtkButton *button, gpointer user_data)
 {
         GduSectionCreatePartitionTable *section = GDU_SECTION_CREATE_PARTITION_TABLE (user_data);
         GduDevice *device;
@@ -138,13 +134,6 @@ update (GduSectionCreatePartitionTable *section)
                 goto out;
         }
 
-        g_object_set (section->priv->create_part_table_action,
-                      "polkit-action",
-                      gdu_device_is_system_internal (device) ?
-                        section->priv->pk_change_system_internal_action :
-                        section->priv->pk_change_action,
-                      NULL);
-
 out:
         if (device != NULL)
                 g_object_unref (device);
@@ -155,10 +144,6 @@ out:
 static void
 gdu_section_create_partition_table_finalize (GduSectionCreatePartitionTable *section)
 {
-        polkit_action_unref (section->priv->pk_change_action);
-        polkit_action_unref (section->priv->pk_change_system_internal_action);
-        g_object_unref (section->priv->create_part_table_action);
-
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -192,28 +177,6 @@ gdu_section_create_partition_table_init (GduSectionCreatePartitionTable *section
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_CREATE_PARTITION_TABLE, GduSectionCreatePartitionTablePrivate);
 
-        section->priv->pk_change_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_action,
-                                     "org.freedesktop.devicekit.disks.change");
-        section->priv->pk_change_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.change-system-internal");
-        section->priv->create_part_table_action = polkit_gnome_action_new_default (
-                "create-part-table",
-                section->priv->pk_change_action,
-                _("C_reate"),
-                _("Create"));
-        g_object_set (section->priv->create_part_table_action,
-                      "auth-label", _("_Create..."),
-                      "yes-icon-name", GTK_STOCK_ADD,
-                      "no-icon-name", GTK_STOCK_ADD,
-                      "auth-icon-name", GTK_STOCK_ADD,
-                      "self-blocked-icon-name", GTK_STOCK_ADD,
-                      NULL);
-        g_signal_connect (section->priv->create_part_table_action, "activate",
-                          G_CALLBACK (create_part_table_callback), section);
-
-
         label = gtk_label_new (NULL);
         text = g_strdup_printf ("<b>%s</b>", _("Create Partition Table"));
         gtk_label_set_markup (GTK_LABEL (label), text);
@@ -271,7 +234,9 @@ gdu_section_create_partition_table_init (GduSectionCreatePartitionTable *section
         gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_START);
         gtk_box_set_spacing (GTK_BOX (button_box), 6);
         gtk_box_pack_start (GTK_BOX (vbox2), button_box, TRUE, TRUE, 0);
-        button = polkit_gnome_action_create_button (section->priv->create_part_table_action);
+        button = gtk_button_new_with_mnemonic ("C_reate");
+        gtk_widget_set_tooltip_text (button, _("Create"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_create_part_table_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 }
 
diff --git a/src/palimpsest/gdu-section-filesystem.c b/src/palimpsest/gdu-section-filesystem.c
index 7e4a31b..a48c428 100644
--- a/src/palimpsest/gdu-section-filesystem.c
+++ b/src/palimpsest/gdu-section-filesystem.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include "gdu-section-filesystem.h"
@@ -36,10 +35,7 @@ struct _GduSectionFilesystemPrivate
 
         GtkWidget *modify_fs_vbox;
         GtkWidget *modify_fs_label_entry;
-
-        PolKitAction *pk_change_action;
-        PolKitAction *pk_change_system_internal_action;
-        PolKitGnomeAction *modify_fslabel_action;
+        GtkWidget *modify_button;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -72,13 +68,6 @@ update (GduSectionFilesystem *section)
 
         pool = gdu_shell_get_pool (gdu_section_get_shell (GDU_SECTION (section)));
 
-        g_object_set (section->priv->modify_fslabel_action,
-                      "polkit-action",
-                      gdu_device_is_system_internal (device) ?
-                        section->priv->pk_change_system_internal_action :
-                        section->priv->pk_change_action,
-                      NULL);
-
         fstype = gdu_device_id_get_type (device);
         if (fstype == NULL)
                 goto out;
@@ -117,8 +106,7 @@ out:
 
         gtk_entry_set_max_length (GTK_ENTRY (section->priv->modify_fs_label_entry), max_label_len);
         gtk_widget_set_sensitive (section->priv->modify_fs_label_entry, max_label_len > 0);
-        polkit_gnome_action_set_sensitive (section->priv->modify_fslabel_action,
-                                           (max_label_len > 0) && changed);
+        gtk_widget_set_sensitive (section->priv->modify_button, max_label_len > 0 && changed);
 
 error:
         if (kfs != NULL)
@@ -150,7 +138,8 @@ change_filesystem_label_callback (GduDevice *device,
 }
 
 static void
-modify_fslabel_callback (GtkAction *action, gpointer user_data)
+on_change_clicked (GtkButton *button,
+                   gpointer   user_data)
 {
         GduSectionFilesystem *section = GDU_SECTION_FILESYSTEM (user_data);
         GduDevice *device;
@@ -177,10 +166,6 @@ out:
 static void
 gdu_section_filesystem_finalize (GduSectionFilesystem *section)
 {
-        polkit_action_unref (section->priv->pk_change_action);
-        polkit_action_unref (section->priv->pk_change_system_internal_action);
-        g_object_unref (section->priv->modify_fslabel_action);
-
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -214,24 +199,6 @@ gdu_section_filesystem_init (GduSectionFilesystem *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_FILESYSTEM, GduSectionFilesystemPrivate);
 
-        section->priv->pk_change_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_action,
-                                     "org.freedesktop.devicekit.disks.change");
-        section->priv->pk_change_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.change-system-internal");
-        section->priv->modify_fslabel_action = polkit_gnome_action_new_default (
-                "modify-fslabel",
-                section->priv->pk_change_action,
-                _("Ch_ange"),
-                _("Change"));
-        g_object_set (section->priv->modify_fslabel_action,
-                      "auth-label", _("Ch_ange..."),
-                      NULL);
-        g_signal_connect (section->priv->modify_fslabel_action, "activate",
-                          G_CALLBACK (modify_fslabel_callback), section);
-
-
         vbox3 = gtk_vbox_new (FALSE, 0);
         gtk_box_pack_start (GTK_BOX (section), vbox3, FALSE, TRUE, 0);
         section->priv->modify_fs_vbox = vbox3;
@@ -275,7 +242,10 @@ gdu_section_filesystem_init (GduSectionFilesystem *section)
         gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
         section->priv->modify_fs_label_entry = entry;
 
-        button = polkit_gnome_action_create_button (section->priv->modify_fslabel_action);
+        button = gtk_button_new_with_mnemonic ("_Change");
+        gtk_widget_set_tooltip_text (button, _("Change"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_change_clicked), section);
+        section->priv->modify_button = button;
         gtk_table_attach (GTK_TABLE (table), button, 2, 3, row, row + 1,
                           GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
 
diff --git a/src/palimpsest/gdu-section-health.c b/src/palimpsest/gdu-section-health.c
index 8073a20..cfd7b64 100644
--- a/src/palimpsest/gdu-section-health.c
+++ b/src/palimpsest/gdu-section-health.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include <gdu-gtk/gdu-gtk.h>
@@ -40,13 +39,6 @@ struct _GduSectionHealthPrivate
         GtkWidget *health_power_on_hours_label;
         GtkWidget *health_temperature_label;
         GtkWidget *health_updated_label;
-
-        PolKitAction *pk_smart_refresh_action;
-        PolKitAction *pk_smart_retrieve_historical_data_action;
-        PolKitAction *pk_smart_selftest_action;
-        PolKitGnomeAction *health_refresh_action;
-        PolKitGnomeAction *health_details_action;
-        PolKitGnomeAction *health_selftest_action;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -117,9 +109,6 @@ smart_data_set_pending (GduSectionHealth *section)
         gtk_label_set_text (GTK_LABEL (section->priv->health_updated_label), "-");
         gtk_label_set_markup (GTK_LABEL (section->priv->health_last_self_test_result_label), "-");
 
-        polkit_gnome_action_set_sensitive (section->priv->health_refresh_action, FALSE);
-        polkit_gnome_action_set_sensitive (section->priv->health_details_action, FALSE);
-        polkit_gnome_action_set_sensitive (section->priv->health_selftest_action, FALSE);
         gtk_widget_hide (section->priv->health_status_explanation_label);
 }
 
@@ -139,9 +128,6 @@ smart_data_set_not_supported (GduSectionHealth *section)
         gtk_label_set_text (GTK_LABEL (section->priv->health_updated_label), "-");
         gtk_label_set_markup (GTK_LABEL (section->priv->health_last_self_test_result_label), "-");
 
-        polkit_gnome_action_set_sensitive (section->priv->health_refresh_action, FALSE);
-        polkit_gnome_action_set_sensitive (section->priv->health_details_action, FALSE);
-        polkit_gnome_action_set_sensitive (section->priv->health_selftest_action, FALSE);
         gtk_widget_hide (section->priv->health_status_explanation_label);
 }
 
@@ -205,9 +191,6 @@ smart_data_set (GduSectionHealth *section)
         has_bad_sectors = gdu_device_drive_ata_smart_get_has_bad_sectors (device);
         has_bad_attributes = gdu_device_drive_ata_smart_get_has_bad_attributes (device);
 
-        polkit_gnome_action_set_sensitive (section->priv->health_refresh_action, TRUE);
-        polkit_gnome_action_set_sensitive (section->priv->health_details_action, TRUE);
-        polkit_gnome_action_set_sensitive (section->priv->health_selftest_action, TRUE);
         gtk_widget_show (section->priv->health_status_image);
 
         explanation = NULL;
@@ -374,7 +357,7 @@ out:
 }
 
 static void
-health_refresh_action_callback (GtkAction *action, gpointer user_data)
+on_refresh_clicked (GtkButton *button, gpointer user_data)
 {
         GduSectionHealth *section = GDU_SECTION_HEALTH (user_data);
         GduDevice *device;
@@ -916,7 +899,8 @@ smart_attr_tree_selection_changed (GtkTreeSelection *treeselection, gpointer use
 }
 
 static void
-health_details_action_callback (GtkAction *action, gpointer user_data)
+on_details_clicked (GtkButton *button,
+                    gpointer   user_data)
 {
         GduSectionHealth *section = GDU_SECTION_HEALTH (user_data);
         GduDevice *device;
@@ -1291,7 +1275,8 @@ run_ata_smart_selftest_callback (GduDevice *device,
 }
 
 static void
-health_selftest_action_callback (GtkAction *action, gpointer user_data)
+on_selftest_clicked (GtkButton *button,
+                     gpointer   user_data)
 {
         int response;
         GtkWidget *dialog;
@@ -1436,12 +1421,6 @@ out:
 static void
 gdu_section_health_finalize (GduSectionHealth *section)
 {
-        polkit_action_unref (section->priv->pk_smart_refresh_action);
-        polkit_action_unref (section->priv->pk_smart_retrieve_historical_data_action);
-        polkit_action_unref (section->priv->pk_smart_selftest_action);
-        g_object_unref (section->priv->health_refresh_action);
-        g_object_unref (section->priv->health_details_action);
-        g_object_unref (section->priv->health_selftest_action);
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -1476,18 +1455,6 @@ gdu_section_health_init (GduSectionHealth *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_HEALTH, GduSectionHealthPrivate);
 
-        section->priv->pk_smart_refresh_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_smart_refresh_action,
-                                     "org.freedesktop.devicekit.disks.drive-ata-smart-refresh");
-
-        section->priv->pk_smart_retrieve_historical_data_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_smart_retrieve_historical_data_action,
-                                     "org.freedesktop.devicekit.disks.drive-ata-smart-retrieve-historical-data");
-
-        section->priv->pk_smart_selftest_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_smart_selftest_action,
-                                     "org.freedesktop.devicekit.disks.drive-ata-smart-selftest");
-
         label = gtk_label_new (NULL);
         s = g_strconcat ("<b>", _("Health"), "</b>", NULL);
         gtk_label_set_markup (GTK_LABEL (label), s);
@@ -1624,55 +1591,19 @@ gdu_section_health_init (GduSectionHealth *section)
         gtk_box_set_spacing (GTK_BOX (button_box), 6);
         gtk_box_pack_start (GTK_BOX (vbox2), button_box, TRUE, TRUE, 0);
 
-        section->priv->health_refresh_action = polkit_gnome_action_new_default (
-                "refresh",
-                section->priv->pk_smart_refresh_action,
-                _("Refre_sh"),
-                _("Refresh ATA SMART data from the device"));
-        g_object_set (section->priv->health_refresh_action,
-                      "auth-label", _("Refre_sh..."),
-                      "yes-icon-name", GTK_STOCK_REFRESH,
-                      "no-icon-name", GTK_STOCK_REFRESH,
-                      "auth-icon-name", GTK_STOCK_REFRESH,
-                      "self-blocked-icon-name", GTK_STOCK_REFRESH,
-                      NULL);
-        g_signal_connect (section->priv->health_refresh_action,
-                          "activate", G_CALLBACK (health_refresh_action_callback), section);
-        button = polkit_gnome_action_create_button (section->priv->health_refresh_action);
+        button = gtk_button_new_with_mnemonic ("Refre_sh");
+        gtk_widget_set_tooltip_text (button, _("Refresh ATA SMART data from the device"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_refresh_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
-        section->priv->health_details_action = polkit_gnome_action_new_default (
-                "details",
-                section->priv->pk_smart_retrieve_historical_data_action,
-                _("_Details..."),
-                _("Show ATA SMART Historical Data"));
-        g_object_set (section->priv->health_details_action,
-                      "auth-label", _("_Details..."),
-                      "yes-icon-name", GTK_STOCK_DIALOG_INFO,
-                      "no-icon-name", GTK_STOCK_DIALOG_INFO,
-                      "auth-icon-name", GTK_STOCK_DIALOG_INFO,
-                      "self-blocked-icon-name", GTK_STOCK_DIALOG_INFO,
-                      NULL);
-        g_signal_connect (section->priv->health_details_action,
-                          "activate", G_CALLBACK (health_details_action_callback), section);
-        button = polkit_gnome_action_create_button (section->priv->health_details_action);
+        button = gtk_button_new_with_mnemonic ("_Details");
+        gtk_widget_set_tooltip_text (button, _("Show ATA SMART Historical Data"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_details_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
-        section->priv->health_selftest_action = polkit_gnome_action_new_default (
-                "selftest",
-                section->priv->pk_smart_selftest_action,
-                _("Se_lf Test..."),
-                _("Run an ATA SMART Self Test"));
-        g_object_set (section->priv->health_selftest_action,
-                      "auth-label", _("Se_lf Test..."),
-                      "yes-icon-name", GTK_STOCK_EXECUTE,
-                      "no-icon-name", GTK_STOCK_EXECUTE,
-                      "auth-icon-name", GTK_STOCK_EXECUTE,
-                      "self-blocked-icon-name", GTK_STOCK_EXECUTE,
-                      NULL);
-        g_signal_connect (section->priv->health_selftest_action,
-                          "activate", G_CALLBACK (health_selftest_action_callback), section);
-        button = polkit_gnome_action_create_button (section->priv->health_selftest_action);
+        button = gtk_button_new_with_mnemonic ("Se_lftest");
+        gtk_widget_set_tooltip_text (button, _("Run an ATA SMART self test on the disk"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_selftest_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 }
 
diff --git a/src/palimpsest/gdu-section-job.c b/src/palimpsest/gdu-section-job.c
index 20a601e..3acfaf1 100644
--- a/src/palimpsest/gdu-section-job.c
+++ b/src/palimpsest/gdu-section-job.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include "gdu-section-job.h"
@@ -34,9 +33,7 @@ struct _GduSectionJobPrivate
 {
         GtkWidget *job_description_label;
         GtkWidget *job_progress_bar;
-
-        PolKitAction *pk_cancel_job_others_action;
-        PolKitGnomeAction *cancel_action;
+        GtkWidget *cancel_button;
 
         guint job_progress_pulse_timer_id;
 };
@@ -58,7 +55,8 @@ job_progress_pulse_timeout_handler (gpointer user_data)
 
 
 static void
-cancel_action_callback (GtkAction *action, gpointer user_data)
+on_cancel_clicked (GtkButton *button,
+                   gpointer   user_data)
 {
         GduDevice *device;
         GduSectionJob *section = GDU_SECTION_JOB (user_data);
@@ -79,18 +77,8 @@ job_update (GduSectionJob *section, GduDevice *device)
         double percentage;
 
         if (device != NULL && gdu_device_job_in_progress (device)) {
-                PolKitAction *pk_action;
-
                 job_initiator = gdu_device_job_get_initiated_by_uid (device);
 
-                pk_action = NULL;
-                if (job_initiator != getuid ())
-                        pk_action = section->priv->pk_cancel_job_others_action;
-                g_object_set (section->priv->cancel_action,
-                              "polkit-action",
-                              pk_action,
-                              NULL);
-
                 job_description = gdu_get_job_description (gdu_device_job_get_id (device));
 
                 s = g_strdup_printf ("<b>%s</b>", job_description);
@@ -118,8 +106,8 @@ job_update (GduSectionJob *section, GduDevice *device)
 
                 g_free (job_description);
 
-                polkit_gnome_action_set_sensitive (section->priv->cancel_action,
-                                                   gdu_device_job_is_cancellable (device));
+                gtk_widget_set_sensitive (section->priv->cancel_button,
+                                          gdu_device_job_is_cancellable (device));
         } else {
                 if (section->priv->job_progress_pulse_timer_id > 0) {
                         g_source_remove (section->priv->job_progress_pulse_timer_id);
@@ -160,8 +148,6 @@ out:
 static void
 gdu_section_job_finalize (GduSectionJob *section)
 {
-        polkit_action_unref (section->priv->pk_cancel_job_others_action);
-
         if (section->priv->job_progress_pulse_timer_id > 0) {
                 g_source_remove (section->priv->job_progress_pulse_timer_id);
         }
@@ -197,10 +183,6 @@ gdu_section_job_init (GduSectionJob *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_JOB, GduSectionJobPrivate);
 
-        section->priv->pk_cancel_job_others_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_cancel_job_others_action,
-                                     "org.freedesktop.devicekit.disks.cancel-job-others");
-
         /* job progress section */
         vbox = gtk_vbox_new (FALSE, 5);
 
@@ -222,21 +204,10 @@ gdu_section_job_init (GduSectionJob *section)
         gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
         gtk_box_set_spacing (GTK_BOX (button_box), 6);
 
-        section->priv->cancel_action = polkit_gnome_action_new_default (
-                "cancel",
-                NULL,
-                _("_Cancel"),
-                _("Cancel Job"));
-        g_object_set (section->priv->cancel_action,
-                      "auth-label", _("_Cancel..."),
-                      "yes-icon-name", GTK_STOCK_CANCEL,
-                      "no-icon-name", GTK_STOCK_CANCEL,
-                      "auth-icon-name", GTK_STOCK_CANCEL,
-                      "self-blocked-icon-name", GTK_STOCK_CANCEL,
-                      NULL);
-        g_signal_connect (section->priv->cancel_action, "activate", G_CALLBACK (cancel_action_callback), section);
-
-        button = polkit_gnome_action_create_button (section->priv->cancel_action);
+        button = gtk_button_new_with_mnemonic (_("_Cancel"));
+        gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));
+        section->priv->cancel_button = button;
+        g_signal_connect (button, "clicked", G_CALLBACK (on_cancel_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
         gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
diff --git a/src/palimpsest/gdu-section-linux-md-drive.c b/src/palimpsest/gdu-section-linux-md-drive.c
index 2d16ca8..4d0f943 100644
--- a/src/palimpsest/gdu-section-linux-md-drive.c
+++ b/src/palimpsest/gdu-section-linux-md-drive.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include <gdu-gtk/gdu-gtk.h>
@@ -43,17 +42,10 @@ struct _GduSectionLinuxMdDrivePrivate
         GtkWidget *linux_md_state_label;
         GtkWidget *linux_md_tree_view;
         GtkTreeStore *linux_md_tree_store;
-#if 0
-        GtkWidget *linux_md_add_to_array_button;
-        GtkWidget *linux_md_remove_from_array_button;
-        GtkWidget *linux_md_add_new_to_array_button;
-#endif
 
-        PolKitAction *pk_linux_md_action;
-
-        PolKitGnomeAction *attach_action;
-        PolKitGnomeAction *detach_action;
-        PolKitGnomeAction *add_action;
+        GtkWidget *attach_button;
+        GtkWidget *detach_button;
+        GtkWidget *add_button;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -87,7 +79,8 @@ add_component_callback (GduDevice *device,
 }
 
 static void
-add_action_callback (GtkAction *action, gpointer user_data)
+on_add_clicked (GtkButton *button,
+                gpointer   user_data)
 {
         GduSectionLinuxMdDrive *section = GDU_SECTION_LINUX_MD_DRIVE (user_data);
         GduPresentable *presentable;
@@ -228,7 +221,8 @@ out:
 }
 
 static void
-attach_action_callback (GtkAction *action, gpointer user_data)
+on_attach_clicked (GtkButton *button,
+                   gpointer   user_data)
 {
         GtkTreePath *path;
         GduSectionLinuxMdDrive *section = GDU_SECTION_LINUX_MD_DRIVE (user_data);
@@ -322,7 +316,8 @@ remove_component_callback (GduDevice *device,
 }
 
 static void
-detach_action_callback (GtkAction *action, gpointer user_data)
+on_detach_clicked (GtkButton *button,
+                   gpointer   user_data)
 {
         GtkTreePath *path;
         GduSectionLinuxMdDrive *section = GDU_SECTION_LINUX_MD_DRIVE (user_data);
@@ -518,9 +513,9 @@ linux_md_buttons_update (GduSectionLinuxMdDrive *section)
         }
 
 out:
-        polkit_gnome_action_set_sensitive (section->priv->attach_action, show_attach_to_array_button);
-        polkit_gnome_action_set_sensitive (section->priv->detach_action, show_detach_from_array_button);
-        polkit_gnome_action_set_sensitive (section->priv->add_action, show_add_new_to_array_button);
+        gtk_widget_set_sensitive (section->priv->attach_button, show_attach_to_array_button);
+        gtk_widget_set_sensitive (section->priv->detach_button, show_detach_from_array_button);
+        gtk_widget_set_sensitive (section->priv->add_button, show_add_new_to_array_button);
 
         g_free (component_objpath);
         if (device != NULL)
@@ -847,10 +842,6 @@ out:
 static void
 gdu_section_linux_md_drive_finalize (GduSectionLinuxMdDrive *section)
 {
-        polkit_action_unref (section->priv->pk_linux_md_action);
-        g_object_unref (section->priv->attach_action);
-        g_object_unref (section->priv->detach_action);
-        g_object_unref (section->priv->add_action);
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -878,6 +869,7 @@ gdu_section_linux_md_drive_init (GduSectionLinuxMdDrive *section)
         GtkWidget *button_box;
         GtkWidget *scrolled_window;
         GtkWidget *tree_view;
+        GtkWidget *button;
         GtkTreeSelection *selection;
         GtkCellRenderer *renderer;
         GtkTreeViewColumn *column;
@@ -885,10 +877,6 @@ gdu_section_linux_md_drive_init (GduSectionLinuxMdDrive *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_LINUX_MD_DRIVE, GduSectionLinuxMdDrivePrivate);
 
-        section->priv->pk_linux_md_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_linux_md_action,
-                                     "org.freedesktop.devicekit.disks.linux-md");
-
         gtk_box_set_spacing (GTK_BOX (section), 8);
 
         table = gtk_table_new (4, 2, FALSE);
@@ -1010,66 +998,12 @@ gdu_section_linux_md_drive_init (GduSectionLinuxMdDrive *section)
         gtk_box_set_homogeneous (GTK_BOX (button_box), FALSE);
         gtk_box_pack_start (GTK_BOX (section), button_box, FALSE, FALSE, 0);
 
-        section->priv->attach_action = polkit_gnome_action_new_default (
-                "attach",
-                section->priv->pk_linux_md_action,
-                _("A_ttach"),
-                _("Attaches the stale component to the RAID array. "
-                  "After attachment, data from the array will be "
-                  "synchronized on the component."));
-        g_object_set (section->priv->attach_action,
-                      "auth-label", _("A_ttach..."),
-                      "yes-icon-name", GTK_STOCK_ADD,
-                      "no-icon-name", GTK_STOCK_ADD,
-                      "auth-icon-name", GTK_STOCK_ADD,
-                      "self-blocked-icon-name", GTK_STOCK_ADD,
-                      NULL);
-        g_signal_connect (section->priv->attach_action, "activate", G_CALLBACK (attach_action_callback), section);
-        gtk_container_add (GTK_CONTAINER (button_box),
-                           polkit_gnome_action_create_button (section->priv->attach_action));
-
-        section->priv->detach_action = polkit_gnome_action_new_default (
-                "detach",
-                section->priv->pk_linux_md_action,
-                _("_Detach"),
-                _("Detaches the running component from the RAID array. Data on "
-                  "the component will be erased and the volume will be ready "
-                  "for other use."));
-        g_object_set (section->priv->detach_action,
-                      "auth-label", _("_Detach..."),
-                      "yes-icon-name", GTK_STOCK_REMOVE,
-                      "no-icon-name", GTK_STOCK_REMOVE,
-                      "auth-icon-name", GTK_STOCK_REMOVE,
-                      "self-blocked-icon-name", GTK_STOCK_REMOVE,
-                      NULL);
-        g_signal_connect (section->priv->detach_action, "activate", G_CALLBACK (detach_action_callback), section);
-        gtk_container_add (GTK_CONTAINER (button_box),
-                           polkit_gnome_action_create_button (section->priv->detach_action));
-
-        section->priv->add_action = polkit_gnome_action_new_default (
-                "add",
-                section->priv->pk_linux_md_action,
-                _("_Add..."),
-                _("Adds a new component to the running RAID array. Use this "
-                  "when replacing a failed component or adding a hot spare."));
-        g_object_set (section->priv->add_action,
-                      "auth-label", _("_Add..."),
-                      "yes-icon-name", GTK_STOCK_NEW,
-                      "no-icon-name", GTK_STOCK_NEW,
-                      "auth-icon-name", GTK_STOCK_NEW,
-                      "self-blocked-icon-name", GTK_STOCK_NEW,
-                      NULL);
-        g_signal_connect (section->priv->add_action, "activate", G_CALLBACK (add_action_callback), section);
-        gtk_container_add (GTK_CONTAINER (button_box),
-                           polkit_gnome_action_create_button (section->priv->add_action));
-
-#if 0
         button = gtk_button_new_with_mnemonic (_("A_ttach"));
         gtk_button_set_image (GTK_BUTTON (button),
                               gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON));
         gtk_container_add (GTK_CONTAINER (button_box), button);
-        section->priv->linux_md_add_to_array_button = button;
-        g_signal_connect (button, "clicked", G_CALLBACK (add_to_array_button_clicked), section);
+        section->priv->attach_button = button;
+        g_signal_connect (button, "clicked", G_CALLBACK (on_attach_clicked), section);
         gtk_widget_set_tooltip_text (button, _("Attaches the stale component to the RAID array. "
                                                "After attachment, data from the array will be "
                                                "synchronized on the component."));
@@ -1078,21 +1012,20 @@ gdu_section_linux_md_drive_init (GduSectionLinuxMdDrive *section)
         gtk_button_set_image (GTK_BUTTON (button),
                               gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON));
         gtk_container_add (GTK_CONTAINER (button_box), button);
-        section->priv->linux_md_remove_from_array_button = button;
-        g_signal_connect (button, "clicked", G_CALLBACK (remove_from_array_button_clicked), section);
+        section->priv->detach_button = button;
+        g_signal_connect (button, "clicked", G_CALLBACK (on_detach_clicked), section);
         gtk_widget_set_tooltip_text (button, _("Detaches the running component from the RAID array. Data on "
-                                               "the component will be erased and the volume will be ready "
+                                               "the component will be erased and the component will be ready "
                                                "for other use."));
 
         button = gtk_button_new_with_mnemonic (_("_Add..."));
         gtk_button_set_image (GTK_BUTTON (button),
                               gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_BUTTON));
         gtk_container_add (GTK_CONTAINER (button_box), button);
-        section->priv->linux_md_add_new_to_array_button = button;
-        g_signal_connect (button, "clicked", G_CALLBACK (add_new_to_array_button_clicked), section);
+        section->priv->add_button = button;
+        g_signal_connect (button, "clicked", G_CALLBACK (on_add_clicked), section);
         gtk_widget_set_tooltip_text (button, _("Adds a new component to the running RAID array. Use this "
                                                "when replacing a failed component or adding a hot spare."));
-#endif
 
         /* add renderers for tree view */
         column = gtk_tree_view_column_new ();
diff --git a/src/palimpsest/gdu-section-partition.c b/src/palimpsest/gdu-section-partition.c
index a860c22..b8b33a1 100644
--- a/src/palimpsest/gdu-section-partition.c
+++ b/src/palimpsest/gdu-section-partition.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include <gdu-gtk/gdu-gtk.h>
@@ -39,11 +38,7 @@ struct _GduSectionPartitionPrivate
         GtkWidget *modify_part_flag_boot_check_button;
         GtkWidget *modify_part_flag_required_check_button;
         GtkWidget *modify_part_revert_button;
-
-        PolKitAction *pk_change_action;
-        PolKitAction *pk_change_system_internal_action;
-        PolKitGnomeAction *modify_partition_action;
-        PolKitGnomeAction *delete_partition_action;
+        GtkWidget *modify_part_apply_button;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -68,7 +63,8 @@ op_delete_partition_callback (GduDevice *device,
 }
 
 static void
-delete_partition_callback (GtkAction *action, gpointer user_data)
+on_delete_partition_clicked (GtkButton *button,
+                             gpointer   user_data)
 {
         GduSectionPartition *section = GDU_SECTION_PARTITION (user_data);
         GduDevice *device;
@@ -284,10 +280,10 @@ modify_part_update_revert_apply_sensitivity (GduSectionPartition *section)
 
         if (label_differ || type_differ || flags_differ) {
                 gtk_widget_set_sensitive (section->priv->modify_part_revert_button, TRUE);
-                polkit_gnome_action_set_sensitive (section->priv->modify_partition_action, TRUE);
+                gtk_widget_set_sensitive (section->priv->modify_part_apply_button, TRUE);
         } else {
                 gtk_widget_set_sensitive (section->priv->modify_part_revert_button, FALSE);
-                polkit_gnome_action_set_sensitive (section->priv->modify_partition_action, FALSE);
+                gtk_widget_set_sensitive (section->priv->modify_part_apply_button, FALSE);
         }
 
 
@@ -313,20 +309,6 @@ update_partition_section (GduSectionPartition *section)
                 goto out;
         }
 
-        g_object_set (section->priv->modify_partition_action,
-                      "polkit-action",
-                      gdu_device_is_system_internal (device) ?
-                        section->priv->pk_change_system_internal_action :
-                        section->priv->pk_change_action,
-                      NULL);
-
-        g_object_set (section->priv->delete_partition_action,
-                      "polkit-action",
-                      gdu_device_is_system_internal (device) ?
-                        section->priv->pk_change_system_internal_action :
-                        section->priv->pk_change_action,
-                      NULL);
-
         size = gdu_device_partition_get_size (device);
         scheme = gdu_device_partition_get_scheme (device);
 
@@ -428,7 +410,8 @@ op_modify_partition_callback (GduDevice *device,
 }
 
 static void
-modify_partition_callback (GtkAction *action, gpointer user_data)
+on_modify_partition_apply_clicked (GtkButton *button,
+                                   gpointer   user_data)
 {
         GduSectionPartition *section = GDU_SECTION_PARTITION (user_data);
         GduDevice *device;
@@ -506,11 +489,6 @@ update (GduSectionPartition *section)
 static void
 gdu_section_partition_finalize (GduSectionPartition *section)
 {
-        polkit_action_unref (section->priv->pk_change_action);
-        polkit_action_unref (section->priv->pk_change_system_internal_action);
-        g_object_unref (section->priv->delete_partition_action);
-        g_object_unref (section->priv->modify_partition_action);
-
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -546,44 +524,6 @@ gdu_section_partition_init (GduSectionPartition *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_PARTITION, GduSectionPartitionPrivate);
 
-        section->priv->pk_change_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_action,
-                                     "org.freedesktop.devicekit.disks.change");
-        section->priv->pk_change_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.change-system-internal");
-
-        section->priv->delete_partition_action = polkit_gnome_action_new_default (
-                "delete-partition",
-                section->priv->pk_change_action,
-                _("_Delete"),
-                _("Delete"));
-        g_object_set (section->priv->delete_partition_action,
-                      "auth-label", _("_Delete..."),
-                      "yes-icon-name", GTK_STOCK_DELETE,
-                      "no-icon-name", GTK_STOCK_DELETE,
-                      "auth-icon-name", GTK_STOCK_DELETE,
-                      "self-blocked-icon-name", GTK_STOCK_DELETE,
-                      NULL);
-        g_signal_connect (section->priv->delete_partition_action, "activate",
-                          G_CALLBACK (delete_partition_callback), section);
-
-        section->priv->modify_partition_action = polkit_gnome_action_new_default (
-                "modify-partition",
-                section->priv->pk_change_action,
-                _("_Apply"),
-                _("Apply"));
-        g_object_set (section->priv->modify_partition_action,
-                      "auth-label", _("_Apply..."),
-                      "yes-icon-name", GTK_STOCK_APPLY,
-                      "no-icon-name", GTK_STOCK_APPLY,
-                      "auth-icon-name", GTK_STOCK_APPLY,
-                      "self-blocked-icon-name", GTK_STOCK_APPLY,
-                      NULL);
-        g_signal_connect (section->priv->modify_partition_action, "activate",
-                          G_CALLBACK (modify_partition_callback), section);
-
-
         label = gtk_label_new (NULL);
         s = g_strconcat ("<b>", _("Partition"), "</b>", NULL);
         gtk_label_set_markup (GTK_LABEL (label), s);
@@ -662,14 +602,19 @@ gdu_section_partition_init (GduSectionPartition *section)
         gtk_box_set_spacing (GTK_BOX (button_box), 6);
         gtk_box_pack_start (GTK_BOX (vbox2), button_box, TRUE, TRUE, 0);
 
-        button = polkit_gnome_action_create_button (section->priv->delete_partition_action);
+        button = gtk_button_new_with_mnemonic ("_Delete");
+        gtk_widget_set_tooltip_text (button, _("Delete the partition"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_delete_partition_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
         button = gtk_button_new_with_mnemonic (_("_Revert"));
         section->priv->modify_part_revert_button = button;
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
-        button = polkit_gnome_action_create_button (section->priv->modify_partition_action);
+        button = gtk_button_new_with_mnemonic ("_Apply");
+        gtk_widget_set_tooltip_text (button, _("Apply the changes made"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_modify_partition_apply_clicked), section);
+        section->priv->modify_part_apply_button = button;
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
         g_signal_connect (section->priv->modify_part_type_combo_box, "changed",
diff --git a/src/palimpsest/gdu-section-swapspace.c b/src/palimpsest/gdu-section-swapspace.c
index 28b91c4..8137051 100644
--- a/src/palimpsest/gdu-section-swapspace.c
+++ b/src/palimpsest/gdu-section-swapspace.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include "gdu-section-swapspace.h"
diff --git a/src/palimpsest/gdu-section-unallocated.c b/src/palimpsest/gdu-section-unallocated.c
index 0bd8ea6..aa50339 100644
--- a/src/palimpsest/gdu-section-unallocated.c
+++ b/src/palimpsest/gdu-section-unallocated.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include <gdu-gtk/gdu-gtk.h>
@@ -46,10 +45,6 @@ struct _GduSectionUnallocatedPrivate
         GtkWidget *warning_label;
         GtkWidget *encrypt_check_button;
         GtkWidget *take_ownership_of_fs_check_button;
-
-        PolKitAction *pk_change_action;
-        PolKitAction *pk_change_system_internal_action;
-        PolKitGnomeAction *create_partition_action;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -132,7 +127,8 @@ create_partition_completed (GduDevice  *device,
 }
 
 static void
-create_partition_callback (GtkAction *action, gpointer user_data)
+on_create_clicked (GtkButton *button,
+                   gpointer   user_data)
 {
         GduSectionUnallocated *section = GDU_SECTION_UNALLOCATED (user_data);
         GduPresentable *presentable;
@@ -475,13 +471,6 @@ update (GduSectionUnallocated *section)
 
         pool = gdu_shell_get_pool (gdu_section_get_shell (GDU_SECTION (section)));
 
-        g_object_set (section->priv->create_partition_action,
-                      "polkit-action",
-                      gdu_device_is_system_internal (toplevel_device) ?
-                        section->priv->pk_change_system_internal_action :
-                        section->priv->pk_change_action,
-                      NULL);
-
         scheme = gdu_device_partition_table_get_scheme (toplevel_device);
 
         at_max_partitions = update_warning (section);
@@ -555,10 +544,6 @@ size_spin_button_value_changed_callback (GtkSpinButton *spin_button,
 static void
 gdu_section_unallocated_finalize (GduSectionUnallocated *section)
 {
-        polkit_action_unref (section->priv->pk_change_action);
-        polkit_action_unref (section->priv->pk_change_system_internal_action);
-        g_object_unref (section->priv->create_partition_action);
-
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -600,27 +585,6 @@ gdu_section_unallocated_init (GduSectionUnallocated *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_UNALLOCATED, GduSectionUnallocatedPrivate);
 
-        section->priv->pk_change_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_action,
-                                     "org.freedesktop.devicekit.disks.change");
-        section->priv->pk_change_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.change-system-internal");
-        section->priv->create_partition_action = polkit_gnome_action_new_default (
-                "create-partition",
-                section->priv->pk_change_action,
-                _("_Create"),
-                _("Create"));
-        g_object_set (section->priv->create_partition_action,
-                      "auth-label", _("_Create..."),
-                      "yes-icon-name", GTK_STOCK_ADD,
-                      "no-icon-name", GTK_STOCK_ADD,
-                      "auth-icon-name", GTK_STOCK_ADD,
-                      "self-blocked-icon-name", GTK_STOCK_ADD,
-                      NULL);
-        g_signal_connect (section->priv->create_partition_action, "activate",
-                          G_CALLBACK (create_partition_callback), section);
-
         vbox = gtk_vbox_new (FALSE, 10);
 
         /* ---------------- */
@@ -763,7 +727,10 @@ gdu_section_unallocated_init (GduSectionUnallocated *section)
         gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_START);
         gtk_box_set_spacing (GTK_BOX (button_box), 6);
         gtk_box_pack_start (GTK_BOX (vbox2), button_box, TRUE, TRUE, 0);
-        button = polkit_gnome_action_create_button (section->priv->create_partition_action);
+
+        button = gtk_button_new_with_mnemonic ("_Create");
+        gtk_widget_set_tooltip_text (button, _("Create partition"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_create_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
 
         /* update sensivity and length of fs label and ensure it's set initially */
diff --git a/src/palimpsest/gdu-section-unrecognized.c b/src/palimpsest/gdu-section-unrecognized.c
index c2a9303..6d2fb28 100644
--- a/src/palimpsest/gdu-section-unrecognized.c
+++ b/src/palimpsest/gdu-section-unrecognized.c
@@ -25,7 +25,6 @@
 #include <dbus/dbus-glib.h>
 #include <stdlib.h>
 #include <math.h>
-#include <polkit-gnome/polkit-gnome.h>
 
 #include <gdu/gdu.h>
 #include <gdu-gtk/gdu-gtk.h>
@@ -40,10 +39,6 @@ struct _GduSectionUnrecognizedPrivate
         GtkWidget *type_combo_box;
         GtkWidget *encrypt_check_button;
         GtkWidget *take_ownership_of_fs_check_button;
-
-        PolKitAction *pk_change_action;
-        PolKitAction *pk_change_system_internal_action;
-        PolKitGnomeAction *erase_action;
 };
 
 static GObjectClass *parent_class = NULL;
@@ -108,7 +103,6 @@ section_volume_unrecognized_type_combo_box_changed (GtkWidget *combo_box, gpoint
 
         gtk_entry_set_max_length (GTK_ENTRY (section->priv->label_entry), max_label_len);
         gtk_widget_set_sensitive (section->priv->label_entry, label_entry_sensitive);
-        polkit_gnome_action_set_sensitive (section->priv->erase_action, can_erase);
 
         if (have_owners)
                 gtk_widget_show (section->priv->take_ownership_of_fs_check_button);
@@ -170,7 +164,8 @@ erase_action_completed (GduDevice  *device,
 }
 
 static void
-erase_action_callback (GtkAction *action, gpointer user_data)
+on_erase_clicked (GtkButton *button,
+                  gpointer   user_data)
 {
         GduSectionUnrecognized *section = GDU_SECTION_UNRECOGNIZED (user_data);
         char *fslabel;
@@ -329,13 +324,6 @@ update (GduSectionUnrecognized *section)
 
         pool = gdu_shell_get_pool (gdu_section_get_shell (GDU_SECTION (section)));
 
-        g_object_set (section->priv->erase_action,
-                      "polkit-action",
-                      gdu_device_is_system_internal (device) ?
-                        section->priv->pk_change_system_internal_action :
-                        section->priv->pk_change_action,
-                      NULL);
-
         if (!section->priv->init_done) {
                 section->priv->init_done = TRUE;
 
@@ -365,10 +353,6 @@ out:
 static void
 gdu_section_unrecognized_finalize (GduSectionUnrecognized *section)
 {
-        polkit_action_unref (section->priv->pk_change_action);
-        polkit_action_unref (section->priv->pk_change_system_internal_action);
-        g_object_unref (section->priv->erase_action);
-
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (section));
 }
@@ -404,26 +388,6 @@ gdu_section_unrecognized_init (GduSectionUnrecognized *section)
 
         section->priv = G_TYPE_INSTANCE_GET_PRIVATE (section, GDU_TYPE_SECTION_UNRECOGNIZED, GduSectionUnrecognizedPrivate);
 
-        section->priv->pk_change_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_action,
-                                     "org.freedesktop.devicekit.disks.change");
-        section->priv->pk_change_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (section->priv->pk_change_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.change-system-internal");
-
-        section->priv->erase_action = polkit_gnome_action_new_default ("create",
-                                                                    section->priv->pk_change_action,
-                                                                    _("_Create"),
-                                                                    _("Create"));
-        g_object_set (section->priv->erase_action,
-                      "auth-label", _("_Create..."),
-                      "yes-icon-name", GTK_STOCK_ADD,
-                      "no-icon-name", GTK_STOCK_ADD,
-                      "auth-icon-name", GTK_STOCK_ADD,
-                      "self-blocked-icon-name", GTK_STOCK_ADD,
-                      NULL);
-        g_signal_connect (section->priv->erase_action, "activate", G_CALLBACK (erase_action_callback), section);
-
         // TODO:
         //gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->erase_action));
 
@@ -530,7 +494,9 @@ gdu_section_unrecognized_init (GduSectionUnrecognized *section)
         gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_START);
         gtk_box_set_spacing (GTK_BOX (button_box), 6);
 
-        button = polkit_gnome_action_create_button (section->priv->erase_action);
+        button = gtk_button_new_with_mnemonic ("_Create");
+        gtk_widget_set_tooltip_text (button, _("Create"));
+        g_signal_connect (button, "clicked", G_CALLBACK (on_erase_clicked), section);
         gtk_container_add (GTK_CONTAINER (button_box), button);
         gtk_box_pack_start (GTK_BOX (vbox), button_box, TRUE, TRUE, 0);
 }
diff --git a/src/palimpsest/gdu-shell.c b/src/palimpsest/gdu-shell.c
index 79cef08..0d2a46d 100644
--- a/src/palimpsest/gdu-shell.c
+++ b/src/palimpsest/gdu-shell.c
@@ -28,7 +28,6 @@
 #include <glib-object.h>
 #include <string.h>
 #include <glib/gi18n.h>
-#include <polkit-gnome/polkit-gnome.h>
 #include <libsexy/sexy.h>
 
 #include <gdu/gdu.h>
@@ -69,31 +68,6 @@ struct _GduShellPrivate
 
         /* -------------------------------------------------------------------------------- */
 
-        PolKitAction *pk_modify_action;
-        PolKitAction *pk_modify_system_internal_action;
-        PolKitAction *pk_fsck_action;
-        PolKitAction *pk_fsck_system_internal_action;
-        PolKitAction *pk_mount_action;
-        PolKitAction *pk_mount_system_internal_action;
-        PolKitAction *pk_unmount_others_action;
-        PolKitAction *pk_eject_action;
-        PolKitAction *pk_unlock_luks_action;
-        PolKitAction *pk_lock_luks_others_action;
-        PolKitAction *pk_linux_md_action;
-
-        PolKitGnomeAction *fsck_action;
-        PolKitGnomeAction *mount_action;
-        PolKitGnomeAction *unmount_action;
-        PolKitGnomeAction *eject_action;
-
-        PolKitGnomeAction *unlock_action;
-        PolKitGnomeAction *lock_action;
-
-        PolKitGnomeAction *start_action;
-        PolKitGnomeAction *stop_action;
-
-        PolKitGnomeAction *erase_action;
-
         GduPresentable *presentable_now_showing;
 
         GtkActionGroup *action_group;
@@ -107,17 +81,6 @@ G_DEFINE_TYPE (GduShell, gdu_shell, G_TYPE_OBJECT);
 static void
 gdu_shell_finalize (GduShell *shell)
 {
-        polkit_action_unref (shell->priv->pk_modify_action);
-        polkit_action_unref (shell->priv->pk_modify_system_internal_action);
-        polkit_action_unref (shell->priv->pk_fsck_action);
-        polkit_action_unref (shell->priv->pk_fsck_system_internal_action);
-        polkit_action_unref (shell->priv->pk_mount_action);
-        polkit_action_unref (shell->priv->pk_mount_system_internal_action);
-        polkit_action_unref (shell->priv->pk_unmount_others_action);
-        polkit_action_unref (shell->priv->pk_unlock_luks_action);
-        polkit_action_unref (shell->priv->pk_lock_luks_others_action);
-        polkit_action_unref (shell->priv->pk_linux_md_action);
-
         if (G_OBJECT_CLASS (parent_class)->finalize)
                 (* G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT (shell));
 }
@@ -702,6 +665,16 @@ gdu_shell_update (GduShell *shell)
                 can_start = gdu_drive_can_activate (drive, NULL);
         }
 
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "mount"), can_mount);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "unmount"), can_unmount);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "eject"), can_eject);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "fsck"), can_fsck);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "lock"), can_lock);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "unlock"), can_unlock);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "start"), can_start);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "stop"), can_stop);
+        gtk_action_set_sensitive (gtk_action_group_get_action (shell->priv->action_group, "erase"), can_erase);
+
         showing_job = job_in_progress;
 
         reset_sections =
@@ -767,111 +740,6 @@ gdu_shell_update (GduShell *shell)
                                update_section,
                                shell);
 
-        if (can_mount) {
-                if (device != NULL) {
-                        g_object_set (shell->priv->mount_action,
-                                      "polkit-action",
-                                      gdu_device_is_system_internal (device) ?
-                                      shell->priv->pk_mount_system_internal_action :
-                                      shell->priv->pk_mount_action,
-                                      NULL);
-                }
-        }
-
-        if (can_fsck) {
-                if (device != NULL) {
-                        g_object_set (shell->priv->fsck_action,
-                                      "polkit-action",
-                                      gdu_device_is_system_internal (device) ?
-                                      shell->priv->pk_fsck_system_internal_action :
-                                      shell->priv->pk_fsck_action,
-                                      NULL);
-                }
-        }
-
-        if (can_unmount) {
-                if (device != NULL) {
-                        PolKitAction *action;
-                        if (gdu_device_get_mounted_by_uid (device) == getuid ()) {
-                                action = NULL;
-                        } else {
-                                action = shell->priv->pk_unmount_others_action;
-                        }
-                        g_object_set (shell->priv->unmount_action,
-                                      "polkit-action",
-                                      action,
-                                      NULL);
-                }
-        }
-
-        if (can_eject) {
-                if (device != NULL) {
-                        g_object_set (shell->priv->eject_action,
-                                      "polkit-action",
-                                      shell->priv->pk_eject_action,
-                                      NULL);
-                }
-        }
-
-        if (can_lock) {
-                PolKitAction *action;
-                action = NULL;
-                if (unlocked_by_uid != getuid () && device != NULL) {
-                        action = shell->priv->pk_lock_luks_others_action;
-                }
-                g_object_set (shell->priv->lock_action,
-                              "polkit-action",
-                              action,
-                              NULL);
-        }
-
-        if (!gdu_pool_supports_luks_devices (shell->priv->pool)) {
-                polkit_gnome_action_set_visible (shell->priv->lock_action, FALSE);
-                polkit_gnome_action_set_visible (shell->priv->unlock_action, FALSE);
-        }
-
-        if (can_erase) {
-                if (device != NULL) {
-                        g_object_set (shell->priv->erase_action,
-                                      "polkit-action",
-                                      gdu_device_is_system_internal (device) ?
-                                      shell->priv->pk_modify_system_internal_action :
-                                      shell->priv->pk_modify_action,
-                                      NULL);
-                }
-        }
-
-        /* update all GtkActions */
-        polkit_gnome_action_set_sensitive (shell->priv->mount_action, can_mount);
-        polkit_gnome_action_set_sensitive (shell->priv->fsck_action, can_fsck);
-        polkit_gnome_action_set_sensitive (shell->priv->unmount_action, can_unmount);
-        polkit_gnome_action_set_sensitive (shell->priv->eject_action, can_eject);
-        polkit_gnome_action_set_sensitive (shell->priv->lock_action, can_lock);
-        polkit_gnome_action_set_sensitive (shell->priv->unlock_action, can_unlock);
-        polkit_gnome_action_set_sensitive (shell->priv->start_action, can_start);
-        polkit_gnome_action_set_sensitive (shell->priv->stop_action, can_stop);
-        polkit_gnome_action_set_sensitive (shell->priv->erase_action, can_erase);
-
-#if 0
-        /* TODO */
-        if (can_lock || can_unlock) {
-                g_warning ("a");
-                polkit_gnome_action_set_visible (shell->priv->mount_action, FALSE);
-                polkit_gnome_action_set_visible (shell->priv->unmount_action, FALSE);
-                polkit_gnome_action_set_visible (shell->priv->eject_action, FALSE);
-                polkit_gnome_action_set_visible (shell->priv->lock_action, TRUE);
-                polkit_gnome_action_set_visible (shell->priv->unlock_action, TRUE);
-        } else {
-                g_warning ("b");
-                polkit_gnome_action_set_visible (shell->priv->mount_action, TRUE);
-                polkit_gnome_action_set_visible (shell->priv->unmount_action, TRUE);
-                polkit_gnome_action_set_visible (shell->priv->eject_action, TRUE);
-                polkit_gnome_action_set_visible (shell->priv->lock_action, FALSE);
-                polkit_gnome_action_set_visible (shell->priv->unlock_action, FALSE);
-        }
-#endif
-
-
         details_update (shell);
 
         if (device != NULL)
@@ -1701,12 +1569,20 @@ static GtkActionEntry entries[] = {
         {"edit", NULL, N_("_Edit"), NULL, NULL, NULL },
         {"help", NULL, N_("_Help"), NULL, NULL, NULL },
 
-        {"quit", GTK_STOCK_QUIT, N_("_Quit"), "<Ctrl>Q", N_("Quit"),
-         G_CALLBACK (quit_action_callback)},
-        {"contents", GTK_STOCK_HELP, N_("_Help"), "F1", N_("Get Help on Palimpsest Disk Utility"),
-         G_CALLBACK (help_contents_action_callback)},
-        {"about", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL,
-         G_CALLBACK (about_action_callback)}
+        {"fsck", "gdu-check-disk", N_("_Check File System"), NULL, N_("Check the file system"), G_CALLBACK (fsck_action_callback)},
+        {"mount", "gdu-mount", N_("_Mount"), NULL, N_("Mount the filesystem on device"), G_CALLBACK (mount_action_callback)},
+        {"unmount", "gdu-unmount", N_("_Unmount"), NULL, N_("Unmount the filesystem"), G_CALLBACK (unmount_action_callback)},
+        {"eject", "gdu-eject", N_("_Eject"), NULL, N_("Eject media from the device"), G_CALLBACK (eject_action_callback)},
+        {"unlock", "gdu-encrypted-unlock", N_("_Unlock"), NULL, N_("Unlock the encrypted device, making the data available in cleartext"), G_CALLBACK (unlock_action_callback)},
+        {"lock", "gdu-encrypted-lock", N_("_Lock"), NULL, N_("Lock the encrypted device, making the cleartext data unavailable"), G_CALLBACK (lock_action_callback)},
+        {"start", "gdu-raid-array-start", N_("_Start"), NULL, N_("Start the array"), G_CALLBACK (start_action_callback)},
+        {"stop", "gdu-raid-array-stop", N_("_Stop"), NULL, N_("Stop the array"), G_CALLBACK (stop_action_callback)},
+        {"erase", "nautilus-gdu", N_("_Erase"), NULL, N_("Erase the contents of the device"), G_CALLBACK (erase_action_callback)},
+
+
+        {"quit", GTK_STOCK_QUIT, N_("_Quit"), "<Ctrl>Q", N_("Quit"), G_CALLBACK (quit_action_callback)},
+        {"contents", GTK_STOCK_HELP, N_("_Help"), "F1", N_("Get Help on Palimpsest Disk Utility"), G_CALLBACK (help_contents_action_callback)},
+        {"about", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, G_CALLBACK (about_action_callback)}
 };
 
 static GtkUIManager *
@@ -1721,155 +1597,6 @@ create_ui_manager (GduShell *shell)
 
         /* -------------------------------------------------------------------------------- */
 
-        shell->priv->fsck_action = polkit_gnome_action_new_default ("fsck",
-                                                                    shell->priv->pk_fsck_action,
-                                                                    _("_Check File System"),
-                                                                    _("Check the file system"));
-        g_object_set (shell->priv->fsck_action,
-                      "auth-label", _("_Check File System..."),
-                      "auth-short-label", _("_Check"),
-                      "yes-short-label", _("_Check"),
-                      "no-short-label", _("_Check"),
-                      "yes-icon-name", "gdu-check-disk",
-                      "no-icon-name", "gdu-check-disk",
-                      "auth-icon-name", "gdu-check-disk",
-                      "self-blocked-icon-name", "gdu-check-disk",
-                      NULL);
-        g_signal_connect (shell->priv->fsck_action, "activate", G_CALLBACK (fsck_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->fsck_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->mount_action = polkit_gnome_action_new_default ("mount",
-                                                                     shell->priv->pk_mount_action,
-                                                                     _("_Mount"),
-                                                                     _("Mount the device"));
-        g_object_set (shell->priv->mount_action,
-                      "auth-label", _("_Mount..."),
-                      "yes-icon-name", "gdu-mount",
-                      "no-icon-name", "gdu-mount",
-                      "auth-icon-name", "gdu-mount",
-                      "self-blocked-icon-name", "gdu-mount",
-                      NULL);
-        g_signal_connect (shell->priv->mount_action, "activate", G_CALLBACK (mount_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->mount_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->unmount_action = polkit_gnome_action_new_default ("unmount",
-                                                                       NULL,
-                                                                       _("_Unmount"),
-                                                                       _("Unmount the device"));
-        g_object_set (shell->priv->unmount_action,
-                      "auth-label", _("_Unmount..."),
-                      "yes-icon-name", "gdu-unmount",
-                      "no-icon-name", "gdu-unmount",
-                      "auth-icon-name", "gdu-unmount",
-                      "self-blocked-icon-name", "gdu-unmount",
-                      NULL);
-        g_signal_connect (shell->priv->unmount_action, "activate", G_CALLBACK (unmount_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->unmount_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->eject_action = polkit_gnome_action_new_default ("eject",
-                                                                     NULL,
-                                                                     _("_Eject"),
-                                                                     _("Eject media from the device"));
-        g_object_set (shell->priv->eject_action,
-                      "auth-label", _("_Eject..."),
-                      "yes-icon-name", "gdu-eject",
-                      "no-icon-name", "gdu-eject",
-                      "auth-icon-name", "gdu-eject",
-                      "self-blocked-icon-name", "gdu-eject",
-                      NULL);
-        g_signal_connect (shell->priv->eject_action, "activate", G_CALLBACK (eject_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->eject_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->unlock_action = polkit_gnome_action_new_default ("unlock",
-                                                                      shell->priv->pk_unlock_luks_action,
-                                                                      _("_Unlock"),
-                                                                      _("Unlock the encrypted device, making the data available in cleartext"));
-        g_object_set (shell->priv->unlock_action,
-                      "auth-label", _("_Unlock..."),
-                      "yes-icon-name", "gdu-encrypted-unlock",
-                      "no-icon-name", "gdu-encrypted-unlock",
-                      "auth-icon-name", "gdu-encrypted-unlock",
-                      "self-blocked-icon-name", "gdu-encrypted-unlock",
-                      NULL);
-        g_signal_connect (shell->priv->unlock_action, "activate", G_CALLBACK (unlock_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->unlock_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->lock_action = polkit_gnome_action_new_default ("lock",
-                                                                    NULL,
-                                                                    _("_Lock"),
-                                                                    _("Lock the encrypted device, making the cleartext data unavailable"));
-        g_object_set (shell->priv->lock_action,
-                      "auth-label", _("_Lock..."),
-                      "yes-icon-name", "gdu-encrypted-lock",
-                      "no-icon-name", "gdu-encrypted-lock",
-                      "auth-icon-name", "gdu-encrypted-lock",
-                      "self-blocked-icon-name", "gdu-encrypted-lock",
-                      NULL);
-        g_signal_connect (shell->priv->lock_action, "activate", G_CALLBACK (lock_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->lock_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->start_action = polkit_gnome_action_new_default ("start",
-                                                                     shell->priv->pk_linux_md_action,
-                                                                     _("_Start"),
-                                                                     _("Start the array"));
-        g_object_set (shell->priv->start_action,
-                      "auth-label", _("_Start..."),
-                      "yes-icon-name", "gdu-raid-array-start",
-                      "no-icon-name", "gdu-raid-array-start",
-                      "auth-icon-name", "gdu-raid-array-start",
-                      "self-blocked-icon-name", "gdu-raid-array-start",
-                      NULL);
-        g_signal_connect (shell->priv->start_action, "activate", G_CALLBACK (start_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->start_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->stop_action = polkit_gnome_action_new_default ("stop",
-                                                                    shell->priv->pk_linux_md_action,
-                                                                    _("_Stop"),
-                                                                    _("Stop the array"));
-        g_object_set (shell->priv->stop_action,
-                      "auth-label", _("_Stop..."),
-                      "yes-icon-name", "gdu-raid-array-stop",
-                      "no-icon-name", "gdu-raid-array-stop",
-                      "auth-icon-name", "gdu-raid-array-stop",
-                      "self-blocked-icon-name", "gdu-raid-array-stop",
-                      NULL);
-        g_signal_connect (shell->priv->stop_action, "activate", G_CALLBACK (stop_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->stop_action));
-
-        /* -------------------------------------------------------------------------------- */
-
-        shell->priv->erase_action = polkit_gnome_action_new_default ("erase",
-                                                                     shell->priv->pk_modify_action,
-                                                                     _("_Erase..."),
-                                                                     _("Erase the contents of the selected device"));
-        g_object_set (shell->priv->erase_action,
-                      "auth-short-label", _("_Erase"),
-                      "no-short-label", _("_Erase"),
-                      "yes-short-label", _("_Erase"),
-                      "yes-icon-name", GTK_STOCK_CLEAR,
-                      "no-icon-name", GTK_STOCK_CLEAR,
-                      "auth-icon-name", GTK_STOCK_CLEAR,
-                      "self-blocked-icon-name", GTK_STOCK_CLEAR,
-                      NULL);
-        g_signal_connect (shell->priv->erase_action, "activate", G_CALLBACK (erase_action_callback), shell);
-        gtk_action_group_add_action (shell->priv->action_group, GTK_ACTION (shell->priv->erase_action));
-
-        /* -------------------------------------------------------------------------------- */
-
         ui_manager = gtk_ui_manager_new ();
         gtk_ui_manager_insert_action_group (ui_manager, shell->priv->action_group, 0);
 
@@ -1885,51 +1612,6 @@ create_ui_manager (GduShell *shell)
 }
 
 static void
-create_polkit_actions (GduShell *shell)
-{
-        shell->priv->pk_modify_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_modify_action,
-                                     "org.freedesktop.devicekit.disks.change");
-
-        shell->priv->pk_modify_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_modify_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.change-system-internal");
-
-        shell->priv->pk_fsck_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_fsck_action,
-                                     "org.freedesktop.devicekit.disks.filesystem-check");
-
-        shell->priv->pk_fsck_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_fsck_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.filesystem-check-system-internal");
-
-        shell->priv->pk_mount_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_mount_action,
-                                     "org.freedesktop.devicekit.disks.filesystem-mount");
-
-        shell->priv->pk_mount_system_internal_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_mount_system_internal_action,
-                                     "org.freedesktop.devicekit.disks.filesystem-mount-system-internal");
-
-        shell->priv->pk_unmount_others_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_unmount_others_action,
-                                     "org.freedesktop.devicekit.disks.filesystem-unmount-others");
-
-
-        shell->priv->pk_unlock_luks_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_unlock_luks_action,
-                                     "org.freedesktop.devicekit.disks.luks-unlock");
-
-        shell->priv->pk_lock_luks_others_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_lock_luks_others_action,
-                                     "org.freedesktop.devicekit.disks.luks-lock-others");
-
-        shell->priv->pk_linux_md_action = polkit_action_new ();
-        polkit_action_set_action_id (shell->priv->pk_linux_md_action,
-                                     "org.freedesktop.devicekit.disks.linux-md");
-}
-
-static void
 url_activated (SexyUrlLabel *url_label,
                const char   *url,
                gpointer      user_data)
@@ -2016,6 +1698,9 @@ gdu_shell_raise_error (GduShell       *shell,
         case GDU_ERROR_ATA_SMART_WOULD_WAKEUP:
                 error_msg = _("Getting ATA SMART data would wake up the device.");
                 break;
+        case GDU_ERROR_PERMISSION_DENIED:
+                error_msg = _("Permission denied.");
+                break;
         default:
                 error_msg = _("Unknown error");
                 break;
@@ -2113,8 +1798,6 @@ create_window (GduShell *shell)
 
         shell->priv->pool = gdu_pool_new ();
 
-        create_polkit_actions (shell);
-
         shell->priv->app_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
         gtk_window_set_resizable (GTK_WINDOW (shell->priv->app_window), TRUE);
         gtk_window_set_default_size (GTK_WINDOW (shell->priv->app_window), 800, 600);
diff --git a/src/playground/grid/Makefile.am b/src/playground/grid/Makefile.am
index 123e550..794ea49 100644
--- a/src/playground/grid/Makefile.am
+++ b/src/playground/grid/Makefile.am
@@ -28,8 +28,6 @@ grid_CFLAGS = 						\
 	$(GIO2_CFLAGS)					\
 	$(GIO_UNIX2_CFLAGS)				\
 	$(DBUS_GLIB_CFLAGS)				\
-	$(POLKIT_DBUS_CFLAGS)				\
-	$(POLKIT_GNOME_CFLAGS)				\
 	$(GNOME_KEYRING_CFLAGS)				\
 	$(GTK2_CFLAGS)					\
 	$(LIBSEXY_CFLAGS)				\
@@ -44,8 +42,6 @@ grid_LDADD = 						\
 	$(GIO2_LIBS)					\
 	$(GIO_UNIX2_LIBS)				\
 	$(DBUS_GLIB_LIBS)				\
-	$(POLKIT_DBUS_LIBS)				\
-	$(POLKIT_GNOME_LIBS)				\
 	$(GNOME_KEYRING_LIBS)				\
 	$(GTK2_LIBS)					\
 	$(LIBSEXY_LIBS)					\



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