Example #1
0
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));
}