Mercurial > pidgin
comparison src/about.c @ 4006:d3812895af8d
[gaim-migrate @ 4206]
GtkIMHtml in the About box by Nathan Walp.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 27 Nov 2002 18:47:14 +0000 |
parents | 222a6e84284d |
children | e2d8ac05871f |
comparison
equal
deleted
inserted
replaced
4005:7aab0cc1ec78 | 4006:d3812895af8d |
---|---|
27 #include <stdlib.h> | 27 #include <stdlib.h> |
28 #include <time.h> | 28 #include <time.h> |
29 | 29 |
30 #include <gtk/gtk.h> | 30 #include <gtk/gtk.h> |
31 #include "gaim.h" | 31 #include "gaim.h" |
32 #include "gtkimhtml.h" | |
32 | 33 |
33 static GtkWidget *about = NULL; | 34 static GtkWidget *about = NULL; |
34 | 35 |
35 static void destroy_about() | 36 static void destroy_about() |
36 { | 37 { |
44 { | 45 { |
45 gtk_main_quit(); | 46 gtk_main_quit(); |
46 } | 47 } |
47 | 48 |
48 | 49 |
49 static void about_click(GtkWidget *w, gpointer m) | |
50 { | |
51 open_url(NULL, WEBSITE); | |
52 } | |
53 | |
54 char *name() | 50 char *name() |
55 { | 51 { |
56 return PACKAGE; | 52 return PACKAGE; |
57 } | 53 } |
58 | 54 |
69 void show_about(GtkWidget *w, void *null) | 65 void show_about(GtkWidget *w, void *null) |
70 { | 66 { |
71 GtkWidget *vbox; | 67 GtkWidget *vbox; |
72 GtkWidget *frame; | 68 GtkWidget *frame; |
73 GtkWidget *fbox; | 69 GtkWidget *fbox; |
74 GtkStyle *style; | |
75 GtkWidget *hbox; | 70 GtkWidget *hbox; |
76 GtkWidget *button; | 71 GtkWidget *button; |
77 GtkWidget *view; | 72 GtkWidget *text; |
78 GtkTextBuffer *buffer; | |
79 GtkTextIter iter; | |
80 GtkTextTag *tag; | |
81 GtkWidget *sw; | 73 GtkWidget *sw; |
82 GtkWidget *logo; | 74 GtkWidget *logo; |
83 | 75 |
84 char abouttitle[45]; | 76 char abouttitle[45]; |
85 | 77 |
105 fbox = gtk_vbox_new(FALSE, 5); | 97 fbox = gtk_vbox_new(FALSE, 5); |
106 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); | 98 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); |
107 gtk_container_add(GTK_CONTAINER(frame), fbox); | 99 gtk_container_add(GTK_CONTAINER(frame), fbox); |
108 gtk_widget_show(fbox); | 100 gtk_widget_show(fbox); |
109 | 101 |
110 /* Left side, TOP */ | |
111 style = gtk_widget_get_style(about); | |
112 | |
113 logo = gaim_pixmap(NULL, "logo.png"); | 102 logo = gaim_pixmap(NULL, "logo.png"); |
114 gtk_box_pack_start(GTK_BOX(fbox), logo, FALSE, FALSE, 0); | 103 gtk_box_pack_start(GTK_BOX(fbox), logo, FALSE, FALSE, 0); |
115 gtk_widget_show(logo); | 104 gtk_widget_show(logo); |
116 | 105 |
117 view = gtk_text_view_new (); | |
118 gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE); | |
119 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(view), FALSE); | |
120 | |
121 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); | |
122 | |
123 gtk_text_buffer_set_text(buffer, "", -1); | |
124 gtk_text_buffer_get_start_iter(buffer, &iter); | |
125 | |
126 tag = gtk_text_buffer_create_tag(buffer, "title", "weight", PANGO_WEIGHT_BOLD, "scale", PANGO_SCALE_LARGE, NULL); | |
127 tag = gtk_text_buffer_create_tag(buffer, "email", "scale", PANGO_SCALE_SMALL, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); | |
128 tag = gtk_text_buffer_create_tag(buffer, "url", "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); | |
129 | |
130 gtk_text_buffer_insert(buffer, &iter, | |
131 _("Gaim is a modular Instant Messaging client capable of using AIM, ICQ,\n" | |
132 "Yahoo!, MSN, IRC, Jabber, Napster, Zephyr, and Gadu-Gadu all at once.\n" | |
133 "It is written using Gtk+ and is licensed under the GPL.\n\n"), -1); | |
134 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "URL: ", -1, "title", NULL); | |
135 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, WEBSITE "\n\n", -1, "url", NULL); | |
136 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "IRC: ", -1, "title", NULL); | |
137 gtk_text_buffer_insert(buffer, &iter, "IRC: #gaim on irc.freenode.net\n", -1); | |
138 | |
139 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nActive Developers:\n"), -1, "title", NULL); | |
140 gtk_text_buffer_insert(buffer, &iter, " Rob Flynn (maintainer) ", -1); | |
141 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "rob@marko.net\n", -1, "email", NULL); | |
142 gtk_text_buffer_insert(buffer, &iter, " Sean Egan (coder) ",-1); | |
143 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "bj91704@binghamton.edu\n", -1, "email", NULL); | |
144 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nCrazy Patch Writers:\n"), -1, "title", NULL); | |
145 gtk_text_buffer_insert(buffer, &iter, " Benjamin Miller\n", -1); | |
146 gtk_text_buffer_insert(buffer, &iter, " Decklin Foster\n", -1); | |
147 gtk_text_buffer_insert(buffer, &iter, " Nathan Walp\n", -1); | |
148 gtk_text_buffer_insert(buffer, &iter, " Mark Doliner\n", -1); | |
149 | |
150 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nWin32 Port:\n"), -1, "title", NULL); | |
151 gtk_text_buffer_insert(buffer, &iter, " Herman Bloggs ", -1); | |
152 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "hermanator12002@yahoo.com\n", -1, "email", NULL); | |
153 | |
154 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, _("\nRetired Developers:\n"), -1, "title", NULL); | |
155 gtk_text_buffer_insert(buffer, &iter, " Jim Duchek\n", -1); | |
156 gtk_text_buffer_insert(buffer, &iter, " Eric Warmenhoven ", -1); | |
157 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "warmenhoven@yahoo.com\n", -1, "email", NULL); | |
158 gtk_text_buffer_insert(buffer, &iter, " Mark Spencer (original author) ", -1); | |
159 gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "markster@marko.net\n", -1, "email", NULL); | |
160 | |
161 sw = gtk_scrolled_window_new(NULL, NULL); | 106 sw = gtk_scrolled_window_new(NULL, NULL); |
162 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | 107 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), |
163 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | 108 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
164 | 109 gtk_box_pack_start(GTK_BOX(fbox), sw, TRUE, TRUE, 0); |
165 | 110 |
166 gtk_container_add(GTK_CONTAINER(sw), view); | 111 text = gtk_imhtml_new(NULL, NULL); |
167 gtk_widget_set_usize(GTK_WIDGET(sw), -1, 350); | 112 gtk_container_add(GTK_CONTAINER(sw), text); |
113 gtk_widget_set_usize(sw, -1, 350); | |
114 gaim_setup_imhtml(text); | |
115 | |
116 | |
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 " | |
121 "Gtk+ and is licensed under the GPL.<BR><BR>"), -1, 0); | |
122 | |
123 gtk_imhtml_append_text(GTK_IMHTML(text), | |
124 "<FONT SIZE=\"3\">URL:</FONT> <A HREF=\"" WEBSITE "\">" | |
125 WEBSITE "</A><BR><BR>", -1, 0); | |
126 | |
127 gtk_imhtml_append_text(GTK_IMHTML(text), | |
128 "<FONT SIZE=\"3\">IRC:</FONT> #gaim on irc.freenode.net" | |
129 "<BR><BR>", -1, 0); | |
130 | |
131 gtk_imhtml_append_text(GTK_IMHTML(text), | |
132 _("<FONT SIZE=\"3\">Active Developers:</FONT><BR>"), -1, 0); | |
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>>" | |
139 "<BR><BR>", -1, 0); | |
140 | |
141 gtk_imhtml_append_text(GTK_IMHTML(text), | |
142 _("<FONT SIZE=\"3\">Crazy Patch Writers:</FONT><BR>"), -1, 0); | |
143 gtk_imhtml_append_text(GTK_IMHTML(text), | |
144 " Benjamin Miller<BR>" | |
145 " Decklin Foster<BR>" | |
146 " Nathan Walp<BR>" | |
147 " Mark Doliner<BR><BR>", -1, 0); | |
148 | |
149 gtk_imhtml_append_text(GTK_IMHTML(text), | |
150 _("<FONT SIZE=\"3\">Win32 Port:</FONT><BR>"), -1, 0); | |
151 gtk_imhtml_append_text(GTK_IMHTML(text), | |
152 " Herman Bloggs " | |
153 "<<A HREF=\"mailto:hermanator12002@yahoo.com\">" | |
154 "hermanator12002@yahoo.com</A>><BR><BR>", -1, 0); | |
155 | |
156 gtk_imhtml_append_text(GTK_IMHTML(text), | |
157 _("<FONT SIZE=\"3\">Retired Developers:</FONT><BR>"), -1, 0); | |
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>>" | |
166 "<BR><BR>", -1, 0); | |
167 | |
168 gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw)), 0); | |
169 | |
170 gtk_widget_show(text); | |
168 gtk_widget_show(sw); | 171 gtk_widget_show(sw); |
169 | 172 |
170 gtk_box_pack_start(GTK_BOX(fbox), sw, TRUE, TRUE, 0); | |
171 gtk_widget_show(view); | |
172 | 173 |
173 /* Close Button */ | 174 /* Close Button */ |
174 | 175 |
175 hbox = gtk_hbox_new(FALSE, 5); | 176 hbox = gtk_hbox_new(FALSE, 5); |
176 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 177 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
195 | 196 |
196 /* this makes the sizes not work. */ | 197 /* this makes the sizes not work. */ |
197 /* GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); */ | 198 /* GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); */ |
198 /* gtk_widget_grab_default(button); */ | 199 /* gtk_widget_grab_default(button); */ |
199 | 200 |
200 button = gaim_pixbuf_button_from_stock(_("Web Site"), GTK_STOCK_HOME, GAIM_BUTTON_HORIZONTAL); | |
201 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
202 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(about_click), NULL); | |
203 gtk_widget_show(button); | 201 gtk_widget_show(button); |
204 } | 202 } |
205 | 203 |
206 /* Let's give'em something to talk about -- woah woah woah */ | 204 /* Let's give'em something to talk about -- woah woah woah */ |
207 gtk_widget_show(about); | 205 gtk_widget_show(about); |