static gboolean
init_gconf (gpointer user_data)
{
	SoupProxyResolverGNOMEInitData *id = user_data;

	if (id)
		g_mutex_lock (id->lock);

	/* resolver_gnome is locked */

	gconf_client = gconf_client_get_default ();

	gconf_client_add_dir (gconf_client, "/system/proxy",
			      GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
	gconf_client_add_dir (gconf_client, "/system/http_proxy",
			      GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
	g_signal_connect (gconf_client, "value_changed",
			  G_CALLBACK (gconf_value_changed),
			  NULL);
	update_proxy_settings ();

	if (id) {
		g_mutex_unlock (id->lock);
		g_cond_signal (id->cond);
	}
	return FALSE;
}
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;
}
Ejemplo n.º 3
0
static void
init_gconf (void)
{
#if defined (HAVE_GCONF)
  char *s;

#if ! GLIB_CHECK_VERSION (2, 36, 0)
  g_type_init ();
#endif

  gconf_client = gconf_client_get_default ();
  gconf_client_set_error_handling (gconf_client, GCONF_CLIENT_HANDLE_NONE);
  gconf_client_add_dir (gconf_client,
                        GCONF_TOOL_BAR_STYLE,
                        GCONF_CLIENT_PRELOAD_ONELEVEL,
                        NULL);
  gconf_client_notify_add (gconf_client,
                           GCONF_TOOL_BAR_STYLE,
                           something_changed_gconfCB,
                           NULL, NULL, NULL);

  s = gconf_client_get_string (gconf_client, GCONF_TOOL_BAR_STYLE, NULL);
  if (s)
    {
      current_tool_bar_style = map_tool_bar_style (s);
      g_free (s);
    }

#ifdef HAVE_XFT
  s = gconf_client_get_string (gconf_client, GCONF_MONO_FONT, NULL);
  if (s)
    {
      dupstring (&current_mono_font, s);
      g_free (s);
    }
  s = gconf_client_get_string (gconf_client, GCONF_FONT_NAME, NULL);
  if (s)
    {
      dupstring (&current_font, s);
      g_free (s);
    }
  gconf_client_add_dir (gconf_client,
                        GCONF_MONO_FONT,
                        GCONF_CLIENT_PRELOAD_ONELEVEL,
                        NULL);
  gconf_client_notify_add (gconf_client,
                           GCONF_MONO_FONT,
                           something_changed_gconfCB,
                           NULL, NULL, NULL);
  gconf_client_add_dir (gconf_client,
                        GCONF_FONT_NAME,
                        GCONF_CLIENT_PRELOAD_ONELEVEL,
                        NULL);
  gconf_client_notify_add (gconf_client,
                           GCONF_FONT_NAME,
                           something_changed_gconfCB,
                           NULL, NULL, NULL);
#endif /* HAVE_XFT */
#endif /* HAVE_GCONF */
}
Ejemplo n.º 4
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;
}
Ejemplo n.º 5
0
/* Ensures that we have a GConf client and if we build one
   set up the signal handler. */
