コード例 #1
0
ファイル: sflnotify.c プロジェクト: dyfet/sflphone
static void
create_new_gnome_notification(gchar *title, gchar *body, NotifyUrgency urgency, gint timeout)
{
#if USE_NOTIFY
    GnomeNotification notif;

    if (eel_gconf_get_integer(NOTIFY_ALL)) {
        notify_init("SFLphone");

        // Set struct fields
        notif.notification = notify_notification_new(title, body, NULL);
        notif.icon = gdk_pixbuf_new_from_file(LOGO_SMALL, NULL);

        notify_notification_set_urgency(notif.notification, urgency);

        if (notif.icon != NULL)
            notify_notification_set_icon_from_pixbuf(notif.notification, notif.icon);
        else
            ERROR("notify(), cannot load notification icon");

        notify_notification_set_timeout(notif.notification, timeout);

        if (!notify_notification_show(notif.notification, NULL)) {
            ERROR("notify(), failed to send notification");
        }
    }

    g_free(title);
    g_free(body);
#endif
}
コード例 #2
0
ファイル: migrate.c プロジェクト: GNOME/galeon
static void
mozilla_migrate_font_gconf_key (const char *pixel_key, const char *point_key)
{
	int size;

	size = eel_gconf_get_integer (pixel_key);

	if (size > 0)
	{
		/* Use doubles to get more accurate arithmetic */
		double dpi   = (double)mozilla_get_dpi ();
		double value = (double)eel_gconf_get_integer (pixel_key);
		gint point = INT_ROUND ((value * 72) / dpi);

		eel_gconf_set_integer (point_key, point);
	}
}
コード例 #3
0
ファイル: gth-png-saver.c プロジェクト: Peliadia/gthumb
static GtkWidget *
gth_png_saver_get_control (GthPixbufSaver *base)
{
	GthPngSaver *self = GTH_PNG_SAVER (base);

	if (self->priv->builder == NULL)
		self->priv->builder = _gtk_builder_new_from_file ("png-options.ui", "pixbuf_savers");

	gtk_adjustment_set_value (GTK_ADJUSTMENT (_gtk_builder_get_widget (self->priv->builder, "png_compression_adjustment")),
				  eel_gconf_get_integer (PREF_PNG_COMPRESSION_LEVEL, 6));

	return _gtk_builder_get_widget (self->priv->builder, "png_options");
}
コード例 #4
0
ファイル: migrate.c プロジェクト: GNOME/galeon
static void
migrate_proxy_prefs (void)
{
	const gchar *keys[][2] = 
	{{OLD_NETWORK_HTTP_PROXY,       CONF_NETWORK_HTTP_PROXY},
	 {OLD_NETWORK_SSL_PROXY,        CONF_NETWORK_SSL_PROXY},
	 {OLD_NETWORK_FTP_PROXY,        CONF_NETWORK_FTP_PROXY},
	 {OLD_NETWORK_SOCKS_PROXY,      CONF_NETWORK_SOCKS_PROXY}, 
	 {OLD_NETWORK_HTTP_PROXY_PORT,  CONF_NETWORK_HTTP_PROXY_PORT},
	 {OLD_NETWORK_SSL_PROXY_PORT,   CONF_NETWORK_SSL_PROXY_PORT},
	 {OLD_NETWORK_FTP_PROXY_PORT,   CONF_NETWORK_FTP_PROXY_PORT},
	 {OLD_NETWORK_SOCKS_PROXY_PORT, CONF_NETWORK_SOCKS_PROXY_PORT},
	 {OLD_NETWORK_PROXY_AUTO_URL,   CONF_NETWORK_PROXY_AUTO_URL},
	 {NULL, NULL}};
	int proxy_mode;
	const char *proxy_modes[3] = {"none", "manual", "auto"};
	/* 
	 * If the proxy prefs were never migrated, and if the user
	 * has no prefs set for the gnome-wide proxy settings, migrate
	 * its prefs
	 */
	if (!eel_gconf_key_exists (CONF_NETWORK_PROXY_AUTO_URL) &&
	    !eel_gconf_get_boolean (CONF_NETWORK_PROXY_MIGRATED)) 
	{
		GConfValue *value;	
		int i;

		for (i=0; keys[i][0] != NULL; i++)
		{		  
			value = eel_gconf_get_value (keys[i][0]);
			if (value)
			{
				eel_gconf_set_value (keys[i][1], value);
				eel_gconf_value_free (value);
			}
		}

		proxy_mode = eel_gconf_get_integer (OLD_NETWORK_PROXY_MODE);
		if (proxy_mode < 0 || proxy_mode > 2) 
		{
			proxy_mode = 0;
		}
		eel_gconf_set_string (CONF_NETWORK_PROXY_MODE, 
				      proxy_modes[proxy_mode]);
	}
	
	eel_gconf_set_boolean (CONF_NETWORK_PROXY_MIGRATED, TRUE);	
}
コード例 #5
0
static GtkWidget *
impl_get_config_widget (RBSource *asource, RBShellPreferences *prefs)
{
	RBPodcastMainSource *source = RB_PODCAST_MAIN_SOURCE (asource);
	RBPodcastManager *podcast_mgr;
	GtkBuilder *builder;
	GtkWidget *cb_update_interval;
	GtkWidget *btn_file;
	char *download_dir;

	if (source->priv->config_widget)
		return source->priv->config_widget;

	builder = rb_builder_load ("podcast-prefs.ui", source);
	source->priv->config_widget = GTK_WIDGET (gtk_builder_get_object (builder, "podcast_vbox"));

	btn_file = GTK_WIDGET (gtk_builder_get_object (builder, "location_chooser"));
	gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (btn_file),
					      rb_music_dir (),
					      NULL);

	g_object_get (source, "podcast-manager", &podcast_mgr, NULL);
	download_dir = rb_podcast_manager_get_podcast_dir (podcast_mgr);
	g_object_unref (podcast_mgr);

	gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (btn_file),
						 download_dir);
	g_free (download_dir);

	g_signal_connect (btn_file,
			  "selection-changed",
			  G_CALLBACK (rb_podcast_main_source_btn_file_change_cb),
			  CONF_STATE_PODCAST_DOWNLOAD_DIR);

	cb_update_interval = GTK_WIDGET (gtk_builder_get_object (builder, "cb_update_interval"));
	gtk_combo_box_set_active (GTK_COMBO_BOX (cb_update_interval),
				  eel_gconf_get_integer (CONF_STATE_PODCAST_DOWNLOAD_INTERVAL));
	g_signal_connect (cb_update_interval,
			  "changed",
			  G_CALLBACK (rb_podcast_main_source_cb_interval_changed_cb),
			  source);

	return source->priv->config_widget;
}
コード例 #6
0
static void
update_browser_views_visibility (RBLibraryBrowser *widget)
{
	RBLibraryBrowserPrivate *priv = RB_LIBRARY_BROWSER_GET_PRIVATE (widget);
	GList *properties = NULL;

	{
		int views = eel_gconf_get_integer (CONF_UI_BROWSER_VIEWS);

		if (views == 0 || views == 2)
			properties = g_list_prepend (properties, (gpointer)RHYTHMDB_PROP_ALBUM);
		properties = g_list_prepend (properties, (gpointer)RHYTHMDB_PROP_ARTIST);
		if (views == 1 || views == 2)
			properties = g_list_prepend (properties, (gpointer)RHYTHMDB_PROP_GENRE);
	}

	g_hash_table_foreach (priv->property_views, (GHFunc)update_browser_property_visibilty, properties);
	g_list_free (properties);
}
コード例 #7
0
ファイル: gth-png-saver.c プロジェクト: Peliadia/gthumb
static gboolean
gth_png_saver_save_pixbuf (GthPixbufSaver  *self,
			   GdkPixbuf       *pixbuf,
			   char           **buffer,
			   gsize           *buffer_size,
			   const char      *mime_type,
			   GError         **error)
{
	char      *pixbuf_type;
	char     **option_keys;
	char     **option_values;
	int        i = -1;
	int        i_value;
	gboolean   result;

	pixbuf_type = get_pixbuf_type_from_mime_type (mime_type);

	option_keys = g_malloc (sizeof (char *) * 2);
	option_values = g_malloc (sizeof (char *) * 2);

	i++;
	i_value = eel_gconf_get_integer (PREF_PNG_COMPRESSION_LEVEL, 6);
	option_keys[i] = g_strdup ("compression");;
	option_values[i] = g_strdup_printf ("%d", i_value);

	i++;
	option_keys[i] = NULL;
	option_values[i] = NULL;

	result = gdk_pixbuf_save_to_bufferv (pixbuf,
					     buffer,
					     buffer_size,
					     pixbuf_type,
					     option_keys,
					     option_values,
					     error);

	g_strfreev (option_keys);
	g_strfreev (option_values);
	g_free (pixbuf_type);

	return result;
}
コード例 #8
0
ファイル: migrate.c プロジェクト: GNOME/galeon
/*
 * Work out what settings need migrating, and migrate them
 */
