Mercurial > pidgin
annotate src/about.c @ 4074:3ccbdf8e7f8d
[gaim-migrate @ 4289]
Thanks Robot101
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 14 Dec 2002 03:55:50 +0000 |
parents | e2d8ac05871f |
children | 4b04ecb3eb97 |
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 | |
3424 | 7 * it under the terms of the GNU General Public License as published by |
1 | 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 |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2072
diff
changeset
|
23 #include <config.h> |
349
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" | |
4006 | 32 #include "gtkimhtml.h" |
1 | 33 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
34 static GtkWidget *about = NULL; |
1 | 35 |
36 static void destroy_about() | |
37 { | |
38 if (about) | |
39 gtk_widget_destroy(about); | |
40 about = NULL; | |
41 } | |
42 | |
43 | |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
44 static void version_exit() |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
45 { |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
46 gtk_main_quit(); |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
47 } |
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 |
1710
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
50 char *name() |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
51 { |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
52 return PACKAGE; |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
53 } |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
54 |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
55 char *description() |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
56 { |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
57 return WEBSITE; |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
58 } |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
59 |
2276
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
60 char *version() |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
61 { |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
62 return VERSION; |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
63 } |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
64 |
1 | 65 void show_about(GtkWidget *w, void *null) |
66 { | |
67 GtkWidget *vbox; | |
1210 | 68 GtkWidget *frame; |
69 GtkWidget *fbox; | |
1205 | 70 GtkWidget *hbox; |
71 GtkWidget *button; | |
4006 | 72 GtkWidget *text; |
2950 | 73 GtkWidget *sw; |
3721 | 74 GtkWidget *logo; |
1 | 75 |
1205 | 76 char abouttitle[45]; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
77 |
1 | 78 if (!about) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
79 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2562
diff
changeset
|
80 GAIM_DIALOG(about); |
2904
3a9bca5fedcf
[gaim-migrate @ 2917]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2902
diff
changeset
|
81 gtk_window_set_default_size(GTK_WINDOW(about), 450, -1); |
2535 | 82 g_snprintf(abouttitle, sizeof(abouttitle), _("About Gaim v%s"), VERSION); |
1 | 83 gtk_window_set_title(GTK_WINDOW(about), abouttitle); |
4074 | 84 gtk_window_set_role(GTK_WINDOW(about), "about"); |
1210 | 85 gtk_window_set_policy(GTK_WINDOW(about), FALSE, TRUE, TRUE); |
86 gtk_widget_realize(about); | |
1 | 87 |
1210 | 88 vbox = gtk_vbox_new(FALSE, 5); |
89 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
90 gtk_container_add(GTK_CONTAINER(about), vbox); | |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
91 gtk_widget_show(vbox); |
1205 | 92 |
2562 | 93 frame = gtk_frame_new("Gaim v" VERSION); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
94 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
95 gtk_widget_show(frame); |
1210 | 96 |
2072 | 97 fbox = gtk_vbox_new(FALSE, 5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
98 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); |
1210 | 99 gtk_container_add(GTK_CONTAINER(frame), fbox); |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
100 gtk_widget_show(fbox); |
1205 | 101 |
3721 | 102 logo = gaim_pixmap(NULL, "logo.png"); |
103 gtk_box_pack_start(GTK_BOX(fbox), logo, FALSE, FALSE, 0); | |
104 gtk_widget_show(logo); | |
1205 | 105 |
4006 | 106 sw = gtk_scrolled_window_new(NULL, NULL); |
107 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
108 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
109 gtk_box_pack_start(GTK_BOX(fbox), sw, TRUE, TRUE, 0); | |
3709 | 110 |
4006 | 111 text = gtk_imhtml_new(NULL, NULL); |
112 gtk_container_add(GTK_CONTAINER(sw), text); | |
113 gtk_widget_set_usize(sw, -1, 350); | |
114 gaim_setup_imhtml(text); | |
2950 | 115 |
3709 | 116 |
4006 | 117 gtk_imhtml_append_text(GTK_IMHTML(text), |
118 _("Gaim is a modular Instant Messaging client capable of " | |
119 "using AIM, ICQ, Yahoo!, MSN, IRC, Jabber, Napster, " | |
120 "Zephyr, and Gadu-Gadu all at once. It is written using " | |
4054 | 121 "Gtk+ and is licensed under the GPL.<BR><BR>"), -1, GTK_IMHTML_NO_SCROLL); |
4006 | 122 |
123 gtk_imhtml_append_text(GTK_IMHTML(text), | |
124 "<FONT SIZE=\"3\">URL:</FONT> <A HREF=\"" WEBSITE "\">" | |
4054 | 125 WEBSITE "</A><BR><BR>", -1, GTK_IMHTML_NO_SCROLL); |
4006 | 126 |
127 gtk_imhtml_append_text(GTK_IMHTML(text), | |
128 "<FONT SIZE=\"3\">IRC:</FONT> #gaim on irc.freenode.net" | |
4054 | 129 "<BR><BR>", -1, GTK_IMHTML_NO_SCROLL); |
4006 | 130 |
131 gtk_imhtml_append_text(GTK_IMHTML(text), | |
4054 | 132 _("<FONT SIZE=\"3\">Active Developers:</FONT><BR>"), -1, GTK_IMHTML_NO_SCROLL); |
4006 | 133 gtk_imhtml_append_text(GTK_IMHTML(text), |
134 " Rob Flynn (maintainer) " | |
135 "<<A HREF=\"mailto:rob@marko.net\">rob@marko.net</A>><BR>" | |
136 " Sean Egan (coder) " | |
137 "<<A HREF=\"mailto:bj91704@binghamton.edu\">" | |
138 "bj91704@binghamton.edu</A>>" | |
4054 | 139 "<BR><BR>", -1, GTK_IMHTML_NO_SCROLL); |
4006 | 140 |
141 gtk_imhtml_append_text(GTK_IMHTML(text), | |
4054 | 142 _("<FONT SIZE=\"3\">Crazy Patch Writers:</FONT><BR>"), -1, GTK_IMHTML_NO_SCROLL); |
4006 | 143 gtk_imhtml_append_text(GTK_IMHTML(text), |
144 " Benjamin Miller<BR>" | |
145 " Decklin Foster<BR>" | |
146 " Nathan Walp<BR>" | |
4054 | 147 " Mark Doliner<BR><BR>", -1, GTK_IMHTML_NO_SCROLL); |
4006 | 148 |
149 gtk_imhtml_append_text(GTK_IMHTML(text), | |
4054 | 150 _("<FONT SIZE=\"3\">Win32 Port:</FONT><BR>"), -1, GTK_IMHTML_NO_SCROLL); |
4006 | 151 gtk_imhtml_append_text(GTK_IMHTML(text), |
152 " Herman Bloggs " | |
153 "<<A HREF=\"mailto:hermanator12002@yahoo.com\">" | |
4054 | 154 "hermanator12002@yahoo.com</A>><BR><BR>", -1, GTK_IMHTML_NO_SCROLL); |
4006 | 155 |
156 gtk_imhtml_append_text(GTK_IMHTML(text), | |
4054 | 157 _("<FONT SIZE=\"3\">Retired Developers:</FONT><BR>"), -1, GTK_IMHTML_NO_SCROLL); |
4006 | 158 gtk_imhtml_append_text(GTK_IMHTML(text), |
159 " Jim Duchek<BR>" | |
160 " Eric Warmenhoven " | |
161 "<<A HREF=\"mailto:warmenhoven@yahoo.com\">" | |
162 "warmenhoven@yahoo.com</A>><BR>" | |
163 " Mark Spencer (original author) " | |
164 "<<A HREF=\"mailto:markster@marko.net\">" | |
165 "markster@marko.net</A>>" | |
4054 | 166 "<BR><BR>", -1, GTK_IMHTML_NO_SCROLL); |
4006 | 167 |
168 gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw)), 0); | |
169 | |
170 gtk_widget_show(text); | |
2950 | 171 gtk_widget_show(sw); |
3709 | 172 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
173 |
1205 | 174 /* Close Button */ |
175 | |
176 hbox = gtk_hbox_new(FALSE, 5); | |
1210 | 177 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
178 gtk_widget_show(hbox); |
1205 | 179 |
3709 | 180 button = gaim_pixbuf_button_from_stock(_("Close"), GTK_STOCK_CLOSE, GAIM_BUTTON_HORIZONTAL); |
1210 | 181 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
622 | 182 |
1142
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
183 if (null != (void *)2) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
184 /* 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
|
185 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
186 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
187 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
188 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
189 } else { |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
190 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
191 GTK_SIGNAL_FUNC(version_exit), NULL); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
192 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
193 GTK_SIGNAL_FUNC(version_exit), NULL); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
194 } |
3709 | 195 gtk_widget_show(button); |
1210 | 196 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
197 /* this makes the sizes not work. */ |
1976 | 198 /* GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); */ |
199 /* gtk_widget_grab_default(button); */ | |
1205 | 200 |
3709 | 201 gtk_widget_show(button); |
1205 | 202 } |
1210 | 203 |
204 /* Let's give'em something to talk about -- woah woah woah */ | |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
205 gtk_widget_show(about); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
206 |
2901
966f623dbd35
[gaim-migrate @ 2914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2827
diff
changeset
|
207 gdk_window_raise(about->window); |
1205 | 208 } |