static void
ensure_gconf_client (void)
{
	if (!gconf_client) {
		gconf_client = gconf_client_get_default ();

		gconf_client_add_dir(gconf_client, LOCKDOWN_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
		gconf_client_notify_add(gconf_client, LOCKDOWN_DIR, lockdown_changed, NULL, NULL, NULL);

		gconf_client_add_dir(gconf_client, KEYBINDING_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
		gconf_client_notify_add(gconf_client, KEYBINDING_DIR, keybinding_changed, NULL, NULL, NULL);
	}
	return;
}
static void
setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
{
	GObject *peditor;
	GtkSizeGroup *combobox_size_group;
	GtkSizeGroup *label_size_group;

	gconf_client_add_dir (gconf_client, GST_GCONF_DIR,
			      GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);

	combobox_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);

	gtk_size_group_add_widget (label_size_group, WID ("sounds_playback_label"));
	gtk_size_group_add_widget (label_size_group, WID ("music_playback_label"));
	gtk_size_group_add_widget (label_size_group, WID ("chat_audio_playback_label"));
	gtk_size_group_add_widget (label_size_group, WID ("chat_audio_capture_label"));
	gtk_size_group_add_widget (label_size_group, WID ("mixer_device_label"));
	gtk_size_group_add_widget (combobox_size_group, WID ("sounds_playback_device"));
	gtk_size_group_add_widget (combobox_size_group, WID ("music_playback_device"));
	gtk_size_group_add_widget (combobox_size_group, WID ("chat_audio_playback_device"));
	gtk_size_group_add_widget (combobox_size_group, WID ("chat_audio_capture_device"));

	setup_device_chooser ("", AUDIO_PLAYBACK, WID ("sounds_playback_device"),
			      WID ("sounds_playback_test"),
			      AUDIO_TEST_SOURCE AUDIO_TEST_IN_BETWEEN "gconfaudiosink");
	setup_device_chooser ("music", AUDIO_PLAYBACK, WID ("music_playback_device"),
			      WID ("music_playback_test"),
			      AUDIO_TEST_SOURCE AUDIO_TEST_IN_BETWEEN "gconfaudiosink profile=music");
	setup_device_chooser ("chat", AUDIO_PLAYBACK, WID ("chat_audio_playback_device"),
			      WID ("chat_audio_playback_test"),
			      AUDIO_TEST_SOURCE AUDIO_TEST_IN_BETWEEN "gconfaudiosink profile=chat");
	setup_device_chooser ("", AUDIO_CAPTURE, WID ("chat_audio_capture_device"),
			      WID ("chat_audio_capture_test"),
			      "gconfaudiosrc" AUDIO_TEST_IN_BETWEEN "gconfaudiosink profile=chat");

#ifdef HAVE_ESD
	peditor = gconf_peditor_new_boolean (NULL, ENABLE_ESD_KEY, WID ("enable_toggle"), NULL);
	gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("events_toggle"));
	gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("events_vbox"));
#else
	gtk_widget_hide (WID ("enable_toggle"));
#endif
	gconf_peditor_new_boolean (NULL, EVENT_SOUNDS_KEY, WID ("events_toggle"), NULL);

	gconf_peditor_new_boolean (NULL, AUDIO_BELL_KEY, WID ("bell_audible_toggle"), NULL);

	peditor = gconf_peditor_new_boolean (NULL, VISUAL_BELL_KEY, WID ("bell_visual_toggle"), NULL);
	gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("bell_flash_vbox"));

	/* peditor not so convenient for the radiobuttons */
	gconf_peditor_new_select_radio (NULL,
					VISUAL_BELL_TYPE_KEY,
					gtk_radio_button_get_group (GTK_RADIO_BUTTON (WID ("bell_flash_window_radio"))),
					"conv-to-widget-cb", bell_flash_to_widget,
					"conv-from-widget-cb", bell_flash_from_widget,
					NULL);

	setup_default_mixer (dialog);
}
Ejemplo n.º 7
0
void
gsearchtool_gconf_watch_key (const gchar * dir,
                             const gchar * key,
                             GConfClientNotifyFunc callback,
                             gpointer user_data)
{
	GConfClient * client;
	GError * error = NULL;

	g_return_if_fail (key != NULL);
	g_return_if_fail (dir != NULL);

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

	gconf_client_add_dir (client,
	                      dir,
	                      GCONF_CLIENT_PRELOAD_NONE,
	                      &error);

	gsearchtool_gconf_handle_error (&error);

	gconf_client_notify_add (client,
	                         key,
	                         callback,
	                         user_data,
	                         NULL,
	                         &error);

	gsearchtool_gconf_handle_error (&error);
}
Ejemplo n.º 8
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 ();
}
Ejemplo n.º 9
0
/*!
* Init parent and hook gconf.
*/
EV_GnomeToolbar::EV_GnomeToolbar(XAP_UnixApp * pUnixApp, 
								 XAP_Frame *pFrame, 
								 const char * szToolbarLayoutName,
								 const char * szToolbarLabelSetName)
 :  EV_UnixToolbar(pUnixApp, pFrame, szToolbarLayoutName, szToolbarLabelSetName)
{

	GConfClient *client;

	client = gconf_client_get_default();

	gconf_client_add_dir (client,
						  PATH,
						  GCONF_CLIENT_PRELOAD_NONE,
						  NULL);

	gconf_client_notify_add (client,
							 KEY_DETACHABLE,
							 detachable_changed_cb,
							 (gpointer)this,
							 NULL,
							 NULL);

#if HONOR_GNOME_TOOLBAR_SETTINGS
	gconf_client_notify_add (client,
							 KEY_STYLE,
							 style_changed_cb,
							 (gpointer)this,
							 NULL,
							 NULL);
#endif

	g_object_unref(G_OBJECT(client));
}
Ejemplo n.º 10
0
Archivo: config.c Proyecto: 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);
}
Ejemplo n.º 11
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);
}
Ejemplo n.º 12
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;
}
Ejemplo n.º 13
0
/**
 * Initializes the GConf stuff
 */
