Mercurial > pidgin.yaz
annotate src/aim.c @ 951:b6d0a7105780
[gaim-migrate @ 961]
0.10.3
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Sat, 07 Oct 2000 09:41:39 +0000 |
parents | 0c3bdd59f983 |
children | fa681641643d |
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 #ifndef USE_APPLET | |
50 #include "pixmaps/logo.xpm" | |
51 #endif /* USE_APPLET */ | |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
52 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
53 #include <signal.h> |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
54 #endif |
462 | 55 #include "locale.h" |
430 | 56 #include "gtkticker.h" |
57 | |
1 | 58 static GtkWidget *name; |
59 static GtkWidget *pass; | |
60 static GtkWidget *signon; | |
61 static GtkWidget *cancel; | |
62 static GtkWidget *progress; | |
63 static GtkWidget *notice; | |
64 | |
65 GList *permit = NULL; | |
66 GList *deny = NULL; | |
67 GList *log_conversations = NULL; | |
68 GList *buddy_pounces = NULL; | |
940 | 69 GSList *away_messages = NULL; |
70 GSList *groups = NULL; | |
1 | 71 GList *buddy_chats = NULL; |
72 GList *conversations = NULL; | |
73 GList *chat_rooms = NULL; | |
74 | |
75 GtkWidget *mainwindow = NULL; | |
705
dcf672c5a1ff
[gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
76 GtkWidget *remember = NULL; |
1 | 77 |
430 | 78 void BuddyTickerCreateWindow( void ); |
79 | |
1 | 80 char toc_addy[16]; |
26 | 81 char *quad_addr = NULL; |
1 | 82 |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
83 gboolean running = FALSE; /* whether or not we're currently trying to sign on */ |
1 | 84 |
85 void cancel_logon(void) | |
86 { | |
87 #ifdef USE_APPLET | |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
88 applet_buddy_show = FALSE; |
941
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
89 if (running) |
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
90 serv_close(); |
757
531c58849b28
[gaim-migrate @ 767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
746
diff
changeset
|
91 running = FALSE; |
941
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
92 if (mainwindow) |
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
93 gtk_widget_hide(mainwindow); |
1 | 94 #else |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
95 #ifdef GAIM_PLUGINS |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
96 GList *c; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
97 struct gaim_plugin *p; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
98 void (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
99 char *error; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
100 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
101 /* 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
|
102 plugin_event(event_quit, 0, 0, 0); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
103 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
104 /* then we remove everyone in a mass suicide */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
105 c = plugins; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
106 while (c) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
107 p = (struct gaim_plugin *)c->data; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
108 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove"); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
109 if ((error = (char *)dlerror()) == NULL) |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
110 (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
111 /* we don't need to worry about removing callbacks since |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
112 * there won't be any more chance to call them back :) */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
113 dlclose(p->handle); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
114 g_free(p->filename); /* why do i bother? */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
115 g_free(p); |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
395
diff
changeset
|
116 c = c->next; |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
117 } |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
118 #endif /* GAIM_PLUGINS */ |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
119 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
120 perl_end(); |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
121 #endif |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
122 |
1 | 123 exit(0); |
124 #endif /* USE_APPLET */ | |
125 } | |
126 | |
127 void set_login_progress(int howfar, char *whattosay) | |
128 { | |
129 gtk_progress_bar_update(GTK_PROGRESS_BAR(progress), | |
130 ((float)howfar / (float)LOGIN_STEPS)); | |
131 gtk_statusbar_pop(GTK_STATUSBAR(notice), 1); | |
132 gtk_statusbar_push(GTK_STATUSBAR(notice), 1, whattosay); | |
133 | |
134 while (gtk_events_pending()) | |
135 gtk_main_iteration(); | |
136 } | |
137 | |
138 void hide_login_progress(char *why) | |
139 { | |
140 gtk_progress_bar_update(GTK_PROGRESS_BAR(progress), | |
141 0); | |
142 gtk_statusbar_pop(GTK_STATUSBAR(notice), 1); | |
143 gtk_statusbar_push(GTK_STATUSBAR(notice), 1, why); | |
144 | |
145 while (gtk_events_pending()) | |
146 gtk_main_iteration(); | |
147 } | |
148 | |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
149 static int snd_tmout; |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
150 int logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
151 static void sound_timeout() { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
152 logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
153 gtk_timeout_remove(snd_tmout); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
154 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
155 |
228 | 156 char g_screenname[ 64 ]; /* gotta be enough */ |
157 | |
1 | 158 void dologin(GtkWidget *widget, GtkWidget *w) |
159 { | |
160 char *username = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(name)->entry)); | |
161 char *password = gtk_entry_get_text(GTK_ENTRY(pass)); | |
228 | 162 int i; |
1 | 163 |
164 if (query_state() != STATE_OFFLINE) | |
165 return; | |
166 | |
167 if (!strlen(username)) { | |
355 | 168 hide_login_progress(_("Please enter your logon")); |
1 | 169 return; |
170 } | |
171 if (!strlen(password)) { | |
355 | 172 hide_login_progress(_("You must give your password")); |
1 | 173 return; |
174 } | |
175 | |
228 | 176 /* save screenname away for cache file use */ |
177 | |
178 strcpy( g_screenname, username ); | |
179 | |
180 /* fold cache screen name file to upper case to avoid problems | |
181 finding file later if user uses different case at login time */ | |
182 | |
183 for ( i = 0; i < strlen( g_screenname ); i++ ) | |
184 g_screenname[i] = toupper( g_screenname[i] ); | |
185 | |
1 | 186 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
187 set_user_state(signing_on); |
1 | 188 #endif /* USE_APPLET */ |
189 | |
84 | 190 if (running) return; |
191 running = TRUE; | |
1 | 192 |
84 | 193 if (serv_login(username, password) < 0) { |
194 running = FALSE; | |
1 | 195 return; |
84 | 196 } |
423
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
410
diff
changeset
|
197 |
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
410
diff
changeset
|
198 if (!USE_OSCAR) /* serv_login will set up USE_OSCAR */ |
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
410
diff
changeset
|
199 gaim_setup(); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
200 } |
1 | 201 |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
265
diff
changeset
|
202 void auth_failed() { |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
265
diff
changeset
|
203 running = FALSE; |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
265
diff
changeset
|
204 } |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
265
diff
changeset
|
205 |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
206 /* 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
|
207 * 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
|
208 * oscar.c, after the buddy list is made and serv_finish_login is called */ |
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
209 void gaim_setup() { |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
210 if (sound_options & OPT_SOUND_LOGIN && |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
211 sound_options & OPT_SOUND_SILENT_SIGNON) { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
212 logins_not_muted = 0; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
213 snd_tmout = gtk_timeout_add(10000, (GtkFunction)sound_timeout, |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
214 NULL); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
215 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
216 |
84 | 217 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
218 set_user_state(online); |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
219 applet_widget_unregister_callback(APPLET_WIDGET(applet),"signon"); |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
220 applet_widget_register_callback(APPLET_WIDGET(applet), |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
221 "signoff", |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
222 _("Signoff"), |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
223 signoff, |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
224 NULL); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
225 #endif /* USE_APPLET */ |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
85
diff
changeset
|
226 |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
757
diff
changeset
|
227 plugin_event(event_signon, 0, 0, 0); |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
85
diff
changeset
|
228 |
84 | 229 running = FALSE; |
230 return; | |
1 | 231 } |
232 | |
233 | |
234 | |
235 | |
236 void doenter(GtkWidget *widget, GtkWidget *w) | |
237 { | |
238 if (widget == name) { | |
239 gtk_entry_set_text(GTK_ENTRY(pass),""); | |
240 gtk_entry_select_region(GTK_ENTRY(GTK_COMBO(name)->entry), 0, 0); | |
158
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
241 gtk_widget_grab_focus(pass); |
1 | 242 } else if (widget == pass) { |
886
3a5301117bb1
[gaim-migrate @ 896]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
855
diff
changeset
|
243 dologin(widget, w); |
1 | 244 } |
245 | |
246 } | |
247 | |
248 | |
249 static void combo_changed(GtkWidget *w, GtkWidget *combo) | |
250 { | |
158
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
251 char *txt = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)); |
1 | 252 struct aim_user *u; |
253 | |
25 | 254 if (!(general_options & OPT_GEN_REMEMBER_PASS)) { |
1 | 255 return; |
25 | 256 } |
257 | |
1 | 258 u = find_user(txt); |
259 | |
260 if (u != NULL) { | |
261 gtk_entry_set_text(GTK_ENTRY(pass), u->password); | |
262 } else { | |
263 gtk_entry_set_text(GTK_ENTRY(pass), ""); | |
264 } | |
25 | 265 |
1 | 266 return; |
267 } | |
268 | |
269 static GList *combo_user_names() | |
270 { | |
271 GList *usr = aim_users; | |
272 GList *tmp = NULL; | |
273 struct aim_user *u; | |
274 | |
275 | |
276 if (!usr) | |
277 return g_list_append(NULL, "<unknown>"); | |
278 | |
279 while(usr) { | |
280 u = (struct aim_user *)usr->data; | |
281 tmp = g_list_append(tmp, g_strdup(u->username)); | |
282 usr = usr->next; | |
283 | |
284 } | |
285 | |
286 return tmp; | |
287 } | |
288 | |
289 | |
290 | |
291 void show_login() | |
292 { | |
293 GtkWidget *options; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
294 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
295 GtkWidget *plugs; |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
296 #endif |
1 | 297 GtkWidget *reg; |
298 GtkWidget *bbox; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
299 GtkWidget *hbox; |
1 | 300 GtkWidget *sbox; |
301 GtkWidget *label; | |
302 GtkWidget *table; | |
303 | |
304 #ifndef USE_APPLET | |
305 GtkWidget *pmw; | |
306 GdkPixmap *pm; | |
307 GtkStyle *style; | |
308 GdkBitmap *mask; | |
309 #endif /* USE_APPLET */ | |
310 | |
311 if (mainwindow) { | |
312 gtk_widget_show(mainwindow); | |
705
dcf672c5a1ff
[gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
313 if (!(general_options & OPT_GEN_REMEMBER_PASS)) |
dcf672c5a1ff
[gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
644
diff
changeset
|
314 gtk_entry_set_text(GTK_ENTRY(pass), ""); |
1 | 315 return; |
316 } | |
430 | 317 |
1 | 318 mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 319 /* Set the WM name and class */ |
320 gtk_window_set_wmclass(GTK_WINDOW(mainwindow), "login", | |
321 "Gaim"); | |
322 /* Disallow resizing */ | |
323 gtk_window_set_policy(GTK_WINDOW(mainwindow), FALSE, FALSE, TRUE); | |
621 | 324 gtk_widget_realize(mainwindow); |
622 | 325 signon = gtk_button_new_with_label(_("Signon")); |
326 cancel = gtk_button_new_with_label(_("Cancel")); | |
327 reg = gtk_button_new_with_label(_("Register")); | |
328 options = gtk_button_new_with_label(_("Options")); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
329 #ifdef GAIM_PLUGINS |
622 | 330 plugs = gtk_button_new_with_label(_("Plugins")); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
331 #endif |
1 | 332 table = gtk_table_new(8, 2, FALSE); |
333 name = gtk_combo_new(); | |
334 pass = gtk_entry_new(); | |
335 notice = gtk_statusbar_new(); | |
621 | 336 progress = gtk_progress_bar_new(); |
1 | 337 |
621 | 338 gtk_combo_set_popdown_strings(GTK_COMBO(name), combo_user_names()); |
1 | 339 |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
340 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
341 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
342 gtk_button_set_relief(GTK_BUTTON(signon), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
343 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
344 gtk_button_set_relief(GTK_BUTTON(reg), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
345 gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
346 #ifdef GAIM_PLUGINS |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
347 gtk_button_set_relief(GTK_BUTTON(plugs), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
348 #endif |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
349 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
350 |
1 | 351 /* Make the buttons do stuff */ |
352 /* Clicking the button initiates a login */ | |
353 gtk_signal_connect(GTK_OBJECT(signon), "clicked", | |
354 GTK_SIGNAL_FUNC(dologin), mainwindow); | |
355 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
356 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); | |
357 /* Allow user to change prefs before logging in */ | |
358 gtk_signal_connect(GTK_OBJECT(options), "clicked", | |
359 GTK_SIGNAL_FUNC(show_prefs), NULL); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
360 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
361 /* Allow user to control plugins before logging in */ |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
362 gtk_signal_connect(GTK_OBJECT(plugs), "clicked", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
363 GTK_SIGNAL_FUNC(show_plugins), NULL); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
364 #endif |
1 | 365 |
366 /* Register opens the right URL */ | |
367 gtk_signal_connect(GTK_OBJECT(reg), "clicked", | |
286 | 368 GTK_SIGNAL_FUNC(open_url), "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"); |
1 | 369 /* Enter in the username clears the password and sets |
370 the pointer in the password field */ | |
371 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "activate", | |
372 GTK_SIGNAL_FUNC(doenter), mainwindow); | |
373 | |
374 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "changed", | |
375 GTK_SIGNAL_FUNC(combo_changed), name); | |
376 | |
377 gtk_signal_connect(GTK_OBJECT(pass), "activate", | |
378 GTK_SIGNAL_FUNC(doenter), mainwindow); | |
379 gtk_signal_connect(GTK_OBJECT(mainwindow), "delete_event", | |
380 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); | |
381 /* Homogenous spacing, 10 padding */ | |
382 bbox = gtk_hbox_new(TRUE, 10); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
383 hbox = gtk_hbox_new(TRUE, 10); |
621 | 384 sbox = gtk_vbox_new(TRUE, 5); |
1 | 385 |
622 | 386 gtk_box_pack_start(GTK_BOX(bbox), reg, TRUE, TRUE, 0); |
1 | 387 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); |
388 gtk_box_pack_start(GTK_BOX(bbox), signon, TRUE, TRUE, 0); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
389 |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
390 gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
391 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
392 gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
393 #endif |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
394 |
1 | 395 gtk_box_pack_start(GTK_BOX(sbox), bbox, TRUE, TRUE, 0); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
396 gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); |
1 | 397 |
398 /* Labels for selectors and text boxes */ | |
399 #if 0 | |
400 label = gtk_label_new("TOC: "); | |
401 gtk_table_attach(GTK_TABLE(table), label, 0,1,1,2,0,0, 5, 5); | |
402 gtk_widget_show(label); | |
403 #endif | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
404 label = gtk_label_new(_("Screen Name: ")); |
1 | 405 gtk_table_attach(GTK_TABLE(table), label, 0,1,2,3,0,0, 5, 5); |
406 gtk_widget_show(label); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
407 label = gtk_label_new(_("Password: ")); |
1 | 408 gtk_table_attach(GTK_TABLE(table), label, 0,1,3,4,0,0, 5, 5); |
409 gtk_widget_show(label); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
410 remember = gtk_check_button_new_with_label(_("Remember Password")); |
1 | 411 gtk_table_attach(GTK_TABLE(table), remember, 0,2,4,5,0,0, 5, 5); |
412 gtk_widget_show(remember); | |
413 | |
414 gtk_widget_show(options); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
415 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
416 gtk_widget_show(plugs); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
417 #endif |
1 | 418 |
419 /* Adjust sizes of inputs */ | |
621 | 420 gtk_widget_set_usize(name,100,0); |
421 gtk_widget_set_usize(pass,100,0); | |
1 | 422 |
423 | |
424 /* Status and label */ | |
425 gtk_widget_show(notice); | |
426 | |
427 gtk_widget_set_usize(progress,150,0); | |
428 | |
429 gtk_widget_show(progress); | |
430 | |
431 gtk_table_attach(GTK_TABLE(table), progress, 0, 2, 6, 7, 0, 0, 5, 5); | |
432 gtk_widget_set_usize(GTK_STATUSBAR(notice)->label, 150, 0); | |
433 gtk_table_attach(GTK_TABLE(table), notice, 0, 2, 8, 9, 0, 0, 5, 5); | |
434 | |
435 /* Attach the buttons at the bottom */ | |
436 gtk_widget_show(signon); | |
437 gtk_widget_show(cancel); | |
438 gtk_widget_show(reg); | |
439 gtk_widget_show(bbox); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
440 gtk_widget_show(hbox); |
1 | 441 gtk_widget_show(sbox); |
442 gtk_table_attach(GTK_TABLE(table), sbox, 0,2,7,8,0,0, 5, 5); | |
443 | |
444 /* Text fields */ | |
445 | |
446 gtk_table_attach(GTK_TABLE(table),name,1,2,2,3,0,0,5,5); | |
447 gtk_widget_show(name); | |
448 gtk_table_attach(GTK_TABLE(table),pass,1,2,3,4,0,0,5,5); | |
449 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE); | |
450 gtk_widget_show(pass); | |
451 | |
452 gtk_container_border_width(GTK_CONTAINER(sbox), 10); | |
453 | |
454 gtk_container_add(GTK_CONTAINER(mainwindow),table ); | |
455 | |
456 gtk_widget_show(table); | |
905 | 457 gtk_window_set_title(GTK_WINDOW(mainwindow),_("Gaim - Login")); |
1 | 458 |
459 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(remember), (general_options & OPT_GEN_REMEMBER_PASS)); | |
423
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
410
diff
changeset
|
460 |
1 | 461 if (current_user) { |
508
1181582366f5
[gaim-migrate @ 518]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
462
diff
changeset
|
462 sprintf(debug_buff, "Current user is %s\n", current_user->username); |
1181582366f5
[gaim-migrate @ 518]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
462
diff
changeset
|
463 debug_print(debug_buff); |
1181582366f5
[gaim-migrate @ 518]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
462
diff
changeset
|
464 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(name)->entry), current_user->username); |
158
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
465 if ((general_options & OPT_GEN_REMEMBER_PASS)) { |
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
466 combo_changed(NULL, name); |
157
aad89d9bce85
[gaim-migrate @ 167]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
155
diff
changeset
|
467 gtk_widget_grab_focus(signon); |
158
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
468 } else { |
157
aad89d9bce85
[gaim-migrate @ 167]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
155
diff
changeset
|
469 gtk_widget_grab_focus(pass); |
158
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
470 } |
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
471 } else { |
157
aad89d9bce85
[gaim-migrate @ 167]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
155
diff
changeset
|
472 gtk_widget_grab_focus(name); |
158
e9414f13d8b7
[gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
157
diff
changeset
|
473 } |
1 | 474 |
475 | |
476 gtk_signal_connect(GTK_OBJECT(remember), "clicked", GTK_SIGNAL_FUNC(set_general_option), (int *)OPT_GEN_REMEMBER_PASS); | |
477 | |
478 | |
479 gtk_widget_realize(mainwindow); | |
480 | |
481 #ifndef USE_APPLET | |
482 /* Logo at the top */ | |
483 style = gtk_widget_get_style(mainwindow); | |
484 pm = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask, | |
485 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo); | |
486 pmw = gtk_pixmap_new( pm, mask); | |
487 gtk_table_attach(GTK_TABLE(table), pmw, 0,2,0,1,0,0,5,5); | |
488 gtk_widget_show(pmw); | |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
489 gdk_pixmap_unref(pm); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
800
diff
changeset
|
490 gdk_bitmap_unref(mask); |
1 | 491 #endif /* USE_APPLET */ |
492 | |
493 | |
494 aol_icon(mainwindow->window); | |
495 #ifndef _WIN32 | |
496 gdk_window_set_group(mainwindow->window, mainwindow->window); | |
497 #endif | |
498 | |
499 | |
500 gtk_widget_show(mainwindow); | |
436 | 501 |
502 SetTickerPrefs(); | |
1 | 503 |
504 if((general_options & OPT_GEN_AUTO_LOGIN) && | |
505 (general_options & OPT_GEN_REMEMBER_PASS)) { | |
506 dologin(signon, NULL); | |
507 } | |
508 } | |
509 | |
200
bc117fbcf527
[gaim-migrate @ 210]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
184
diff
changeset
|
510 extern void show_debug(GtkObject *); |
180 | 511 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
512 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
513 void sighandler(int sig) |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
514 { |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
515 fprintf(stderr, "God damn, I tripped.\n"); |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
516 exit(11); /* signal 11 */ |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
517 } |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
518 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
519 |
1 | 520 int main(int argc, char *argv[]) |
521 { | |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
522 #ifdef ENABLE_NLS |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
523 bindtextdomain(PACKAGE, LOCALEDIR); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
524 textdomain(PACKAGE); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
525 #endif |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
526 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
527 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
528 /* Let's not violate any PLA's!!!! */ |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
529 /* signal(SIGSEGV, sighandler); */ |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
530 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
531 |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
532 if (argc > 1 && !strcmp(argv[1], "--version")) { |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
533 gtk_init(&argc, &argv); |
917 | 534 set_defaults(FALSE); /* needed for open_url_nw */ |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
535 load_prefs(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
536 show_about(0, (void *)1); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
537 gtk_main(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
538 return 0; |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
539 } |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
540 |
1 | 541 #ifdef USE_APPLET |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
542 init_applet_mgr(argc, argv); |
724
e7d812852a7f
[gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
705
diff
changeset
|
543 #elif defined USE_GNOME |
e7d812852a7f
[gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
705
diff
changeset
|
544 gnome_init(PACKAGE,VERSION,argc,argv); |
1 | 545 #else |
546 gtk_init(&argc, &argv); | |
724
e7d812852a7f
[gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
705
diff
changeset
|
547 #endif /* USE_GNOME */ |
1 | 548 |
917 | 549 set_defaults(FALSE); |
1 | 550 load_prefs(); |
180 | 551 |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
552 if (general_options & OPT_GEN_DEBUG) |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
553 show_debug(NULL); |
1 | 554 |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
555 gdk_threads_enter(); |
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
556 |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
557 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
558 perl_init(); |
800
022048cde898
[gaim-migrate @ 810]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
792
diff
changeset
|
559 perl_autoload(); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
560 #endif |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
561 |
1 | 562 #ifdef USE_APPLET |
563 applet_widget_register_callback(APPLET_WIDGET(applet), | |
564 "prefs", | |
565 _("Preferences"), | |
566 show_prefs, | |
567 NULL); | |
568 applet_widget_register_callback(APPLET_WIDGET(applet), | |
569 "signon", | |
570 _("Signon"), | |
342
f4fba304b236
[gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
571 applet_do_signon, |
1 | 572 NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
573 #ifdef GAIM_PLUGINS |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
574 applet_widget_register_callback(APPLET_WIDGET(applet), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
575 "plugins", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
576 _("Plugins"), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
577 GTK_SIGNAL_FUNC(show_plugins), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
578 NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
579 #endif /* GAIM_PLUGINS */ |
1 | 580 |
581 if((general_options & OPT_GEN_AUTO_LOGIN) && | |
582 (general_options & OPT_GEN_REMEMBER_PASS)) { | |
583 | |
584 applet_show_login(APPLET_WIDGET(applet), NULL); | |
585 } | |
82 | 586 |
587 update_pixmaps(); | |
1 | 588 |
589 applet_widget_gtk_main(); | |
590 #else | |
591 | |
592 | |
593 show_login(); | |
594 gtk_main(); | |
595 | |
596 #endif /* USE_APPLET */ | |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
597 gdk_threads_leave(); |
1 | 598 |
599 return 0; | |
600 | |
601 } |