void selections__gth_browser_update_extra_widget_cb (GthBrowser *browser) { GthFileData *location_data; GtkWidget *info_bar; int n_selection; char *msg; location_data = gth_browser_get_location_data (browser); if (! _g_content_type_is_a (g_file_info_get_content_type (location_data->info), "gthumb/selection")) return; n_selection = g_file_info_get_attribute_int32 (location_data->info, "gthumb::n-selection"); if (n_selection <= 0) return; info_bar = gth_browser_get_list_info_bar (browser); gtk_info_bar_set_message_type (GTK_INFO_BAR(info_bar), GTK_MESSAGE_INFO); gth_info_bar_set_icon_name (GTH_INFO_BAR (info_bar), "dialog-information-symbolic", GTK_ICON_SIZE_MENU); gth_info_bar_set_primary_text (GTH_INFO_BAR (info_bar), NULL); msg = g_strdup_printf (_("Use Alt-%d to add files to this selection, Ctrl-%d to view this selection."), n_selection, n_selection); gth_info_bar_set_secondary_text (GTH_INFO_BAR (info_bar), msg); gtk_widget_show (info_bar); g_free (msg); }
static void wallpaper_data_set (WallpaperData *wdata) { GtkWidget *infobar; wallpaper_style_set_as_current (&wdata->new_style); infobar = gth_browser_get_infobar (wdata->browser); gth_info_bar_set_icon (GTH_INFO_BAR (infobar), GTK_STOCK_DIALOG_INFO); { char *name; char *msg; name = _g_file_get_display_name (wdata->new_style.file); msg = g_strdup_printf ("The image \"%s\" has been set as desktop background", name); gth_info_bar_set_primary_text (GTH_INFO_BAR (infobar), msg); g_free (msg); g_free (name); } _gtk_info_bar_clear_action_area (GTK_INFO_BAR (infobar)); gtk_orientable_set_orientation (GTK_ORIENTABLE (gtk_info_bar_get_action_area (GTK_INFO_BAR (infobar))), GTK_ORIENTATION_HORIZONTAL); gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_INFO); gtk_info_bar_add_buttons (GTK_INFO_BAR (infobar), GTK_STOCK_PREFERENCES, _RESPONSE_PREFERENCES, GTK_STOCK_UNDO, _RESPONSE_UNDO, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); gtk_info_bar_set_response_sensitive (GTK_INFO_BAR (infobar), _RESPONSE_UNDO, wdata->old_style.file != NULL); wdata->response_id = g_signal_connect (infobar, "response", G_CALLBACK (infobar_response_cb), wdata); gtk_widget_show (infobar); }