c217833cbea5bf140f99c36cc2aa75106a8401b5
[pspp-builds.git] / src / ui / gui / about.c
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2006, 2007  Free Software Foundation
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 #include <config.h>
19
20 #include <gtk/gtk.h>
21
22 #include <libpspp/copyleft.h>
23 #include <libpspp/version.h>
24 #include "about.h"
25 #include "helper.h"
26
27
28 static const gchar *artists[] = { "Patrick Brunier", "Dondi Bogusky", NULL};
29
30 void
31 about_new (GtkMenuItem *m, GtkWindow *parent)
32 {
33   GtkBuilder *xml = builder_new ("psppire.ui");
34
35   GtkWidget *about =  get_widget_assert (xml, "aboutdialog1");
36
37   GdkPixbuf *pb =
38     gdk_pixbuf_new_from_file_at_size (relocate (PKGDATADIR "/pspplogo.png"),
39                                       64, 64, 0);
40
41   gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about), pb);
42
43
44   gtk_window_set_icon_name (GTK_WINDOW (about), "psppicon");
45
46   gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (about),
47                                 "http://www.gnu.org/software/pspp");
48
49   gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (about),
50                                 bare_version);
51
52   gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (about),
53                                 (const gchar **) authors);
54
55   gtk_about_dialog_set_artists (GTK_ABOUT_DIALOG (about),
56                                 artists);
57
58   gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (about),
59                                 copyleft);
60
61
62   gtk_window_set_transient_for (GTK_WINDOW (about), parent);
63
64   gtk_window_set_modal (GTK_WINDOW (about), TRUE);
65
66   gtk_window_set_keep_above (GTK_WINDOW (about), TRUE);
67
68   gtk_dialog_run (GTK_DIALOG (about));
69
70   gtk_widget_hide (about);
71 }
72