Mercurial > pidgin
annotate src/about.c @ 1210:265abea9db72
[gaim-migrate @ 1220]
Decklin is still trying to replace me, I think :-P
committer: Tailor Script <tailor@pidgin.im>
| author | Rob Flynn <gaim@robflynn.com> |
|---|---|
| date | Wed, 06 Dec 2000 21:39:56 +0000 |
| parents | b81213bb5b61 |
| children | 728a90516211 |
| 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" |
| 1210 | 34 #include "pixmaps/about_small.xpm" |
| 1 | 35 |
| 36 static GtkWidget *about=NULL; | |
| 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 { |
|
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
54 open_url_nw(NULL, "http://www.marko.net/gaim/"); |
|
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
55 } |
|
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
356
diff
changeset
|
56 |
| 1 | 57 void show_about(GtkWidget *w, void *null) |
| 58 { | |
| 59 GtkWidget *vbox; | |
| 1210 | 60 GtkWidget *frame; |
| 61 GtkWidget *fbox; | |
| 1205 | 62 GtkWidget *a_table; |
| 63 GtkWidget *label; | |
| 1 | 64 GtkWidget *pixmap; |
| 65 GtkStyle *style; | |
| 66 GdkPixmap *pm; | |
| 67 GdkBitmap *bm; | |
| 1205 | 68 GtkWidget *hbox; |
| 69 GtkWidget *eventbox; | |
| 70 GtkWidget *button; | |
| 1 | 71 |
| 1205 | 72 char abouttitle[45]; |
| 73 | |
| 1 | 74 if (!about) { |
| 1205 | 75 |
| 1 | 76 about = gtk_window_new(GTK_WINDOW_DIALOG); |
| 1205 | 77 |
|
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
78 g_snprintf(abouttitle, sizeof(abouttitle), _("About GAIM v%s"), VERSION); |
| 1 | 79 gtk_window_set_title(GTK_WINDOW(about), abouttitle); |
| 905 | 80 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "Gaim" ); |
| 1210 | 81 gtk_window_set_policy(GTK_WINDOW(about), FALSE, TRUE, TRUE); |
| 1 | 82 |
| 1210 | 83 gtk_widget_realize(about); |
| 1 | 84 aol_icon(about->window); |
| 85 | |
| 1210 | 86 vbox = gtk_vbox_new(FALSE, 5); |
| 87 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
| 88 gtk_container_add(GTK_CONTAINER(about), vbox); | |
| 1205 | 89 |
| 1210 | 90 frame = gtk_frame_new("Gaim " VERSION); |
| 91 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); | |
| 92 | |
| 93 fbox = gtk_hbox_new(FALSE, 5); | |
| 94 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); | |
| 95 gtk_container_add(GTK_CONTAINER(frame), fbox); | |
| 1205 | 96 |
| 97 /* Left side, TOP */ | |
| 1 | 98 style = gtk_widget_get_style(about); |
| 99 pm = gdk_pixmap_create_from_xpm_d(about->window, &bm, | |
| 100 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo); | |
| 101 pixmap = gtk_pixmap_new(pm, bm); | |
| 1205 | 102 |
|
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
622
diff
changeset
|
103 gdk_pixmap_unref(pm); |
|
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
104 gdk_bitmap_unref(bm); |
| 1205 | 105 |
| 1210 | 106 gtk_box_pack_start(GTK_BOX(fbox), pixmap, FALSE, FALSE, 0); |
| 1205 | 107 |
| 108 /* Set up the author table */ | |
| 1210 | 109 a_table = gtk_table_new(6, 2, TRUE); |
| 110 gtk_table_set_row_spacings(GTK_TABLE(a_table), 5); | |
| 111 gtk_table_set_col_spacings(GTK_TABLE(a_table), 5); | |
| 1205 | 112 |
| 1210 | 113 label = gtk_label_new(_("GAIM is a client that supports AOL's Instant Messenger protocol. " |
| 114 "It is written using Gtk+ and is licensed under the GPL.\n" | |
| 115 "URL: http://www.marko.net/gaim/")); | |
| 116 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
| 117 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 2, 0, 2); | |
| 118 | |
| 1205 | 119 /* Rob */ |
| 120 label = gtk_label_new("Rob Flynn (Maintainer)"); | |
| 121 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 122 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 2, 3); |
| 1205 | 123 |
| 124 label = gtk_label_new("rob@tgflinux.com"); | |
| 125 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 126 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 1, 2, 2, 3); |
| 1 | 127 |
| 1205 | 128 /* Eric */ |
| 129 label = gtk_label_new("Eric Warmenhoven"); | |
| 130 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 131 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 3, 4); |
| 1205 | 132 |
| 133 label = gtk_label_new("warmenhoven@yahoo.com"); | |
| 134 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 135 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 1, 2, 3, 4); |
| 1205 | 136 |
| 137 /* Jim */ | |
| 138 label = gtk_label_new("Jim Duchek"); | |
| 139 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 140 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 4, 5); |
| 1205 | 141 |
| 142 /* Mark */ | |
| 143 label = gtk_label_new("Mark Spencer"); | |
| 144 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 145 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 5, 6); |
| 1205 | 146 |
| 147 label = gtk_label_new("markster@marko.net"); | |
| 148 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 1210 | 149 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 1, 2, 5, 6); |
| 1205 | 150 |
| 1210 | 151 gtk_box_pack_start(GTK_BOX(fbox), a_table, TRUE, TRUE, 0); |
| 1205 | 152 |
| 153 /* Close Button */ | |
| 154 | |
| 155 hbox = gtk_hbox_new(FALSE, 5); | |
| 1210 | 156 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 1205 | 157 |
| 1210 | 158 button = picture_button(about, _("Close"), cancel_xpm); |
| 159 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 622 | 160 |
|
1142
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
161 if (null != (void *)2) { |
|
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1117
diff
changeset
|
162 /* 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
|
163 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", |
|
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
164 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
|
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
165 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
|
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
166 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); |
|
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
167 } else { |
|
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
168 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
|
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
541
diff
changeset
|
169 GTK_SIGNAL_FUNC(version_exit), NULL); |
|
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
170 gtk_signal_connect(GTK_OBJECT(about), "destroy", |
|
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
171 GTK_SIGNAL_FUNC(version_exit), NULL); |
|
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
172 } |
| 1210 | 173 |
| 174 /* this makes the sizes not work. */ | |
| 175 //GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
| 176 //gtk_widget_grab_default(button); | |
| 1205 | 177 |
| 1210 | 178 button = picture_button(about, _("Web Site"), about_small_xpm); |
| 179 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 180 gtk_signal_connect(GTK_OBJECT(button), "clicked", | |
| 181 GTK_SIGNAL_FUNC(about_click), NULL); | |
| 1205 | 182 |
| 1210 | 183 if (display_options & OPT_DISP_COOL_LOOK) |
| 184 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1205 | 185 } |
| 1210 | 186 |
| 187 /* Let's give'em something to talk about -- woah woah woah */ | |
| 188 gtk_widget_show_all(about); | |
| 1 | 189 |
| 1205 | 190 } |
| 1 | 191 |
