comparison 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
comparison
equal deleted inserted replaced
1209:7aec3f881c98 1210:265abea9db72
29 29
30 #include <gtk/gtk.h> 30 #include <gtk/gtk.h>
31 #include "gaim.h" 31 #include "gaim.h"
32 #include "pixmaps/logo.xpm" 32 #include "pixmaps/logo.xpm"
33 #include "pixmaps/cancel.xpm" 33 #include "pixmaps/cancel.xpm"
34 #include "pixmaps/about_small.xpm"
34 35
35 static GtkWidget *about=NULL; 36 static GtkWidget *about=NULL;
36 37
37 static void destroy_about() 38 static void destroy_about()
38 { 39 {
54 } 55 }
55 56
56 void show_about(GtkWidget *w, void *null) 57 void show_about(GtkWidget *w, void *null)
57 { 58 {
58 GtkWidget *vbox; 59 GtkWidget *vbox;
59 GtkWidget *table; 60 GtkWidget *frame;
61 GtkWidget *fbox;
60 GtkWidget *a_table; 62 GtkWidget *a_table;
61 GtkWidget *label; 63 GtkWidget *label;
62 GtkWidget *pixmap; 64 GtkWidget *pixmap;
63 GtkStyle *style; 65 GtkStyle *style;
64 GdkPixmap *pm; 66 GdkPixmap *pm;
74 about = gtk_window_new(GTK_WINDOW_DIALOG); 76 about = gtk_window_new(GTK_WINDOW_DIALOG);
75 77
76 g_snprintf(abouttitle, sizeof(abouttitle), _("About GAIM v%s"), VERSION); 78 g_snprintf(abouttitle, sizeof(abouttitle), _("About GAIM v%s"), VERSION);
77 gtk_window_set_title(GTK_WINDOW(about), abouttitle); 79 gtk_window_set_title(GTK_WINDOW(about), abouttitle);
78 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "Gaim" ); 80 gtk_window_set_wmclass(GTK_WINDOW(about), "about", "Gaim" );
79 gtk_container_border_width(GTK_CONTAINER(about), 2); 81 gtk_window_set_policy(GTK_WINDOW(about), FALSE, TRUE, TRUE);
80 gtk_widget_set_usize(about, 535, 255);
81 gtk_window_set_policy(GTK_WINDOW(about), FALSE, FALSE, TRUE);
82 82
83 gtk_widget_show(about); 83 gtk_widget_realize(about);
84 aol_icon(about->window); 84 aol_icon(about->window);
85 85
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);
86 89
87 vbox = gtk_vbox_new(FALSE, 5); 90 frame = gtk_frame_new("Gaim " VERSION);
88 91 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
89 table = gtk_table_new(3, 2, FALSE); 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);
90 96
91 /* Left side, TOP */ 97 /* Left side, TOP */
92 style = gtk_widget_get_style(about); 98 style = gtk_widget_get_style(about);
93 pm = gdk_pixmap_create_from_xpm_d(about->window, &bm, 99 pm = gdk_pixmap_create_from_xpm_d(about->window, &bm,
94 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo); 100 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo);
95 pixmap = gtk_pixmap_new(pm, bm); 101 pixmap = gtk_pixmap_new(pm, bm);
96 102
97 gdk_pixmap_unref(pm); 103 gdk_pixmap_unref(pm);
98 gdk_bitmap_unref(bm); 104 gdk_bitmap_unref(bm);
99 105
100 gtk_table_attach(GTK_TABLE(table), pixmap, 0, 1, 0, 1, 0, 0, 5, 5); 106 gtk_box_pack_start(GTK_BOX(fbox), pixmap, FALSE, FALSE, 0);
101 gtk_widget_show(pixmap);
102
103
104 /* Right side, TOP*/
105 hbox = gtk_vbox_new(FALSE, 5);
106
107 label = gtk_label_new(_("GAIM is a client that supports AOL's Instant Messanger protocol. It is "
108 "written using Gtk+ and is licensed under the GPL."));
109 gtk_widget_show(label);
110 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
111 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
112 gtk_box_pack_start(GTK_BOX(hbox), label, GTK_EXPAND, FALSE, 0);
113 107
114 /* Set up the author table */ 108 /* Set up the author table */
115 a_table = gtk_table_new(2, 5, FALSE); 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);
116 112
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
117 /* Rob */ 119 /* Rob */
118 label = gtk_label_new("Rob Flynn (Maintainer)"); 120 label = gtk_label_new("Rob Flynn (Maintainer)");
119 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 121 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
120 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 1, 2, GTK_FILL, 0, 5, 5); 122 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 2, 3);
121 123
122 label = gtk_label_new("rob@tgflinux.com"); 124 label = gtk_label_new("rob@tgflinux.com");
123 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 125 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
124 gtk_table_attach(GTK_TABLE(a_table), label, 1, 2, 1, 2, GTK_FILL, 0, 5, 5); 126 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 1, 2, 2, 3);
125 127
126 /* Eric */ 128 /* Eric */
127 label = gtk_label_new("Eric Warmenhoven"); 129 label = gtk_label_new("Eric Warmenhoven");
128 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 130 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
129 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 2, 3, GTK_FILL, 0, 5, 5); 131 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 3, 4);
130 132
131 label = gtk_label_new("warmenhoven@yahoo.com"); 133 label = gtk_label_new("warmenhoven@yahoo.com");
132 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 134 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
133 gtk_table_attach(GTK_TABLE(a_table), label, 1, 2, 2, 3, GTK_FILL, 0, 5, 5); 135 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 1, 2, 3, 4);
134 136
135 /* Jim */ 137 /* Jim */
136 label = gtk_label_new("Jim Duchek"); 138 label = gtk_label_new("Jim Duchek");
137 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 139 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
138 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 3, 4, GTK_FILL, 0, 5, 5); 140 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 4, 5);
139 141
140 /* Mark */ 142 /* Mark */
141 label = gtk_label_new("Mark Spencer"); 143 label = gtk_label_new("Mark Spencer");
142 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 144 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
143 gtk_table_attach(GTK_TABLE(a_table), label, 0, 1, 4, 5, GTK_FILL, 0, 5, 5); 145 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 0, 1, 5, 6);
144 146
145 label = gtk_label_new("markster@marko.net"); 147 label = gtk_label_new("markster@marko.net");
146 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 148 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
147 gtk_table_attach(GTK_TABLE(a_table), label, 1, 2, 4, 5, GTK_FILL, 0, 5, 5); 149 gtk_table_attach_defaults(GTK_TABLE(a_table), label, 1, 2, 5, 6);
148 150
149 gtk_box_pack_start(GTK_BOX(hbox), a_table, TRUE, FALSE, 0); 151 gtk_box_pack_start(GTK_BOX(fbox), a_table, TRUE, TRUE, 0);
150
151 gtk_widget_show_all(a_table);
152
153 /* End Author List */
154
155 gtk_table_attach(GTK_TABLE(table), hbox, 1, 3, 0, 1, 0, 0, 5, 5);
156 gtk_widget_show(hbox);
157
158 /* Clickable URL */
159 eventbox = gtk_event_box_new();
160 gtk_table_attach(GTK_TABLE(table), eventbox, 0, 3, 1, 2, GTK_FILL, FALSE, 5, 5);
161 gtk_widget_show(eventbox);
162
163 label = gtk_label_new("Gaim " VERSION " - http://www.marko.net/gaim/\n");
164 gtk_container_add(GTK_CONTAINER(eventbox), label);
165
166 gtk_signal_connect(GTK_OBJECT(eventbox), "button_press_event",
167 GTK_SIGNAL_FUNC(about_click), NULL);
168 gdk_window_set_cursor(eventbox->window, gdk_cursor_new(GDK_HAND2));
169 gtk_widget_show(label);
170
171 /* End Clickable URL */
172 152
173 /* Close Button */ 153 /* Close Button */
174 154
155 hbox = gtk_hbox_new(FALSE, 5);
156 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
157
175 button = picture_button(about, _("Close"), cancel_xpm); 158 button = picture_button(about, _("Close"), cancel_xpm);
176
177 hbox = gtk_hbox_new(FALSE, 5);
178 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 159 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
179 gtk_widget_show(hbox);
180
181 /* End Button */
182
183 gtk_widget_show(vbox);
184 gtk_widget_show(table);
185
186
187 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
188 gtk_box_pack_end(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
189
190 gtk_container_add(GTK_CONTAINER(about), vbox);
191 160
192 if (null != (void *)2) { 161 if (null != (void *)2) {
193 /* 2 can be as sad as 1, it's the loneliest number since the number 1 */ 162 /* 2 can be as sad as 1, it's the loneliest number since the number 1 */
194 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", 163 gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
195 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about)); 164 GTK_SIGNAL_FUNC(destroy_about), GTK_OBJECT(about));
199 gtk_signal_connect(GTK_OBJECT(button), "clicked", 168 gtk_signal_connect(GTK_OBJECT(button), "clicked",
200 GTK_SIGNAL_FUNC(version_exit), NULL); 169 GTK_SIGNAL_FUNC(version_exit), NULL);
201 gtk_signal_connect(GTK_OBJECT(about), "destroy", 170 gtk_signal_connect(GTK_OBJECT(about), "destroy",
202 GTK_SIGNAL_FUNC(version_exit), NULL); 171 GTK_SIGNAL_FUNC(version_exit), NULL);
203 } 172 }
204
205 if (display_options & OPT_DISP_COOL_LOOK)
206 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
207
208 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
209 gtk_widget_grab_default(button);
210 173
174 /* this makes the sizes not work. */
175 //GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
176 //gtk_widget_grab_default(button);
211 177
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);
182
183 if (display_options & OPT_DISP_COOL_LOOK)
184 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
212 } 185 }
213 else 186
214 /* Let's give'em something to talk about -- woah woah woah */ 187 /* Let's give'em something to talk about -- woah woah woah */
215 gtk_widget_show(about); 188 gtk_widget_show_all(about);
216 189
217 } 190 }
218 191