Пример #1
0
static void gglk_style_response(GtkDialog *dialog,
				gint response,
				gpointer unused_data)
{
    switch(response) {
    case GTK_RESPONSE_APPLY:
	if(gglk_style_changeset)
	    gconf_client_commit_change_set(gconf_client_get_default(),
					   gglk_style_changeset,
					   TRUE,
					   NULL);
	break;
    case GTK_RESPONSE_OK:
	if(gglk_style_changeset)
	    gconf_client_commit_change_set(gconf_client_get_default(),
					   gglk_style_changeset,
					   TRUE,
					   NULL);
	gtk_widget_destroy(GTK_WIDGET(dialog));
	break;
    case GTK_RESPONSE_CANCEL:
	gtk_widget_destroy(GTK_WIDGET(dialog));
	break;
    }
}
Пример #2
0
static void getagpslatlon()
{
    GConfClient *clint = NULL;
    double d;
    char c[100];
    GConfValue *gcv = NULL;

    g_type_init();

    strcpy(c, "/system/osso/supl/");
    strcat(c, "pos_latitude");
    clint = gconf_client_get_default();
    gcv = gconf_client_get_without_default(clint, c, NULL);
    d = 0.0;
    if (gcv) {
        d = gconf_value_get_float(gcv);
        gconf_value_free(gcv);
    }
    g_object_unref(clint);
    gpst.llat = (int) (d * 1000000.0);

    strcpy(c, "/system/osso/supl/");
    strcat(c, "pos_longitude");
    clint = gconf_client_get_default();
    gcv = gconf_client_get_without_default(clint, c, NULL);
    d = 0.0;
    if (gcv) {
        d = gconf_value_get_float(gcv);
        gconf_value_free(gcv);
    }
    g_object_unref(clint);
    gpst.llon = (int) (d * 1000000.0);
}
Пример #3
0
void
config_open_close (const gint op)
{
  static GMutex mutex;

  switch (op)
    {
    case CONFIG_OP_OPEN:
      g_mutex_lock (&mutex);
      if (!conf_client)
	{
	  conf_client = gconf_client_get_default ();
	}
      g_mutex_unlock (&mutex);
      break;
    case CONFIG_OP_CLOSE:
      g_mutex_lock (&mutex);
      if (conf_client)
	{
	  g_object_unref (conf_client);
	}
      g_mutex_unlock (&mutex);
      break;
    }
}
Пример #4
0
int
main(int argc, char** argv)
{
  GError* error = NULL;
  GConfClient* client = NULL;

  gtk_init(&argc, &argv);
  
  if (!gconf_init(argc, argv, &error))
    {
      g_assert(error != NULL);
      g_warning("GConf init failed:\n  %s", error->message);
      return 1;
    }

  g_assert(error == NULL);

  client = gconf_client_get_default();

  gconf_client_add_dir(client, "/apps/gnome/testgconfclient", GCONF_CLIENT_PRELOAD_NONE, NULL);

  create_controls(client);
  
  gtk_main();

  g_object_unref(G_OBJECT(client));
  
  return 0;
}
Пример #5
0
static void
mnb_statusbar_update_datetime (MnbStatusbar *self)
{
  MnbStatusbarPrivate *priv = self->priv;
  GDateTime *datetime = g_date_time_new_now_local ();
  gchar *time_str;
  GConfClient *client = gconf_client_get_default ();
  gboolean c24h = gconf_client_get_bool (client, MNB_24H_KEY, NULL);

  if (c24h)
    {

      /* translators: translate this to a suitable 24 hourt time
       * format for your locale showing only hours and minutes. For
       * available format specifiers see
       * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html
       */
      time_str = g_date_time_format (datetime, _("%A %B %e, %Y - %H:%M"));
    }
  else
    {
      /* translators: translate this to a suitable default time format for
       * your locale showing only hours and minutes. For available format
       * specifiers see
       * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html
       */
      time_str = g_date_time_format (datetime, _("%A %B %e, %Y - %l:%M %P"));
    }

  mx_button_set_label (MX_BUTTON (priv->datetime), time_str);

  g_date_time_unref (datetime);
  g_free (time_str);
}
Пример #6
0
static void
em_junk_sa_init (void)
{
	pthread_mutex_lock (&em_junk_sa_init_lock);

	if (!em_junk_sa_gconf) {
		em_junk_sa_gconf = gconf_client_get_default();
		gconf_client_add_dir (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);

		em_junk_sa_local_only = gconf_client_get_bool (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/local_only", NULL);
		em_junk_sa_use_daemon = gconf_client_get_bool (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/use_daemon", NULL);

		pthread_mutex_lock (&em_junk_sa_preferred_socket_path_lock);
		g_free (em_junk_sa_preferred_socket_path);
		em_junk_sa_preferred_socket_path = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/socket_path", NULL);
		pthread_mutex_unlock (&em_junk_sa_preferred_socket_path_lock);

		gconf_client_notify_add(em_junk_sa_gconf, "/apps/evolution/mail/junk/sa",
					(GConfClientNotifyFunc)em_junk_sa_setting_notify,
					NULL, NULL, NULL);

		em_junk_sa_spamc_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamc_binary", NULL);
		em_junk_sa_spamd_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamd_binary", NULL);
	}

	pthread_mutex_unlock (&em_junk_sa_init_lock);

	atexit (em_junk_sa_finalize);
}
Пример #7
0
static void
electron_manager_init (ElectronManager *eman)
{
  ElectronManagerPrivate *priv = ELECTRON_MANAGER_GET_PRIVATE (eman);
  GError *error = NULL;

  eman->priv = priv;

  eman->data = electron_new ();
  priv->timeout = 0;

  priv->gconf = gconf_client_get_default ();
  gconf_client_add_dir (priv->gconf, ELECTRON_MANAGER_ROMS_CONF_DIR,
                        GCONF_CLIENT_PRELOAD_ONELEVEL, &error);

  if (error == NULL)
    priv->added_dir = FALSE;
  else
  {
    g_error_free (error);
    priv->added_dir = TRUE;
  }

  priv->value_changed_handler
    = g_signal_connect (priv->gconf, "value-changed",
                        G_CALLBACK (electron_manager_on_value_changed),
                        eman);

  priv->full_speed_timer = g_timer_new ();
}
static GdkFilterReturn
device_presence_filter (GdkXEvent *xevent,
                        GdkEvent  *event,
                        gpointer   data)
{
    XEvent *xev = (XEvent *)xevent;
    XEventClass class_presence;
    int xi_presence;
    GpdsXInput *xinput;
    GsdPointingDeviceManager *manager = GSD_POINTING_DEVICE_MANAGER(data);

    xinput = gsd_pointing_device_manager_get_xinput(manager);
    if (!xinput)
        return GDK_FILTER_CONTINUE;

    DevicePresence(gdk_x11_get_default_xdisplay(), xi_presence, class_presence);

    if (xev->type == xi_presence) {
        XDevicePresenceNotifyEvent *notify_event = (XDevicePresenceNotifyEvent *)xev;
        if (notify_event->devchange == DeviceEnabled ||
            notify_event->devchange == DeviceRemoved) {
            set_disable_while_other_device_exists(manager,
                                                  xinput,
                                                  gconf_client_get_default());
        }
    }
    g_object_unref(xinput);

    return GDK_FILTER_CONTINUE;
}
Пример #9
0
void
aoview_voice_init(GladeXML *xml)
{
	gboolean	enabled;
	GConfClient	*gconf_client;

	voice_enable = GTK_CHECK_MENU_ITEM(glade_xml_get_widget(xml, "voice_enable"));
	assert(voice_enable);

	gconf_client = gconf_client_get_default();
	enabled = TRUE;
	if (gconf_client)
	{
		GError	*error;

		error = NULL;
		enabled = gconf_client_get_bool(gconf_client,
						ALTOS_VOICE_PATH,
						&error);
		if (error)
			enabled = TRUE;
	}
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(voice_enable), enabled);
	if (enabled)
		aoview_voice_open();

	g_signal_connect(G_OBJECT(voice_enable), "toggled",
			 G_CALLBACK(aoview_voice_enable),
			 voice_enable);
}
Пример #10
0
/**
 * D-Bus callback for the config get method call
 *
 * @param msg The D-Bus message to reply to
 *
 * @return TRUE if reply message was successfully sent, FALSE on failure
 */
static gboolean config_get_dbus_cb(DBusMessage *const msg)
{
	gboolean status = FALSE;
	DBusMessage *reply = NULL;
	const char *key = NULL;
	GError *err = NULL;
	GConfValue *conf = 0;

	DBusMessageIter body;

	mce_log(LL_DEBUG, "Received configuration query request");

	dbus_message_iter_init(msg, &body);

	/* HACK: The key used to be object path, not string.
	 *       Allow clients to use either one. */
	switch( dbus_message_iter_get_arg_type(&body) ) {
	case DBUS_TYPE_OBJECT_PATH:
	case DBUS_TYPE_STRING:
		dbus_message_iter_get_basic(&body, &key);
		dbus_message_iter_next(&body);
		break;

	default:
		reply = dbus_message_new_error(msg, DBUS_ERROR_INVALID_ARGS,
					       "expected string/object path");
		goto EXIT;
	}

	if( !(conf = gconf_client_get(gconf_client_get_default(), key, &err)) ) {
		reply = dbus_message_new_error(msg,
					       "com.nokia.mce.GConf.Error",
					       err->message ?: "unknown");
		goto EXIT;
	}
Пример #11
0
/**
 * gpk_prefs_update_freq_combo_changed:
 **/
static void
gpk_prefs_update_freq_combo_changed (GtkWidget *widget, gpointer data)
{
	gchar *value;
	guint freq = 0;
	GConfClient *client;

	client = gconf_client_get_default ();
	value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
	if (strcmp (value, PK_FREQ_HOURLY_TEXT) == 0)
		freq = GPK_PREFS_VALUE_HOURLY;
	else if (strcmp (value, PK_FREQ_DAILY_TEXT) == 0)
		freq = GPK_PREFS_VALUE_DAILY;
	else if (strcmp (value, PK_FREQ_WEEKLY_TEXT) == 0)
		freq = GPK_PREFS_VALUE_WEEKLY;
	else if (strcmp (value, PK_FREQ_NEVER_TEXT) == 0)
		freq = GPK_PREFS_VALUE_NEVER;
	else
		g_assert (FALSE);

	egg_debug ("Changing %s to %i", GPK_CONF_FREQUENCY_GET_UPDATES, freq);
	gconf_client_set_int (client, GPK_CONF_FREQUENCY_GET_UPDATES, freq, NULL);
	g_free (value);
	g_object_unref (client);
}
Пример #12
0
/**
 * gpk_prefs_update_combo_changed:
 **/
static void
gpk_prefs_update_combo_changed (GtkWidget *widget, gpointer data)
{
	gchar *value;
	const gchar *action;
	GpkUpdateEnum update = GPK_UPDATE_ENUM_UNKNOWN;
	GConfClient *client;

	client = gconf_client_get_default ();
	value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
	if (value == NULL) {
		egg_warning ("value NULL");
		return;
	}
	if (strcmp (value, PK_UPDATE_ALL_TEXT) == 0) {
		update = GPK_UPDATE_ENUM_ALL;
	} else if (strcmp (value, PK_UPDATE_SECURITY_TEXT) == 0) {
		update = GPK_UPDATE_ENUM_SECURITY;
	} else if (strcmp (value, PK_UPDATE_NONE_TEXT) == 0) {
		update = GPK_UPDATE_ENUM_NONE;
	} else {
		g_assert (FALSE);
	}

	action = gpk_update_enum_to_text (update);
	egg_debug ("Changing %s to %s", GPK_CONF_AUTO_UPDATE, action);
	gconf_client_set_string (client, GPK_CONF_AUTO_UPDATE, action, NULL);
	g_free (value);
	g_object_unref (client);
}
Пример #13
0
static void
gam_app_init (GamApp *gam_app)
{
    GamAppPrivate *priv;

    g_return_if_fail (GAM_IS_APP (gam_app));

    priv = GAM_APP_GET_PRIVATE (gam_app);

    priv->gconf_client = gconf_client_get_default ();
    /*gconf_client_add_dir (priv->gconf_client,
                          "/apps/PAW/PAWed/preferences",
                          GCONF_CLIENT_PRELOAD_NONE,
                          NULL);*/

    priv->ui_manager = gtk_ui_manager_new ();
    priv->ui_accel_group = gtk_ui_manager_get_accel_group (priv->ui_manager);

    priv->main_action_group = gtk_action_group_new ("MainActions");

#ifdef ENABLE_NLS
    gtk_action_group_set_translation_domain (priv->main_action_group, GETTEXT_PACKAGE);
#endif

    priv->status_bar = gtk_statusbar_new ();
    priv->tip_message_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->status_bar),
                                                          "GamAppToolTips");

    priv->notebook = gtk_notebook_new ();
    gtk_notebook_set_scrollable (GTK_NOTEBOOK (priv->notebook), TRUE);
    gtk_notebook_set_tab_pos (GTK_NOTEBOOK (priv->notebook), GTK_POS_TOP);
    priv->view_mixers_cb_active=TRUE;
}
Пример #14
0
void save_settings()
{
	  GConfClient* gcClient = NULL;

	  gcClient = gconf_client_get_default();
	  g_assert(GCONF_IS_CLIENT(gcClient));

	  gchar *port_path = g_strconcat(config->GC_ROOT, "port", NULL);
	  const gchar *save_server_port = gtk_entry_get_text(GTK_ENTRY(txtServerPort));
	  if (! gconf_client_set_string(gcClient, port_path, save_server_port, NULL) ) {
			GtkWidget *failDialog = gtk_message_dialog_new(NULL,
		     		GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
		     		GTK_BUTTONS_OK,
		     		"Failed to update server port setting\n");
			gtk_dialog_run (GTK_DIALOG (failDialog));
			gtk_widget_destroy (failDialog);
	  }

	  gchar *update_path = g_strconcat(config->GC_ROOT, "update", NULL);
	  const gchar *save_update_interval = gtk_entry_get_text(GTK_ENTRY(txtUpdateInterval));
	  if (! gconf_client_set_int(gcClient, update_path, g_ascii_strtod(save_update_interval, NULL), NULL) ) {
			GtkWidget *failDialog = gtk_message_dialog_new(NULL,
		     		GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
		     		GTK_BUTTONS_OK,
		     		"Failed to update update interval setting\n");
			gtk_dialog_run (GTK_DIALOG (failDialog));
			gtk_widget_destroy (failDialog);
	  }

	  g_object_unref(gcClient);
	  gcClient = NULL;

}
Пример #15
0
static gboolean
migrate_old_categories (void)
{
	/* Try migrating old category settings from GConf to the new
         * category XML file.  If successful, unset the old GConf key
         * so that this is a one-time-only operation. */

	const gchar *key = "/apps/evolution/general/category_master_list";

	GConfClient *client;
	gchar *string;
	gint n_added = 0;

	client = gconf_client_get_default ();
	string = gconf_client_get_string (client, key, NULL);
	if (string == NULL || *string == '\0')
		goto exit;

	g_debug ("Loading categories from GConf key \"%s\"", key);

	n_added = parse_categories (string, strlen (string));
	if (n_added == 0)
		goto exit;

	/* default icon files are now in an unversioned directory */
	g_hash_table_foreach (categories_table, migrate_old_icon_file, NULL);

	gconf_client_unset (client, key, NULL);

exit:
	g_object_unref (client);
	g_free (string);

	return n_added;
}
Пример #16
0
static void
on_notify_font_theme (GSettings* settings,
                      const gchar* key,
                      gpointer user_data)
{
	Sourceview *sv;
	sv = ANJUTA_SOURCEVIEW(user_data);
	
	if (g_settings_get_boolean (settings, key))
	{
		/* FIXME: GSettings */
#if 0		 
		GConfClient *gclient = gconf_client_get_default ();
		gchar *desktop_fixed_font;
		desktop_fixed_font =
			gconf_client_get_string (gclient, DESKTOP_FIXED_FONT, NULL);
		if (desktop_fixed_font)
			anjuta_view_set_font(sv->priv->view, FALSE, desktop_fixed_font);
		else
			anjuta_view_set_font(sv->priv->view, TRUE, NULL);
		g_free (desktop_fixed_font);
#endif		
	}
	else
	{
		gchar* font = g_settings_get_string (settings, FONT);
		anjuta_view_set_font(sv->priv->view, FALSE, font);
		g_free (font);
	}
}
Пример #17
0
static void
init_fonts(Sourceview* sv)
{
	gboolean font_theme;
	
	font_theme = FALSE; //g_settings_get_boolean (sv->priv->settings, FONT_THEME);
	
	if (!font_theme)
	{
		gchar* font = g_settings_get_string (sv->priv->settings, FONT);
		anjuta_view_set_font(sv->priv->view, FALSE, font);
		g_free (font);
	}
#if 0
	else
	{
		/* FIXME: Get font from GSettings */	
		GConfClient *gclient;
		gchar *desktop_fixed_font;
		
		gclient = gconf_client_get_default ();
		desktop_fixed_font =
			gconf_client_get_string (gclient, DESKTOP_FIXED_FONT, NULL);
		if (desktop_fixed_font)
			anjuta_view_set_font(sv->priv->view, FALSE, desktop_fixed_font);
		else
			anjuta_view_set_font(sv->priv->view, TRUE, NULL);
		g_free (desktop_fixed_font);
		g_object_unref (gclient);
	}
#endif
}
Пример #18
0
/**
 * Init function for the mce-gconf component
 *
 * @return TRUE on success, FALSE on failure
 */
