static void
panel_menu_button_mateconf_notify (MateConfClient     *client,
				guint            cnxn_id,
				MateConfEntry      *entry,
				PanelMenuButton *button)
{
	MateConfValue *value;
	const char *key;

	key = panel_mateconf_basename (mateconf_entry_get_key (entry));

	value = entry->value;

	if (!strcmp (key, "menu_path")) {
		if (value && value->type == MATECONF_VALUE_STRING)
			panel_menu_button_set_menu_path (button,
							 mateconf_value_get_string (value));
	} else if (!strcmp (key, "custom_icon")) {
		if (value && value->type == MATECONF_VALUE_STRING)
			panel_menu_button_set_custom_icon (button,
							   mateconf_value_get_string (value));
	} else if (!strcmp (key, "tooltip")) {
		if (value && value->type == MATECONF_VALUE_STRING)
			panel_menu_button_set_tooltip (button,
						       mateconf_value_get_string (value));
	} else if (!strcmp (key, "use_menu_path")) {
		if (value && value->type == MATECONF_VALUE_BOOL)
			panel_menu_button_set_use_menu_path (button,
							     mateconf_value_get_bool (value));
	} else if (!strcmp (key, "use_custom_icon")) {
		if (value && value->type == MATECONF_VALUE_BOOL)
			panel_menu_button_set_use_custom_icon (button,
							       mateconf_value_get_bool (value));
	}
}
static gboolean
get_mateconf_value_with_default (PlumaDrawspacesPlugin *plugin,
			      const gchar           *key,
			      gboolean               def)
{
	MateConfValue *value;
	gboolean ret;

	value = mateconf_client_get (plugin->priv->mateconf_client,
				  key, NULL);

	if (value != NULL && value->type == MATECONF_VALUE_BOOL)
	{
		ret = mateconf_value_get_bool (value);
	}
	else
	{
		ret = def;
	}

	if (value != NULL)
	{
		mateconf_value_free (value);
	}

	return ret;
}
示例#3
0
static void all_workspaces_changed(MateConfClient* client, guint cnxn_id, MateConfEntry* entry, PagerData* pager)
{
	gboolean value = TRUE; /* Default value */

	if (entry->value != NULL && entry->value->type == MATECONF_VALUE_BOOL)
	{
		value = mateconf_value_get_bool(entry->value);
	}

	pager->display_all = value;
	pager_update(pager);

	if (pager->all_workspaces_radio)
	{
		if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pager->all_workspaces_radio)) != value)
		{
			if (value)
			{
				gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->all_workspaces_radio), TRUE);
			}
			else
			{
				gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->current_only_radio), TRUE);
			}
		}

		if (!g_object_get_data(G_OBJECT(pager->num_rows_spin), NEVER_SENSITIVE))
			gtk_widget_set_sensitive(pager->num_rows_spin, value);
	}
}
示例#4
0
static void display_workspace_names_changed(MateConfClient* client, guint cnxn_id, MateConfEntry* entry, PagerData* pager)
{
	gboolean value = FALSE; /* Default value */

	if (entry->value != NULL && entry->value->type == MATECONF_VALUE_BOOL)
	{
		value = mateconf_value_get_bool(entry->value);
	}

	if (value)
	{
		pager->display_mode = MATEWNCK_PAGER_DISPLAY_NAME;
	}
	else
	{
		pager->display_mode = MATEWNCK_PAGER_DISPLAY_CONTENT;
	}

	pager_update(pager);

	if (pager->display_workspaces_toggle && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pager->display_workspaces_toggle)) != value)
	{
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pager->display_workspaces_toggle), value);
	}
}
static void
chk_separate_group_per_window_toggled (MateConfPropertyEditor * peditor,
				       const gchar * key,
				       const MateConfValue * value,
				       GtkBuilder * dialog)
{
	gtk_widget_set_sensitive (WID ("chk_new_windows_inherit_layout"),
				  mateconf_value_get_bool (value));
}
示例#6
0
static void
auto_complete_history_changed (MateConfClient  *client,
			       guint         cnxn_id,
			       MateConfEntry   *entry,
			       MCData       *mc)
{
    if (!entry->value || entry->value->type != MATECONF_VALUE_BOOL)
	return;

    mc->preferences.auto_complete_history = mateconf_value_get_bool (entry->value);
}
void
mateconf_bookmarks_hook_up_menu (MateConfEditorWindow *window,
			      GtkWidget *menu,
			      GtkWidget *add_bookmark,
			      GtkWidget *edit_bookmarks)
{
	MateConfClient *client;
	guint notify_id;

	g_object_set_data (G_OBJECT (menu), "editor-window", window);

	client = mateconf_client_get_default ();
	
	/* Add a notify function */
	mateconf_client_add_dir (client, "/apps/mateconf-editor/bookmarks",
			      MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
	notify_id = mateconf_client_notify_add (client, "/apps/mateconf-editor/bookmarks",
					     mateconf_bookmarks_key_changed, menu, NULL, NULL);
	g_object_set_data_full (G_OBJECT (menu), "notify-id", GINT_TO_POINTER (notify_id),
				remove_notify_id);


	notify_id = mateconf_client_notify_add (client, "/desktop/mate/interface/menus_have_icons",
					     mateconf_bookmarks_have_icons_notify, menu, NULL, NULL); 
	g_object_set_data_full (G_OBJECT (menu), "notify-id-x", GINT_TO_POINTER (notify_id),
				remove_notify_id);

	mateconf_bookmarks_update_menu (menu);

        {
                gboolean have_icons;
                MateConfValue *value;
                GError *err;

                err = NULL;
                value = mateconf_client_get (client, "/desktop/mate/interface/menus_have_icons", &err);

                if (err != NULL || value == NULL || value->type != MATECONF_VALUE_BOOL)
                        return;

                have_icons = mateconf_value_get_bool (value);
                mateconf_bookmarks_set_have_icons (menu, have_icons);

                mateconf_value_free (value);
        }

	if ( ! mateconf_client_key_is_writable (client, "/apps/mateconf-editor/bookmarks", NULL)) {
		gtk_widget_set_sensitive (add_bookmark, FALSE);
		gtk_widget_set_sensitive (edit_bookmarks, FALSE);
	}

	g_object_unref (client);
}
示例#8
0
/* MateConf notification handlers
 */
static void
show_default_theme_changed (MateConfClient  *client,
			    guint         cnxn_id,
			    MateConfEntry   *entry,
			    MCData       *mc)
{
    if (!entry->value || entry->value->type != MATECONF_VALUE_BOOL)
	return;

    mc->preferences.show_default_theme = mateconf_value_get_bool (entry->value);

    mc_applet_draw (mc); /* FIXME: we shouldn't have to redraw the whole applet */
}
static void
mateconf_bookmarks_have_icons_notify (MateConfClient       *client,
				   guint              cnxn_id,
				   MateConfEntry        *entry,
				   gpointer           data)
{
        GtkWidget *menu;
	gboolean have_icons;

        menu = GTK_WIDGET (data);

	if (entry->value->type != MATECONF_VALUE_BOOL)
		return;

	have_icons = mateconf_value_get_bool (entry->value);

	mateconf_bookmarks_set_have_icons (menu, have_icons);
}
示例#10
0
static void
mate_panel_applet_locked_change_notify (MateConfClient *client,
				   guint        cnxn_id,
				   MateConfEntry  *entry,
				   GtkWidget   *applet)
{
	MateConfValue  *value;
	gboolean     locked;
	gboolean     applet_locked;
	AppletInfo  *info;
	PanelWidget *panel_widget;

	g_assert (applet != NULL);

	info = (AppletInfo  *) g_object_get_data (G_OBJECT (applet),
						  "applet_info");
	if (info == NULL)
		return;

	value = mateconf_entry_get_value (entry);
	if (value == NULL || value->type != MATECONF_VALUE_BOOL)
		return;

	locked = mateconf_value_get_bool (value);

	panel_widget = mate_panel_applet_get_panel_widget (info);
	applet_locked = panel_widget_get_applet_locked (panel_widget,
							info->widget);

	if ((locked && applet_locked) || !(locked || applet_locked))
		return;

	mate_panel_applet_toggle_locked (info);

	if (info->type == PANEL_OBJECT_APPLET)
		mate_panel_applet_frame_sync_menu_state (MATE_PANEL_APPLET_FRAME (info->widget));
	else
		mate_panel_applet_recreate_menu (info);
}
static void
mateconf_notify_cb (MateConfClient *client,
                    guint        cnxn_id,
                    MateConfEntry  *entry,
                    gpointer     user_data)
{
    DrWright  *dr = user_data;
    GtkWidget *item;

    if (!strcmp (entry->key, MATECONF_PATH "/type_time")) {
        if (entry->value->type == MATECONF_VALUE_INT) {
            dr->type_time = 60 * mateconf_value_get_int (entry->value);
            dr->warn_time = MIN (dr->type_time / 10, 5*60);

            dr->state = STATE_START;
        }
    }
    else if (!strcmp (entry->key, MATECONF_PATH "/break_time")) {
        if (entry->value->type == MATECONF_VALUE_INT) {
            dr->break_time = 60 * mateconf_value_get_int (entry->value);
            dr->state = STATE_START;
        }
    }
    else if (!strcmp (entry->key, MATECONF_PATH "/enabled")) {
        if (entry->value->type == MATECONF_VALUE_BOOL) {
            dr->enabled = mateconf_value_get_bool (entry->value);
            dr->state = STATE_START;

            item = gtk_ui_manager_get_widget (dr->ui_manager,
                                              "/Pop/TakeABreak");
            gtk_widget_set_sensitive (item, dr->enabled);

            update_status (dr);
        }
    }

    maybe_change_state (dr);
}
static void
on_mateconf_notify (MateConfClient *client,
		 guint cnxn_id,
		 MateConfEntry *entry,
		 gpointer user_data)
{
	PlumaDrawspacesPlugin *plugin = PLUMA_DRAWSPACES_PLUGIN (user_data);
	gboolean value;

	if (strcmp (entry->key, MATECONF_KEY_DRAW_TABS) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_TAB;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_TAB;
		}
	}
	else if (strcmp (entry->key, MATECONF_KEY_DRAW_SPACES) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_SPACE;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_SPACE;
		}
	}
	else if (strcmp (entry->key, MATECONF_KEY_DRAW_NEWLINE) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_NEWLINE;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_NEWLINE;
		}
	}
	else if (strcmp (entry->key, MATECONF_KEY_DRAW_NBSP) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_NBSP;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_NBSP;
		}
	}
	else if (strcmp (entry->key, MATECONF_KEY_DRAW_LEADING) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_LEADING;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_LEADING;
		}
	}
	else if (strcmp (entry->key, MATECONF_KEY_DRAW_TEXT) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_TEXT;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_TEXT;
		}
	}
	else if (strcmp (entry->key, MATECONF_KEY_DRAW_TRAILING) == 0)
	{
		value = mateconf_value_get_bool (entry->value);

		if (value)
		{
			plugin->priv->flags |= GTK_SOURCE_DRAW_SPACES_TRAILING;
		}
		else
		{
			plugin->priv->flags &= ~GTK_SOURCE_DRAW_SPACES_TRAILING;
		}
	}

	draw_spaces (plugin);
}
gchar*
mateconf_value_to_string(const MateConfValue* value)
{
  /* These strings shouldn't be translated; they're primarily 
     intended for machines to read, not humans, though I do
     use them in some debug spew
  */
  gchar* retval = NULL;

  switch (value->type)
    {
    case MATECONF_VALUE_INT:
      retval = g_strdup_printf("%d", mateconf_value_get_int(value));
      break;
    case MATECONF_VALUE_FLOAT:
      retval = mateconf_double_to_string(mateconf_value_get_float(value));
      break;
    case MATECONF_VALUE_STRING:
      retval = g_strdup(mateconf_value_get_string(value));
      break;
    case MATECONF_VALUE_BOOL:
      retval = mateconf_value_get_bool(value) ? g_strdup("true") : g_strdup("false");
      break;
    case MATECONF_VALUE_LIST:
      {
        GSList* list;

        list = mateconf_value_get_list(value);

        if (list == NULL)
          retval = g_strdup("[]");
        else
          {
            gchar* buf = NULL;
            guint bufsize = 64;
            guint cur = 0;

            g_assert(list != NULL);
            
            buf = g_malloc(bufsize+3); /* my +3 superstition */
            
            buf[0] = '[';
            ++cur;

            g_assert(cur < bufsize);
            
            while (list != NULL)
              {
                gchar* tmp;
                gchar* elem;
                guint len;
                
                tmp = mateconf_value_to_string((MateConfValue*)list->data);

                g_assert(tmp != NULL);

		elem = escape_string(tmp, ",]");

		g_free(tmp);

                len = strlen(elem);

                if ((cur + len + 2) >= bufsize) /* +2 for '\0' and comma */
                  {
                    bufsize = MAX(bufsize*2, bufsize+len+4); 
                    buf = g_realloc(buf, bufsize+3);
                  }

                g_assert(cur < bufsize);
                
                strcpy(&buf[cur], elem);
                cur += len;

                g_assert(cur < bufsize);
                
                g_free(elem);

                buf[cur] = ',';
                ++cur;

                g_assert(cur < bufsize);
                
                list = g_slist_next(list);
              }

            g_assert(cur < bufsize);
            
            buf[cur-1] = ']'; /* overwrites last comma */
            buf[cur] = '\0';

            retval = buf;
          }
      }
      break;
    case MATECONF_VALUE_PAIR:
      {
        gchar* tmp;
        gchar* car;
        gchar* cdr;

        if (mateconf_value_get_car (value))
          tmp = mateconf_value_to_string(mateconf_value_get_car(value));
        else
          tmp = g_strdup ("nil");
	car = escape_string(tmp, ",)");
	g_free(tmp);

        if (mateconf_value_get_cdr (value))
          tmp = mateconf_value_to_string(mateconf_value_get_cdr(value));
        else
          tmp = g_strdup ("nil");
	cdr = escape_string(tmp, ",)");
	g_free(tmp);
        retval = g_strdup_printf("(%s,%s)", car, cdr);
        g_free(car);
        g_free(cdr);
      }
      break;
      /* These remaining shouldn't really be used outside of debug spew... */
    case MATECONF_VALUE_INVALID:
      retval = g_strdup("Invalid");
      break;
    case MATECONF_VALUE_SCHEMA:
      {
        const gchar* locale;
        const gchar* type;
        const gchar* list_type;
        const gchar* car_type;
        const gchar* cdr_type;
        
        locale = mateconf_schema_get_locale(mateconf_value_get_schema(value));
        type = mateconf_value_type_to_string(mateconf_schema_get_type(mateconf_value_get_schema(value)));
        list_type = mateconf_value_type_to_string(mateconf_schema_get_list_type(mateconf_value_get_schema(value)));
        car_type = mateconf_value_type_to_string(mateconf_schema_get_car_type(mateconf_value_get_schema(value)));
        cdr_type = mateconf_value_type_to_string(mateconf_schema_get_cdr_type(mateconf_value_get_schema(value)));
        
        retval = g_strdup_printf("Schema (type: `%s' list_type: '%s' "
				 "car_type: '%s' cdr_type: '%s' locale: `%s')",
                                 type, list_type, car_type, cdr_type,
				 locale ? locale : "(null)");
      }
      break;
    default:
      g_assert_not_reached();
      break;
    }

  return retval;
}
int
mateconf_value_compare (const MateConfValue *value_a,
                     const MateConfValue *value_b)
{
  g_return_val_if_fail (value_a != NULL, 0);
  g_return_val_if_fail (value_b != NULL, 0);

  /* Impose arbitrary type ordering, just to keep the
   * sort invariants stable.
   */
  if (value_a->type < value_b->type)
    return -1;
  else if (value_a->type > value_b->type)
    return 1;
  
  switch (value_a->type)
    {
    case MATECONF_VALUE_INT:
      if (mateconf_value_get_int (value_a) < mateconf_value_get_int (value_b))
        return -1;
      else if (mateconf_value_get_int (value_a) > mateconf_value_get_int (value_b))
        return 1;
      else
        return 0;
    case MATECONF_VALUE_FLOAT:
      if (mateconf_value_get_float (value_a) < mateconf_value_get_float (value_b))
        return -1;
      else if (mateconf_value_get_float (value_a) > mateconf_value_get_float (value_b))
        return 1;
      else
        return 0;
    case MATECONF_VALUE_STRING:
      return strcmp (mateconf_value_get_string (value_a),
                     mateconf_value_get_string (value_b));
    case MATECONF_VALUE_BOOL:
      if (mateconf_value_get_bool (value_a) == mateconf_value_get_bool (value_b))
        return 0;
      /* make TRUE > FALSE to maintain sort invariants */
      else if (mateconf_value_get_bool (value_a))
        return 1;
      else
        return -1;
    case MATECONF_VALUE_LIST:
      {
        GSList *list_a;
        GSList *list_b;

        list_a = mateconf_value_get_list (value_a);
        list_b = mateconf_value_get_list (value_b);
        
        while (list_a != NULL && list_b != NULL)
          {
            int result;

            result = mateconf_value_compare (list_a->data, list_b->data);

            if (result != 0)
              return result;
            
            list_a = g_slist_next (list_a);
            list_b = g_slist_next (list_b);
          }
        
        if (list_a)
          return 1; /* list_a is longer so "greater" */
        else if (list_b)
          return -1;
        else
          return 0;
      }
    case MATECONF_VALUE_PAIR:
      {
        MateConfValue *a_car, *b_car, *a_cdr, *b_cdr;
        int result;
        
        a_car = mateconf_value_get_car (value_a);
        b_car = mateconf_value_get_car (value_b);
        a_cdr = mateconf_value_get_cdr (value_a);
        b_cdr = mateconf_value_get_cdr (value_b);

        if (a_car == NULL && b_car != NULL)
          return -1;
        else if (a_car != NULL && b_car == NULL)
          return 1;
        else if (a_car != NULL && b_car != NULL)
          {
            result = mateconf_value_compare (a_car, b_car);

            if (result != 0)
              return result;
          }

        if (a_cdr == NULL && b_cdr != NULL)
          return -1;
        else if (a_cdr != NULL && b_cdr == NULL)
          return 1;
        else if (a_cdr != NULL && b_cdr != NULL)
          {
            result = mateconf_value_compare (a_cdr, b_cdr);

            if (result != 0)
              return result;
          }

        return 0;
      }
    case MATECONF_VALUE_INVALID:
      return 0;
    case MATECONF_VALUE_SCHEMA:
      {
        const char *locale_a, *locale_b;
        MateConfValueType type_a, type_b;
        MateConfValueType list_type_a, list_type_b;
        MateConfValueType car_type_a, car_type_b;
        MateConfValueType cdr_type_a, cdr_type_b;
        const char *short_desc_a, *short_desc_b;
        const char *long_desc_a, *long_desc_b;
        int result;
        
        type_a = mateconf_schema_get_type (mateconf_value_get_schema (value_a));
        type_b = mateconf_schema_get_type (mateconf_value_get_schema (value_b));

        if (type_a < type_b)
          return -1;
        else if (type_a > type_b)
          return 1;

        short_desc_a = mateconf_schema_get_short_desc (mateconf_value_get_schema (value_a));
        short_desc_b = mateconf_schema_get_short_desc (mateconf_value_get_schema (value_b));

        result = null_safe_strcmp (short_desc_a, short_desc_b);
        if (result != 0)
          return result;
        
        long_desc_a = mateconf_schema_get_long_desc (mateconf_value_get_schema (value_a));


        long_desc_b = mateconf_schema_get_long_desc (mateconf_value_get_schema (value_b));

        result = null_safe_strcmp (long_desc_a, long_desc_b);
        if (result != 0)
          return result;
        
        locale_a = mateconf_schema_get_locale (mateconf_value_get_schema (value_a));
        locale_b = mateconf_schema_get_locale (mateconf_value_get_schema (value_b));

        result = null_safe_strcmp (locale_a, locale_b);
        if (result != 0)
          return result;        

        if (type_a == MATECONF_VALUE_LIST)
          {
            list_type_a = mateconf_schema_get_list_type (mateconf_value_get_schema (value_a));
            list_type_b = mateconf_schema_get_list_type (mateconf_value_get_schema (value_b));
            
            if (list_type_a < list_type_b)
              return -1;
            else if (list_type_a > list_type_b)
              return 1;
          }

        if (type_a == MATECONF_VALUE_PAIR)
          {
            car_type_a = mateconf_schema_get_car_type (mateconf_value_get_schema (value_a));
            car_type_b = mateconf_schema_get_car_type (mateconf_value_get_schema (value_b));
            
            if (car_type_a < car_type_b)
              return -1;
            else if (car_type_a > car_type_b)
              return 1;
            
            cdr_type_a = mateconf_schema_get_cdr_type (mateconf_value_get_schema (value_a));
            cdr_type_b = mateconf_schema_get_cdr_type (mateconf_value_get_schema (value_b));
            
            if (cdr_type_a < cdr_type_b)
              return -1;
            else if (cdr_type_a > cdr_type_b)
              return 1;
          }

        return 0;
      }
    }

  g_assert_not_reached ();

  return 0;
}
static gboolean
handle_file (const gchar *filename)
{
  GKeyFile *keyfile;
  MateConfClient *client;
  MateConfValue *value;
  gint i, j;
  gchar *mateconf_key;
  gchar **groups;
  gchar **keys;
  GVariantBuilder *builder;
  GVariant *v;
  const gchar *s;
  gchar *str;
  gint ii;
  GSList *list, *l;
  GSettings *settings;
  GError *error;

  keyfile = g_key_file_new ();

  error = NULL;
  if (!g_key_file_load_from_file (keyfile, filename, 0, &error))
    {
      g_printerr ("%s\n", error->message);
      g_error_free (error);

      g_key_file_free (keyfile);

      return FALSE;
    }

  client = mateconf_client_get_default ();

  groups = g_key_file_get_groups (keyfile, NULL);
  for (i = 0; groups[i]; i++)
    {
      gchar **schema_path;

      schema_path = g_strsplit (groups[i], ":", 2);

      if (verbose)
        {
          g_print ("collecting settings for schema '%s'\n", schema_path[0]);
          if (schema_path[1])
            g_print ("for storage at '%s'\n", schema_path[1]);
        }

      if (schema_path[1] != NULL)
        settings = g_settings_new_with_path (schema_path[0], schema_path[1]);
      else
        settings = g_settings_new (schema_path[0]);

      g_settings_delay (settings);

      error = NULL;
      if ((keys = g_key_file_get_keys (keyfile, groups[i], NULL, &error)) == NULL)
        {
          g_printerr ("%s", error->message);
          g_error_free (error);

          continue;
        }

      for (j = 0; keys[j]; j++)
        {
          if (strchr (keys[j], '/') != 0)
            {
              g_printerr ("Key '%s' contains a '/'\n", keys[j]);

              continue;
            }

          error = NULL;
          if ((mateconf_key = g_key_file_get_string (keyfile, groups[i], keys[j], &error)) ==  NULL)
            {
              g_printerr ("%s", error->message);
              g_error_free (error);

              continue;
            }

          error = NULL;
          if ((value = mateconf_client_get_without_default (client, mateconf_key, &error)) == NULL)
            {
              if (error)
                {
                  g_printerr ("Failed to get MateConf key '%s': %s\n",
                              mateconf_key, error->message);
                  g_error_free (error);
                }
              else
                {
                  if (verbose)
                    g_print ("Skipping MateConf key '%s', no user value\n",
                             mateconf_key);
                }

              g_free (mateconf_key);

              continue;
            }

          switch (value->type)
            {
            case MATECONF_VALUE_STRING:
              if (dry_run)
                g_print ("set key '%s' to string '%s'\n", keys[j],
                         mateconf_value_get_string (value));
              else
                g_settings_set (settings, keys[j], "s",
                                mateconf_value_get_string (value));
              break;

            case MATECONF_VALUE_INT:
              if (dry_run)
                g_print ("set key '%s' to integer '%d'\n",
                         keys[j], mateconf_value_get_int (value));
              else
                g_settings_set (settings, keys[j], "i",
                                mateconf_value_get_int (value));
              break;

            case MATECONF_VALUE_BOOL:
              if (dry_run)
                g_print ("set key '%s' to boolean '%d'\n",
                         keys[j], mateconf_value_get_bool (value));
              else
                g_settings_set (settings, keys[j], "b",
                                mateconf_value_get_bool (value));
              break;

            case MATECONF_VALUE_FLOAT:
              if (dry_run)
                g_print ("set key '%s' to double '%g'\n",
                         keys[j], mateconf_value_get_float (value));
              else
                g_settings_set (settings, keys[j], "d",
                                mateconf_value_get_float (value));
              break;

            case MATECONF_VALUE_LIST:
              switch (mateconf_value_get_list_type (value))
                {
                case MATECONF_VALUE_STRING:
                  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
                  list = mateconf_value_get_list (value);
                  if (list != NULL)
                    {
                      for (l = list; l; l = l->next)
                        {
                          MateConfValue *lv = l->data;
                          s = mateconf_value_get_string (lv);
                          g_variant_builder_add (builder, "s", s);
                        }
                      v = g_variant_new ("as", builder);
                    }
                  else
                    v = g_variant_new_array (G_VARIANT_TYPE_STRING, NULL, 0);
                  g_variant_ref_sink (v);

                  if (dry_run)
                    {
                      str = g_variant_print (v, FALSE);
                      g_print ("set key '%s' to a list of strings: %s\n",
                               keys[j], str);
                      g_free (str);
                    }
                  else
                    g_settings_set_value (settings, keys[j], v);

                  g_variant_unref (v);
                  g_variant_builder_unref (builder);
                  break;

                case MATECONF_VALUE_INT:
                  builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
                  list = mateconf_value_get_list (value);
                  if (list != NULL)
                    {
                      for (l = list; l; l = l->next)
                        {
                          MateConfValue *lv = l->data;
                          ii = mateconf_value_get_int (lv);
                          g_variant_builder_add (builder, "i", ii);
                        }
                      v = g_variant_new ("ai", builder);
                    }
                  else
                    v = g_variant_new_array (G_VARIANT_TYPE_INT32, NULL, 0);
                  g_variant_ref_sink (v);

                  if (dry_run)
                    {
                      str = g_variant_print (v, FALSE);
                      g_print ("set key '%s' to a list of integers: %s\n",
                               keys[j], str);
                      g_free (str);
                    }
                  else
                    g_settings_set_value (settings, keys[j], v);

                  g_variant_unref (v);
                  g_variant_builder_unref (builder);
                  break;

                default:
                  g_printerr ("Keys of type 'list of %s' not handled yet\n",
                              mateconf_value_type_to_string (mateconf_value_get_list_type (value)));
                  break;
                }
              break;

            default:
              g_printerr ("Keys of type %s not handled yet\n",
                          mateconf_value_type_to_string (value->type));
              break;
            }

          mateconf_value_free (value);
          g_free (mateconf_key);
        }

      g_strfreev (keys);

      if (!dry_run)
        g_settings_apply (settings);

      g_object_unref (settings);
      g_strfreev (schema_path);
    }

  g_strfreev (groups);

  g_object_unref (client);

  return TRUE;
}
static void web_mateconf_changed_cb(MateConfPropertyEditor* peditor, gchar* key, MateConfValue* value, MateDACapplet* capplet)
{
    MateConfChangeSet *cs;
    GError *error = NULL;
    GList *list_entry;

    /* This function is used to update HTTPS,ABOUT and UNKNOWN handlers, which
     * should also use the same value as HTTP
     */

    if (strcmp (key, DEFAULT_APPS_KEY_HTTP_EXEC) == 0) {
	gchar *short_browser, *pos;
	const gchar *value_str = mateconf_value_get_string (value);

	cs = mateconf_change_set_new ();

	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_EXEC, value);
	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_EXEC, value);
	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_EXEC, value);
	pos = strstr (value_str, " ");
	if (pos == NULL)
	    short_browser = g_strdup (value_str);
	else
	    short_browser = g_strndup (value_str, pos - value_str);
	mateconf_change_set_set_string (cs, DEFAULT_APPS_KEY_BROWSER_EXEC, short_browser);
	g_free (short_browser);

	list_entry = g_list_find_custom (capplet->web_browsers,
					 value_str,
					 (GCompareFunc) web_item_comp);

	if (list_entry) {
	    MateDAWebItem *item = (MateDAWebItem *) list_entry->data;

	    mateconf_change_set_set_bool (cs, DEFAULT_APPS_KEY_BROWSER_NREMOTE, item->netscape_remote);
	}

	mateconf_client_commit_change_set (capplet->mateconf, cs, TRUE, &error);

	if (error != NULL) {
	    g_warning (_("Error saving configuration: %s"), error->message);
	    g_error_free (error);
	    error = NULL;
	}

	mateconf_change_set_unref (cs);
    }
    else if (strcmp (key, DEFAULT_APPS_KEY_HTTP_NEEDS_TERM) == 0) {
	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (capplet->web_browser_terminal_checkbutton),
				      mateconf_value_get_bool (value));

	cs = mateconf_change_set_new ();

	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_HTTPS_NEEDS_TERM, value);
	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_UNKNOWN_NEEDS_TERM, value);
	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_ABOUT_NEEDS_TERM, value);
	mateconf_change_set_set (cs, DEFAULT_APPS_KEY_BROWSER_NEEDS_TERM, value);

	mateconf_client_commit_change_set (capplet->mateconf, cs, TRUE, &error);

	if (error != NULL) {
	    g_warning (_("Error saving configuration: %s"), error->message);
	    g_error_free (error);
	    error = NULL;
	}

	mateconf_change_set_unref (cs);
    }
}