Mercurial > pidgin
annotate src/aim.c @ 987:cf6662982b40
[gaim-migrate @ 997]
I am cool.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Fri, 13 Oct 2000 18:55:04 +0000 |
parents | 7e231bc0018a |
children | 9523b772e546 |
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:
342
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
342
diff
changeset
|
23 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
342
diff
changeset
|
24 #endif |
1 | 25 #ifdef USE_APPLET |
26 #include "gnome_applet_mgr.h" | |
27 #include <gnome.h> | |
730
e46cc3c6ff26
[gaim-migrate @ 740]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
724
diff
changeset
|
28 #else |
e46cc3c6ff26
[gaim-migrate @ 740]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
724
diff
changeset
|
29 #ifdef USE_GNOME |
e46cc3c6ff26
[gaim-migrate @ 740]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
724
diff
changeset
|
30 #include <gnome.h> |
e46cc3c6ff26
[gaim-migrate @ 740]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
724
diff
changeset
|
31 #endif /* USE_GNOME */ |
1 | 32 #endif /* USE_APPLET */ |
395
9a436c1d128d
[gaim-migrate @ 405]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
33 #ifdef GAIM_PLUGINS |
9a436c1d128d
[gaim-migrate @ 405]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
34 #include <dlfcn.h> |
9a436c1d128d
[gaim-migrate @ 405]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
35 #endif /* GAIM_PLUGINS */ |
1 | 36 #include <gtk/gtk.h> |
37 #include <gdk/gdkx.h> | |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
38 #include <gdk/gdk.h> |
1 | 39 #include <unistd.h> |
40 #include <netinet/in.h> | |
41 #include <arpa/inet.h> | |
42 #include <sys/wait.h> | |
43 #include <stdio.h> | |
44 #include <string.h> | |
45 #include <stdarg.h> | |
46 #include <stdlib.h> | |
228 | 47 #include <ctype.h> |
1 | 48 #include "gaim.h" |
49 #include "pixmaps/logo.xpm" | |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
50 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
51 #include <signal.h> |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
52 #endif |
462 | 53 #include "locale.h" |
430 | 54 #include "gtkticker.h" |
55 | |
1 | 56 GList *permit = NULL; |
57 GList *deny = NULL; | |
58 GList *log_conversations = NULL; | |
59 GList *buddy_pounces = NULL; | |
940 | 60 GSList *away_messages = NULL; |
61 GSList *groups = NULL; | |
1 | 62 GList *conversations = NULL; |
63 GList *chat_rooms = NULL; | |
64 | |
65 GtkWidget *mainwindow = NULL; | |
66 | |
430 | 67 void BuddyTickerCreateWindow( void ); |
68 | |
1 | 69 char toc_addy[16]; |
26 | 70 char *quad_addr = NULL; |
1 | 71 |
72 void cancel_logon(void) | |
73 { | |
74 #ifdef USE_APPLET | |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
75 applet_buddy_show = FALSE; |
941
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
76 if (mainwindow) |
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
77 gtk_widget_hide(mainwindow); |
1 | 78 #else |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
79 #ifdef GAIM_PLUGINS |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
80 GList *c; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
81 struct gaim_plugin *p; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
82 void (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
83 char *error; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
84 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
85 /* first we tell those who have requested it we're quitting */ |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
757
diff
changeset
|
86 plugin_event(event_quit, 0, 0, 0); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
87 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
88 /* then we remove everyone in a mass suicide */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
89 c = plugins; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
90 while (c) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
91 p = (struct gaim_plugin *)c->data; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
92 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove"); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
93 if ((error = (char *)dlerror()) == NULL) |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
94 (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
95 /* we don't need to worry about removing callbacks since |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
96 * there won't be any more chance to call them back :) */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
97 dlclose(p->handle); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
98 g_free(p->filename); /* why do i bother? */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
99 g_free(p); |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
395
diff
changeset
|
100 c = c->next; |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
101 } |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
102 #endif /* GAIM_PLUGINS */ |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
103 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
104 perl_end(); |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
105 #endif |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
106 |
1 | 107 exit(0); |
108 #endif /* USE_APPLET */ | |
109 } | |
110 | |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
967
diff
changeset
|
111 void hide_login_progress(char *name, char *why) |
1 | 112 { |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
967
diff
changeset
|
113 char buf[2048]; |
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
967
diff
changeset
|
114 sprintf(buf, _("%s was unable to sign on: %s"), name, why); |
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
967
diff
changeset
|
115 do_error_dialog(buf, _("Signon Error")); |
1 | 116 } |
117 | |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
118 static int snd_tmout; |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
119 int logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
120 static void sound_timeout() { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
121 logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
122 gtk_timeout_remove(snd_tmout); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
123 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
124 |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
125 /* we need to do this for Oscar because serv_login only starts the login |
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
126 * process, it doesn't end there. gaim_setup will be called later from |
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
127 * oscar.c, after the buddy list is made and serv_finish_login is called */ |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
128 void gaim_setup(struct gaim_connection *gc) { |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
129 if (sound_options & OPT_SOUND_LOGIN && |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
130 sound_options & OPT_SOUND_SILENT_SIGNON) { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
131 logins_not_muted = 0; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
132 snd_tmout = gtk_timeout_add(10000, (GtkFunction)sound_timeout, |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
133 NULL); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
134 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
135 |
84 | 136 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
137 set_user_state(online); |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
138 applet_widget_register_callback(APPLET_WIDGET(applet), |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
139 "signoff", |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
140 _("Signoff"), |
966
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
141 (AppletCallbackFunc)signoff_all, |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
142 NULL); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
143 #endif /* USE_APPLET */ |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
85
diff
changeset
|
144 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
145 account_online(gc); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
146 |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
757
diff
changeset
|
147 plugin_event(event_signon, 0, 0, 0); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
85
diff
changeset
|
148 |
84 | 149 return; |
1 | 150 } |
151 | |
152 | |
153 | |
154 | |
155 void show_login() | |
156 { | |
157 GtkWidget *options; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
158 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
159 GtkWidget *plugs; |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
160 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
161 GtkWidget *accts; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
162 GtkWidget *cancel; |
1 | 163 GtkWidget *reg; |
164 GtkWidget *bbox; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
165 GtkWidget *hbox; |
1 | 166 GtkWidget *sbox; |
167 GtkWidget *table; | |
168 | |
169 GtkWidget *pmw; | |
170 GdkPixmap *pm; | |
171 GtkStyle *style; | |
172 GdkBitmap *mask; | |
173 | |
174 if (mainwindow) { | |
175 gtk_widget_show(mainwindow); | |
176 return; | |
177 } | |
430 | 178 |
1 | 179 mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 180 /* Set the WM name and class */ |
181 gtk_window_set_wmclass(GTK_WINDOW(mainwindow), "login", | |
182 "Gaim"); | |
183 /* Disallow resizing */ | |
184 gtk_window_set_policy(GTK_WINDOW(mainwindow), FALSE, FALSE, TRUE); | |
621 | 185 gtk_widget_realize(mainwindow); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
186 accts = gtk_button_new_with_label(_("Accounts")); |
622 | 187 cancel = gtk_button_new_with_label(_("Cancel")); |
188 reg = gtk_button_new_with_label(_("Register")); | |
189 options = gtk_button_new_with_label(_("Options")); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
190 #ifdef GAIM_PLUGINS |
622 | 191 plugs = gtk_button_new_with_label(_("Plugins")); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
192 #endif |
1 | 193 table = gtk_table_new(8, 2, FALSE); |
194 | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
195 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
196 { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
197 gtk_button_set_relief(GTK_BUTTON(accts), GTK_RELIEF_NONE); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
198 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
199 gtk_button_set_relief(GTK_BUTTON(reg), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
200 gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
201 #ifdef GAIM_PLUGINS |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
202 gtk_button_set_relief(GTK_BUTTON(plugs), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
203 #endif |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
204 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
205 |
1 | 206 /* Make the buttons do stuff */ |
207 /* Clicking the button initiates a login */ | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
208 gtk_signal_connect(GTK_OBJECT(accts), "clicked", |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
209 GTK_SIGNAL_FUNC(account_editor), mainwindow); |
1 | 210 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", |
211 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); | |
212 /* Allow user to change prefs before logging in */ | |
213 gtk_signal_connect(GTK_OBJECT(options), "clicked", | |
214 GTK_SIGNAL_FUNC(show_prefs), NULL); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
215 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
216 /* Allow user to control plugins before logging in */ |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
217 gtk_signal_connect(GTK_OBJECT(plugs), "clicked", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
218 GTK_SIGNAL_FUNC(show_plugins), NULL); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
219 #endif |
1 | 220 |
221 /* Register opens the right URL */ | |
222 gtk_signal_connect(GTK_OBJECT(reg), "clicked", | |
286 | 223 GTK_SIGNAL_FUNC(open_url), "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"); |
1 | 224 gtk_signal_connect(GTK_OBJECT(mainwindow), "delete_event", |
225 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); | |
226 /* Homogenous spacing, 10 padding */ | |
227 bbox = gtk_hbox_new(TRUE, 10); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
228 hbox = gtk_hbox_new(TRUE, 10); |
621 | 229 sbox = gtk_vbox_new(TRUE, 5); |
1 | 230 |
622 | 231 gtk_box_pack_start(GTK_BOX(bbox), reg, TRUE, TRUE, 0); |
1 | 232 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
233 |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
234 gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
235 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
236 gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
237 #endif |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
238 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
239 gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); |
1 | 240 gtk_box_pack_start(GTK_BOX(sbox), bbox, TRUE, TRUE, 0); |
241 | |
242 /* Labels for selectors and text boxes */ | |
243 | |
244 gtk_widget_show(options); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
245 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
246 gtk_widget_show(plugs); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
247 #endif |
1 | 248 |
249 /* Attach the buttons at the bottom */ | |
250 gtk_widget_show(cancel); | |
251 gtk_widget_show(reg); | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
252 gtk_widget_show(accts); |
1 | 253 gtk_widget_show(bbox); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
254 gtk_widget_show(hbox); |
1 | 255 gtk_widget_show(sbox); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
256 gtk_table_attach(GTK_TABLE(table), accts, 0,2,6,7,0,0, 5, 5); |
1 | 257 gtk_table_attach(GTK_TABLE(table), sbox, 0,2,7,8,0,0, 5, 5); |
258 | |
259 /* Text fields */ | |
260 | |
261 gtk_container_border_width(GTK_CONTAINER(sbox), 10); | |
262 | |
263 gtk_container_add(GTK_CONTAINER(mainwindow),table ); | |
264 | |
265 gtk_widget_show(table); | |
905 | 266 gtk_window_set_title(GTK_WINDOW(mainwindow),_("Gaim - Login")); |
1 | 267 |
268 | |
269 gtk_widget_realize(mainwindow); | |
270 | |
271 /* Logo at the top */ | |
272 style = gtk_widget_get_style(mainwindow); | |
273 pm = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask, | |
274 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo); | |
275 pmw = gtk_pixmap_new( pm, mask); | |
276 gtk_table_attach(GTK_TABLE(table), pmw, 0,2,0,1,0,0,5,5); | |
277 gtk_widget_show(pmw); | |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
278 gdk_pixmap_unref(pm); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
800
diff
changeset
|
279 gdk_bitmap_unref(mask); |
1 | 280 |
281 | |
282 aol_icon(mainwindow->window); | |
283 #ifndef _WIN32 | |
284 gdk_window_set_group(mainwindow->window, mainwindow->window); | |
285 #endif | |
286 | |
287 | |
288 gtk_widget_show(mainwindow); | |
436 | 289 |
290 SetTickerPrefs(); | |
1 | 291 |
292 } | |
293 | |
200
bc117fbcf527
[gaim-migrate @ 210]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
184
diff
changeset
|
294 extern void show_debug(GtkObject *); |
180 | 295 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
296 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
297 void sighandler(int sig) |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
298 { |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
299 fprintf(stderr, "God damn, I tripped.\n"); |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
300 exit(11); /* signal 11 */ |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
301 } |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
302 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
303 |
1 | 304 int main(int argc, char *argv[]) |
305 { | |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
306 #ifdef ENABLE_NLS |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
307 bindtextdomain(PACKAGE, LOCALEDIR); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
308 textdomain(PACKAGE); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
309 #endif |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
310 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
311 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
312 /* Let's not violate any PLA's!!!! */ |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
313 /* signal(SIGSEGV, sighandler); */ |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
314 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
315 |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
316 if (argc > 1 && !strcmp(argv[1], "--version")) { |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
317 gtk_init(&argc, &argv); |
917 | 318 set_defaults(FALSE); /* needed for open_url_nw */ |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
319 load_prefs(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
320 show_about(0, (void *)1); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
321 gtk_main(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
322 return 0; |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
323 } |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
324 |
1 | 325 #ifdef USE_APPLET |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
326 init_applet_mgr(argc, argv); |
724
e7d812852a7f
[gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
705
diff
changeset
|
327 #elif defined USE_GNOME |
e7d812852a7f
[gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
705
diff
changeset
|
328 gnome_init(PACKAGE,VERSION,argc,argv); |
1 | 329 #else |
330 gtk_init(&argc, &argv); | |
724
e7d812852a7f
[gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
705
diff
changeset
|
331 #endif /* USE_GNOME */ |
1 | 332 |
917 | 333 set_defaults(FALSE); |
1 | 334 load_prefs(); |
180 | 335 |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
336 if (general_options & OPT_GEN_DEBUG) |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
337 show_debug(NULL); |
1 | 338 |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
339 gdk_threads_enter(); |
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
340 |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
341 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
342 perl_init(); |
800
022048cde898
[gaim-migrate @ 810]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
792
diff
changeset
|
343 perl_autoload(); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
344 #endif |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
345 |
1 | 346 #ifdef USE_APPLET |
347 applet_widget_register_callback(APPLET_WIDGET(applet), | |
348 "prefs", | |
349 _("Preferences"), | |
350 show_prefs, | |
351 NULL); | |
352 applet_widget_register_callback(APPLET_WIDGET(applet), | |
966
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
353 "accounts", |
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
354 _("Accounts"), |
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
355 (AppletCallbackFunc)account_editor, |
1 | 356 NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
357 #ifdef GAIM_PLUGINS |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
358 applet_widget_register_callback(APPLET_WIDGET(applet), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
359 "plugins", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
360 _("Plugins"), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
361 GTK_SIGNAL_FUNC(show_plugins), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
362 NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
363 #endif /* GAIM_PLUGINS */ |
1 | 364 |
82 | 365 update_pixmaps(); |
1 | 366 |
367 applet_widget_gtk_main(); | |
368 #else | |
369 | |
370 | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
371 static_proto_init(); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
372 |
1 | 373 show_login(); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
374 auto_login(); |
1 | 375 gtk_main(); |
376 | |
377 #endif /* USE_APPLET */ | |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
378 gdk_threads_leave(); |
1 | 379 |
380 return 0; | |
381 | |
382 } |