gboolean mce_gconf_init(void)
{
	gboolean status = FALSE;

#ifdef ENABLE_BUILTIN_GCONF
	/* builtin-gconf does not use D-Bus */
#else
	/* Trying to use gconf without already existing session
	 * bus can only yield problems -> disable gconf access
	 */
	if( !getenv("DBUS_SESSION_BUS_ADDRESS") ) {
		mce_log(LL_ERR, "No session bus - disabling gconf accesss");
		gconf_disabled = TRUE;
		status = TRUE;
		goto EXIT;
	}
#endif

	/* Get the default GConf client */
	if ((gconf_client = gconf_client_get_default()) == FALSE) {
		mce_log(LL_CRIT, "Could not get default GConf client");
		goto EXIT;
	}

	status = TRUE;

EXIT:
	return status;
}
Пример #19
0
gchar *gconf_get_password() {
   if (scrm_session.password == NULL) {
      scrm_session.password = gconf_client_get_string(gconf_client_get_default(), GCONF_KEY_PASSWORD, NULL);
   }
   return scrm_session.password;

}
MnpClockArea *
mnp_clock_area_new (void)
{
	MnpClockArea *area = g_object_new(MNP_TYPE_CLOCK_AREA, NULL);
	int clk_sec = 60 - (time(NULL)%60);
	GConfClient *client = gconf_client_get_default ();

	area->priv = g_new0(MnpClockAreaPriv, 1);
	area->priv->is_enabled = 1;
	area->priv->prop_sec_zero = FALSE;
	area->priv->clock_tiles = g_ptr_array_new ();
	area->priv->position = 0.05;
	mx_box_layout_set_orientation ((MxBoxLayout *)area, MX_ORIENTATION_VERTICAL);
	mx_box_layout_set_enable_animations ((MxBoxLayout *)area, TRUE);
	area->priv->time_now = time(NULL);
	area->priv->last_time = area->priv->time_now - 60 + clk_sec;

	mx_box_layout_set_spacing ((MxBoxLayout *)area, 4);

	if (clk_sec) {
		area->priv->source = g_timeout_add (clk_sec * 1000, (GSourceFunc)clock_ticks, area);
	} else {
		area->priv->prop_sec_zero = TRUE;
		area->priv->source = g_timeout_add (60 * 1000, (GSourceFunc)clock_ticks, area);
	}

  	gconf_client_add_dir (client, "/apps/date-time-panel", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
  	gconf_client_notify_add (client, "/apps/date-time-panel/24_h_clock", clock_fmt_changed, area, NULL, NULL);
	
	area->priv->tfh = gconf_client_get_bool (client, "/apps/date-time-panel/24_h_clock", NULL);

	g_object_unref(client);

	return area;
}
Пример #21
0
static void
widget_entry_changed_cb (GtkWidget *widget,
                         gpointer data)
{
	const gchar *value;
	gint port = -1;
	GConfClient *client;

	client = gconf_client_get_default ();

	/*
	 * Do not change the order of comparison -
	 * GtkSpinButton is an extended form of GtkEntry
	*/
	if (GTK_IS_SPIN_BUTTON (widget)) {
		port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (widget));
		gconf_client_set_int (client, (const gchar *) data, port, NULL);
		d(g_print ("%s:%s: %s is SpinButton: value = [%d]\n", G_STRLOC, G_STRFUNC, (const gchar *)data, port));
	} else if (GTK_IS_ENTRY (widget)) {
		value = gtk_entry_get_text (GTK_ENTRY (widget));
		gconf_client_set_string (client, (const gchar *) data, value, NULL);
		d(g_print ("%s:%s: %s is Entry: value = [%s]\n", G_STRLOC, G_STRFUNC, (const gchar *)data, value));
	}

	g_object_unref (client);
}
Пример #22
0
Файл: gui.c Проект: acli/xiphos
void gconf_setup()
{
	gchar *str;
	GConfClient *client = gconf_client_get_default();

	if (client == NULL)
		return; /* we're not running under GConf */

	/*
	 * This is deliberately somewhat simple-minded, at least for now.
	 * We care about one thing: Is anything set to handle "bible://"?
	 *
	 * Unfortunate consequence of changing xiphos2 => xiphos:
	 * We must fix broken keys.
	 */
	if ((((str = gconf_client_get_string(client, gconf_keys[0][0],
					     NULL)) == NULL) ||
	     (strncmp(str, "xiphos ", 7) == 0))) {
		/*
		 * Mechanical as can be, one after another.
		 */
		int i;
		for (i = 0; i < GS_GCONF_MAX; ++i) {
			(((i % 3) == 0) /* contrived hack */
			     ? gconf_client_set_string(client, gconf_keys[i][0], gconf_keys[i][1], NULL)
			     : gconf_client_set_bool(client,
						     gconf_keys[i][0],
						     (gconf_keys[i][1] ? TRUE : FALSE), NULL));
		}
	}
}
Пример #23
0
static GConfClient*
get_global_client (void)
{
    GError *error = NULL;

    /* Initialize gconf if needed */
    if (!gconf_is_initialized ()) {
        char *argv[] = { "seahorse", NULL };

        if (!gconf_init (1, argv, &error)) {
            if (handle_error (&error))
                return NULL;
        }
    }

    if (global_gconf_client == NULL) {
        global_gconf_client = gconf_client_get_default ();

        if (global_gconf_client) {
            gconf_client_add_dir (global_gconf_client, SEAHORSE_DESKTOP_KEYS,
                                  GCONF_CLIENT_PRELOAD_NONE, &error);
            handle_error (&error);
            gconf_client_add_dir (global_gconf_client, SEAHORSE_SCHEMAS,
                                  GCONF_CLIENT_PRELOAD_NONE, &error);
            handle_error (&error);
        }

        atexit (global_client_free);
    }

    return global_gconf_client;
}
Пример #24
0
static void
add_send_options_to_source (EGwSendOptions *n_opts)
{
	GConfClient *gconf = gconf_client_get_default ();
	ESource *csource, *tsource;
	ESourceList *list;
	EGwSendOptionsGeneral *gopts;
	EGwSendOptionsStatusTracking *topts, *copts;

	list = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources");
	csource = get_source (list);

	list = e_source_list_new_for_gconf (gconf, "/apps/evolution/tasks/sources");
	tsource = get_source (list);

	gopts = e_gw_sendoptions_get_general_options (n_opts);
	copts = e_gw_sendoptions_get_status_tracking_options (n_opts, "calendar");
	topts = e_gw_sendoptions_get_status_tracking_options (n_opts, "task");

	if (csource)
		put_options_in_source (csource, gopts, copts);

	if (tsource)
		put_options_in_source (tsource, gopts, topts);

	g_object_unref (gconf);
}
Пример #25
0
Файл: config.c Проект: BBIO/ibus
static void
ibus_config_gconf_init (IBusConfigGConf *config)
{
    config->client = gconf_client_get_default ();
    gconf_client_add_dir (config->client, GCONF_PREFIX, GCONF_CLIENT_PRELOAD_NONE, NULL);
    g_signal_connect (config->client, "value-changed", G_CALLBACK (_value_changed_cb), config);
}
Пример #26
0
/*
 * Class:     org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider
 * Method:    gconfInit
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_org_eclipse_core_internal_net_proxy_unix_UnixProxyProvider_gconfInit(
		JNIEnv *env, jclass clazz) {

	g_type_init();
	client = gconf_client_get_default();
	jclass cls= NULL;
	CHECK_NULL(cls = (*env)->FindClass(env, "org/eclipse/core/internal/net/ProxyData"));
	proxyInfoClass = (*env)->NewGlobalRef(env, cls);

	CHECK_NULL(cls = (*env)->FindClass(env, "java/lang/String"));
	stringClass = (*env)->NewGlobalRef(env, cls);

	CHECK_NULL(proxyInfoConstructor = (*env)->GetMethodID(env, proxyInfoClass, "<init>", "(Ljava/lang/String;)V"));

	CHECK_NULL(toString = (*env)->GetMethodID(env, proxyInfoClass, "toString", "()Ljava/lang/String;"));

	CHECK_NULL(hostMethod = (*env)->GetMethodID(env, proxyInfoClass, "setHost",
					"(Ljava/lang/String;)V"));
	CHECK_NULL(portMethod = (*env)->GetMethodID(env, proxyInfoClass, "setPort",
					"(I)V"));
	CHECK_NULL(userMethod = (*env)->GetMethodID(env, proxyInfoClass, "setUserid",
					"(Ljava/lang/String;)V"));
	CHECK_NULL(passwordMethod = (*env)->GetMethodID(env, proxyInfoClass, "setPassword",
					"(Ljava/lang/String;)V"));
}
static void
nautilus_file_background_write_desktop_default_settings (void)
{
	/* We just unset all the gconf keys so they go back to
	 * defaults
	 */
	GConfClient *client;
	GConfChangeSet *set;

	client = gconf_client_get_default ();
	set = gconf_change_set_new ();

	/* the list of keys here has to be kept in sync with libgnome
	 * schemas, which isn't the most maintainable thing ever.
	 */
 	gconf_change_set_unset (set, "/desktop/gnome/background/picture_options");
	gconf_change_set_unset (set, "/desktop/gnome/background/picture_filename");
	gconf_change_set_unset (set, "/desktop/gnome/background/picture_opacity");
	gconf_change_set_unset (set, "/desktop/gnome/background/primary_color");
	gconf_change_set_unset (set, "/desktop/gnome/background/secondary_color");
	gconf_change_set_unset (set, "/desktop/gnome/background/color_shading_type");

	/* this isn't atomic yet so it'll be a bit inefficient, but
	 * someday it might be atomic.
	 */
 	gconf_client_commit_change_set (client, set, FALSE, NULL);

	gconf_change_set_unref (set);
	
	g_object_unref (G_OBJECT (client));
}
Пример #28
0
static void
shell_status_menu_init (ShellStatusMenu *status)
{
  ShellStatusMenuPrivate *priv;

  status->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (status, SHELL_TYPE_STATUS_MENU,
                                                     ShellStatusMenuPrivate);

  g_object_set (G_OBJECT (status),
                "orientation", BIG_BOX_ORIENTATION_HORIZONTAL,
                NULL);
  priv->client = gconf_client_get_default ();

  priv->user_icon = CLUTTER_TEXTURE (clutter_texture_new ());
  big_box_append (BIG_BOX (status), CLUTTER_ACTOR (status->priv->user_icon), 0);

  priv->name_box = BIG_BOX (big_box_new (BIG_BOX_ORIENTATION_VERTICAL));
  g_object_set (G_OBJECT (priv->name_box), "y-align", BIG_BOX_ALIGNMENT_CENTER, NULL);
  big_box_append (BIG_BOX (status), CLUTTER_ACTOR (priv->name_box), BIG_BOX_PACK_EXPAND);
  priv->name = CLUTTER_TEXT (clutter_text_new ());
  big_box_append (BIG_BOX (priv->name_box), CLUTTER_ACTOR (priv->name), BIG_BOX_PACK_EXPAND);

  priv->manager = gdm_user_manager_ref_default ();
  setup_current_user (status);

  create_sub_menu (status);
}
Пример #29
0
CGnomeSettingsStore::CGnomeSettingsStore() {
  the_gconf_client = gconf_client_get_default();

  gconf_client_add_dir(the_gconf_client, "/apps/dasher4", GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);

  LoadPersistent();
}
int main(int argc, char **argv) {
  gtk_init (&argc, &argv);
  client = gconf_client_get_default ();
  /* which confs to monitor */
  gconf_client_add_dir (client, DEFAULT_BACKGROUND_GCONF_PATH,
			GCONF_CLIENT_PRELOAD_NONE, NULL);
  gconf_client_add_dir (client, MULTI_BACKGROUND_GCONF_PATH,
			GCONF_CLIENT_PRELOAD_NONE, NULL);
  
#define GET_DEFAULT_BACKGROUND(client, type, entry)			\
  default_ ## entry = gconf_client_get_ ## type(client,			\
						DEFAULT_BACKGROUND_GCONF_PATH "/" # entry, \
						NULL)
  
  GET_DEFAULT_BACKGROUND(client, string, color_shading_type);
  GET_DEFAULT_BACKGROUND(client, bool, draw_background);
  GET_DEFAULT_BACKGROUND(client, string, picture_filename);
  GET_DEFAULT_BACKGROUND(client, int, picture_opacity);
  GET_DEFAULT_BACKGROUND(client, string, picture_options);
  GET_DEFAULT_BACKGROUND(client, string, primary_color);
  GET_DEFAULT_BACKGROUND(client, string, secondary_color);

  screen = wnck_screen_get_default ();
  wnck_screen_force_update (screen);	
  
  g_signal_connect(G_OBJECT (screen), "active_workspace_changed",
		   G_CALLBACK (workspace_changed_cb),
		   NULL);
  add_monitors();
  gtk_main ();
  return 0;
}