Ejemplo n.º 1
0
static gboolean
window_state_timeout_cb (WindowState *state)
{
  mateconf_client_set_int (client, MATECONF_PREFIX "/width", state->width, NULL);
  mateconf_client_set_int (client, MATECONF_PREFIX "/height", state->height, NULL);

  state->timeout_id = 0;
  return FALSE;
}
void
mate_panel_applet_mateconf_set_int (MatePanelApplet  *applet,
			    const gchar  *key,
			    gint          the_int,
			    GError      **opt_error)
{
	MateConfClient  *client;
	gchar        *full_key;
	GError      **error = NULL;
	GError       *our_error = NULL;

	g_return_if_fail (PANEL_IS_APPLET (applet));

	if (opt_error)
		error = opt_error;
	else
		error = &our_error;

	full_key = mate_panel_applet_mateconf_get_full_key (applet, key);

	client = mate_panel_applet_mateconf_get_client ();

	mateconf_client_set_int (client, full_key, the_int, error);

	g_free (full_key);

	if (!opt_error && our_error) {
		g_warning (G_STRLOC ": mateconf error : '%s'", our_error->message);
		g_error_free (our_error);
	}
}
void
xkb_save_default_group (gint default_group)
{
	if (default_group != xkb_get_default_group ())
		mateconf_client_set_int (xkb_mateconf_client,
				      MATEKBD_DESKTOP_CONFIG_KEY_DEFAULT_GROUP,
				      default_group, NULL);
}
void
visual_quality_menu_changed (GtkComboBox *combobox, Idol *idol)
{
	int i;

	i = gtk_combo_box_get_active (combobox);
	mateconf_client_set_int (idol->gc,
			MATECONF_PREFIX"/visual_quality", i, NULL);
	bacon_video_widget_set_visuals_quality (idol->bvw, i);
}
Ejemplo n.º 5
0
  void update(GtkSpinButton* spin)
  {
    int new_value = int(1000 * gtk_spin_button_get_value(spin));
    GError* e = 0;

    if (not mateconf_client_set_int(ProcData::get_instance()->client,
				 this->mateconf_key.c_str(), new_value,
				 &e)) {
      g_warning("Failed to mateconf_client_set_int %s %d : %s\n",
		this->mateconf_key.c_str(), new_value, e->message);
      g_error_free(e);
    }

    procman_debug("set %s to %d", this->mateconf_key.c_str(), new_value);
  }
Ejemplo n.º 6
0
void
mate_panel_applet_save_position (AppletInfo *applet_info,
			    const char *id,
			    gboolean    immediate)
{
	PanelMateConfKeyType  key_type;
	MateConfClient       *client;
	PanelWidget       *panel_widget;
	const char        *key;
	const char        *toplevel_id;
	char              *old_toplevel_id;
	gboolean           right_stick;
	gboolean           locked;
	int                position;

	g_return_if_fail (applet_info != NULL);

	if (!immediate) {
		if (!queued_position_source)
			queued_position_source =
				g_timeout_add_seconds (1,
						       (GSourceFunc) mate_panel_applet_position_save_timeout,
						       NULL);

		if (!g_slist_find (queued_position_saves, applet_info))
			queued_position_saves =
				g_slist_prepend (queued_position_saves, applet_info);

		return;
	}

	if (!(toplevel_id = mate_panel_applet_get_toplevel_id (applet_info)))
		return;

	client  = panel_mateconf_get_client ();

	key_type = applet_info->type == PANEL_OBJECT_APPLET ? PANEL_MATECONF_APPLETS : PANEL_MATECONF_OBJECTS;

	panel_widget = mate_panel_applet_get_panel_widget (applet_info);

	/* FIXME: Instead of getting keys, comparing and setting, there
	   should be a dirty flag */

	key = panel_mateconf_full_key (key_type, id, "toplevel_id");
	old_toplevel_id = mateconf_client_get_string (client, key, NULL);
	if (old_toplevel_id == NULL || strcmp (old_toplevel_id, toplevel_id) != 0)
		mateconf_client_set_string (client, key, toplevel_id, NULL);
	g_free (old_toplevel_id);

	/* Note: changing some properties of the panel that may not be locked down
	   (e.g. background) can change the state of the "panel_right_stick" and
	   "position" properties of an applet that may in fact be locked down.
	   So check if these are writable before attempting to write them */

	right_stick = panel_is_applet_right_stick (applet_info->widget) ? 1 : 0;
	key = panel_mateconf_full_key (
			key_type, id, "panel_right_stick");
	if (mateconf_client_key_is_writable (client, key, NULL) &&
	    (mateconf_client_get_bool (client, key, NULL) ? 1 : 0) != right_stick)
		mateconf_client_set_bool (client, key, right_stick, NULL);

	position = mate_panel_applet_get_position (applet_info);
	if (right_stick && !panel_widget->packed)
		position = panel_widget->size - position;

	key = panel_mateconf_full_key (key_type, id, "position");
	if (mateconf_client_key_is_writable (client, key, NULL) &&
	    mateconf_client_get_int (client, key, NULL) != position)
		mateconf_client_set_int (client, key, position, NULL);

	locked = panel_widget_get_applet_locked (panel_widget, applet_info->widget) ? 1 : 0;
	key = panel_mateconf_full_key (key_type, id, "locked");
	if (mateconf_client_get_bool (client, key, NULL) ? 1 : 0 != locked)
		mateconf_client_set_bool (client, key, locked, NULL);
}