Mercurial > pidgin
annotate src/about.c @ 1207:b81213bb5b61
[gaim-migrate @ 1217]
It wasn't *quite* the right size.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Tue, 05 Dec 2000 17:46:44 +0000 |
parents | 7bdb54311828 |
children | 265abea9db72 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
23 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <stdio.h> | |
27 #include <stdlib.h> | |
28 #include <time.h> | |
29 | |
30 #include <gtk/gtk.h> | |
31 #include "gaim.h" | |
32 #include "pixmaps/logo.xpm" | |
1205 | 33 #include "pixmaps/cancel.xpm" |
1 | 34 |
35 static GtkWidget *about=NULL; | |
36 | |
37 static void destroy_about() | |
38 { | |
39 if (about) | |
40 gtk_widget_destroy(about); | |
41 about = NULL; | |
42 } | |
43 | |
44 | |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
45 static void version_exit() |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
46 { |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
47 gtk_main_quit(); |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
48 } |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
49 |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
50 |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
51 static void about_click(GtkWidget *w, gpointer m) |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
52 { |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
53 open_url_nw(NULL, "http://www.marko.net/gaim/"); |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
54 } |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
55 |
1 | 56 void show_about(GtkWidget *w, void *null) |
57 { | |
58 GtkWidget *vbox; | |
1205 | 59 GtkWidget *table; |
60 GtkWidget *a_table; | |
61 GtkWidget *label; | |
1 | 62 GtkWidget *pixmap; |
63 GtkStyle *style; | |
64 GdkPixmap *pm; | |
65 GdkBitmap *bm; | |
1205 | 66 GtkWidget *hbox; |
67 GtkWidget *eventbox; | |
68 GtkWidget *button; | |
1 | 69 |
1205 | 70 char abouttitle[45]; |
71 | |
1 | 72 if (!about) { |
1205 | 73 |
1 | 74 about = gtk_window_new(GTK_WINDOW_DIALOG); |
1205 | 75 |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
76 g_snprintf(abouttitle, sizeof(abouttitle), _("About GAIM v%s"), VERSION); |
1 | 77 gtk_window_set_title(GTK_WINDOW(about), abouttitle); |
905 | 78 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "Gaim" ); |
1 | 79 gtk_container_border_width(GTK_CONTAINER(about), 2); |
1207 | 80 gtk_widget_set_usize(about, 535, 255); |
1205 | 81 gtk_window_set_policy(GTK_WINDOW(about), FALSE, FALSE, TRUE); |
1 | 82 |
83 gtk_widget_show(about); | |
84 aol_icon(about->window); | |
85 | |
1205 | 86 |
87 vbox = gtk_vbox_new(FALSE, 5); | |
1 | 88 |
1205 | 89 table = gtk_table_new(3, 2, FALSE); |
90 | |
91 /* Left side, TOP */ | |
1 | 92 style = gtk_widget_get_style(about); |
93 pm = gdk_pixmap_create_from_xpm_d(about->window, &bm, | |
94 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo); | |
95 pixmap = gtk_pixmap_new(pm, bm); | |
1205 | 96 |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
622
diff
changeset
|
97 gdk_pixmap_unref(pm); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
98 gdk_bitmap_unref(bm); |
1205 | 99 |
100 gtk_table_attach(GTK_TABLE(table), pixmap, 0, 1, 0, 1, 0, 0, 5, 5); | |
101 gtk_widget_show(pixmap); | |
102 | |
1 | 103 |
1205 | 104 /* Right side, TOP*/ |
105 hbox = gtk_vbox_new(FALSE, 5); | |
106 | |
107 label = gtk_label_new(_("GAIM is a client that supports AOL's Instant Messanger protocol. It is " | |
108 "written using Gtk+ and is licensed under the GPL.")); | |
109 gtk_widget_show(label); | |
110 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
111 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
112 gtk_box_pack_start(GTK_BOX(hbox), label, GTK_EXPAND, FALSE, 0); | |
113 | |
114 /* Set up the author table */ | |
115 a_table = gtk_table_new(2, 5, FALSE); | |
116 | |
117 /* Rob */ | |
118 label = gtk_label_new("Rob Flynn (Maintainer)"); | |
119 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
120 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 1, 2, GTK_FILL, 0, 5, 5); | |
121 | |
122 label = gtk_label_new("rob@tgflinux.com"); | |
123 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
124 gtk_table_attach(GTK_TABLE(a_table), label, 1, 2, 1, 2, GTK_FILL, 0, 5, 5); | |
1 | 125 |
1205 | 126 /* Eric */ |
127 label = gtk_label_new("Eric Warmenhoven"); | |
128 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
129 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 2, 3, GTK_FILL, 0, 5, 5); | |
130 | |
131 label = gtk_label_new("warmenhoven@yahoo.com"); | |
132 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
133 gtk_table_attach(GTK_TABLE(a_table), label, 1, 2, 2, 3, GTK_FILL, 0, 5, 5); | |
134 | |
135 /* Jim */ | |
136 label = gtk_label_new("Jim Duchek"); | |
137 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
138 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 3, 4, GTK_FILL, 0, 5, 5); | |
139 | |
140 /* Mark */ | |
141 label = gtk_label_new("Mark Spencer"); | |
142 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
143 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 4, 5, GTK_FILL, 0, 5, 5); | |
144 | |
145 label = gtk_label_new("markster@marko.net"); | |
146 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
147 gtk_table_attach(GTK_TABLE(a_table), label, 1, 2, 4, 5, GTK_FILL, 0, 5, 5); | |
148 | |
149 gtk_box_pack_start(GTK_BOX(hbox), a_table, TRUE, FALSE, 0); | |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
150 |
1205 | 151 gtk_widget_show_all(a_table); |
152 | |
153 /* End Author List */ | |
154 | |
155 gtk_table_attach(GTK_TABLE(table), hbox, 1, 3, 0, 1, 0, 0, 5, 5); | |
156 gtk_widget_show(hbox); | |
157 | |
158 /* Clickable URL */ | |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
159 eventbox = gtk_event_box_new(); |
1205 | 160 gtk_table_attach(GTK_TABLE(table), eventbox, 0, 3, 1, 2, GTK_FILL, FALSE, 5, 5); |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
161 gtk_widget_show(eventbox); |
1205 | 162 |
163 label = gtk_label_new("Gaim " VERSION " - http://www.marko.net/gaim/\n"); | |
164 gtk_container_add(GTK_CONTAINER(eventbox), label); | |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
165 |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
166 gtk_signal_connect(GTK_OBJECT(eventbox), "button_press_event", |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
167 GTK_SIGNAL_FUNC(about_click), NULL); |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
168 gdk_window_set_cursor(eventbox->window, gdk_cursor_new(GDK_HAND2)); |
1205 | 169 gtk_widget_show(label); |
170 | |
171 /* End Clickable URL */ | |
172 | |
173 /* Close Button */ | |
174 | |
175 button = picture_button(about, _("Close"), cancel_xpm); | |
176 | |
177 hbox = gtk_hbox_new(FALSE, 5); | |
178 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
179 gtk_widget_show(hbox); | |
180 | |
181 /* End Button */ | |
182 | |
183 gtk_widget_show(vbox); | |
184 gtk_widget_show(table); | |
185 | |
186 | |
187 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); | |
188 gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); | |
189 | |
190 gtk_container_add(GTK_CONTAINER(about), vbox); | |
622 | 191 |
1142
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
192 if (null != (void *)2) { |
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
193 /* 2 can be as sad as 1, it's the loneliest number since the number 1 */ |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
194 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
195 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
196 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
197 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
198 } else { |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
199 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
200 GTK_SIGNAL_FUNC(version_exit), NULL); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
201 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
202 GTK_SIGNAL_FUNC(version_exit), NULL); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
203 } |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
204 |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
205 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
206 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
207 |
1 | 208 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
209 gtk_widget_grab_default(button); | |
1205 | 210 |
211 | |
212 } | |
213 else | |
214 /* Let's give'em something to talk about -- woah woah woah */ | |
215 gtk_widget_show(about); | |
1 | 216 |
1205 | 217 } |
1 | 218 |