Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
GNOME:Apps
libgksu
libgksu-gsettings.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libgksu-gsettings.patch of Package libgksu
--- a/configure.ac +++ b/configure.ac @@ -37,11 +37,10 @@ AC_LIBTOOL_LINKER_OPTION([whether the li use_version_script, [-Wl,--version-script=libgksu/libgksu.ver]) AM_CONDITIONAL(USE_VERSION_SCRIPT, test x$use_version_script = xyes) -AC_PATH_PROG(GCONFTOOL, gconftool-2) -AM_GCONF_SOURCE_2 +GLIB_GSETTINGS -PKG_CHECK_MODULES(LIBGKSU, [gtk+-2.0 >= 2.4.0, gconf-2.0, libstartup-notification-1.0, gnome-keyring-1, libgtop-2.0]) -PKG_CHECK_MODULES(GKSU_PROPERTIES, [gtk+-2.0 >= 2.12, gconf-2.0]) +PKG_CHECK_MODULES(LIBGKSU, [gtk+-2.0 >= 2.4.0, gio-2.0 >= 2.25.0, libstartup-notification-1.0, gnome-keyring-1, libgtop-2.0]) +PKG_CHECK_MODULES(GKSU_PROPERTIES, [gtk+-2.0 >= 2.12, gio-2.0 >= 2.25.0]) # Checks for library functions. ALL_LINGUAS="ca cs da de es eu fr hu it ko lt pl pt_BR ro ru sk sv nb nl th zh_CN" --- a/docs/html/libgksu-API-Reference.html +++ b/docs/html/libgksu-API-Reference.html @@ -697,9 +697,9 @@ href="/usr/share/gtk-doc/html/glib/glib- >GError</a> **error);</pre> <p> This function is a wrapper for gksu_sudo/gksu_su. It will call one -of them, depending on the GConf key that defines whether the default -behavior for gksu is su or sudo mode. This is the recommended way of -using the library functionality.</p> +of them, depending on the GSettings key that defines whether the +default behaviour for gksu is su or sudo mode. This is the recommended +way of using the library functionality.</p> <p> </p> <div class="variablelist"><table border="0"> @@ -776,7 +776,7 @@ href="/usr/share/gtk-doc/html/glib/glib- <td> a <span class="type">GksuPassNotNeededFunc</span> that will be called when the command is being run without the need for requesting a password; it will only be called if the display-no-pass-info -gconf key is enabled; NULL will have the standard dialog be shown +gsettings key is enabled; NULL will have the standard dialog be shown </td> </tr> <tr> @@ -896,7 +896,7 @@ href="/usr/share/gtk-doc/html/glib/glib- <td> a <span class="type">GksuPassNotNeededFunc</span> that will be called when the command is being run without the need for requesting a password; it will only be called if the display-no-pass-info -gconf key is enabled; NULL will have the standard dialog be shown +gsettings key is enabled; NULL will have the standard dialog be shown </td> </tr> <tr> @@ -1016,7 +1016,7 @@ href="/usr/share/gtk-doc/html/glib/glib- <td> a <span class="type">GksuPassNotNeededFunc</span> that will be called when the command is being run without the need for requesting a password; it will only be called if the display-no-pass-info -gconf key is enabled; NULL will have the standard dialog be shown +gsettings key is enabled; NULL will have the standard dialog be shown </td> </tr> <tr> --- a/docs/xml/libgksu.xml +++ b/docs/xml/libgksu.xml @@ -382,9 +382,9 @@ Frees the given <link linkend="GksuConte <link linkend="GError">GError</link> **error);</programlisting> <para> This function is a wrapper for gksu_sudo/gksu_su. It will call one -of them, depending on the GConf key that defines whether the default -behavior for gksu is su or sudo mode. This is the recommended way of -using the library functionality.</para> +of them, depending on the GSettings key that defines whether the +default behaviour for gksu is su or sudo mode. This is the recommended +way of using the library functionality.</para> <para> </para><variablelist role="params"> <varlistentry><term><parameter>command_line</parameter> :</term> @@ -426,7 +426,7 @@ the standard password request dialog wil <listitem><simpara> a <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> that will be called when the command is being run without the need for requesting a password; it will only be called if the display-no-pass-info -gconf key is enabled; NULL will have the standard dialog be shown +gsettings key is enabled; NULL will have the standard dialog be shown </simpara></listitem></varlistentry> <varlistentry><term><parameter>pass_not_needed_data</parameter> :</term> <listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with the user data to be passed to the @@ -490,7 +490,7 @@ the standard password request dialog wil <listitem><simpara> a <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> that will be called when the command is being run without the need for requesting a password; it will only be called if the display-no-pass-info -gconf key is enabled; NULL will have the standard dialog be shown +gsettings key is enabled; NULL will have the standard dialog be shown </simpara></listitem></varlistentry> <varlistentry><term><parameter>pass_not_needed_data</parameter> :</term> <listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with the user data to be passed to the @@ -554,7 +554,7 @@ the standard password request dialog wil <listitem><simpara> a <link linkend="GksuPassNotNeededFunc"><type>GksuPassNotNeededFunc</type></link> that will be called when the command is being run without the need for requesting a password; it will only be called if the display-no-pass-info -gconf key is enabled; NULL will have the standard dialog be shown +gsettings key is enabled; NULL will have the standard dialog be shown </simpara></listitem></varlistentry> <varlistentry><term><parameter>pass_not_needed_data</parameter> :</term> <listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> with the user data to be passed to the --- a/gksu.convert +++ b/gksu.convert @@ -0,0 +1,8 @@ +[org.gksu] +disable-grab = /apps/gksu/disable-grab +force-grab = /apps/gksu/force-grab +sudo-mode = /apps/gksu/sudo-mode +prompt = /apps/gksu/prompt +display-no-pass-info = /apps/gksu/display-no-pass-info +save-to-keyring = /apps/gksu/save-to-keyring +save-keyring = /apps/gksu/save-keyring --- a/gksu-properties/gksu-properties.c +++ b/gksu-properties/gksu-properties.c @@ -2,7 +2,7 @@ #include <string.h> #include <gtk/gtk.h> -#include <gconf/gconf-client.h> +#include <gio/gio.h> #include "../config.h" #include "../libgksu/defines.h" @@ -11,7 +11,7 @@ static GtkBuilder *gui = NULL; static GtkWidget *main_window; static GtkWidget *grab_combo; static GtkWidget *mode_combo; -static GConfClient *gconf_client; /* NULL */ +static GSettings *gsettings; /* NULL */ gboolean disable_grab = FALSE; gboolean force_grab = FALSE; @@ -19,19 +19,15 @@ gboolean prompt = FALSE; gboolean sudo_mode = FALSE; void -update_from_gconf () +update_from_gsettings () { - disable_grab = gconf_client_get_bool (gconf_client, BASE_PATH "disable-grab", - NULL); + disable_grab = g_settings_get_boolean (gsettings, "disable-grab"); - force_grab = gconf_client_get_bool (gconf_client, BASE_PATH "force-grab", - NULL); + force_grab = g_settings_get_boolean (gsettings, "force-grab"); - prompt = gconf_client_get_bool (gconf_client, BASE_PATH "prompt", - NULL); + prompt = g_settings_get_boolean (gsettings, "prompt"); - sudo_mode = gconf_client_get_bool (gconf_client, BASE_PATH "sudo-mode", - NULL); + sudo_mode = g_settings_get_boolean (gsettings, "sudo-mode"); } const gchar* @@ -132,10 +128,10 @@ create_dialog () } void -gconf_change_cb (GConfClient *gconf_client, guint cnxn_id, - GConfEntry *entry, gpointer data) +gsettings_change_cb (GSettings *settings, guint cnxn_id, + gchar *key, gpointer data) { - update_from_gconf (); + update_from_gsettings (); update_mode_combo (); update_grab_combo (); } @@ -157,49 +153,35 @@ combo_change_cb (GtkWidget *widget, gpoi if (!strcmp (combo_name, "mode")) { if (!strcmp (buffer, "sudo")) - gconf_client_set_bool (gconf_client, BASE_PATH "sudo-mode", - TRUE, NULL); + g_settings_set_boolean (gsettings, "sudo-mode", TRUE); else - gconf_client_set_bool (gconf_client, BASE_PATH "sudo-mode", - FALSE, NULL); + g_settings_set_boolean (gsettings, "sudo-mode", FALSE); } else { if (!strcmp (buffer, "enable")) { - gconf_client_set_bool (gconf_client, BASE_PATH "prompt", - FALSE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "disable-grab", - FALSE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "force-grab", - FALSE, NULL); + g_settings_set_boolean (gsettings, "prompt", FALSE); + g_settings_set_boolean (gsettings, "disable-grab", FALSE); + g_settings_set_boolean (gsettings, "force-grab", FALSE); } else if (!strcmp (buffer, "disable")) { - gconf_client_set_bool (gconf_client, BASE_PATH "prompt", - FALSE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "disable-grab", - TRUE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "force-grab", - FALSE, NULL); + g_settings_set_boolean (gsettings, "prompt", FALSE); + g_settings_set_boolean (gsettings, "disable-grab", TRUE); + g_settings_set_boolean (gsettings, "force-grab", FALSE); } else if (!strcmp (buffer, "prompt")) { - gconf_client_set_bool (gconf_client, BASE_PATH "prompt", - TRUE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "disable-grab", - FALSE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "force-grab", - FALSE, NULL); + g_settings_set_boolean (gsettings, "prompt", TRUE); + g_settings_set_boolean (gsettings, "disable-grab", FALSE); + g_settings_set_boolean (gsettings, "force-grab", FALSE); } else if (!strcmp (buffer, "force enable")) { - gconf_client_set_bool (gconf_client, BASE_PATH "prompt", - FALSE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "disable-grab", - FALSE, NULL); - gconf_client_set_bool (gconf_client, BASE_PATH "force-grab", - TRUE, NULL); + g_settings_set_boolean (gsettings, "prompt", FALSE); + g_settings_set_boolean (gsettings, "disable-grab", FALSE); + g_settings_set_boolean (gsettings, "force-grab", TRUE); } } } @@ -208,8 +190,8 @@ combo_change_cb (GtkWidget *widget, gpoi void setup_notifications () { - gconf_client_notify_add (gconf_client, GCONF_DIR, gconf_change_cb, - NULL, NULL, NULL); + g_signal_connect (gsettings, "changed::" GSETTINGS_SCHEMA, + G_CALLBACK(gsettings_change_cb), NULL); g_signal_connect (G_OBJECT(mode_combo), "changed", G_CALLBACK(combo_change_cb), "mode"); @@ -266,16 +248,16 @@ main (int argc, char **argv) gtk_builder_connect_signals (gui, NULL); - gconf_client = gconf_client_get_default (); + gsettings = g_settings_new (GSETTINGS_SCHEMA); - update_from_gconf (); + update_from_gsettings (); create_dialog (); setup_notifications (); if (main_window) gtk_main (); - g_object_unref (gconf_client); + g_object_unref (gsettings); return 0; } Only in a: gksu.schemas.in --- a/libgksu/defines.h +++ b/libgksu/defines.h @@ -21,8 +21,7 @@ #ifndef __DEFINES_H__ #define __DEFINES_H__ -#define GCONF_DIR "/apps/gksu" -#define BASE_PATH GCONF_DIR"/" +#define GSETTINGS_SCHEMA "org.gksu" /* Gettext */ #include <libintl.h> --- a/libgksu/libgksu2.pc.in +++ b/libgksu/libgksu2.pc.in @@ -6,6 +6,6 @@ includedir=@prefix@/include Name: LibGKSu Version: @VERSION@ Description: GKSu library version 2. -Requires: glib-2.0, libstartup-notification-1.0, gnome-keyring-1, gconf-2.0 +Requires: glib-2.0, libstartup-notification-1.0, gnome-keyring-1, gio-2.0 Libs: -L${libdir} -lgksu2 Cflags: -I${includedir}/libgksu --- a/libgksu/libgksu.c +++ b/libgksu/libgksu.c @@ -44,7 +44,7 @@ #include <gtk/gtk.h> #include <locale.h> -#include <gconf/gconf-client.h> +#include <gio/gio.h> #include <gnome-keyring.h> #include "defines.h" @@ -691,11 +691,11 @@ keyring_create_item_cb (GnomeKeyringResu static void set_gnome_keyring_password (GksuContext *context, gchar *password) { - GConfClient *gconf_client; + GSettings *gsettings; gboolean save_to_keyring; - gconf_client = context->gconf_client; - save_to_keyring = gconf_client_get_bool (gconf_client, BASE_PATH"save-to-keyring", NULL); + gsettings = context->gsettings; + save_to_keyring = g_settings_get_boolean (gsettings, "save-to-keyring"); if (password && save_to_keyring) { @@ -729,7 +729,7 @@ set_gnome_keyring_password (GksuContext keyring_loop = g_main_loop_new (NULL, FALSE); - keyring_name = gconf_client_get_string (gconf_client, BASE_PATH"save-keyring", NULL); + keyring_name = g_settings_get_string (gsettings, "save-keyring"); if (keyring_name == NULL) keyring_name = g_strdup ("session"); @@ -757,7 +757,7 @@ set_gnome_keyring_password (GksuContext static void unset_gnome_keyring_password (GksuContext *context) { - GConfClient *gconf_client; + GSettings *gsettings; gboolean save_to_keyring; GnomeKeyringAttributeList *attributes; @@ -765,8 +765,8 @@ unset_gnome_keyring_password (GksuContex GnomeKeyringResult result; GList *list; - gconf_client = context->gconf_client; - save_to_keyring = gconf_client_get_bool (gconf_client, BASE_PATH"save-to-keyring", NULL); + gsettings = context->gsettings; + save_to_keyring = g_settings_get_boolean (gsettings, "save-to-keyring"); if (save_to_keyring) { @@ -809,18 +809,15 @@ unset_gnome_keyring_password (GksuContex void get_configuration_options (GksuContext *context) { - GConfClient *gconf_client = context->gconf_client; + GSettings *gsettings = context->gsettings; gboolean force_grab; - context->grab = !gconf_client_get_bool (gconf_client, BASE_PATH "disable-grab", - NULL); - force_grab = gconf_client_get_bool (gconf_client, BASE_PATH "force-grab", - NULL); + context->grab = !g_settings_get_boolean (gsettings, "disable-grab"); + force_grab = g_settings_get_boolean (gsettings, "force-grab"); if (force_grab) context->grab = TRUE; - context->sudo_mode = gconf_client_get_bool (gconf_client, BASE_PATH "sudo-mode", - NULL); + context->sudo_mode = g_settings_get_boolean (gsettings, "sudo-mode"); } /** @@ -953,7 +950,7 @@ su_ask_password (GksuContext *context, g static void cb_toggled_cb (GtkWidget *button, gpointer data) { - GConfClient *gconf_client; + GSettings *gsettings; gchar *key; gboolean toggled; gchar *key_name; @@ -962,10 +959,10 @@ cb_toggled_cb (GtkWidget *button, gpoint key_name = (gchar*)data; - gconf_client = gconf_client_get_default (); + gsettings = g_settings_new (GSETTINGS_SCHEMA); toggled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)); - key = g_strdup_printf (BASE_PATH "%s", key_name); + key = g_strdup_printf ("%s", key_name); if (!strcmp (key_name, "display-no-pass-info")) { @@ -973,12 +970,12 @@ cb_toggled_cb (GtkWidget *button, gpoint of the answer - when the check button is checked the key must be off */ - gconf_client_set_bool (gconf_client, key, !toggled, NULL); + g_settings_set_boolean (gsettings, key, !toggled); } else - gconf_client_set_bool (gconf_client, key, toggled, NULL); + g_settings_set_boolean (gsettings, key, toggled); - g_object_unref (gconf_client); + g_object_unref (gsettings); g_free (key); } @@ -1344,7 +1341,7 @@ gksu_context_new () context->dir = NULL; context->display = NULL; - context->gconf_client = gconf_client_get_default (); + context->gsettings = g_settings_new (GSETTINGS_SCHEMA); context->sudo_mode = FALSE; @@ -1801,7 +1798,7 @@ gksu_context_free (GksuContext *context) g_free (context->dir); g_free (context->display); - g_object_unref (context->gconf_client); + g_object_unref (context->gsettings); g_free (context->description); g_free (context->message); @@ -1867,7 +1864,7 @@ gksu_context_get_type (void) * @pass_not_needed: a #GksuPassNotNeededFunc that will be called * when the command is being run without the need for requesting * a password; it will only be called if the display-no-pass-info - * gconf key is enabled; NULL will have the standard dialog be shown + * gsettings key is enabled; NULL will have the standard dialog be shown * @pass_not_needed_data: a #gpointer with the user data to be passed to the * #GksuPasswordNotNeededFunc * @error: a #GError object to be filled with the error code or NULL @@ -1906,7 +1903,7 @@ gksu_su_full (GksuContext *context, * @pass_not_needed: a #GksuPassNotNeededFunc that will be called * when the command is being run without the need for requesting * a password; it will only be called if the display-no-pass-info - * gconf key is enabled; NULL will have the standard dialog be shown + * gsettings key is enabled; NULL will have the standard dialog be shown * @pass_not_needed_data: a #gpointer with the user data to be passed to the * #GksuPasswordNotNeededFunc * @exit_status: an optional pointer to a #gint8 which will be filled with @@ -2074,8 +2071,7 @@ gksu_su_fuller (GksuContext *context, if (!(tio.c_lflag & ECHO)) { gboolean prompt_grab; - prompt_grab = gconf_client_get_bool (context->gconf_client, BASE_PATH "prompt", - NULL); + prompt_grab = g_settings_get_boolean (context->gsettings, "prompt"); if (prompt_grab) gksu_prompt_grab (context); @@ -2270,8 +2266,8 @@ gksu_su_fuller (GksuContext *context, { gboolean should_display; - should_display = gconf_client_get_bool (context->gconf_client, - BASE_PATH "display-no-pass-info", NULL); + should_display = g_settings_get_boolean (context->gsettings, + "display-no-pass-info"); /* configuration tells us to show this message */ if (should_display) @@ -2406,7 +2402,7 @@ read_line (int fd, gchar *buffer, int n) * @pass_not_needed: a #GksuPassNotNeededFunc that will be called * when the command is being run without the need for requesting * a password; it will only be called if the display-no-pass-info - * gconf key is enabled; NULL will have the standard dialog be shown + * gsettings key is enabled; NULL will have the standard dialog be shown * @pass_not_needed_data: a #gpointer with the user data to be passed to the * #GksuPasswordNotNeededFunc * @error: a #GError object to be filled with the error code or NULL @@ -2444,7 +2440,7 @@ gksu_sudo_full (GksuContext *context, * @pass_not_needed: a #GksuPassNotNeededFunc that will be called * when the command is being run without the need for requesting * a password; it will only be called if the display-no-pass-info - * gconf key is enabled; NULL will have the standard dialog be shown + * gsettings key is enabled; NULL will have the standard dialog be shown * @pass_not_needed_data: a #gpointer with the user data to be passed to the * #GksuPasswordNotNeededFunc * @error: a #GError object to be filled with the error code or NULL @@ -2801,8 +2797,7 @@ gksu_sudo_fuller (GksuContext *context, if (context->debug) fprintf (stderr, "Yeah, we're in...\n"); - prompt_grab = gconf_client_get_bool (context->gconf_client, BASE_PATH "prompt", - NULL); + prompt_grab = g_settings_get_boolean (context->gsettings, "prompt"); if (prompt_grab) gksu_prompt_grab (context); @@ -2857,8 +2852,8 @@ gksu_sudo_fuller (GksuContext *context, fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK); #endif - should_display = gconf_client_get_bool (context->gconf_client, - BASE_PATH "display-no-pass-info", NULL); + should_display = g_settings_get_boolean (context->gsettings, + "display-no-pass-info"); /* configuration tells us to show this message */ if (should_display) @@ -3026,7 +3021,7 @@ gksu_sudo (gchar *command_line, * @pass_not_needed: a #GksuPassNotNeededFunc that will be called * when the command is being run without the need for requesting * a password; it will only be called if the display-no-pass-info - * gconf key is enabled; NULL will have the standard dialog be shown + * gsettings key is enabled; NULL will have the standard dialog be shown * @pass_not_needed_data: a #gpointer with the user data to be passed to the * #GksuPasswordNotNeededFunc * @error: a #GError object to be filled with the error code or NULL @@ -3062,7 +3057,7 @@ gksu_run_full (GksuContext *context, * @pass_not_needed: a #GksuPassNotNeededFunc that will be called * when the command is being run without the need for requesting * a password; it will only be called if the display-no-pass-info - * gconf key is enabled; NULL will have the standard dialog be shown + * gsettings key is enabled; NULL will have the standard dialog be shown * @pass_not_needed_data: a #gpointer with the user data to be passed to the * #GksuPasswordNotNeededFunc * @exit_status: an optional pointer to a #gint8 which will be filled with @@ -3070,7 +3065,7 @@ gksu_run_full (GksuContext *context, * @error: a #GError object to be filled with the error code or NULL * * This function is a wrapper for gksu_sudo_full/gksu_su_full. It will - * call one of them, depending on the GConf key that defines whether + * call one of them, depending on the GSettings key that defines whether * the default behavior for gksu is su or sudo mode. This is the * recommended way of using the library functionality. * @@ -3085,13 +3080,12 @@ gksu_run_fuller (GksuContext *context, gint8 *exit_status, GError **error) { - GConfClient *gconf_client; + GSettings *gsettings; gboolean sudo_mode; - gconf_client = gconf_client_get_default (); - sudo_mode = gconf_client_get_bool (gconf_client, BASE_PATH "sudo-mode", - NULL); - g_object_unref (gconf_client); + gsettings = g_settings_new (GSETTINGS_SCHEMA); + sudo_mode = g_settings_get_boolean (gsettings, "sudo-mode"); + g_object_unref (gsettings); if (sudo_mode) return gksu_sudo_fuller (context, ask_pass, ask_pass_data, @@ -3110,7 +3104,7 @@ gksu_run_fuller (GksuContext *context, * happens * * This function is a wrapper for gksu_sudo/gksu_su. It will call one - * of them, depending on the GConf key that defines whether the default + * of them, depending on the GSettings key that defines whether the default * behavior for gksu is su or sudo mode. This is the recommended way of * using the library functionality. * @@ -3120,13 +3114,12 @@ gboolean gksu_run (gchar *command_line, GError **error) { - GConfClient *gconf_client; + GSettings *gsettings; gboolean sudo_mode; - gconf_client = gconf_client_get_default (); - sudo_mode = gconf_client_get_bool (gconf_client, BASE_PATH "sudo-mode", - NULL); - g_object_unref (gconf_client); + gsettings = g_settings_new (GSETTINGS_SCHEMA); + sudo_mode = g_settings_get_boolean (gsettings, "sudo-mode"); + g_object_unref (gsettings); if (sudo_mode) return gksu_sudo (command_line, error); --- a/libgksu/libgksu.h +++ b/libgksu/libgksu.h @@ -29,7 +29,7 @@ #include <gtk/gtk.h> -#include <gconf/gconf-client.h> +#include <gio/gio.h> G_BEGIN_DECLS @@ -47,7 +47,7 @@ struct _GksuContext gboolean sudo_mode; - GConfClient *gconf_client; + GSettings *gsettings; /* what to run, with whose powers */ gchar *user; --- a/libgksuui/defines.h +++ b/libgksuui/defines.h @@ -21,7 +21,7 @@ #ifndef __DEFINES_H__ #define __DEFINES_H__ -#define BASE_PATH "/apps/gksu/" +#define GSETTINGS_SCHEMA "org.gksu" /* Gettext */ #include <libintl.h> --- a/libgksuui/gksuui-dialog.c +++ b/libgksuui/gksuui-dialog.c @@ -24,7 +24,7 @@ #include <gdk/gdkx.h> #include <X11/XKBlib.h> -#include <gconf/gconf-client.h> +#include <gio/gio.h> #include "defines.h" #include "../config.h" @@ -166,7 +166,7 @@ set_sensitivity_cb (GtkWidget *button, g static void cb_toggled_cb (GtkWidget *button, gpointer data) { - GConfClient *gconf_client; + GSettings *gsettings; gchar *key; gboolean toggled; gchar *key_name; @@ -175,22 +175,22 @@ cb_toggled_cb (GtkWidget *button, gpoint key_name = (gchar*)data; - gconf_client = gconf_client_get_default (); + gsettings = g_settings_new (GSETTINGS_SCHEMA); toggled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)); - key = g_strdup_printf (BASE_PATH "%s", key_name); + key = g_strdup_printf ("%s", key_name); if (!strcmp (key_name, "save-keyring")) { if (toggled) - gconf_client_set_string (gconf_client, key, "session", NULL); + g_settings_set_string (gsettings, key, "session"); else - gconf_client_set_string (gconf_client, key, "default", NULL); + g_settings_set_string (gsettings, key, "default"); } else - gconf_client_set_bool (gconf_client, key, toggled, NULL); + g_settings_set_boolean (gsettings, key, toggled); - g_object_unref (gconf_client); + g_object_unref (gsettings); g_free (key); } @@ -205,12 +205,12 @@ gksuui_dialog_create_gnome_keyring_ui (G GtkWidget *radio_vbox; GtkWidget *radio_session, *radio_default; - GConfClient *gconf_client; + GSettings *gsettings; gboolean remember_password; gchar *tmp = NULL; /* gnome-keyring stuff */ - gconf_client = gconf_client_get_default (); + gsettings = g_settings_new (GSETTINGS_SCHEMA); vbox = gtk_vbox_new (2, TRUE); gtk_box_pack_start (GTK_BOX(GKSUUI_DIALOG(dialog)->entry_vbox), vbox, TRUE, TRUE, 0); @@ -219,7 +219,7 @@ gksuui_dialog_create_gnome_keyring_ui (G check_button = gtk_check_button_new_with_label (_("Remember password")); g_signal_connect (G_OBJECT(check_button), "toggled", G_CALLBACK(cb_toggled_cb), "save-to-keyring"); - remember_password = gconf_client_get_bool (gconf_client, BASE_PATH"save-to-keyring", NULL); + remember_password = g_settings_get_boolean (gsettings, "save-to-keyring"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(check_button), remember_password); gtk_box_pack_start (GTK_BOX(vbox), check_button, TRUE, TRUE, 0); gtk_widget_show (check_button); @@ -244,12 +244,12 @@ gksuui_dialog_create_gnome_keyring_ui (G g_signal_connect (G_OBJECT(check_button), "toggled", G_CALLBACK(set_sensitivity_cb), radio_vbox); - tmp = gconf_client_get_string (gconf_client, BASE_PATH"save-keyring", NULL); + tmp = g_settings_get_string (gsettings, "save-keyring"); if (tmp && (!strcmp (tmp, "default"))) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radio_default), TRUE); g_free (tmp); - g_object_unref (gconf_client); + g_object_unref (gsettings); } static gboolean --- a/libgksuui/Makefile.am +++ b/libgksuui/Makefile.am @@ -1,10 +1,10 @@ AM_CFLAGS = -g -O2 -Wall -INCLUDES = `pkg-config --cflags x11 gtk+-2.0 gconf-2.0` +INCLUDES = `pkg-config --cflags x11 gtk+-2.0 gio-2.0` AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" -DDATA_DIR=\"$(datadir)\" -DPREFIX=\"$(prefix)\" noinst_LTLIBRARIES = libgksuui1.0.la libgksuui1_0_la_SOURCES = gksuui-dialog.c -libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-config --libs x11 gtk+-2.0 gconf-2.0` +libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-config --libs x11 gtk+-2.0 gio-2.0` noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h includedir = ${prefix}/include/$(PACKAGE) --- a/Makefile.am +++ b/Makefile.am @@ -5,23 +5,13 @@ DISTCLEANFILES = *~ intltool-extract int SUBDIRS = po libgksuui libgksu gksu-properties docs DIST_SUBDIRS = $(SUBDIRS) -schemasdir = $(GCONF_SCHEMA_FILE_DIR) -schemas_in_files = gksu.schemas.in -schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) -@INTLTOOL_SCHEMAS_RULE@ +gsettings_SCHEMAS = org.gksu.gschema.xml +@GSETTINGS_RULES@ + +convertdir = $(datadir)/GConf/gsettings +convert_DATA = gksu.convert pixmapdir = $(datadir)/icons/hicolor/48x48/apps dist_pixmap_DATA = gksu.png -EXTRA_DIST = config.rpath mkinstalldirs intltool-extract.in intltool-merge.in intltool-update.in gksu.schemas.in - -if GCONF_SCHEMAS_INSTALL -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schemas_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \ - done \ - fi -else -install-data-local: -endif +EXTRA_DIST = config.rpath mkinstalldirs intltool-extract.in intltool-merge.in intltool-update.in --- a/org.gksu.gschema.xml +++ b/org.gksu.gschema.xml @@ -0,0 +1,39 @@ +<schemalist> + <schema id="org.gksu" path="/apps/gksu/"> + <key name="disable-grab" type="b"> + <default>false</default> + <summary>Disable keyboard and mouse grab</summary> + <description>Whether the keyboard and mouse grabbing should be turned off. This will make it possible for other X applications to listen to keyboard input events, thus making it not possible to shield from malicious applications which may be running.</description> + </key> + <key name="force-grab" type="b"> + <default>false</default> + <summary>Force keyboard and mouse grab</summary> + <description>Grab keyboard and mouse even if -g has been passed as argument on the command line.</description> + </key> + <key name="sudo-mode" type="b"> + <default>false</default> + <summary>Sudo mode</summary> + <description>Whether sudo should be the default backend method. This method is otherwise accessed though the -S switch or by running 'gksudo' instead of 'gksu'.</description> + </key> + <key name="prompt" type="b"> + <default>false</default> + <summary>Prompt for grabbing</summary> + <description>This option will make gksu prompt the user if he wants to have the screen grabbed before entering the password. Notice that this only has an effect if force-grab is disabled.</description> + </key> + <key name="display-no-pass-info" type="b"> + <default>true</default> + <summary>Display information message when no password is needed</summary> + <description>This option determines whether a message dialog will be displayed informing the user that the program is being run without the need of a password being asked for some reason.</description> + </key> + <key name="save-to-keyring" type="b"> + <default>true</default> + <summary>Save password to gnome-keyring</summary> + <description>gksu can save the password you type to the gnome-keyring so you'll not be asked everytime.</description> + </key> + <key name="save-keyring" type="s"> + <default>"session"</default> + <summary>Keyring to which passwords will be saved</summary> + <description>The name of the keyring gksu should use. Usual values are "session", which saves the password for the session, and "default", which saves the password with no timeout.</description> + </key> + </schema> +</schemalist>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor