Mercurial > pidgin
annotate src/aim.c @ 2107:f3a162033356
[gaim-migrate @ 2117]
i feel the earth
move
under my feet
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 02 Aug 2001 01:40:35 +0000 |
parents | b66aca8e8dce |
children | 02cbc4f76b77 |
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 |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2083
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
342
diff
changeset
|
24 #endif |
1 | 25 #ifdef USE_APPLET |
1261
07f0bb41bbe1
[gaim-migrate @ 1271]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1254
diff
changeset
|
26 #include "applet.h" |
1 | 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" |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1093
diff
changeset
|
56 #include "gtkspell.h" |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
57 #ifndef USE_GNOME |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
58 #include <getopt.h> |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
59 #endif |
430 | 60 |
1128
418b1738a9a7
[gaim-migrate @ 1138]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
61 static gchar *ispell_cmd[] = { "ispell", "-a", NULL }; |
418b1738a9a7
[gaim-migrate @ 1138]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1124
diff
changeset
|
62 |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
63 static GtkWidget *name; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
64 static GtkWidget *pass; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
65 |
1 | 66 GList *log_conversations = NULL; |
67 GList *buddy_pounces = NULL; | |
940 | 68 GSList *away_messages = NULL; |
1 | 69 GList *conversations = NULL; |
70 GList *chat_rooms = NULL; | |
1768 | 71 GSList *message_queue = NULL; |
1774 | 72 GSList *away_time_queue = NULL; |
1 | 73 |
74 GtkWidget *mainwindow = NULL; | |
75 | |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
76 int opt_away = 0; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
77 char *opt_away_arg = NULL; |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
78 char *opt_rcfile_arg = NULL; |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
79 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
80 void BuddyTickerCreateWindow(void); |
430 | 81 |
1 | 82 void cancel_logon(void) |
83 { | |
84 #ifdef USE_APPLET | |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
85 applet_buddy_show = FALSE; |
941
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
86 if (mainwindow) |
0c3bdd59f983
[gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
87 gtk_widget_hide(mainwindow); |
1 | 88 #else |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
89 #ifdef GAIM_PLUGINS |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
90 GList *c; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
91 struct gaim_plugin *p; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
92 void (*gaim_plugin_remove)(); |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
93 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
94 /* 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
|
95 plugin_event(event_quit, 0, 0, 0, 0); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
96 |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
97 /* then we remove everyone in a mass suicide */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
98 c = plugins; |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
99 while (c) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
100 p = (struct gaim_plugin *)c->data; |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1033
diff
changeset
|
101 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove)) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
102 (*gaim_plugin_remove)(); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
103 /* we don't need to worry about removing callbacks since |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
104 * there won't be any more chance to call them back :) */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
105 g_free(p); |
403
d6f02d7f78d8
[gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
395
diff
changeset
|
106 c = c->next; |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
107 } |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
108 #endif /* GAIM_PLUGINS */ |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
109 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
110 perl_end(); |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
111 #endif |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
369
diff
changeset
|
112 |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1093
diff
changeset
|
113 gtk_main_quit(); |
1 | 114 #endif /* USE_APPLET */ |
115 } | |
116 | |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
117 static int snd_tmout; |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
118 int logins_not_muted = 1; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
119 static void sound_timeout() |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
120 { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
121 logins_not_muted = 1; |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
122 gtk_timeout_remove(snd_tmout); |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
123 } |
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
124 |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
125 /* we need to do this for Oscar because serv_login only starts the login |
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
126 * process, it doesn't end there. gaim_setup will be called later from |
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
127 * oscar.c, after the buddy list is made and serv_finish_login is called */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
128 void gaim_setup(struct gaim_connection *gc) |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
129 { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
130 if ((sound_options & OPT_SOUND_LOGIN) && (sound_options & OPT_SOUND_SILENT_SIGNON)) { |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
109
diff
changeset
|
131 logins_not_muted = 0; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
132 snd_tmout = gtk_timeout_add(10000, (GtkFunction)sound_timeout, NULL); |
109
45bcfa3b584c
[gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
107
diff
changeset
|
133 } |
84 | 134 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
135 set_user_state(online); |
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
730
diff
changeset
|
136 applet_widget_register_callback(APPLET_WIDGET(applet), |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
137 "signoff", _("Signoff"), (AppletCallbackFunc)signoff_all, NULL); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
138 #endif /* USE_APPLET */ |
1 | 139 } |
140 | |
141 | |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
142 static void dologin(GtkWidget *widget, GtkWidget *w) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
143 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
144 struct aim_user *u; |
1942
ba421d552093
[gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
145 const char *username = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(name)->entry)); |
ba421d552093
[gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
146 const char *password = gtk_entry_get_text(GTK_ENTRY(pass)); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
147 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
148 if (!strlen(username)) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
149 do_error_dialog(_("Please enter your logon"), _("Signon Error")); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
150 return; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
151 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
152 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
153 if (!strlen(password)) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
154 do_error_dialog(_("Please enter your password"), _("Signon Error")); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
155 return; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
156 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
157 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
158 /* 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
|
159 * to use the account editor to sign in the second one */ |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
160 u = find_user(username, -1); |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1333
diff
changeset
|
161 if (!u) |
1878
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1820
diff
changeset
|
162 u = new_user(username, DEFAULT_PROTO, OPT_USR_REM_PASS); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
163 g_snprintf(u->password, sizeof u->password, "%s", password); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
164 save_prefs(); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
165 serv_login(u); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
166 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
167 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
168 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
169 static void doenter(GtkWidget *widget, GtkWidget *w) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
170 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
171 if (widget == name) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
172 gtk_entry_set_text(GTK_ENTRY(pass), ""); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
173 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
|
174 gtk_widget_grab_focus(pass); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
175 } else if (widget == pass) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
176 dologin(widget, w); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
177 } |
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 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
180 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
181 static void combo_changed(GtkWidget *w, GtkWidget *combo) |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
182 { |
1942
ba421d552093
[gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
183 const char *txt = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
184 struct aim_user *u; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
185 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1026
diff
changeset
|
186 u = find_user(txt, -1); |
989
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 if (u && u->options & OPT_USR_REM_PASS) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
189 gtk_entry_set_text(GTK_ENTRY(pass), u->password); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
190 } else { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
191 gtk_entry_set_text(GTK_ENTRY(pass), ""); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
192 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
193 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
194 |
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 static GList *combo_user_names() |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
197 { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
198 GList *usr = aim_users; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
199 GList *tmp = NULL; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
200 struct aim_user *u; |
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 if (!usr) |
1409
17e544f8c7fb
[gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1400
diff
changeset
|
203 return g_list_append(NULL, "<New User>"); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
204 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
205 while (usr) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
206 u = (struct aim_user *)usr->data; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
207 tmp = g_list_append(tmp, g_strdup(u->username)); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
208 usr = usr->next; |
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 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
211 return tmp; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
212 } |
1 | 213 |
214 | |
215 void show_login() | |
216 { | |
217 GtkWidget *options; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
218 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
219 GtkWidget *plugs; |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
220 #endif |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
221 #ifndef NO_MULTI |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
222 GtkWidget *accts; |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
223 #endif |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
224 GtkWidget *signon; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
941
diff
changeset
|
225 GtkWidget *cancel; |
1 | 226 GtkWidget *reg; |
227 GtkWidget *bbox; | |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
228 GtkWidget *hbox; |
1 | 229 GtkWidget *sbox; |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
230 GtkWidget *label; |
1 | 231 GtkWidget *table; |
232 | |
233 GtkWidget *pmw; | |
234 GdkPixmap *pm; | |
235 GtkStyle *style; | |
236 GdkBitmap *mask; | |
237 | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
238 if (mainwindow) { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
239 gtk_widget_show(mainwindow); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
240 return; |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
241 } |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
242 |
1 | 243 mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
244 gtk_window_set_wmclass(GTK_WINDOW(mainwindow), "login", "Gaim"); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
245 gtk_window_set_policy(GTK_WINDOW(mainwindow), FALSE, FALSE, TRUE); |
1360
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
246 gtk_signal_connect(GTK_OBJECT(mainwindow), "delete_event", |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
247 GTK_SIGNAL_FUNC(cancel_logon), mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
248 gtk_window_set_title(GTK_WINDOW(mainwindow), _("Gaim - Login")); |
621 | 249 gtk_widget_realize(mainwindow); |
1360
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
250 aol_icon(mainwindow->window); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
251 gdk_window_set_group(mainwindow->window, mainwindow->window); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
252 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
253 table = gtk_table_new(8, 2, FALSE); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
254 gtk_container_add(GTK_CONTAINER(mainwindow), table); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
255 gtk_widget_show(table); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
256 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
257 style = gtk_widget_get_style(mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
258 pm = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask, |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
259 &style->bg[GTK_STATE_NORMAL], (gchar **) aol_logo); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
260 pmw = gtk_pixmap_new(pm, mask); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
261 gtk_table_attach(GTK_TABLE(table), pmw, 0, 2, 0, 1, 0, 0, 5, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
262 gtk_widget_show(pmw); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
263 gdk_pixmap_unref(pm); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
264 gdk_bitmap_unref(mask); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
265 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
266 label = gtk_label_new(_("Screen Name: ")); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
267 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, 0, 0, 5, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
268 gtk_widget_show(label); |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
269 |
1360
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
270 name = gtk_combo_new(); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
271 gtk_combo_set_popdown_strings(GTK_COMBO(name), combo_user_names()); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
272 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "activate", |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
273 GTK_SIGNAL_FUNC(doenter), mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
274 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "changed", |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
275 GTK_SIGNAL_FUNC(combo_changed), name); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
276 gtk_widget_set_usize(name, 100, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
277 gtk_table_attach(GTK_TABLE(table), name, 1, 2, 2, 3, 0, 0, 5, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
278 gtk_widget_show(name); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
279 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
280 label = gtk_label_new(_("Password: ")); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
281 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, 0, 0, 5, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
282 gtk_widget_show(label); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
283 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
284 pass = gtk_entry_new(); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
285 gtk_widget_set_usize(pass, 100, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
286 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
287 gtk_signal_connect(GTK_OBJECT(pass), "activate", GTK_SIGNAL_FUNC(doenter), mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
288 gtk_table_attach(GTK_TABLE(table), pass, 1, 2, 3, 4, 0, 0, 5, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
289 gtk_widget_show(pass); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
290 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
291 sbox = gtk_vbox_new(TRUE, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
292 gtk_container_border_width(GTK_CONTAINER(sbox), 10); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
293 gtk_table_attach(GTK_TABLE(table), sbox, 0, 2, 7, 8, 0, 0, 5, 5); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
294 gtk_widget_show(sbox); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
295 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
296 bbox = gtk_hbox_new(TRUE, 10); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
297 gtk_box_pack_start(GTK_BOX(sbox), bbox, TRUE, TRUE, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
298 gtk_widget_show(bbox); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
299 |
1400
476b24cdfa32
[gaim-migrate @ 1410]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
300 #ifndef USE_APPLET |
1391
d606da211acb
[gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1361
diff
changeset
|
301 cancel = gtk_button_new_with_label(_("Quit")); |
1400
476b24cdfa32
[gaim-migrate @ 1410]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
302 #else |
476b24cdfa32
[gaim-migrate @ 1410]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
303 cancel = gtk_button_new_with_label(_("Close")); |
476b24cdfa32
[gaim-migrate @ 1410]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1391
diff
changeset
|
304 #endif |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
305 #ifndef NO_MULTI |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
306 accts = gtk_button_new_with_label(_("Accounts")); |
991
3dbc2cd326e2
[gaim-migrate @ 1001]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
989
diff
changeset
|
307 #endif |
1360
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
308 signon = gtk_button_new_with_label(_("Signon")); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
309 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
310 if (display_options & OPT_DISP_COOL_LOOK) { |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
311 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
312 #ifndef NO_MULTI |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
313 gtk_button_set_relief(GTK_BUTTON(accts), GTK_RELIEF_NONE); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
314 #endif |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
315 gtk_button_set_relief(GTK_BUTTON(signon), GTK_RELIEF_NONE); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
316 } |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
317 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
318 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(cancel_logon), mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
319 #ifndef NO_MULTI |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
320 gtk_signal_connect(GTK_OBJECT(accts), "clicked", GTK_SIGNAL_FUNC(account_editor), mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
321 #endif |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
322 gtk_signal_connect(GTK_OBJECT(signon), "clicked", GTK_SIGNAL_FUNC(dologin), mainwindow); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
323 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
324 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
325 #ifndef NO_MULTI |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
326 gtk_box_pack_start(GTK_BOX(bbox), accts, TRUE, TRUE, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
327 #endif |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
328 gtk_box_pack_start(GTK_BOX(bbox), signon, TRUE, TRUE, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
329 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
330 gtk_widget_show(cancel); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
331 #ifndef NO_MULTI |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
332 gtk_widget_show(accts); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
333 #endif |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
334 gtk_widget_show(signon); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
335 |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
336 hbox = gtk_hbox_new(TRUE, 10); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
337 gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
338 gtk_widget_show(hbox); |
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
339 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
340 reg = gtk_button_new_with_label(_("Register")); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
341 options = gtk_button_new_with_label(_("Options")); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
342 #ifdef GAIM_PLUGINS |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
343 plugs = gtk_button_new_with_label(_("Plugins")); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
344 #endif |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
345 if (display_options & OPT_DISP_COOL_LOOK) { |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
346 gtk_button_set_relief(GTK_BUTTON(reg), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
347 gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
348 #ifdef GAIM_PLUGINS |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
349 gtk_button_set_relief(GTK_BUTTON(plugs), GTK_RELIEF_NONE); |
600
01777a942034
[gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
583
diff
changeset
|
350 #endif |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
351 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
508
diff
changeset
|
352 |
1360
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
353 gtk_signal_connect(GTK_OBJECT(reg), "clicked", GTK_SIGNAL_FUNC(register_user), NULL); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
354 gtk_signal_connect(GTK_OBJECT(options), "clicked", GTK_SIGNAL_FUNC(show_prefs), NULL); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
355 #ifdef GAIM_PLUGINS |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
356 gtk_signal_connect(GTK_OBJECT(plugs), "clicked", GTK_SIGNAL_FUNC(show_plugins), NULL); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
357 #endif |
1 | 358 |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
359 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
|
360 gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
361 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
362 gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
363 #endif |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
364 |
1360
ed8b24a73764
[gaim-migrate @ 1370]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
365 gtk_widget_show(reg); |
1 | 366 gtk_widget_show(options); |
96
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
367 #ifdef GAIM_PLUGINS |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
368 gtk_widget_show(plugs); |
247f540ea6e1
[gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
369 #endif |
989
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
370 |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
371 if (aim_users) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
372 struct aim_user *c = (struct aim_user *)aim_users->data; |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
373 if (c->options & OPT_USR_REM_PASS) { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
374 combo_changed(NULL, name); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
375 gtk_widget_grab_focus(signon); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
376 } else { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
377 gtk_widget_grab_focus(pass); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
378 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
379 } else { |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
380 gtk_widget_grab_focus(name); |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
381 } |
bd8eb3efe14e
[gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
382 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
383 gtk_widget_show(mainwindow); |
1 | 384 } |
385 | |
200
bc117fbcf527
[gaim-migrate @ 210]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
184
diff
changeset
|
386 extern void show_debug(GtkObject *); |
180 | 387 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
388 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
389 void sighandler(int sig) |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
390 { |
1415
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
391 switch (sig) { |
2083
f5659096bcd6
[gaim-migrate @ 2093]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2075
diff
changeset
|
392 case SIGHUP: |
f5659096bcd6
[gaim-migrate @ 2093]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2075
diff
changeset
|
393 debug_printf("caught signal %d\n", sig); |
f5659096bcd6
[gaim-migrate @ 2093]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2075
diff
changeset
|
394 signoff_all(NULL, NULL); |
f5659096bcd6
[gaim-migrate @ 2093]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2075
diff
changeset
|
395 break; |
1415
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
396 case SIGSEGV: |
1697
23ad4f7b644f
[gaim-migrate @ 1707]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1560
diff
changeset
|
397 fprintf(stderr, "Gaim has segfaulted and attempted to dump a core file.\n" |
23ad4f7b644f
[gaim-migrate @ 1707]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1560
diff
changeset
|
398 "Please notify the gaim maintainers by reporting a bug at\n" |
2005
7d996c7715b0
[gaim-migrate @ 2015]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
399 WEBSITE "bug.php3\n\n" |
1697
23ad4f7b644f
[gaim-migrate @ 1707]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1560
diff
changeset
|
400 "Please make sure to specify what you were doing at the time,\n" |
2005
7d996c7715b0
[gaim-migrate @ 2015]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
401 "and post the backtrace from the core file. If you do not know\n" |
7d996c7715b0
[gaim-migrate @ 2015]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
402 "how to get the backtrace, please get instructions at\n" |
7d996c7715b0
[gaim-migrate @ 2015]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
403 WEBSITE "gdb.shtml. If you need further\n" |
2006
cf0c383beebb
[gaim-migrate @ 2016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2005
diff
changeset
|
404 "assistance, please IM either EWarmenhoven or RobFlynn and\n" |
2005
7d996c7715b0
[gaim-migrate @ 2015]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
405 "they can help you.\n"); |
1415
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
406 abort(); |
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
407 break; |
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
408 default: |
1820
73bb4244165f
[gaim-migrate @ 1830]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
409 gtkspell_stop(); |
73bb4244165f
[gaim-migrate @ 1830]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
410 debug_printf("caught signal %d\n", sig); |
1792
de88617f542c
[gaim-migrate @ 1802]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1774
diff
changeset
|
411 if (gtk_main_level()) |
de88617f542c
[gaim-migrate @ 1802]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1774
diff
changeset
|
412 gtk_main_quit(); |
1415
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
413 exit(0); |
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
414 } |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
415 } |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
416 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
417 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
418 |
1 | 419 int main(int argc, char *argv[]) |
420 { | |
1555
5e54c7a2a394
[gaim-migrate @ 1565]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1548
diff
changeset
|
421 int opt; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
422 int opt_acct = 0, opt_help = 0, opt_version = 0, opt_user = 0, opt_login = 0, do_login_ret = -1; |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
423 char *opt_user_arg = NULL, *opt_login_arg = NULL; |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
424 int i; |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
425 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
426 #ifdef USE_GNOME |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
427 struct poptOption popt_options[] = { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
428 {"acct", 'a', POPT_ARG_NONE, &opt_acct, 'a', |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
429 "Display account editor window", NULL}, |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
430 {"away", 'w', POPT_ARG_STRING, NULL, 'w', |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
431 "Make away on signon (optional argument MESG specifies name of away message to use)", "[MESG]"}, |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
432 {"login", 'l', POPT_ARG_STRING, NULL, 'l', |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
433 "Automatically login (optional argument NAME specifies account(s) to use)", "[NAME]"}, |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
434 {"user", 'u', POPT_ARG_STRING, &opt_user_arg, 'u', |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
435 "Use account NAME", "NAME"}, |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
436 {"file", 'f', POPT_ARG_STRING, &opt_rcfile_arg, 'f', |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
437 "Use FILE as config", "FILE"}, |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
438 {0, 0, 0, 0, 0, 0, 0} |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
439 }; |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
440 #endif /* USE_GNOME */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
441 struct option long_options[] = { |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
442 {"acct", no_argument, NULL, 'a'}, |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
443 /*{"away", optional_argument, NULL, 'w'},*/ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
444 {"help", no_argument, NULL, 'h'}, |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
445 /*{"login", optional_argument, NULL, 'l'},*/ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
446 {"user", required_argument, NULL, 'u'}, |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
447 {"file", required_argument, NULL, 'f'}, |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
448 {"version", no_argument, NULL, 'v'}, |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
449 {0, 0, 0, 0} |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
450 }; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
451 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
452 |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
453 #ifdef ENABLE_NLS |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
454 bindtextdomain(PACKAGE, LOCALEDIR); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
455 textdomain(PACKAGE); |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
456 #endif |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
357
diff
changeset
|
457 |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
458 #if HAVE_SIGNAL_H |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
459 /* Let's not violate any PLA's!!!! */ |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1811
diff
changeset
|
460 #ifndef DEBUG |
1415
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
461 signal(SIGSEGV, sighandler); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1811
diff
changeset
|
462 #endif |
1415
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
463 signal(SIGHUP, sighandler); |
3dfd2a83fb5e
[gaim-migrate @ 1425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1409
diff
changeset
|
464 signal(SIGINT, sighandler); |
2083
f5659096bcd6
[gaim-migrate @ 2093]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2075
diff
changeset
|
465 signal(SIGTERM, sighandler); |
1548
c867a2123830
[gaim-migrate @ 1558]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1542
diff
changeset
|
466 signal(SIGPIPE, SIG_IGN); |
614
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
467 #endif |
a3e32af35b30
[gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
600
diff
changeset
|
468 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
469 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
470 #ifdef USE_APPLET |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
471 init_applet_mgr(argc, argv); |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
472 #else |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
473 for (i = 0; i < argc; i++) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
474 /* --login option */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
475 if (strstr(argv[i], "--l") == argv[i]) { |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
476 char *equals; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
477 opt_login = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
478 if ((equals = strchr(argv[i], '=')) != NULL) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
479 /* --login=NAME */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
480 opt_login_arg = g_strdup(equals + 1); |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
481 if (strlen (opt_login_arg) == 0) { |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
482 g_free (opt_login_arg); |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
483 opt_login_arg = NULL; |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
484 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
485 } else if (i + 1 < argc && argv[i + 1][0] != '-') { |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
486 /* --login NAME */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
487 opt_login_arg = g_strdup(argv[i + 1]); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
488 strcpy(argv[i + 1], " "); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
489 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
490 strcpy(argv[i], " "); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
491 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
492 /* -l option */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
493 else if (strstr(argv[i], "-l") == argv[i]) { |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
494 opt_login = 1; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
495 if (strlen(argv[i]) > 2) { |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
496 /* -lNAME */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
497 opt_login_arg = g_strdup(argv[i] + 2); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
498 } else if (i + 1 < argc && argv[i + 1][0] != '-') { |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
499 /* -l NAME */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
500 opt_login_arg = g_strdup(argv[i + 1]); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
501 strcpy(argv[i + 1], " "); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
502 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
503 strcpy(argv[i], " "); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
504 } |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
505 /* --away option */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
506 else if (strstr (argv[i], "--aw") == argv[i]) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
507 char *equals; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
508 opt_away = 1; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
509 if ((equals = strchr(argv[i], '=')) != NULL) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
510 /* --away=MESG */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
511 opt_away_arg = g_strdup (equals+1); |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
512 if (strlen (opt_away_arg) == 0) { |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
513 g_free (opt_away_arg); |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
514 opt_away_arg = NULL; |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
515 } |
1254
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
516 } else if (i+1 < argc && argv[i+1][0] != '-') { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
517 /* --away MESG */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
518 opt_away_arg = g_strdup (argv[i+1]); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
519 strcpy (argv[i+1], " "); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
520 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
521 strcpy (argv[i], " "); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
522 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
523 /* -w option */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
524 else if (strstr (argv[i], "-w") == argv[i]) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
525 opt_away = 1; |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
526 if (strlen (argv[i]) > 2) { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
527 /* -wMESG */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
528 opt_away_arg = g_strdup (argv[i]+2); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
529 } else if (i+1 < argc && argv[i+1][0] != '-') { |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
530 /* -w MESG */ |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
531 opt_away_arg = g_strdup (argv[i+1]); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
532 strcpy (argv[i+1], " "); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
533 } |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
534 strcpy(argv[i], " "); |
9da444224f0e
[gaim-migrate @ 1264]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
535 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
536 } |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
537 /* |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
538 if (opt_login) { |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
539 printf ("--login given with arg %s\n", |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
540 opt_login_arg ? opt_login_arg : "NULL"); |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
541 exit(0); |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
542 } |
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
543 */ |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
544 |
2075
75c06bcb022e
[gaim-migrate @ 2085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2068
diff
changeset
|
545 gtk_set_locale(); |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
546 #ifdef USE_GNOME |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
547 gnome_init_with_popt_table(PACKAGE, VERSION, argc, argv, popt_options, 0, NULL); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
548 #else |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
549 gtk_init(&argc, &argv); |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
550 #endif |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
551 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
552 /* scan command-line options */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
553 opterr = 1; |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
554 while ((opt = getopt_long(argc, argv, "ahu:f:v", |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
555 long_options, NULL)) != -1) { |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
556 switch (opt) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
557 case 'u': /* set user */ |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
558 opt_user = 1; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
559 opt_user_arg = g_strdup(optarg); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
560 break; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
561 case 'a': /* account editor */ |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
562 opt_acct = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
563 break; |
1560
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
564 case 'f': |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
565 opt_rcfile_arg = g_strdup (optarg); |
72235e3fcff6
[gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1555
diff
changeset
|
566 break; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
567 case 'v': /* version */ |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
568 opt_version = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
569 break; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
570 case 'h': /* help */ |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
571 opt_help = 1; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
572 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
573 case '?': |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
574 default: |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
575 show_usage(1, argv[0]); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
576 return 0; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
577 break; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
578 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
579 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
580 |
2068
e38eb507b261
[gaim-migrate @ 2078]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2006
diff
changeset
|
581 #endif /* USE_APPLET */ |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
582 |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
583 /* show help message */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
584 if (opt_help) { |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
585 show_usage(0, argv[0]); |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
586 return 0; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
587 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
588 /* show version window */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
589 if (opt_version) { |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
590 gtk_init(&argc, &argv); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
591 set_defaults(FALSE); /* needed for open_url_nw */ |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
592 load_prefs(); |
1142
4593153a956c
[gaim-migrate @ 1152]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1137
diff
changeset
|
593 show_about(0, (void *)2); |
546
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
594 gtk_main(); |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
595 return 0; |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
596 } |
e312b8b9bee5
[gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
597 |
1 | 598 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
599 set_defaults(FALSE); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
600 load_prefs(); |
180 | 601 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
602 /* set the default username */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
603 if (opt_user_arg != NULL) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
604 set_first_user(opt_user_arg); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
605 #ifndef USE_GNOME |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
606 g_free(opt_user_arg); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
607 opt_user_arg = NULL; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
608 #endif /* USE_GNOME */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
609 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
610 |
176
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
611 if (general_options & OPT_GEN_DEBUG) |
c99d0b82c8a8
[gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
158
diff
changeset
|
612 show_debug(NULL); |
1 | 613 |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1093
diff
changeset
|
614 gtkspell_start(NULL, ispell_cmd); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
615 #ifdef USE_PERL |
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
616 perl_init(); |
800
022048cde898
[gaim-migrate @ 810]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
792
diff
changeset
|
617 perl_autoload(); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
618 #endif |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
619 static_proto_init(); |
784
4c292b3f74ea
[gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
620 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
621 /* deal with --login */ |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
622 if (opt_login) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
623 do_login_ret = do_auto_login(opt_login_arg); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
624 if (opt_login_arg != NULL) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
625 g_free(opt_login_arg); |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
626 opt_login_arg = NULL; |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
627 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
628 } |
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
629 |
1 | 630 #ifdef USE_APPLET |
631 applet_widget_register_callback(APPLET_WIDGET(applet), | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
632 "prefs", _("Preferences"), show_prefs, NULL); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
633 applet_widget_register_callback(APPLET_WIDGET(applet), |
966
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
634 "accounts", |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
635 _("Accounts"), (AppletCallbackFunc)account_editor, (void *)1); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
636 #ifdef GAIM_PLUGINS |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
637 applet_widget_register_callback(APPLET_WIDGET(applet), |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
638 "plugins", _("Plugins"), GTK_SIGNAL_FUNC(show_plugins), NULL); |
97
5b4b7aa8dd9a
[gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
96
diff
changeset
|
639 #endif /* GAIM_PLUGINS */ |
1 | 640 |
82 | 641 update_pixmaps(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
642 |
1326
3d82e8f8b786
[gaim-migrate @ 1336]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1320
diff
changeset
|
643 if (!opt_acct) |
3d82e8f8b786
[gaim-migrate @ 1336]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1320
diff
changeset
|
644 auto_login(); |
3d82e8f8b786
[gaim-migrate @ 1336]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1320
diff
changeset
|
645 |
1 | 646 applet_widget_gtk_main(); |
647 #else | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
648 |
1361
5d4464379703
[gaim-migrate @ 1371]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1360
diff
changeset
|
649 if (!opt_acct) |
5d4464379703
[gaim-migrate @ 1371]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1360
diff
changeset
|
650 auto_login(); |
5d4464379703
[gaim-migrate @ 1371]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1360
diff
changeset
|
651 |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
652 if (opt_acct) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
653 account_editor(NULL, NULL); |
1361
5d4464379703
[gaim-migrate @ 1371]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1360
diff
changeset
|
654 } else if ((do_login_ret == -1) && !connections) |
1009
d496fe2614a6
[gaim-migrate @ 1019]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
655 show_login(); |
1137 | 656 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
657 gtk_main(); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
658 |
1 | 659 #endif /* USE_APPLET */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
660 |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1093
diff
changeset
|
661 gtkspell_stop(); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1093
diff
changeset
|
662 |
1 | 663 return 0; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1142
diff
changeset
|
664 |
1 | 665 } |