Ejemplo n.º 1
0
gint
calendar_config_get_month_vpane_pos	(void)
{
	calendar_config_init ();

	return  gconf_client_get_int (config, CALENDAR_CONFIG_MONTH_VPANE_POS, NULL);
}
Ejemplo n.º 2
0
static void colors_changed(GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data)
{
        gint color_scheme = gconf_client_get_int(client, entry->key, NULL);
        load_colors(color_scheme);
        load_palette(color_scheme);
        gtk_widget_queue_draw(gui.conversation_panel);
}
Ejemplo n.º 3
0
void
aoview_channel_init(GladeXML *xml)
{
	int	c;
	GConfClient	*gconf_client;

	for (c = 0; c < NUM_CHANNEL; c++) {
		char	name[32];

		sprintf(name, "channel_%d", c);
		channel_item[c] = GTK_RADIO_MENU_ITEM(glade_xml_get_widget(xml, name));
		assert(channel_item[c]);
		g_signal_connect(G_OBJECT(channel_item[c]), "toggled",
				 G_CALLBACK(aoview_channel_change),
				 (gpointer) c);
	}
	gconf_client = gconf_client_get_default();
	c = 0;
	if (gconf_client)
	{
		GError	*error;

		error = NULL;
		c = gconf_client_get_int(gconf_client,
					 ALTOS_CHANNEL_PATH,
					 &error);
		if (error)
			c = 0;
	}
	aoview_channel_notify(c);
}
Ejemplo n.º 4
0
gint
calendar_config_get_day_end_minute	(void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_END_MINUTE, NULL);
}
Ejemplo n.º 5
0
/* The time divisions in the Day/Work-Week view in minutes (5/10/15/30/60). */
gint
calendar_config_get_time_divisions	(void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_TIME_DIVISIONS, NULL);
}
Ejemplo n.º 6
0
/* The start day of the week (0 = Sun to 6 = Mon). */
gint
calendar_config_get_week_start_day	(void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_WEEK_START, NULL);
}
Ejemplo n.º 7
0
gint
calendar_config_get_day_end_hour	(void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_END_HOUR, NULL);
}
Ejemplo n.º 8
0
gint
calendar_config_get_hide_completed_tasks_value	(void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_VALUE, NULL);
}
Ejemplo n.º 9
0
/**
 * calendar_config_get_default_reminder_interval:
 *
 * Queries the interval for the default reminder of newly-created
 * appointments, i.e. 5 in "5 minutes".
 *
 * Return value: Interval for default reminders.
 **/
int
calendar_config_get_default_reminder_interval (void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL, NULL);
}
Ejemplo n.º 10
0
gint gm_pref_store_get_int(GmPrefStore * store, const gchar * key)
{

    gint value = 0;

    if (store == NULL)
        return value;
#if HAVE_GSETTINGS
    value = g_settings_get_int(store->settings, key);
#else
#ifdef HAVE_GCONF
    gchar *full_key;

    full_key = g_strdup_printf("/apps/%s/preferences/%s", store->context, key);
    value = gconf_client_get_int(store->gconf, full_key, NULL);
    g_free(full_key);
#else

    if (g_key_file_has_key(store->keyfile, store->context, key, NULL))
        value = g_key_file_get_integer(store->keyfile, store->context, key, NULL);

#endif
#endif
    return value;
}
Ejemplo n.º 11
0
/* The working days of the week, a bit-wise combination of flags. */
CalWeekdays
calendar_config_get_working_days	(void)
{
	calendar_config_init ();

	return gconf_client_get_int (config, CALENDAR_CONFIG_WORKING_DAYS, NULL);
}
Ejemplo n.º 12
0
Archivo: main.c Proyecto: hsgg/quark
static void
config_load (GConfClient *gconf)
{
    GSList *paths, *it;

    main_set_loop_at_end (gconf_client_get_bool (gconf, LOOP_PLAYLIST, NULL));
    main_set_random_order (gconf_client_get_bool (gconf, RANDOM_ORDER, NULL));

    paths = gconf_client_get_list (gconf, PLAYLIST, GCONF_VALUE_STRING, NULL);
    for (it = paths; it; it = g_slist_next (it)) {
        GError *e = NULL;
        gchar *p = g_filename_from_utf8 (it->data, -1, NULL, NULL, &e);
        if (p) { playlist_append_single (p); g_free(p); }
        if (e) {
            g_warning ("Error loading playlist: %s", e->message);
            g_error_free(e);
        }
        g_free(it->data);
    }
    g_slist_free(paths);

    /* don't need another copy of the playlist in memory, and
       gconf_client_clear_cache makes a nice segfault when I try save stuff
       later. This value can't be edited while quark is running anyways.
    */
    gconf_client_unset (gconf, PLAYLIST, NULL);

    playlist_seek (gconf_client_get_int (gconf, PLAYLIST_POSITION, NULL));
}
Ejemplo n.º 13
0
void
gfloppy_config_load (GFloppyConfig *config,
		     GConfClient   *client)
{
	GError *error = NULL;

	g_return_if_fail (config != NULL);
	g_return_if_fail (client != NULL);

	/* We'll default the value when analyzing it, after loading the config */
	config->default_fs = g_strdup (gconf_client_get_string (client, "/apps/gfloppy/default_fs", &error));
	check_gconf_error (&error);

        /* Check to make sure that it's a valid string */
        if (config->default_fs == NULL)
		config->default_fs = g_strdup (GFLOPPY_CONFIG_FS_FAT);
        else if (config->default_fs && strcmp (config->default_fs, GFLOPPY_CONFIG_FS_EXT2) && strcmp (config->default_fs, GFLOPPY_CONFIG_FS_FAT)) {
		g_free (config->default_fs);
		config->default_fs = g_strdup (GFLOPPY_CONFIG_FS_FAT);
        }

	config->default_formatting_mode = gconf_client_get_int (client, "/apps/gfloppy/default_formatting_mode", &error);

	/* We need to care about users sillyness ;) */
	if (!check_gconf_error (&error) ||
	    config->default_formatting_mode < GFLOPPY_FORMAT_QUICK ||
	    config->default_formatting_mode > GFLOPPY_FORMAT_THOROUGH)
		config->default_formatting_mode = GFLOPPY_FORMAT_STANDARD;

	config->prefer_mkdosfs_backend = gconf_client_get_bool (client, "/apps/gfloppy/prefer_mkdosfs_backend", &error);

	if (!check_gconf_error (&error))
		config->prefer_mkdosfs_backend = TRUE;
}
Ejemplo n.º 14
0
int
gm_conf_get_int (const gchar *key)
{
    g_return_val_if_fail (key != NULL, 0);

    return gconf_client_get_int (client, key, NULL);
}
Ejemplo n.º 15
0
gint
calendar_config_get_task_vpane_pos	(void)
{
	calendar_config_init ();

	return  gconf_client_get_int (config, CALENDAR_CONFIG_TASK_VPANE_POS, NULL);
}
Ejemplo n.º 16
0
static void
get_gconf_options (MTClosure *mt)
{
    gdouble val;

    mt->threshold = gconf_client_get_int (mt->client, OPT_THRESHOLD, NULL);
    mt->delay_enabled = gconf_client_get_bool (mt->client, OPT_DELAY, NULL);
    mt->dwell_enabled = gconf_client_get_bool (mt->client, OPT_DWELL, NULL);
    mt->dwell_show_ctw = gconf_client_get_bool (mt->client, OPT_CTW, NULL);
    mt->dwell_mode = gconf_client_get_int (mt->client, OPT_MODE, NULL);
    mt->style = gconf_client_get_int (mt->client, OPT_STYLE, NULL);
    mt->animate_cursor = gconf_client_get_bool (mt->client, OPT_ANIMATE, NULL);

    val = gconf_client_get_float (mt->client, OPT_DELAY_T, NULL);
    mt_timer_set_target (mt->delay_timer, val);
    val = gconf_client_get_float (mt->client, OPT_DWELL_T, NULL);
    mt_timer_set_target (mt->dwell_timer, val);

    mt->dwell_dirs[DWELL_CLICK_TYPE_SINGLE] =
	gconf_client_get_int (mt->client, OPT_G_SINGLE, NULL);
    mt->dwell_dirs[DWELL_CLICK_TYPE_DOUBLE] =
	gconf_client_get_int (mt->client, OPT_G_DOUBLE, NULL);
    mt->dwell_dirs[DWELL_CLICK_TYPE_DRAG] =
	gconf_client_get_int (mt->client, OPT_G_DRAG, NULL);
    mt->dwell_dirs[DWELL_CLICK_TYPE_RIGHT] =
	gconf_client_get_int (mt->client, OPT_G_RIGHT, NULL);
}
Ejemplo n.º 17
0
void xmonadlog_applet_size_change(GConfClient *client,
                                  guint cnxn_id,
                                  GConfEntry *entry,
                                  gpointer user_data) {
    gint width = gconf_client_get_int (client,
                                        "/apps/xmonad-log-applet/width-chars",
                                        NULL);
    gtk_label_set_width_chars(GTK_LABEL(user_data), width);
}
Ejemplo n.º 18
0
int preferences_get_int (const char *key)
{
        GError *err;
        int i;

        err = NULL;
        i = gconf_client_get_int (warlock_gconf_client, key, &err);
        print_error (err);

        return i;
}
Ejemplo n.º 19
0
void switcher_button_update_icon(SwitcherButton *self)
{
    if (self->priv->model == N800 || self->priv->model == N810)
        self->priv->current = gconf_client_get_int(self->priv->gconfClient, GCONF_CURRENT_2008, 0);
    else if (self->priv->model == N770)
        self->priv->current = gconf_client_get_bool(self->priv->gconfClient, GCONF_CURRENT_2006, 0) ? 0 : 1;

    self->priv->locked = gconf_client_get_bool(self->priv->gconfClient, GCONF_LOCK_ENTRY, 0) ? 1 : 0;
    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(self->priv->menuItemBlock), self->priv->locked != 0);

    gtk_widget_queue_draw(GTK_WIDGET(self));
}
Ejemplo n.º 20
0
static void construct_gl_http_proxy(gboolean use_proxy)
{
    g_free(gl_http_proxy);
    gl_http_proxy = NULL;

    g_slist_foreach(gl_ignore_hosts, (GFunc) g_free, NULL);
    g_slist_free(gl_ignore_hosts);
    gl_ignore_hosts = NULL;
    g_slist_foreach(gl_ignore_addrs, (GFunc) g_free, NULL);
    g_slist_free(gl_ignore_addrs);
    gl_ignore_addrs = NULL;

    if (use_proxy) {
	char *proxy_host;
	int proxy_port;
	GSList *ignore;

	proxy_host =
	    gconf_client_get_string(gl_client,
				    KEY_GCONF_HTTP_PROXY_HOST, NULL);
	proxy_port =
	    gconf_client_get_int(gl_client,
				 KEY_GCONF_HTTP_PROXY_PORT, NULL);

	if (proxy_host && proxy_host[0] != '\0') {
	    if (0 != proxy_port && 0xffff >= (unsigned) proxy_port) {
		gl_http_proxy =
		    g_strdup_printf("%s:%u", proxy_host, (unsigned)
				    proxy_port);
	    } else {
		gl_http_proxy =
		    g_strdup_printf("%s:%u", proxy_host, (unsigned)
				    DEFAULT_HTTP_PROXY_PORT);
	    }
	    DEBUG_HTTP(("New HTTP proxy: '%s'", gl_http_proxy));
	} else {
	    DEBUG_HTTP(("HTTP proxy unset"));
	}

	g_free(proxy_host);
	proxy_host = NULL;

	ignore = gconf_client_get_list(gl_client,
				       KEY_GCONF_HTTP_PROXY_IGNORE_HOSTS,
				       GCONF_VALUE_STRING, NULL);
	g_slist_foreach(ignore, (GFunc) parse_ignore_host, NULL);
	g_slist_foreach(ignore, (GFunc) g_free, NULL);
	g_slist_free(ignore);
	ignore = NULL;
    }
}
static void
sj_metadata_musicbrainz5_init (SjMetadataMusicbrainz5 *self)
{
  GConfClient *gconf_client;
  gchar *server_name;

  SjMetadataMusicbrainz5Private *priv;

  priv = GET_PRIVATE (self);

  gconf_client = gconf_client_get_default ();

  server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL);

  if (server_name && (*server_name == '\0')) {
    g_free (server_name);
    server_name = NULL;
  }

  priv->mb = mb5_query_new (SJ_MUSICBRAINZ_USER_AGENT, server_name, 0);
  g_free (server_name);


  /* Set the HTTP proxy */
  if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) {
    char *proxy_host;
    int port;

    proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL);
    mb5_query_set_proxyhost (priv->mb, proxy_host);
    g_free (proxy_host);

    port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL);
    mb5_query_set_proxyport (priv->mb, port);

    if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) {
      char *username, *password;

      username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL);
      mb5_query_set_proxyusername (priv->mb, username);
      g_free (username);

      password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL);
      mb5_query_set_proxypassword (priv->mb, password);
      g_free (password);
    }
  }

  g_object_unref (gconf_client);
}
Ejemplo n.º 22
0
NS_IMETHODIMP
nsGConfService::GetInt(const nsACString &aKey, PRInt32* aResult)
{
  GError* error = nsnull;
  *aResult = gconf_client_get_int(mClient, PromiseFlatCString(aKey).get(),
                                  &error);

  if (error) {
    g_error_free(error);
    return NS_ERROR_FAILURE;
  }

  return NS_OK;
}
Ejemplo n.º 23
0
static void
gam_app_load_prefs (GamApp *gam_app)
{
    GamAppPrivate *priv;
    gint height, width;

    g_return_if_fail (GAM_IS_APP (gam_app));

    priv = GAM_APP_GET_PRIVATE (gam_app);

    width = gconf_client_get_int (priv->gconf_client,
                                  "/apps/gnome-alsamixer/geometry/main_window_width",
                                  NULL);
    height = gconf_client_get_int (priv->gconf_client,
                                   "/apps/gnome-alsamixer/geometry/main_window_height",
                                   NULL);

    if ((height != 0) && (width != 0))
        gtk_window_resize (GTK_WINDOW (gam_app), width, height);
    else /* This is really pedantic, since it is very unlikely to ever happen */
        gtk_window_set_default_size (GTK_WINDOW (gam_app), 480, 350);
    
}
Ejemplo n.º 24
0
static void
gconf_int_value_changed (GConfClient *client,
                         guint cnxn_id,
                         GConfEntry *entry,
                         gint *save_location)
{
	GError *error = NULL;

	*save_location = gconf_client_get_int (client, entry->key, &error);
	if (error != NULL) {
		g_warning ("%s", error->message);
		g_error_free (error);
	}
}
static void
sj_metadata_musicbrainz3_init (SjMetadataMusicbrainz3 *self)
{
  GConfClient *gconf_client;
  gchar *server_name;

  SjMetadataMusicbrainz3Private *priv;

  priv = GET_PRIVATE (self);

  priv->mb = mb_webservice_new ();

  gconf_client = gconf_client_get_default ();

  server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL);

  if (server_name && strcmp (server_name, "") != 0) {
    mb_webservice_set_host (priv->mb, server_name);
  }

  g_free (server_name);

  /* Set the HTTP proxy */
  if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) {
    char *proxy_host;
    int port;

    proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL);
    mb_webservice_set_proxy_host (priv->mb, proxy_host);
    g_free (proxy_host);

    port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL);
    mb_webservice_set_proxy_port (priv->mb, port);

    if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) {
      char *username, *password;

      username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL);
      mb_webservice_set_proxy_username (priv->mb, username);
      g_free (username);

      password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL);
      mb_webservice_set_proxy_password (priv->mb, password);
      g_free (password);
    }
  }

  g_object_unref (gconf_client);
}
Ejemplo n.º 26
0
int
seahorse_gconf_get_integer (const char *key)
{
	int result;
	GConfClient *client;
	GError *error = NULL;

	g_return_val_if_fail (key != NULL, 0);

	client = get_global_client ();
	g_return_val_if_fail (client != NULL, 0);

	result = gconf_client_get_int (client, key, &error);
    return handle_error (&error) ? 0 : result;
}
Ejemplo n.º 27
0
/**
 * Get the graph update frequency.
 */
