1 /*
2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License as published by
4 the Free Software Foundation; either version 2, or (at your option)
5 any later version.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 */
16
17 #include <gtk/gtk.h>
18 #include "about_dialog.h"
19 #include "util.h"
20 #include "stock.h"
21
22 #define LPROJNAME "<b>" PROJNAME "</b>"
23
24 #define ABOUT \
25 "<big><big><span weight=\"heavy\">" LPROJNAME " " VERSION "</span></big></big>\n" \
26 "by Aristotle Pagaltzis <tt><pagaltzis@gmx.de></tt>\n\n" \
27 "<tt><small><u>http://plasmasturm.org/</u></small></tt>"
28
29 #define LICENSE \
30 "<span size=\"x-small\">" \
31 LPROJNAME " is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.\n\n" \
32 LPROJNAME " is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." \
33 "See the GNU General Public License for more details.\n\n" \
34 "You should have received a copy of the GNU General Public License along with " LPROJNAME "; see the file COPYING." \
35 "If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." \
36 "</span>"
37
show_about_dialog(void)38 void show_about_dialog(void) {
39 GtkWidget* about_dlg = gtk_dialog_new();
40 GtkWidget* about, *box, *ok_button;
41 gtk_window_set_title(GTK_WINDOW(about_dlg), "About");
42 gtk_window_set_resizable(GTK_WINDOW(about_dlg), FALSE);
43 gtk_dialog_set_has_separator(GTK_DIALOG(about_dlg), FALSE);
44 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(about_dlg)->vbox), 20);
45
46 about = GTK_WIDGET(gtk_label_new_from_pango_markup((ABOUT), GTK_JUSTIFY_CENTER));
47
48 box = gtk_hbox_new(FALSE, 0);
49 gtk_container_set_border_width(GTK_CONTAINER(box), 20);
50 gtk_box_pack_start(GTK_BOX(box), about, FALSE, FALSE, 10);
51 gtk_widget_show_all(box);
52
53 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(about_dlg)->vbox), box, FALSE, FALSE, 10);
54
55 ok_button = gtk_dialog_add_button(GTK_DIALOG(about_dlg), GTK_STOCK_OK, 0);
56 gtk_button_set_use_stock(GTK_BUTTON(ok_button), TRUE);
57
58 gtk_dialog_run(GTK_DIALOG(about_dlg));
59
60 gtk_widget_destroy(about_dlg);
61 }
62