Mercurial > pidgin.yaz
annotate src/about.c @ 3718:fd3880c03f0d
[gaim-migrate @ 3851]
global.mak introduced
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 16 Oct 2002 20:00:51 +0000 |
parents | 03e58c078917 |
children | ac084ce0c130 |
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" | |
32 #include "pixmaps/logo.xpm" | |
1205 | 33 #include "pixmaps/cancel.xpm" |
1210 | 34 #include "pixmaps/about_small.xpm" |
1 | 35 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
36 static GtkWidget *about = NULL; |
1 | 37 |
38 static void destroy_about() | |
39 { | |
40 if (about) | |
41 gtk_widget_destroy(about); | |
42 about = NULL; | |
43 } | |
44 | |
45 | |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
46 static void version_exit() |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
47 { |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1009
diff
changeset
|
48 gtk_main_quit(); |
546
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 |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
51 |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
52 static void about_click(GtkWidget *w, gpointer m) |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
53 { |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2725
diff
changeset
|
54 open_url(NULL, WEBSITE); |
1710
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
55 } |
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 char *name() |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
58 { |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
59 return PACKAGE; |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
60 } |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
61 |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
62 char *description() |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
63 { |
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
64 return WEBSITE; |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
65 } |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
66 |
2276
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
67 char *version() |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
68 { |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
69 return VERSION; |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
70 } |
8f9aa8739bf1
[gaim-migrate @ 2286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2251
diff
changeset
|
71 |
1 | 72 void show_about(GtkWidget *w, void *null) |
73 { | |
74 GtkWidget *vbox; | |
1210 | 75 GtkWidget *frame; |
76 GtkWidget *fbox; | |
1205 | 77 GtkWidget *label; |
1 | 78 GtkWidget *pixmap; |
79 GtkStyle *style; | |
80 GdkPixmap *pm; | |
81 GdkBitmap *bm; | |
1205 | 82 GtkWidget *hbox; |
83 GtkWidget *button; | |
3630 | 84 GtkWidget *view; |
85 GtkTextBuffer *buffer; | |
3709 | 86 GtkTextIter iter; |
87 GtkTextTag *tag; | |
2950 | 88 GtkWidget *sw; |
1 | 89 |
1205 | 90 char abouttitle[45]; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
91 |
1 | 92 if (!about) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
93 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2562
diff
changeset
|
94 GAIM_DIALOG(about); |
2904
3a9bca5fedcf
[gaim-migrate @ 2917]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2902
diff
changeset
|
95 gtk_window_set_default_size(GTK_WINDOW(about), 450, -1); |
2535 | 96 g_snprintf(abouttitle, sizeof(abouttitle), _("About Gaim v%s"), VERSION); |
1 | 97 gtk_window_set_title(GTK_WINDOW(about), abouttitle); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
98 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "Gaim"); |
1210 | 99 gtk_window_set_policy(GTK_WINDOW(about), FALSE, TRUE, TRUE); |
100 gtk_widget_realize(about); | |
1 | 101 |
1210 | 102 vbox = gtk_vbox_new(FALSE, 5); |
103 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
104 gtk_container_add(GTK_CONTAINER(about), vbox); | |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
105 gtk_widget_show(vbox); |
1205 | 106 |
2562 | 107 frame = gtk_frame_new("Gaim v" VERSION); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
108 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
|
109 gtk_widget_show(frame); |
1210 | 110 |
2072 | 111 fbox = gtk_vbox_new(FALSE, 5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
112 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); |
1210 | 113 gtk_container_add(GTK_CONTAINER(frame), fbox); |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
114 gtk_widget_show(fbox); |
1205 | 115 |
116 /* Left side, TOP */ | |
1 | 117 style = gtk_widget_get_style(about); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
118 pm = gdk_pixmap_create_from_xpm_d(about->window, &bm, |
2533 | 119 &style->bg[GTK_STATE_NORMAL], (gchar **)gaim_logo_xpm); |
1 | 120 pixmap = gtk_pixmap_new(pm, bm); |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
622
diff
changeset
|
121 gdk_pixmap_unref(pm); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
122 gdk_bitmap_unref(bm); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
123 gtk_box_pack_start(GTK_BOX(fbox), pixmap, FALSE, FALSE, 0); |
2450
59bac9b1a716
[gaim-migrate @ 2463]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2434
diff
changeset
|
124 gtk_widget_show(pixmap); |
1205 | 125 |
3630 | 126 view = gtk_text_view_new (); |
3709 | 127 gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE); |
128 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(view), FALSE); | |
3630 | 129 |
130 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); | |
2949 | 131 |
3709 | 132 gtk_text_buffer_set_text(buffer, "", -1); |
133 gtk_text_buffer_get_start_iter(buffer, &iter); | |
134 | |
135 tag = gtk_text_buffer_create_tag(buffer, "title", "weight", PANGO_WEIGHT_BOLD, "scale", PANGO_SCALE_LARGE, NULL); | |
136 tag = gtk_text_buffer_create_tag(buffer, "email", "scale", PANGO_SCALE_SMALL, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); | |
137 tag = gtk_text_buffer_create_tag(buffer, "url", "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); | |
138 | |
139 gtk_text_buffer_insert(buffer, &iter, | |
140 _("Gaim is a modular Instant Messaging client capable of using AIM, ICQ,\n" | |
141 "Yahoo!, MSN, IRC, Jabber, Napster, Zephyr, and Gadu-Gadu all at once.\n" | |
142 "It is written using Gtk+ and is licensed under the GPL.\n\n"), -1); | |
143 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "URL: ", -1, "title", NULL); | |
144 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, WEBSITE "\n\n", -1, "url", NULL); | |
145 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "IRC: ", -1, "title", NULL); | |
146 gtk_text_buffer_insert(buffer, &iter, "IRC: #gaim on irc.freenode.net\n", -1); | |
147 | |
148 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nActive Developers:\n"), -1, "title", NULL); | |
149 gtk_text_buffer_insert(buffer, &iter, " Rob Flynn (maintainer) ", -1); | |
150 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "rob@marko.net\n", -1, "email", NULL); | |
151 gtk_text_buffer_insert(buffer, &iter, " Sean Egan (coder) ",-1); | |
152 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "bj91704@binghamton.edu\n", -1, "email", NULL); | |
153 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nCrazy Patch Writers:\n"), -1, "title", NULL); | |
154 gtk_text_buffer_insert(buffer, &iter, " Benjamin Miller\n", -1); | |
155 gtk_text_buffer_insert(buffer, &iter, " Decklin Foster\n", -1); | |
156 gtk_text_buffer_insert(buffer, &iter, " Nathan Walp\n", -1); | |
157 gtk_text_buffer_insert(buffer, &iter, " Mark Doliner\n", -1); | |
158 | |
159 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nWin32 Port:\n"), -1, "title", NULL); | |
160 gtk_text_buffer_insert(buffer, &iter, " Herman Bloggs ", -1); | |
161 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "hermanator12002@yahoo.com\n", -1, "email", NULL); | |
162 | |
163 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nRetired Developers:\n"), -1, "title", NULL); | |
164 gtk_text_buffer_insert(buffer, &iter, " Jim Duchek\n", -1); | |
165 gtk_text_buffer_insert(buffer, &iter, " Eric Warmenhoven ", -1); | |
166 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "warmenhoven@yahoo.com\n", -1, "email", NULL); | |
167 gtk_text_buffer_insert(buffer, &iter, " Mark Spencer (original author) ", -1); | |
168 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "markster@marko.net\n", -1, "email", NULL); | |
2950 | 169 |
170 sw = gtk_scrolled_window_new(NULL, NULL); | |
171 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
172 | |
3709 | 173 |
3630 | 174 gtk_container_add(GTK_CONTAINER(sw), view); |
3709 | 175 gtk_widget_set_usize(GTK_WIDGET(sw), -1, 350); |
2950 | 176 gtk_widget_show(sw); |
3709 | 177 |
2950 | 178 gtk_box_pack_start(GTK_BOX(fbox), sw, TRUE, TRUE, 0); |
3630 | 179 gtk_widget_show(view); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
180 |
1205 | 181 /* Close Button */ |
182 | |
183 hbox = gtk_hbox_new(FALSE, 5); | |
1210 | 184 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
|
185 gtk_widget_show(hbox); |
1205 | 186 |
3709 | 187 button = gaim_pixbuf_button_from_stock(_("Close"), GTK_STOCK_CLOSE, GAIM_BUTTON_HORIZONTAL); |
1210 | 188 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
622 | 189 |
1142
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
190 if (null != (void *)2) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
191 /* 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
|
192 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
193 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
194 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
195 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
196 } else { |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
197 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
198 GTK_SIGNAL_FUNC(version_exit), NULL); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
199 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
200 GTK_SIGNAL_FUNC(version_exit), NULL); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
201 } |
3709 | 202 gtk_widget_show(button); |
1210 | 203 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
204 /* this makes the sizes not work. */ |
1976 | 205 /* GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); */ |
206 /* gtk_widget_grab_default(button); */ | |
1205 | 207 |
3709 | 208 button = gaim_pixbuf_button_from_stock(_("Web Site"), GTK_STOCK_HOME, GAIM_BUTTON_HORIZONTAL); |
1210 | 209 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
210 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(about_click), NULL); |
3709 | 211 gtk_widget_show(button); |
1205 | 212 } |
1210 | 213 |
214 /* 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
|
215 gtk_widget_show(about); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
216 |
2901
966f623dbd35
[gaim-migrate @ 2914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2827
diff
changeset
|
217 gdk_window_raise(about->window); |
1205 | 218 } |