void cpumeter_gconf_init(CpuMeter* cpumeter)
{
  cpumeter->client = gconf_client_get_default();
  // TODO - Add Callback for updates
  gconf_client_add_dir(cpumeter->client, GCONF_PATH, GCONF_CLIENT_PRELOAD_NONE, NULL);
  gconf_client_notify_add(cpumeter->client, GCONF_PATH, cpumeter_gconf_event, cpumeter, NULL, NULL);
}
Ejemplo n.º 14
0
void listenerGconf(void *ptr)
{
    GConfClient *client;

	//char *key = "/apps/mousecam/MyVal";
	//char *monitor = "/apps/mousecam";
	int valor;
	int clientId;

	client = gconf_client_get_default();
	gconf_client_add_dir(client, monitor, GCONF_CLIENT_PRELOAD_NONE, NULL);

	gconf_client_notify_add(client,
			  	  	  	  	  key,
	                          setKeys,
	                          NULL,
	                          NULL,
	                          NULL);

	//valor =  gconf_client_get_int(client, key, NULL);
    //printf("(%d) listenerGconf valor %d\n",id,valor);
    
   
	gtk_main();
}
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;
}
Ejemplo n.º 16
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();
}
Ejemplo n.º 17
0
void
gm_conf_init ()
{
    client = gconf_client_get_default ();
    gconf_client_set_error_handling (client, GCONF_CLIENT_HANDLE_UNRETURNED);
    gconf_client_add_dir (client, "/apps/" PACKAGE_NAME,
                          GCONF_CLIENT_PRELOAD_NONE, NULL);
}
Ejemplo n.º 18
0
static void
gedit_dict_panel_init(GeditDictPanel *panel)
{
	gchar * data_dir;
	GeditDictPanelPrivate *priv;
	GError *gconf_error;
	
	panel->priv = GEDIT_DICT_PANEL_GET_PRIVATE (panel);
	priv = panel->priv;
	
	if (!priv->loader)
		panel->priv->loader = gdict_source_loader_new ();
	
	/* add our data dir inside $HOME to the loader's search paths */
	data_dir = gdict_get_data_dir ();
	gdict_source_loader_add_search_path (priv->loader, data_dir);
	g_free (data_dir);
	
	
	
	/* get the default gconf client */
	if (!priv->gconf_client)
		priv->gconf_client = gconf_client_get_default ();

	gconf_error = NULL;
	gconf_client_add_dir (priv->gconf_client,
			      GDICT_GCONF_DIR,
			      GCONF_CLIENT_PRELOAD_ONELEVEL,
			      &gconf_error);
	if (gconf_error)
	{
		/*gdict_show_gerror_dialog (NULL,
					  _("Unable to connect to GConf"),
					  gconf_error);*/
		gconf_error = NULL;
	}
	
	priv->notify_id = gconf_client_notify_add (priv->gconf_client,
						   GDICT_GCONF_DIR,
						   gedit_dict_panel_gconf_notify_cb,
						   panel, NULL,
						   &gconf_error);
	if (gconf_error)
	{
		/*gdict_show_gerror_dialog (NULL,
					  _("Unable to get notification for preferences"),
					  gconf_error);*/
			
		gconf_error = NULL;
	}
	
	/* force retrieval of the configuration from GConf */
	gedit_dict_panel_set_source_name (panel, NULL);
	
	/* Draw widgets */
	gedit_dict_panel_draw(panel);
}
Ejemplo n.º 19
0
static guint
register_config_callback (GConfClient * client,
			  const char *path, GConfClientNotifyFunc func)
{
	gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_ONELEVEL,
			      NULL);
	return gconf_client_notify_add (client, path, func, NULL, NULL,
					NULL);
}
Ejemplo n.º 20
0
void
gnc_gconf_add_notification (GObject *object,
                            const gchar *section,
                            GConfClientNotifyFunc callback,
                            const gchar *whoami)
{
    GConfClient *client;
    GError *error = NULL;
    gchar *path, *client_tag, *notify_tag;
    guint id;

    g_return_if_fail(G_IS_OBJECT(object));
    g_return_if_fail(callback != NULL);
    g_return_if_fail(whoami != NULL);

    client = gconf_client_get_default();
    path = gnc_gconf_section_name(section);

    /*
     * First we have to add the directory...
     */
    gconf_client_add_dir(client, path, GCONF_CLIENT_PRELOAD_ONELEVEL, &error);
    if (error != NULL)
    {
        printf("Failed to add history section to watched directories in gconf: %s", error->message);
        g_error_free(error);
        g_object_unref(client);
        g_free(path);
        return;
    }

    /*
     * Then we can add the notification callback.
     */
    id = gconf_client_notify_add(client, path, callback,
                                 object, NULL, &error);
    if (error != NULL)
    {
        printf("Failed to set gconf notify for history section: %s", error->message);
        gconf_client_remove_dir(client, path, NULL);
        g_error_free(error);
        g_object_unref(client);
        g_free(path);
        return;
    }

    /*
     * Save the values needed to undo this later.
     */
    client_tag = g_strdup_printf(CLIENT_TAG, section ? section : "", whoami);
    notify_tag = g_strdup_printf(NOTIFY_TAG, section ? section : "", whoami);
    g_object_set_data(object, client_tag, client);
    g_object_set_data(object, notify_tag, GUINT_TO_POINTER(id));
    g_free(notify_tag);
    g_free(client_tag);
    g_free(path);
}
Ejemplo n.º 21
0
void notify_demo(GConfClient* client)
{
	gconf_client_add_dir(client, "/apps/demo", GCONF_CLIENT_PRELOAD_NONE, NULL);

	gconf_client_notify_add(client, string_key, on_notify, NULL, NULL, NULL);
	gconf_client_set_string(client, string_key, "string_new_value", NULL);
	gconf_client_set_string(client, string_key, "string_new_value1", NULL);

	return;
}
Ejemplo n.º 22
0
static void
calendar_sources_load_sources (CalendarSources    *sources,
			       CalendarSourceData *source_data,
			       const char         *sources_key,
			       const char         *selected_sources_key,
			       const char         *selected_sources_dir)
{
  GConfClient *gconf_client;
  GError      *error;

  dprintf ("---------------------------\n");
  dprintf ("Loading sources:\n");
  dprintf ("  sources_key: %s\n", sources_key);
  dprintf ("  selected_sources_key: %s\n", selected_sources_key);
  dprintf ("  selected_sources_dir: %s\n", selected_sources_dir);

  gconf_client = sources->priv->gconf_client;

  error = NULL;
  source_data->selected_sources = gconf_client_get_list (gconf_client,
							 selected_sources_key,
							 GCONF_VALUE_STRING,
							 &error);
  if (error)
    {
      g_warning ("Failed to get selected sources from '%s': %s\n",
		 selected_sources_key,
		 error->message);
      g_error_free (error);
      return;
    }

  gconf_client_add_dir (gconf_client,
			selected_sources_dir,
			GCONF_CLIENT_PRELOAD_NONE,
			NULL);
  source_data->selected_sources_dir = g_strdup (selected_sources_dir);

  source_data->selected_sources_listener =
    gconf_client_notify_add (gconf_client,
			     selected_sources_dir,
			     (GConfClientNotifyFunc) calendar_sources_selected_sources_notify,
			     source_data, NULL, NULL);

  source_data->esource_list = e_source_list_new_for_gconf (gconf_client, sources_key);
  g_signal_connect (source_data->esource_list, "changed",
		    G_CALLBACK (calendar_sources_esource_list_changed),
		    source_data);

  calendar_sources_load_esource_list (source_data);

  source_data->loaded = TRUE;

  dprintf ("---------------------------\n");
}
Ejemplo n.º 23
0
int
main (int argc, char *argv[])
{
	GConfClient	*client;
	GConfChangeSet	*changeset;
	GladeXML	*dialog = NULL;
	GtkWidget	*dialog_win;
	
	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);

	gnome_program_init ("brightside-properties", VERSION,
			LIBGNOMEUI_MODULE, argc, argv,
			NULL);

	client = gconf_client_get_default ();
	gconf_client_add_dir (client, BRIGHTSIDE_KEY_ROOT,
			GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
	conf_client = client;

	changeset = gconf_change_set_new ();
	dialog = create_dialog ();
	setup_dialog (dialog, changeset);

	dialog_win = gtk_dialog_new_with_buttons(
			_("Screen Actions"), NULL, 
			GTK_DIALOG_NO_SEPARATOR,
			GTK_STOCK_HELP, GTK_RESPONSE_HELP,
			GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
			NULL);
	gtk_container_set_border_width (GTK_CONTAINER (dialog_win), 5);
	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG(dialog_win)->vbox), 2);
	gtk_dialog_set_default_response (GTK_DIALOG (dialog_win), 
			GTK_RESPONSE_CLOSE);
	g_signal_connect (G_OBJECT (dialog_win), "response", 
			(GCallback) dialog_button_clicked_cb, changeset);
	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_win)->vbox), 
			WID ("prefs_widget"), TRUE, TRUE, 0);
	gtk_window_set_resizable (GTK_WINDOW (dialog_win), FALSE);
	gtk_window_set_icon_from_file (GTK_WINDOW (dialog_win), 
			BRIGHTSIDE_DATA "brightside.svg", NULL);
	gtk_widget_show_all (dialog_win);
	
	if (is_running () == FALSE)
		g_spawn_command_line_async ("brightside", NULL);
	
	gtk_main ();

	gconf_change_set_unref (changeset);

	g_object_unref (dialog);

	return 0;
}
void
ui_init (AppearanceData *data)
{
  GObject *peditor;
  char *toolbar_style;

  gconf_client_add_dir (data->client, "/desktop/gnome/interface",
			GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);

  peditor = gconf_peditor_new_boolean
    (NULL, "/desktop/gnome/interface/can_change_accels",
     glade_xml_get_widget (data->xml, "menu_accel_toggle"), NULL);

  peditor = gconf_peditor_new_boolean
    (NULL, "/desktop/gnome/interface/menus_have_icons",
     glade_xml_get_widget (data->xml, "menu_icons_toggle"), NULL);
  g_signal_connect (peditor, "value_changed",
		    (GCallback) menus_have_icons_cb, data);

  set_have_icons (data,
    gconf_client_get_bool (data->client,
			   "/desktop/gnome/interface/menus_have_icons",
			   NULL));

  peditor = gconf_peditor_new_combo_box
    (NULL, "/desktop/gnome/interface/toolbar_style",
     glade_xml_get_widget (data->xml, "toolbar_style_select"),
     "conv-to-widget-cb", toolbar_to_widget,
     "conv-from-widget-cb", toolbar_from_widget,
     NULL);
  g_signal_connect (peditor, "value_changed",
		    (GCallback) toolbar_style_cb, data);

  g_signal_connect (glade_xml_get_widget (data->xml, "toolbar_handlebox"),
		    "button_press_event",
		    (GCallback) button_press_block_cb, NULL);

  show_handlebar (data,
    gconf_client_get_bool (data->client,
			   "/desktop/gnome/interface/toolbar_detachable",
			   NULL));

  toolbar_style = gconf_client_get_string
    (data->client,
     "/desktop/gnome/interface/toolbar_style",
     NULL);
  set_toolbar_style (data, toolbar_style);
  g_free (toolbar_style);

  /* no ui for detachable toolbars */
  gconf_client_notify_add (data->client,
			   "/desktop/gnome/interface/toolbar_detachable",
                           (GConfClientNotifyFunc) toolbar_detachable_cb,
                           data, NULL, NULL);
}
Ejemplo n.º 25
0
void proxy_init(void)
{
    GError *gconf_error = NULL;
    gboolean use_proxy;
    gboolean use_proxy_auth;

    gl_client = gconf_client_get_default();
    gl_mutex = g_mutex_new();

    gconf_client_add_dir(gl_client, PATH_GCONF_GNOME_VFS,
			 GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
    if (gconf_error) {
	DEBUG_HTTP(("GConf error during client_add_dir '%s'",
		    gconf_error->message));
	g_error_free(gconf_error);
	gconf_error = NULL;
    }

    gconf_client_notify_add(gl_client, PATH_GCONF_GNOME_VFS,
			    notify_gconf_value_changed, NULL, NULL,
			    &gconf_error);
    if (gconf_error) {
	DEBUG_HTTP(("GConf error during notify_error '%s'",
		    gconf_error->message));
	g_error_free(gconf_error);
	gconf_error = NULL;
    }

    /* Load the http proxy setting */
    use_proxy =
	gconf_client_get_bool(gl_client, KEY_GCONF_USE_HTTP_PROXY,
			      &gconf_error);

    if (gconf_error != NULL) {
	DEBUG_HTTP(("GConf error during client_get_bool '%s'",
		    gconf_error->message));
	g_error_free(gconf_error);
	gconf_error = NULL;
    } else {
	construct_gl_http_proxy(use_proxy);
    }

    use_proxy_auth =
	gconf_client_get_bool(gl_client, KEY_GCONF_HTTP_USE_AUTH,
			      &gconf_error);

    if (gconf_error != NULL) {
	DEBUG_HTTP(("GConf error during client_get_bool '%s'",
		    gconf_error->message));
	g_error_free(gconf_error);
	gconf_error = NULL;
    } else {
	set_proxy_auth(use_proxy_auth);
    }
}
/* Create and initalize global sticky notes instance */
void
stickynotes_applet_init (PanelApplet *panel_applet)
{
	stickynotes = g_new(StickyNotes, 1);

	stickynotes->notes = NULL;
	stickynotes->applets = NULL;
	stickynotes->last_timeout_data = 0;

	g_set_application_name (_("Sticky Notes"));

	/* Register size for icons */
	gtk_icon_size_register ("stickynotes_icon_size", 8,8);

	gtk_window_set_default_icon_name ("consort-sticky-notes-applet");

	stickynotes->icon_normal = gtk_icon_theme_load_icon (
			gtk_icon_theme_get_default (),
			"consort-sticky-notes-applet",
			48, 0, NULL);

	stickynotes->icon_prelight = gdk_pixbuf_new (
			gdk_pixbuf_get_colorspace (stickynotes->icon_normal),
			gdk_pixbuf_get_has_alpha (stickynotes->icon_normal),
			gdk_pixbuf_get_bits_per_sample (
				stickynotes->icon_normal),
			gdk_pixbuf_get_width (stickynotes->icon_normal),
			gdk_pixbuf_get_height (stickynotes->icon_normal));
	stickynotes_make_prelight_icon (stickynotes->icon_prelight,
			stickynotes->icon_normal, 30);
	stickynotes->gconf = gconf_client_get_default();
	stickynotes->visible = TRUE;

	stickynotes_applet_init_icons();
	stickynotes_applet_init_prefs();

	/* Watch GConf values */
	gconf_client_add_dir (stickynotes->gconf, GCONF_PATH,
			GCONF_CLIENT_PRELOAD_NONE, NULL);
	gconf_client_notify_add (stickynotes->gconf, GCONF_PATH "/defaults",
			(GConfClientNotifyFunc) preferences_apply_cb,
			NULL, NULL, NULL);
	gconf_client_notify_add (stickynotes->gconf, GCONF_PATH "/settings",
			(GConfClientNotifyFunc) preferences_apply_cb,
			NULL, NULL, NULL);

	/* Max height for large notes*/
	stickynotes->max_height = 0.8*gdk_screen_get_height( gdk_screen_get_default() );

	/* Load sticky notes */
	stickynotes_load (gtk_widget_get_screen (GTK_WIDGET (panel_applet)));

	install_check_click_on_desktop ();
}
Ejemplo n.º 27
0
static void
calendar_config_init (void)
{
	if (config)
		return;

	config = gconf_client_get_default ();
	g_atexit ((GVoidFunc) do_cleanup);

	gconf_client_add_dir (config, CALENDAR_CONFIG_PREFIX, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
}
Ejemplo n.º 28
0
static void
gst_gconf_audio_sink_init (GstGConfAudioSink * sink,
    GstGConfAudioSinkClass * g_class)
{
  gst_gconf_audio_sink_reset (sink);

  sink->client = gconf_client_get_default ();
  gconf_client_add_dir (sink->client, GST_GCONF_DIR "/default",
      GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);

  gst_gconf_switch_profile (sink, GCONF_PROFILE_SOUNDS);
}
Ejemplo n.º 29
0
static void
gconf_settings_backend_subscribe (GSettingsBackend *backend,
                                  const gchar      *name)
{
  GConfSettingsBackend *gconf = GCONF_SETTINGS_BACKEND (backend);
  gchar                *path;

  path = gconf_settings_backend_get_gconf_path_from_name (name);
  if (gconf_settings_backend_add_notifier (gconf, path))
    gconf_client_add_dir (gconf->priv->client, path, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
  g_free (path);
}
Ejemplo n.º 30
0
static void 
register_crawler_watch (void)
{
	GConfClient *client = gconf_client_get_default();
	gconf_client_add_dir(client,
			     "/apps/osso/mafw-metalayer-crawler",
			     GCONF_CLIENT_PRELOAD_NONE,
			     NULL);
	gconf_client_notify_add(client, 
				"/apps/osso/mafw-metalayer-crawler/state",
				crawler_state_changed, 
				NULL, NULL, NULL);
}