static void display_about_dialog (GtkAction *action, WinPickerApp *applet) { GtkWidget *panel_about_dialog; panel_about_dialog = mate_about_dialog_new (); g_object_set (panel_about_dialog, "name", _("Window Picker"), "comments", _("Window Picker"), "version", PACKAGE_VERSION, "authors", close_window_authors, "logo-icon-name", "preferences-system-windows", "copyright", "Copyright \xc2\xa9 2008 Canonical Ltd\n" "Copyright \xc2\xa9 2013-2014 Stefano Karapetsas", NULL); gtk_widget_show (panel_about_dialog); g_signal_connect (panel_about_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_window_present (GTK_WINDOW (panel_about_dialog)); }
void mate_about_run(void) { mate_about_dialog = (MateAboutDialog*) mate_about_dialog_new(); GtkIconTheme* icon_theme = gtk_icon_theme_get_default(); if (gtk_icon_theme_has_icon(icon_theme, icon)) { gtk_window_set_default_icon_name(icon); mate_about_dialog_set_logo_icon_name(mate_about_dialog, icon); } else { gtk_window_set_default_icon_name(desktop_icon); mate_about_dialog_set_logo_icon_name(mate_about_dialog, desktop_icon); } // name mate_about_dialog_set_program_name(mate_about_dialog, gettext(program_name)); // version mate_about_dialog_set_version(mate_about_dialog, version); // credits and website mate_about_dialog_set_copyright(mate_about_dialog, copyright); mate_about_dialog_set_website(mate_about_dialog, website); /** * This generate a random message. * The comments index must not be more than comments_count - 1 */ mate_about_dialog_set_comments(mate_about_dialog, gettext(comments_array[g_random_int_range(0, comments_count - 1)])); mate_about_dialog_set_authors(mate_about_dialog, authors); mate_about_dialog_set_artists(mate_about_dialog, artists); mate_about_dialog_set_documenters(mate_about_dialog, documenters); /* Translators should localize the following string which will be * displayed in the about box to give credit to the translator(s). */ mate_about_dialog_set_translator_credits(mate_about_dialog, _("translator-credits")); #if GTK_CHECK_VERSION(3, 0, 0) gtk_window_set_application(GTK_WINDOW(mate_about_dialog), mate_about_application); #endif // start and destroy gtk_dialog_run((GtkDialog*) mate_about_dialog); gtk_widget_destroy((GtkWidget*) mate_about_dialog); }
static void extension_about_clicked (GtkButton *button, Extension *ext) { MateAboutDialog *extension_about_dialog; extension_about_dialog = (MateAboutDialog *) mate_about_dialog_new(); mate_about_dialog_set_program_name (extension_about_dialog, ext->name != NULL ? ext->name : ext->filename); mate_about_dialog_set_comments (extension_about_dialog, ext->description); mate_about_dialog_set_logo_icon_name (extension_about_dialog, ext->icon != NULL ? ext->icon : "system-run"); mate_about_dialog_set_copyright (extension_about_dialog, ext->copyright); mate_about_dialog_set_authors (extension_about_dialog, ext->author); mate_about_dialog_set_version (extension_about_dialog, ext->version); mate_about_dialog_set_website (extension_about_dialog, ext->website); gtk_window_set_title (GTK_WINDOW(extension_about_dialog), _("About Extension")); gtk_dialog_run (GTK_DIALOG (extension_about_dialog)); gtk_widget_destroy (GTK_WIDGET (extension_about_dialog)); }
static void panel_context_menu_show_about_dialog (GtkWidget *menuitem) { static GtkWidget *about = NULL; char *authors [] = { /* MATE */ "Perberos <*****@*****.**>", "Stefano Karapetsas <*****@*****.**>", "Steve Zesch <*****@*****.**>", /* GNOME */ "Alex Larsson <*****@*****.**>", "Anders Carlsson <*****@*****.**>", "Arvind Samptur <*****@*****.**>", "Darin Adler <*****@*****.**>", "Elliot Lee <*****@*****.**>", "Federico Mena <*****@*****.**>", "George Lebl <*****@*****.**>", "Glynn Foster <*****@*****.**>", "Ian Main <*****@*****.**>", "Ian McKellar <*****@*****.**>", "Jacob Berkman <*****@*****.**>", "Mark McLoughlin <*****@*****.**>", "Martin Baulig <*****@*****.**>", "Miguel de Icaza <*****@*****.**>", "Owen Taylor <*****@*****.**>", "Padraig O'Briain <*****@*****.**>", "Seth Nickell <*****@*****.**>", "Stephen Browne <*****@*****.**>", "Tom Tromey <*****@*****.**>", "Vincent Untz <*****@*****.**>", N_("And many, many others..."), NULL }; char *documenters[] = { "Alexander Kirillov <*****@*****.**>", "Dan Mueth <*****@*****.**>", "Dave Mason <*****@*****.**>", NULL }; int i; if (about) { gtk_window_set_screen (GTK_WINDOW (about), menuitem_to_screen (menuitem)); gtk_window_present (GTK_WINDOW (about)); return; } for (i = 0; authors [i]; i++) authors [i] = _(authors [i]); /* Note: we don't use gtk_show_about_dialog() since some applets can * be loaded in this process and we don't want to share the about * dialog */ about = mate_about_dialog_new (); g_object_set (about, "program-name", _("The MATE Panel"), "version", VERSION, "copyright", "Copyright \xc2\xa9 1997-2003 Free Software Foundation, Inc.", "comments", _("This program is responsible for launching other " "applications and provides useful utilities."), "authors", authors, "documenters", documenters, "title", _("About the MATE Panel"), "translator-credits", _("translator-credits"), "logo-icon-name", PANEL_ICON_PANEL, NULL); gtk_window_set_screen (GTK_WINDOW (about), menuitem_to_screen (menuitem)); g_signal_connect (about, "destroy", G_CALLBACK (gtk_widget_destroyed), &about); g_signal_connect (about, "event", G_CALLBACK (panel_context_menu_check_for_screen), NULL); g_signal_connect (about, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (about); }