guint cpumeter_gconf_get_update_frequency(GConfClient* client)
{
  guint update_freq;
  GConfValue *value = gconf_client_get(client, GCONF_UPDATE_FREQ, NULL);

  if (value)
  {
    update_freq = gconf_client_get_int(client, GCONF_UPDATE_FREQ, NULL);
  }
  else
  {
    update_freq = GCONF_DEFAULT_UPDATE_FREQ;
    gconf_client_set_int(client, GCONF_UPDATE_FREQ, GCONF_DEFAULT_UPDATE_FREQ, NULL);
  }

  return update_freq;
}
Ejemplo n.º 28
0
//this will insert proxy in the session
void
proxify_session(EProxy *proxy, SoupSession *session, gchar *uri)
{
	SoupURI *proxy_uri = NULL;
#if EVOLUTION_VERSION < 30304
	gint ptype = gconf_client_get_int (
			rss_gconf, KEY_GCONF_EVO_PROXY_TYPE, NULL);
#else
	GSettings *settings = g_settings_new(CONF_SCHEMA_EVO_NETWORK);
	gint ptype = g_settings_get_int (
			settings, CONF_EVO_PROXY_TYPE);
#endif

	switch (ptype) {
#ifndef HAVE_LIBSOUP_GNOME
	case 0:
#endif
	case 2:
		if (e_proxy_require_proxy_for_uri (proxy, uri)) {
#if (DATASERVER_VERSION >=2026000)
			proxy_uri = e_proxy_peek_uri_for (proxy, uri);
#else
			g_print("WARN: e_proxy_peek_uri_for() requires evolution-data-server 2.26\n");
			return;
#endif
			if (proxy_uri) {
				d("proxified %s with %s:%d\n", uri, proxy_uri->host, proxy_uri->port);
			}
		} else {
			d("no PROXY-%s\n", uri);
		}
		g_object_set (
			G_OBJECT (session),
			SOUP_SESSION_PROXY_URI,
			proxy_uri, NULL);
		break;

#ifdef HAVE_LIBSOUP_GNOME
	case 0:
		soup_session_add_feature_by_type (
			session, SOUP_TYPE_PROXY_RESOLVER_DEFAULT);
		break;
#endif
	}

}
Ejemplo n.º 29
0
/**
 * gpm_backlight_notify_system_idle_changed:
 **/
