Commit 1c23ea4d authored by Ramiro Estrugo's avatar Ramiro Estrugo
Browse files

Initialize gconf if needed before creating a gconf_client.

* libnautilus-extensions/nautilus-user-level-manager.c:
(user_level_manager_new):
Initialize gconf if needed before creating a gconf_client.

* src/nautilus-first-time-druid.c: (user_level_selection_changed),
(set_up_user_level_page):
Update the user level when its toggled by the user.
parent 33c776b3
......@@ -108,6 +108,24 @@ user_level_manager_new (void)
NautilusUserLevelManager *manager;
guint i;
if (!gconf_is_initialized ()) {
GConfError *error = NULL;
char *argv[] = { "nautilus", NULL };
if (!gconf_init (1, argv, &error)) {
g_assert (error != NULL);
/* FIXME bugzilla.eazel.com 672: Need better error reporting here */
g_warning ("GConf init failed:\n %s", error->str);
gconf_error_destroy (error);
error = NULL;
return NULL;
}
}
manager = NAUTILUS_USER_LEVEL_MANAGER (gtk_object_new (nautilus_user_level_manager_get_type (), NULL));
manager->gconf_client = gconf_client_new ();
......
......@@ -108,6 +108,24 @@ user_level_manager_new (void)
NautilusUserLevelManager *manager;
guint i;
if (!gconf_is_initialized ()) {
GConfError *error = NULL;
char *argv[] = { "nautilus", NULL };
if (!gconf_init (1, argv, &error)) {
g_assert (error != NULL);
/* FIXME bugzilla.eazel.com 672: Need better error reporting here */
g_warning ("GConf init failed:\n %s", error->str);
gconf_error_destroy (error);
error = NULL;
return NULL;
}
}
manager = NAUTILUS_USER_LEVEL_MANAGER (gtk_object_new (nautilus_user_level_manager_get_type (), NULL));
manager->gconf_client = gconf_client_new ();
......
......@@ -39,14 +39,14 @@
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-radio-button-group.h>
#include <libnautilus-extensions/nautilus-user-level-manager.h>
#include "nautilus-first-time-druid.h"
static NautilusApplication *save_application;
static gboolean save_manage_desktop;
static int last_user_level;
static int last_signup_choice;
static int last_signup_choice = 0;
static void
druid_cancel (GtkWidget *druid)
......@@ -109,8 +109,8 @@ set_up_background (NautilusDruidPageStandard *page, const char *background_color
static void
user_level_selection_changed (GtkWidget *radio_buttons, gpointer user_data)
{
last_user_level = nautilus_radio_button_group_get_active_index (NAUTILUS_RADIO_BUTTON_GROUP (radio_buttons));
nautilus_user_level_manager_set_user_level (
nautilus_radio_button_group_get_active_index (NAUTILUS_RADIO_BUTTON_GROUP (radio_buttons)));
}
/* handler for signup buttons changing */
......@@ -153,6 +153,8 @@ set_up_user_level_page (NautilusDruidPageStandard *page)
nautilus_radio_button_group_insert (NAUTILUS_RADIO_BUTTON_GROUP (radio_buttons), _("Novice - for beginning users"));
nautilus_radio_button_group_insert (NAUTILUS_RADIO_BUTTON_GROUP (radio_buttons), _("Intermediate - for non-technical users"));
nautilus_radio_button_group_insert (NAUTILUS_RADIO_BUTTON_GROUP (radio_buttons), _("Hacker - for expert users"));
nautilus_radio_button_group_set_active_index (NAUTILUS_RADIO_BUTTON_GROUP (radio_buttons),
nautilus_user_level_manager_get_user_level ());
gtk_signal_connect (GTK_OBJECT (radio_buttons),
"changed",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment