1 |
/* |
2 |
* about.c Copyright © 2009 by Benoît Rouits <brouits@free.fr> |
3 |
* Published under the terms of the GNU General Public License v2 (GPLv2). |
4 |
* |
5 |
* This program is free software; you can redistribute it and/or |
6 |
* modify it under the terms of the GNU General Public License |
7 |
* as published by the Free Software Foundation; either version 2 |
8 |
* of the License, or (at your option) any later version. |
9 |
* |
10 |
* This program is distributed in the hope that it will be useful, |
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
* GNU General Public License for more details. |
14 |
* |
15 |
* You should have received a copy of the GNU General Public License |
16 |
* along with this program; if not, write to the Free Software |
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 |
* Boston, MA 02110-1301, USA. |
19 |
* |
20 |
* see the COPYING file included in the jackie package or |
21 |
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt for the full licence |
22 |
* |
23 |
*/ |
24 |
|
25 |
#include <gtk/gtk.h> |
26 |
|
27 |
/* destroy the about window on response GTK_RESPONSE_CANCEL */ |
28 |
void about_on_response (GtkDialog* dialog, gint response_id, gpointer unused) |
29 |
{ |
30 |
unused = NULL; |
31 |
if (response_id == GTK_RESPONSE_CANCEL) { |
32 |
gtk_widget_hide(GTK_WIDGET(dialog)); |
33 |
gtk_widget_destroy(GTK_WIDGET(dialog)); |
34 |
} |
35 |
else |
36 |
g_message ("about_on_response: %d was given", response_id); |
37 |
return; |
38 |
} |
39 |
|
40 |
GtkAboutDialog* |
41 |
about_create (const gchar* name, const gchar* version, const gchar* copyright, |
42 |
const gchar* comment, const gchar* license, const gchar* website, |
43 |
const gchar** authors) |
44 |
{ |
45 |
GtkWidget* aboutdialog; |
46 |
|
47 |
aboutdialog = gtk_about_dialog_new (); |
48 |
/* gtk_container_set_border_width (GTK_CONTAINER (aboutdialog), 5); */ |
49 |
gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (aboutdialog), version); |
50 |
gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (aboutdialog), name); |
51 |
gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (aboutdialog), copyright); |
52 |
gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (aboutdialog), comment); |
53 |
gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (aboutdialog), license); |
54 |
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (aboutdialog), website); |
55 |
#if 0 |
56 |
gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG (aboutdialog), website_label); |
57 |
#endif |
58 |
gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (aboutdialog), authors); |
59 |
gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (aboutdialog), NULL); |
60 |
/* call about_on_response on [Close] button-press */ |
61 |
g_signal_connect(aboutdialog, "response", G_CALLBACK(about_on_response), NULL); |
62 |
return GTK_ABOUT_DIALOG(aboutdialog); |
63 |
} |
64 |
|
65 |
void about_show (GtkAboutDialog* dialog) |
66 |
{ |
67 |
gtk_widget_show(GTK_WIDGET(dialog)); |
68 |
} |
69 |
|
70 |
void about_hide (GtkAboutDialog* dialog) |
71 |
{ |
72 |
gtk_widget_hide(GTK_WIDGET(dialog)); |
73 |
} |
74 |
|
75 |
void about_destroy (GtkAboutDialog* dialog) |
76 |
{ |
77 |
gtk_widget_destroy(GTK_WIDGET(dialog)); |
78 |
} |
79 |
|