Mercurial > pidgin.yaz
annotate src/aim.c @ 1036:faa5afc2b89e
[gaim-migrate @ 1046]
return of the aliases. bit by bit, day by day.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 31 Oct 2000 09:17:03 +0000 |
parents | 099748ff3a0a |
children | ece2d1543b20 |
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> |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
48 #include "prpl.h" |
1 | 49 #include "gaim.h" |
50 #include "pixmaps/logo.xpm" | |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
51 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
52 #include <signal.h> |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
53 #endif |
462 | 54 #include "locale.h" |
430 | 55 #include "gtkticker.h" |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
56 #ifndef USE_GNOME |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
57 #include <getopt.h> |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
58 #endif |
430 | 59 |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
60 static GtkWidget *name; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
61 static GtkWidget *pass; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
62 |
1 | 63 GList *log_conversations = NULL; |
64 GList *buddy_pounces = NULL; | |
940 | 65 GSList *away_messages = NULL; |
1 | 66 GList *conversations = NULL; |
67 GList *chat_rooms = NULL; | |
68 | |
69 GtkWidget *mainwindow = NULL; | |
70 | |
430 | 71 void BuddyTickerCreateWindow( void ); |
72 | |
1 | 73 char toc_addy[16]; |
26 | 74 char *quad_addr = NULL; |
1 | 75 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
76 |
1 | 77 void cancel_logon(void) |
78 { | |
79 #ifdef USE_APPLET | |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
80 applet_buddy_show = FALSE; |
941
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
81 if (mainwindow) |
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
82 gtk_widget_hide(mainwindow); |
1 | 83 #else |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
84 #ifdef GAIM_PLUGINS |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
85 GList *c; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
86 struct gaim_plugin *p; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
87 void (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
88 char *error; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
89 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
90 /* first we tell those who have requested it we're quitting */ |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
997
diff
changeset
|
91 plugin_event(event_quit, 0, 0, 0, 0); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
92 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
93 /* then we remove everyone in a mass suicide */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
94 c = plugins; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
95 while (c) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
96 p = (struct gaim_plugin *)c->data; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
97 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove"); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
98 if ((error = (char *)dlerror()) == NULL) |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
99 (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
100 /* we don't need to worry about removing callbacks since |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
101 * there won't be any more chance to call them back :) */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
102 g_free(p->filename); /* why do i bother? */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
103 g_free(p); |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
395
diff
changeset
|
104 c = c->next; |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
105 } |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
106 #endif /* GAIM_PLUGINS */ |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
107 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
108 perl_end(); |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
109 #endif |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
110 |
1 | 111 exit(0); |
112 #endif /* USE_APPLET */ | |
113 } | |
114 | |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
115 static int snd_tmout; |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
116 int logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
117 static void sound_timeout() { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
118 logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
119 gtk_timeout_remove(snd_tmout); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
120 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
121 |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
122 /* 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
|
123 * 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
|
124 * 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
|
125 void gaim_setup(struct gaim_connection *gc) { |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
126 if (sound_options & OPT_SOUND_LOGIN && |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
127 sound_options & OPT_SOUND_SILENT_SIGNON) { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
128 logins_not_muted = 0; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
129 snd_tmout = gtk_timeout_add(10000, (GtkFunction)sound_timeout, |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
130 NULL); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
131 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
132 |
84 | 133 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
134 set_user_state(online); |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
135 applet_widget_register_callback(APPLET_WIDGET(applet), |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
136 "signoff", |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
137 _("Signoff"), |
966
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
138 (AppletCallbackFunc)signoff_all, |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
139 NULL); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
140 #endif /* USE_APPLET */ |
1 | 141 } |
142 | |
143 | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
144 static void dologin(GtkWidget *widget, GtkWidget *w) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
145 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
146 struct aim_user *u; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
147 char *username = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(name)->entry)); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
148 char *password = gtk_entry_get_text(GTK_ENTRY(pass)); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
149 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
150 if (!strlen(username)) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
151 do_error_dialog(_("Please enter your logon"), _("Signon Error")); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
152 return; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
153 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
154 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
155 if (!strlen(password)) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
156 do_error_dialog(_("Please enter your password"), _("Signon Error")); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
157 return; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
158 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
159 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
160 /* if there is more than one user of the same name, then fuck them, they just have |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
161 * to use the account editor to sign in the second one */ |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
162 u = find_user(username, -1); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
163 if (!u) { |
994
fc1ca0d9c878
[gaim-migrate @ 1004]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
992
diff
changeset
|
164 u = g_new0(struct aim_user, 1); |
fc1ca0d9c878
[gaim-migrate @ 1004]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
992
diff
changeset
|
165 g_snprintf(u->username, sizeof(u->username), "%s", username); |
fc1ca0d9c878
[gaim-migrate @ 1004]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
992
diff
changeset
|
166 u->protocol = PROTO_TOC; |
fc1ca0d9c878
[gaim-migrate @ 1004]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
992
diff
changeset
|
167 u->options = OPT_USR_REM_PASS; |
fc1ca0d9c878
[gaim-migrate @ 1004]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
992
diff
changeset
|
168 aim_users = g_list_append(aim_users, u); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
169 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
170 g_snprintf(u->password, sizeof u->password, "%s", password); |
1026 | 171 set_first_user(username); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
172 save_prefs(); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
173 serv_login(u); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
174 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
175 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
176 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
177 static void doenter(GtkWidget *widget, GtkWidget *w) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
178 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
179 if (widget == name) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
180 gtk_entry_set_text(GTK_ENTRY(pass), ""); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
181 gtk_entry_select_region(GTK_ENTRY(GTK_COMBO(name)->entry), 0, 0); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
182 gtk_widget_grab_focus(pass); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
183 } else if (widget == pass) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
184 dologin(widget, w); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
185 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
186 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
187 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
188 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
189 static void combo_changed(GtkWidget *w, GtkWidget *combo) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
190 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
191 char *txt = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
192 struct aim_user *u; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
193 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
194 u = find_user(txt, -1); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
195 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
196 if (u && u->options & OPT_USR_REM_PASS) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
197 gtk_entry_set_text(GTK_ENTRY(pass), u->password); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
198 } else { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
199 gtk_entry_set_text(GTK_ENTRY(pass), ""); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
200 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
201 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
202 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
203 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
204 static GList *combo_user_names() |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
205 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
206 GList *usr = aim_users; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
207 GList *tmp = NULL; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
208 struct aim_user *u; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
209 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
210 if (!usr) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
211 return g_list_append(NULL, "<unknown>"); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
212 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
213 while (usr) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
214 u = (struct aim_user *)usr->data; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
215 tmp = g_list_append(tmp, g_strdup(u->username)); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
216 usr = usr->next; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
217 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
218 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
219 return tmp; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
220 } |
1 | 221 |
222 | |
223 void show_login() | |
224 { | |
225 GtkWidget *options; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
226 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
227 GtkWidget *plugs; |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
228 #endif |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
229 #ifndef NO_MULTI |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
230 GtkWidget *accts; |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
231 #endif |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
232 GtkWidget *signon; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
233 GtkWidget *cancel; |
1 | 234 GtkWidget *reg; |
235 GtkWidget *bbox; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
236 GtkWidget *hbox; |
1 | 237 GtkWidget *sbox; |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
238 GtkWidget *label; |
1 | 239 GtkWidget *table; |
240 | |
241 GtkWidget *pmw; | |
242 GdkPixmap *pm; | |
243 GtkStyle *style; | |
244 GdkBitmap *mask; | |
245 | |
246 if (mainwindow) { | |
247 gtk_widget_show(mainwindow); | |
248 return; | |
249 } | |
430 | 250 |
1 | 251 mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 252 /* Set the WM name and class */ |
253 gtk_window_set_wmclass(GTK_WINDOW(mainwindow), "login", | |
254 "Gaim"); | |
255 /* Disallow resizing */ | |
256 gtk_window_set_policy(GTK_WINDOW(mainwindow), FALSE, FALSE, TRUE); | |
621 | 257 gtk_widget_realize(mainwindow); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
258 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
259 signon = gtk_button_new_with_label(_("Signon")); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
260 #ifndef NO_MULTI |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
261 accts = gtk_button_new_with_label(_("Accounts")); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
262 #endif |
622 | 263 cancel = gtk_button_new_with_label(_("Cancel")); |
264 reg = gtk_button_new_with_label(_("Register")); | |
265 options = gtk_button_new_with_label(_("Options")); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
266 #ifdef GAIM_PLUGINS |
622 | 267 plugs = gtk_button_new_with_label(_("Plugins")); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
268 #endif |
1 | 269 table = gtk_table_new(8, 2, FALSE); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
270 name = gtk_combo_new(); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
271 pass = gtk_entry_new(); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
272 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
273 gtk_combo_set_popdown_strings(GTK_COMBO(name), combo_user_names()); |
1 | 274 |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
275 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
276 { |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
277 gtk_button_set_relief(GTK_BUTTON(signon), GTK_RELIEF_NONE); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
278 #ifndef NO_MULTI |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
279 gtk_button_set_relief(GTK_BUTTON(accts), GTK_RELIEF_NONE); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
280 #endif |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
281 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
282 gtk_button_set_relief(GTK_BUTTON(reg), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
283 gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
284 #ifdef GAIM_PLUGINS |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
285 gtk_button_set_relief(GTK_BUTTON(plugs), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
286 #endif |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
287 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
288 |
1 | 289 /* Make the buttons do stuff */ |
290 /* Clicking the button initiates a login */ | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
291 gtk_signal_connect(GTK_OBJECT(signon), "clicked", |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
292 GTK_SIGNAL_FUNC(dologin), mainwindow); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
293 #ifndef NO_MULTI |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
294 gtk_signal_connect(GTK_OBJECT(accts), "clicked", |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
295 GTK_SIGNAL_FUNC(account_editor), mainwindow); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
296 #endif |
1 | 297 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", |
298 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); | |
299 /* Allow user to change prefs before logging in */ | |
300 gtk_signal_connect(GTK_OBJECT(options), "clicked", | |
301 GTK_SIGNAL_FUNC(show_prefs), NULL); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
302 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
303 /* Allow user to control plugins before logging in */ |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
304 gtk_signal_connect(GTK_OBJECT(plugs), "clicked", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
305 GTK_SIGNAL_FUNC(show_plugins), NULL); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
306 #endif |
1 | 307 |
308 /* Register opens the right URL */ | |
309 gtk_signal_connect(GTK_OBJECT(reg), "clicked", | |
286 | 310 GTK_SIGNAL_FUNC(open_url), "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
311 /* Enter in the username clears the password and sets |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
312 the pointer in the password field */ |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
313 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "activate", |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
314 GTK_SIGNAL_FUNC(doenter), mainwindow); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
315 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "changed", |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
316 GTK_SIGNAL_FUNC(combo_changed), name); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
317 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
318 gtk_signal_connect(GTK_OBJECT(pass), "activate", |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
319 GTK_SIGNAL_FUNC(doenter), mainwindow); |
1 | 320 gtk_signal_connect(GTK_OBJECT(mainwindow), "delete_event", |
321 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); | |
322 /* Homogenous spacing, 10 padding */ | |
323 bbox = gtk_hbox_new(TRUE, 10); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
324 hbox = gtk_hbox_new(TRUE, 10); |
621 | 325 sbox = gtk_vbox_new(TRUE, 5); |
1 | 326 |
327 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); | |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
328 #ifndef NO_MULTI |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
329 gtk_box_pack_start(GTK_BOX(bbox), accts, TRUE, TRUE, 0); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
330 #endif |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
331 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
|
332 |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
333 gtk_box_pack_start(GTK_BOX(hbox), reg, TRUE, TRUE, 0); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
334 gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
335 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
336 gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
337 #endif |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
338 |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
339 gtk_box_pack_start(GTK_BOX(sbox), bbox, TRUE, TRUE, 0); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
340 gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); |
1 | 341 |
342 /* Labels for selectors and text boxes */ | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
343 label = gtk_label_new(_("Screen Name: ")); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
344 gtk_table_attach(GTK_TABLE(table), label, 0,1,2,3,0,0, 5, 5); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
345 gtk_widget_show(label); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
346 label = gtk_label_new(_("Password: ")); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
347 gtk_table_attach(GTK_TABLE(table), label, 0,1,3,4,0,0, 5, 5); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
348 gtk_widget_show(label); |
1 | 349 |
350 gtk_widget_show(options); | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
351 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
352 gtk_widget_show(plugs); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
353 #endif |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
354 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
355 /* Adjust sizes of inputs */ |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
356 gtk_widget_set_usize(name,100,0); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
357 gtk_widget_set_usize(pass,100,0); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
358 |
1 | 359 |
360 /* Attach the buttons at the bottom */ | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
361 gtk_widget_show(signon); |
1 | 362 gtk_widget_show(cancel); |
363 gtk_widget_show(reg); | |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
364 #ifndef NO_MULTI |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
365 gtk_widget_show(accts); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
366 #endif |
1 | 367 gtk_widget_show(bbox); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
368 gtk_widget_show(hbox); |
1 | 369 gtk_widget_show(sbox); |
370 gtk_table_attach(GTK_TABLE(table), sbox, 0,2,7,8,0,0, 5, 5); | |
371 | |
372 /* Text fields */ | |
373 | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
374 gtk_table_attach(GTK_TABLE(table),name,1,2,2,3,0,0,5,5); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
375 gtk_widget_show(name); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
376 gtk_table_attach(GTK_TABLE(table),pass,1,2,3,4,0,0,5,5); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
377 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
378 gtk_widget_show(pass); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
379 |
1 | 380 gtk_container_border_width(GTK_CONTAINER(sbox), 10); |
381 | |
382 gtk_container_add(GTK_CONTAINER(mainwindow),table ); | |
383 | |
384 gtk_widget_show(table); | |
905 | 385 gtk_window_set_title(GTK_WINDOW(mainwindow),_("Gaim - Login")); |
1 | 386 |
387 | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
388 if (aim_users) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
389 struct aim_user *c = (struct aim_user *)aim_users->data; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
390 sprintf(debug_buff, "First user is %s\n", c->username); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
391 if (c->options & OPT_USR_REM_PASS) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
392 combo_changed(NULL, name); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
393 gtk_widget_grab_focus(signon); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
394 } else { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
395 gtk_widget_grab_focus(pass); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
396 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
397 } else { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
398 gtk_widget_grab_focus(name); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
399 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
400 |
1 | 401 gtk_widget_realize(mainwindow); |
402 | |
403 /* Logo at the top */ | |
404 style = gtk_widget_get_style(mainwindow); | |
405 pm = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask, | |
406 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo); | |
407 pmw = gtk_pixmap_new( pm, mask); | |
408 gtk_table_attach(GTK_TABLE(table), pmw, 0,2,0,1,0,0,5,5); | |
409 gtk_widget_show(pmw); | |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
410 gdk_pixmap_unref(pm); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
800
diff
changeset
|
411 gdk_bitmap_unref(mask); |
1 | 412 |
413 | |
414 aol_icon(mainwindow->window); | |
415 #ifndef _WIN32 | |
416 gdk_window_set_group(mainwindow->window, mainwindow->window); | |
417 #endif | |
418 | |
419 | |
420 gtk_widget_show(mainwindow); | |
436 | 421 |
422 SetTickerPrefs(); | |
1 | 423 |
424 } | |
425 | |
200
bc117fbcf527
[gaim-migrate @ 210]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
184
diff
changeset
|
426 extern void show_debug(GtkObject *); |
180 | 427 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
428 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
429 void sighandler(int sig) |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
430 { |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
431 fprintf(stderr, "God damn, I tripped.\n"); |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
432 exit(11); /* signal 11 */ |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
433 } |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
434 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
435 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
436 |
1 | 437 int main(int argc, char *argv[]) |
438 { | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
439 char opt; |
1033
099748ff3a0a
[gaim-migrate @ 1043]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
440 int i; |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
441 int opt_acct = 0, opt_help = 0, opt_version = 0, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
442 opt_user = 0, opt_login = 0, do_login_ret = -1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
443 char *opt_user_arg = NULL, *opt_login_arg = NULL; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
444 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
445 #ifdef USE_GNOME |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
446 poptContext popt_context; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
447 struct poptOption popt_options[] = |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
448 { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
449 {"acct", 'a', POPT_ARG_NONE, &opt_acct, 'a', |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
450 "Display account editor window", NULL}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
451 {"login", 'l', POPT_ARG_STRING, NULL, 'l', |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
452 "Automatically login (optional argument NAME specifies account(s) to use)", "[NAME]"}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
453 {"user", 'u', POPT_ARG_STRING, &opt_user_arg, 'u', |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
454 "Use account NAME", "NAME"}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
455 {0, 0, 0, 0, 0, 0, 0} |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
456 }; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
457 #else |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
458 struct option long_options[] = |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
459 { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
460 {"acct", no_argument, NULL, 'a'}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
461 {"help", no_argument, NULL, 'h'}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
462 {"login", optional_argument, NULL, 'l'}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
463 {"user", required_argument, NULL, 'u'}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
464 {"version", no_argument, NULL, 'v'}, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
465 {0, 0, 0, 0} |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
466 }; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
467 #endif /* USE_GNOME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
468 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
469 |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
470 #ifdef ENABLE_NLS |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
471 bindtextdomain(PACKAGE, LOCALEDIR); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
472 textdomain(PACKAGE); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
473 #endif |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
474 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
475 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
476 /* Let's not violate any PLA's!!!! */ |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
477 /* signal(SIGSEGV, sighandler); */ |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
478 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
479 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
480 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
481 #ifdef USE_APPLET |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
482 init_applet_mgr(argc, argv); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
483 #elif defined USE_GNOME |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
484 for (i = 0; i < argc; i++) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
485 /* --login option */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
486 if (strstr (argv[i], "--l") == argv[i]) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
487 char *equals; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
488 opt_login = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
489 if ((equals = strchr(argv[i], '=')) != NULL) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
490 /* --login=NAME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
491 opt_login_arg = g_strdup (equals+1); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
492 } else if (i+1 < argc && argv[i+1][0] != '-') { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
493 /* --login NAME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
494 opt_login_arg = g_strdup (argv[i+1]); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
495 strcpy (argv[i+1], " "); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
496 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
497 strcpy (argv[i], " "); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
498 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
499 /* -l option */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
500 else if (strstr (argv[i], "-l") == argv[i]) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
501 opt_login = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
502 if (strlen (argv[i]) > 2) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
503 /* -lNAME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
504 opt_login_arg = g_strdup (argv[i]+2); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
505 } else if (i+1 < argc && argv[i+1][0] != '-') { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
506 /* -l NAME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
507 opt_login_arg = g_strdup (argv[i+1]); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
508 strcpy (argv[i+1], " "); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
509 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
510 strcpy (argv[i], " "); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
511 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
512 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
513 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
514 gnome_init_with_popt_table(PACKAGE,VERSION,argc,argv, |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
515 popt_options,0,NULL); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
516 #else |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
517 gtk_init(&argc, &argv); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
518 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
519 /* scan command-line options */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
520 opterr = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
521 while ((opt = getopt_long (argc, argv, /*"ahl::u:v"*/"ahl::u:v", |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
522 long_options, NULL)) != -1) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
523 switch (opt) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
524 case 'u': /* set user */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
525 opt_user = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
526 opt_user_arg = g_strdup (optarg); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
527 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
528 case 'l': |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
529 opt_login = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
530 opt_login_arg = g_strdup (optarg); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
531 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
532 case 'a': /* account editor */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
533 opt_acct = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
534 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
535 case 'v': /* version */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
536 opt_version = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
537 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
538 case 'h': /* help */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
539 opt_help = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
540 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
541 case '?': |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
542 default: |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
543 show_usage(1, argv[0]); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
544 return 0; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
545 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
546 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
547 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
548 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
549 #endif /* USE_GNOME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
550 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
551 /* show help message */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
552 if (opt_help) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
553 show_usage(0, argv[0]); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
554 return 0; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
555 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
556 /* show version window */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
557 if (opt_version) { |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
558 gtk_init(&argc, &argv); |
917 | 559 set_defaults(FALSE); /* needed for open_url_nw */ |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
560 load_prefs(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
561 show_about(0, (void *)1); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
562 gtk_main(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
563 return 0; |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
564 } |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
565 |
1 | 566 |
917 | 567 set_defaults(FALSE); |
1 | 568 load_prefs(); |
180 | 569 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
570 /* set the default username */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
571 if (opt_user_arg != NULL) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
572 set_first_user (opt_user_arg); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
573 #ifndef USE_GNOME |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
574 g_free (opt_user_arg); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
575 opt_user_arg = NULL; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
576 #endif /* USE_GNOME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
577 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
578 |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
579 if (general_options & OPT_GEN_DEBUG) |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
580 show_debug(NULL); |
1 | 581 |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
582 gdk_threads_enter(); |
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
583 |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
584 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
585 perl_init(); |
800
022048cde898
[gaim-migrate @ 810]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
792
diff
changeset
|
586 perl_autoload(); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
587 #endif |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
588 static_proto_init(); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
589 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
590 /* deal with --login */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
591 if (opt_login) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
592 do_login_ret = do_auto_login (opt_login_arg); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
593 if (opt_login_arg != NULL) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
594 g_free (opt_login_arg); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
595 opt_login_arg = NULL; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
596 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
597 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
598 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
599 if (!opt_acct) |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
600 auto_login(); |
992
09dd5725945c
[gaim-migrate @ 1002]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
991
diff
changeset
|
601 |
1 | 602 #ifdef USE_APPLET |
603 applet_widget_register_callback(APPLET_WIDGET(applet), | |
604 "prefs", | |
605 _("Preferences"), | |
606 show_prefs, | |
607 NULL); | |
608 applet_widget_register_callback(APPLET_WIDGET(applet), | |
966
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
609 "accounts", |
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
610 _("Accounts"), |
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
611 (AppletCallbackFunc)account_editor, |
1 | 612 NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
613 #ifdef GAIM_PLUGINS |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
614 applet_widget_register_callback(APPLET_WIDGET(applet), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
615 "plugins", |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
616 _("Plugins"), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
617 GTK_SIGNAL_FUNC(show_plugins), |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
618 NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
619 #endif /* GAIM_PLUGINS */ |
1 | 620 |
82 | 621 update_pixmaps(); |
1 | 622 |
623 applet_widget_gtk_main(); | |
624 #else | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
625 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
626 if (opt_acct) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
627 account_editor (NULL, NULL); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
628 } else if (do_login_ret == -1) |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
629 show_login(); |
1 | 630 gtk_main(); |
631 | |
632 #endif /* USE_APPLET */ | |
216
f7e17fb767eb
[gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
200
diff
changeset
|
633 gdk_threads_leave(); |
1 | 634 |
635 return 0; | |
636 | |
637 } |