Mercurial > pidgin
annotate src/about.c @ 2110:704a07ed9481
[gaim-migrate @ 2120]
well this was a stupid bug.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 02 Aug 2001 19:59:25 +0000 |
parents | b66aca8e8dce |
children | 14e8978f86bb |
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 |
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 { |
1710
f42ce672c560
[gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1670
diff
changeset
|
54 open_url_nw(NULL, WEBSITE); |
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 |
1 | 67 void show_about(GtkWidget *w, void *null) |
68 { | |
69 GtkWidget *vbox; | |
1210 | 70 GtkWidget *frame; |
71 GtkWidget *fbox; | |
1205 | 72 GtkWidget *label; |
1 | 73 GtkWidget *pixmap; |
74 GtkStyle *style; | |
75 GdkPixmap *pm; | |
76 GdkBitmap *bm; | |
1205 | 77 GtkWidget *hbox; |
78 GtkWidget *button; | |
2072 | 79 GtkWidget *text; |
1 | 80 |
1205 | 81 char abouttitle[45]; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
82 |
1 | 83 if (!about) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
84 |
1972
1053abe6e9f4
[gaim-migrate @ 1982]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1971
diff
changeset
|
85 about = gtk_window_new(GTK_WINDOW_DIALOG); |
1205 | 86 |
2072 | 87 gtk_widget_set_usize(GTK_WIDGET(about), 450, 450); |
88 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
89 g_snprintf(abouttitle, sizeof(abouttitle), _("About GAIM v%s"), VERSION); |
1 | 90 gtk_window_set_title(GTK_WINDOW(about), abouttitle); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
91 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "Gaim"); |
1210 | 92 gtk_window_set_policy(GTK_WINDOW(about), FALSE, TRUE, TRUE); |
1 | 93 |
1210 | 94 gtk_widget_realize(about); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
95 aol_icon(about->window); |
1 | 96 |
1210 | 97 vbox = gtk_vbox_new(FALSE, 5); |
98 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
99 gtk_container_add(GTK_CONTAINER(about), vbox); | |
1205 | 100 |
1210 | 101 frame = gtk_frame_new("Gaim " VERSION); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
102 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
1210 | 103 |
2072 | 104 fbox = gtk_vbox_new(FALSE, 5); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
105 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); |
1210 | 106 gtk_container_add(GTK_CONTAINER(frame), fbox); |
1205 | 107 |
108 /* Left side, TOP */ | |
1 | 109 style = gtk_widget_get_style(about); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
110 pm = gdk_pixmap_create_from_xpm_d(about->window, &bm, |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
111 &style->bg[GTK_STATE_NORMAL], (gchar **) aol_logo); |
1 | 112 pixmap = gtk_pixmap_new(pm, bm); |
1205 | 113 |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
622
diff
changeset
|
114 gdk_pixmap_unref(pm); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
115 gdk_bitmap_unref(bm); |
1205 | 116 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
117 gtk_box_pack_start(GTK_BOX(fbox), pixmap, FALSE, FALSE, 0); |
1205 | 118 |
2072 | 119 label = gtk_label_new(_("GAIM is a client that supports AOL's Instant Messenger protocol. It is written\n" |
120 "using Gtk+ and is licensed under the GPL.\n\n" | |
121 "URL: " WEBSITE)); | |
1210 | 122 |
2072 | 123 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
124 |
2072 | 125 gtk_box_pack_start(GTK_BOX(fbox), label, TRUE, TRUE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
126 |
2072 | 127 text = gtk_text_new(NULL, NULL); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
128 |
2072 | 129 gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, _("Rob Flynn (maintainer) rob@marko.net\nEric Warmenhoven (lead coder) warmenhoven@yahoo.com\n\nBenjamin Miller\nDecklin Foster\nJim Duchek\nMark Spencer (original author) markster@marko.net"), 199); |
130 | |
131 gtk_widget_show(text); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
132 |
2072 | 133 gtk_box_pack_start(GTK_BOX(fbox), text, TRUE, TRUE, 0); |
1205 | 134 |
135 /* Close Button */ | |
136 | |
137 hbox = gtk_hbox_new(FALSE, 5); | |
1210 | 138 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1205 | 139 |
1210 | 140 button = picture_button(about, _("Close"), cancel_xpm); |
141 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
622 | 142 |
1142
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
143 if (null != (void *)2) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
144 /* 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
|
145 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
146 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
147 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
148 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
149 } else { |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
150 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
151 GTK_SIGNAL_FUNC(version_exit), NULL); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
152 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
153 GTK_SIGNAL_FUNC(version_exit), NULL); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
154 } |
1210 | 155 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
156 /* this makes the sizes not work. */ |
1976 | 157 /* GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); */ |
158 /* gtk_widget_grab_default(button); */ | |
1205 | 159 |
1210 | 160 button = picture_button(about, _("Web Site"), about_small_xpm); |
161 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
|
162 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(about_click), NULL); |
1205 | 163 |
1210 | 164 if (display_options & OPT_DISP_COOL_LOOK) |
165 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
1205 | 166 } |
1210 | 167 |
168 /* Let's give'em something to talk about -- woah woah woah */ | |
169 gtk_widget_show_all(about); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
170 |
1205 | 171 } |