void
migrate_gconf_settings (void)
{
	int conf_version = 0;
	int i, num_migrate_funcs;

	if (eel_gconf_key_exists (GALEON_CONFIG_VERSION))
	{
		conf_version = eel_gconf_get_integer (GALEON_CONFIG_VERSION);
	}

	num_migrate_funcs = G_N_ELEMENTS(migrate_funcs);

	if (conf_version >= num_migrate_funcs) return;

	for (i = conf_version ; i < num_migrate_funcs ; i++ )
	{
		if (migrate_funcs[i]) (migrate_funcs[i])();	
	}

	eel_gconf_set_integer (GALEON_CONFIG_VERSION, num_migrate_funcs);
}
コード例 #9
0
ファイル: migrate.c プロジェクト: GNOME/galeon
/**
 * Migrate the old toolbar style gconf key to the new (and better)
 * format (the format was changed in 1.3.13)
 */
static void
migrate_toolbar_style(void)
{
	const char * value = "system";
	int old_setting;

	if (!eel_gconf_is_default (CONF_TOOLBAR_STYLE) ||
	    !eel_gconf_key_exists (CONF_OLD_TOOLBAR_STYLE))
	{
		return;
	}

	old_setting = eel_gconf_get_integer (CONF_OLD_TOOLBAR_STYLE);
	switch (old_setting)
	{
	case 0: value = "text_beside"; break;
	case 1: value = "text_below";  break;
	case 2: value = "text_only";   break;
	case 3: value = "icons_only";  break;
	}
	eel_gconf_set_string (CONF_TOOLBAR_STYLE, value);
}
コード例 #10
0
ファイル: gth-file-list.c プロジェクト: ChingezKhan/gthumb
static void
gth_file_list_update_thumbs (GthFileList *file_list)
{
	int    i;
	GList *scan;

	thumb_loader_save_thumbnails (THUMB_LOADER (file_list->priv->thumb_loader), eel_gconf_get_boolean (PREF_SAVE_THUMBNAILS, TRUE));
	thumb_loader_set_max_file_size (THUMB_LOADER (file_list->priv->thumb_loader), eel_gconf_get_integer (PREF_THUMBNAIL_LIMIT, 0));

	for (i = 0; i < gth_file_view_get_images (file_list->view); i++)
		set_unknown_pixbuf (file_list, i);

	for (scan = file_list->list; scan; scan = scan->next) {
		FileData *fd = scan->data;
		fd->thumb_loaded = FALSE;
		fd->thumb_created = FALSE;
		fd->error = FALSE;
	}

	file_list->priv->load_thumbs = file_list->enable_thumbs;
	start_update_next_thumb (file_list);
}