static gboolean
gpm_backlight_notify_system_idle_changed (GpmBacklight *backlight, gboolean is_idle)
{
	gdouble elapsed;

	/* no point continuing */
	if (backlight->priv->system_is_idle == is_idle) {
		egg_debug ("state not changed");
		return FALSE;
	}

	/* get elapsed time and reset timer */
	elapsed = g_timer_elapsed (backlight->priv->idle_timer, NULL);
	g_timer_reset (backlight->priv->idle_timer);

	if (is_idle == FALSE) {
		egg_debug ("we have just been idle for %lfs", elapsed);

		/* The user immediatly undimmed the screen!
		 * We should double the timeout to avoid this happening again */
		if (elapsed < 10) {
			/* double the event time */
			backlight->priv->idle_dim_timeout *= 2.0;
			egg_debug ("increasing idle dim time to %is", backlight->priv->idle_dim_timeout);
			gpm_idle_set_timeout_dim (backlight->priv->idle, backlight->priv->idle_dim_timeout);
		}

		/* We reset the dimming after 2 minutes of idle,
		 * as the user will have changed tasks */
		if (elapsed > 2*60) {
			/* reset back to our default dimming */
			backlight->priv->idle_dim_timeout =
				gconf_client_get_int (backlight->priv->conf,
					   GPM_CONF_BACKLIGHT_IDLE_DIM_TIME, NULL);
			egg_debug ("resetting idle dim time to %is", backlight->priv->idle_dim_timeout);
			gpm_idle_set_timeout_dim (backlight->priv->idle, backlight->priv->idle_dim_timeout);
		}
	} else {
		egg_debug ("we were active for %lfs", elapsed);
	}

	egg_debug ("changing powersave idle status to %i", is_idle);
	backlight->priv->system_is_idle = is_idle;
	return TRUE;
}
int MsgSettingGetInt(const char *pKey)
{
	if (pKey == NULL)
	{
		MSG_DEBUG("IN Parameter is NULL");
		return -1;
	}

	int retVal = 0;

#ifdef USE_GCONF
	retVal = gconf_client_get_int((GConfClient*)pClient, pKey, NULL);
#else
	if (vconf_get_int(pKey, &retVal) < 0)
		return -1;
#endif

	return retVal;
}