annotate src/aim.c @ 989:bd8eb3efe14e

[gaim-migrate @ 999] putting the login window back the way it was, mostly committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 13 Oct 2000 20:21:38 +0000
parents 9523b772e546
children 3dbc2cd326e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include "gnome_applet_mgr.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include <arpa/inet.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 #include <sys/wait.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 #include <stdarg.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 #include <stdlib.h>
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 216
diff changeset
47 #include <ctype.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49 #include "pixmaps/logo.xpm"
614
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
50 #if HAVE_SIGNAL_H
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
51 #include <signal.h>
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
52 #endif
462
9a5da5b17722 [gaim-migrate @ 472]
Rob Flynn <gaim@robflynn.com>
parents: 436
diff changeset
53 #include "locale.h"
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
54 #include "gtkticker.h"
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
55
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
56 static GtkWidget *name;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
57 static GtkWidget *pass;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
58
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59 GList *permit = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60 GList *deny = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 GList *log_conversations = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62 GList *buddy_pounces = NULL;
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 917
diff changeset
63 GSList *away_messages = NULL;
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 917
diff changeset
64 GSList *groups = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 GList *conversations = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 GList *chat_rooms = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 GtkWidget *mainwindow = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
70 void BuddyTickerCreateWindow( void );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
71
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 char toc_addy[16];
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
73 char *quad_addr = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 void cancel_logon(void)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77 #ifdef USE_APPLET
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 730
diff changeset
78 applet_buddy_show = FALSE;
941
0c3bdd59f983 [gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
79 if (mainwindow)
0c3bdd59f983 [gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
80 gtk_widget_hide(mainwindow);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 #else
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
82 #ifdef GAIM_PLUGINS
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
83 GList *c;
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
84 struct gaim_plugin *p;
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
85 void (*gaim_plugin_remove)();
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
86 char *error;
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
87
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
88 /* first we tell those who have requested it we're quitting */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 757
diff changeset
89 plugin_event(event_quit, 0, 0, 0);
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
90
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
91 /* then we remove everyone in a mass suicide */
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
92 c = plugins;
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
93 while (c) {
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
94 p = (struct gaim_plugin *)c->data;
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
95 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove");
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
96 if ((error = (char *)dlerror()) == NULL)
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
97 (*gaim_plugin_remove)();
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
98 /* we don't need to worry about removing callbacks since
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
99 * there won't be any more chance to call them back :) */
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
100 dlclose(p->handle);
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
101 g_free(p->filename); /* why do i bother? */
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
102 g_free(p);
403
d6f02d7f78d8 [gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 395
diff changeset
103 c = c->next;
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
104 }
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
105 #endif /* GAIM_PLUGINS */
784
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
106 #ifdef USE_PERL
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
107 perl_end();
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
108 #endif
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 369
diff changeset
109
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 exit(0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111 #endif /* USE_APPLET */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113
109
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
114 static int snd_tmout;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 109
diff changeset
115 int logins_not_muted = 1;
109
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
116 static void sound_timeout() {
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 109
diff changeset
117 logins_not_muted = 1;
109
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
118 gtk_timeout_remove(snd_tmout);
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
119 }
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
120
265
59f1748b09a6 [gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
121 /* 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
122 * 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
123 * 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
124 void gaim_setup(struct gaim_connection *gc) {
109
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
125 if (sound_options & OPT_SOUND_LOGIN &&
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
126 sound_options & OPT_SOUND_SILENT_SIGNON) {
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 109
diff changeset
127 logins_not_muted = 0;
109
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
128 snd_tmout = gtk_timeout_add(10000, (GtkFunction)sound_timeout,
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
129 NULL);
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
130 }
45bcfa3b584c [gaim-migrate @ 119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
131
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 82
diff changeset
132 #ifdef USE_APPLET
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 730
diff changeset
133 set_user_state(online);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 730
diff changeset
134 applet_widget_register_callback(APPLET_WIDGET(applet),
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 730
diff changeset
135 "signoff",
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 730
diff changeset
136 _("Signoff"),
966
f7886476f9d9 [gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
137 (AppletCallbackFunc)signoff_all,
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 730
diff changeset
138 NULL);
265
59f1748b09a6 [gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
139 #endif /* USE_APPLET */
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 85
diff changeset
140
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
141 account_online(gc);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
142
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 757
diff changeset
143 plugin_event(event_signon, 0, 0, 0);
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 85
diff changeset
144
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 82
diff changeset
145 return;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
149 static void dologin(GtkWidget *widget, GtkWidget *w)
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
150 {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
151 struct aim_user *u;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
152 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
153 char *password = gtk_entry_get_text(GTK_ENTRY(pass));
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(username)) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
156 do_error_dialog(_("Please enter your logon"), _("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
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
160 if (!strlen(password)) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
161 do_error_dialog(_("Please enter your password"), _("Signon Error"));
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
162 return;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
163 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
164
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
165 u = find_user(username);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
166 if (!u) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
167 /* FIXME : add user */
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 g_snprintf(u->password, sizeof u->password, "%s", password);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
170 save_prefs();
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
171 serv_login(u);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
172 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
173
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 static void doenter(GtkWidget *widget, GtkWidget *w)
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 if (widget == name) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
178 gtk_entry_set_text(GTK_ENTRY(pass), "");
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
179 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
180 gtk_widget_grab_focus(pass);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
181 } else if (widget == pass) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
182 dologin(widget, w);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
183 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
184 }
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 static void combo_changed(GtkWidget *w, GtkWidget *combo)
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 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
190 struct aim_user *u;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
191
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
192 u = find_user(txt);
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 if (u && u->options & OPT_USR_REM_PASS) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
195 gtk_entry_set_text(GTK_ENTRY(pass), u->password);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
196 } else {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
197 gtk_entry_set_text(GTK_ENTRY(pass), "");
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
198 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
199 }
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 static GList *combo_user_names()
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 GList *usr = aim_users;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
205 GList *tmp = NULL;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
206 struct aim_user *u;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
207
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
208 if (!usr)
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
209 return g_list_append(NULL, "<unknown>");
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 while (usr) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
212 u = (struct aim_user *)usr->data;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
213 tmp = g_list_append(tmp, g_strdup(u->username));
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
214 usr = usr->next;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
215 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
216
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
217 return tmp;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
218 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221 void show_login()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 GtkWidget *options;
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
224 #ifdef GAIM_PLUGINS
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
225 GtkWidget *plugs;
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
226 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
227 GtkWidget *accts;
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
228 GtkWidget *signon;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
229 GtkWidget *cancel;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 GtkWidget *reg;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 GtkWidget *bbox;
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
232 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 GtkWidget *sbox;
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
234 GtkWidget *label;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235 GtkWidget *table;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 GtkWidget *pmw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 GdkPixmap *pm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 GtkStyle *style;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 GdkBitmap *mask;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 if (mainwindow) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 gtk_widget_show(mainwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 }
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
246
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 886
diff changeset
248 /* Set the WM name and class */
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 886
diff changeset
249 gtk_window_set_wmclass(GTK_WINDOW(mainwindow), "login",
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 886
diff changeset
250 "Gaim");
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 886
diff changeset
251 /* Disallow resizing */
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 886
diff changeset
252 gtk_window_set_policy(GTK_WINDOW(mainwindow), FALSE, FALSE, TRUE);
621
991bf4e3c9fe [gaim-migrate @ 631]
Todd Kulesza <fflewddur>
parents: 614
diff changeset
253 gtk_widget_realize(mainwindow);
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
254
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
255 signon = gtk_button_new_with_label(_("Signon"));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
256 accts = gtk_button_new_with_label(_("Accounts"));
622
7f8b85e2e894 [gaim-migrate @ 632]
Rob Flynn <gaim@robflynn.com>
parents: 621
diff changeset
257 cancel = gtk_button_new_with_label(_("Cancel"));
7f8b85e2e894 [gaim-migrate @ 632]
Rob Flynn <gaim@robflynn.com>
parents: 621
diff changeset
258 reg = gtk_button_new_with_label(_("Register"));
7f8b85e2e894 [gaim-migrate @ 632]
Rob Flynn <gaim@robflynn.com>
parents: 621
diff changeset
259 options = gtk_button_new_with_label(_("Options"));
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
260 #ifdef GAIM_PLUGINS
622
7f8b85e2e894 [gaim-migrate @ 632]
Rob Flynn <gaim@robflynn.com>
parents: 621
diff changeset
261 plugs = gtk_button_new_with_label(_("Plugins"));
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
262 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 table = gtk_table_new(8, 2, FALSE);
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
264 name = gtk_combo_new();
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
265 pass = gtk_entry_new();
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
266
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
267 gtk_combo_set_popdown_strings(GTK_COMBO(name), combo_user_names());
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
269 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
270 {
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
271 gtk_button_set_relief(GTK_BUTTON(signon), GTK_RELIEF_NONE);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
272 gtk_button_set_relief(GTK_BUTTON(accts), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
273 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
274 gtk_button_set_relief(GTK_BUTTON(reg), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
275 gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE);
600
01777a942034 [gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 583
diff changeset
276 #ifdef GAIM_PLUGINS
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
277 gtk_button_set_relief(GTK_BUTTON(plugs), GTK_RELIEF_NONE);
600
01777a942034 [gaim-migrate @ 610]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 583
diff changeset
278 #endif
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
279 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 508
diff changeset
280
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
281 /* Make the buttons do stuff */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 /* Clicking the button initiates a login */
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
283 gtk_signal_connect(GTK_OBJECT(signon), "clicked",
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
284 GTK_SIGNAL_FUNC(dologin), mainwindow);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
285 gtk_signal_connect(GTK_OBJECT(accts), "clicked",
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
286 GTK_SIGNAL_FUNC(account_editor), mainwindow);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 GTK_SIGNAL_FUNC(cancel_logon), mainwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 /* Allow user to change prefs before logging in */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290 gtk_signal_connect(GTK_OBJECT(options), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
291 GTK_SIGNAL_FUNC(show_prefs), NULL);
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
292 #ifdef GAIM_PLUGINS
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
293 /* Allow user to control plugins before logging in */
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
294 gtk_signal_connect(GTK_OBJECT(plugs), "clicked",
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
295 GTK_SIGNAL_FUNC(show_plugins), NULL);
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
296 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 /* Register opens the right URL */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 gtk_signal_connect(GTK_OBJECT(reg), "clicked",
286
37a1d222b7f8 [gaim-migrate @ 296]
Rob Flynn <gaim@robflynn.com>
parents: 278
diff changeset
300 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
301 /* Enter in the username clears the password and sets
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
302 the pointer in the password field */
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
303 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "activate",
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
304 GTK_SIGNAL_FUNC(doenter), mainwindow);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
305 gtk_signal_connect(GTK_OBJECT(GTK_COMBO(name)->entry), "changed",
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
306 GTK_SIGNAL_FUNC(combo_changed), name);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
307
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
308 gtk_signal_connect(GTK_OBJECT(pass), "activate",
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
309 GTK_SIGNAL_FUNC(doenter), mainwindow);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 gtk_signal_connect(GTK_OBJECT(mainwindow), "delete_event",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311 GTK_SIGNAL_FUNC(cancel_logon), mainwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312 /* Homogenous spacing, 10 padding */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 bbox = gtk_hbox_new(TRUE, 10);
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
314 hbox = gtk_hbox_new(TRUE, 10);
621
991bf4e3c9fe [gaim-migrate @ 631]
Todd Kulesza <fflewddur>
parents: 614
diff changeset
315 sbox = gtk_vbox_new(TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
318 gtk_box_pack_start(GTK_BOX(bbox), accts, TRUE, TRUE, 0);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
319 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
320
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
321 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
322 gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0);
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
323 #ifdef GAIM_PLUGINS
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
324 gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0);
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
325 #endif
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
326
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
327 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
328 gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 /* Labels for selectors and text boxes */
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
331 label = gtk_label_new(_("Screen Name: "));
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
332 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
333 gtk_widget_show(label);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
334 label = gtk_label_new(_("Password: "));
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
335 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
336 gtk_widget_show(label);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
338 gtk_widget_show(options);
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
339 #ifdef GAIM_PLUGINS
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
340 gtk_widget_show(plugs);
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
341 #endif
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
342
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
343 /* Adjust sizes of inputs */
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
344 gtk_widget_set_usize(name,100,0);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
345 gtk_widget_set_usize(pass,100,0);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
346
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 /* Attach the buttons at the bottom */
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
349 gtk_widget_show(signon);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 gtk_widget_show(cancel);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 gtk_widget_show(reg);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
352 gtk_widget_show(accts);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353 gtk_widget_show(bbox);
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
354 gtk_widget_show(hbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355 gtk_widget_show(sbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 gtk_table_attach(GTK_TABLE(table), sbox, 0,2,7,8,0,0, 5, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
358 /* Text fields */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
359
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
360 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
361 gtk_widget_show(name);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
362 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
363 gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
364 gtk_widget_show(pass);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
365
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 gtk_container_border_width(GTK_CONTAINER(sbox), 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
367
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
368 gtk_container_add(GTK_CONTAINER(mainwindow),table );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
369
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
370 gtk_widget_show(table);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 886
diff changeset
371 gtk_window_set_title(GTK_WINDOW(mainwindow),_("Gaim - Login"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
372
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
373
989
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
374 if (aim_users) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
375 struct aim_user *c = (struct aim_user *)aim_users->data;
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
376 sprintf(debug_buff, "First user is %s\n", c->username);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
377 if (c->options & OPT_USR_REM_PASS) {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
378 combo_changed(NULL, name);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
379 gtk_widget_grab_focus(signon);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
380 } else {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
381 gtk_widget_grab_focus(pass);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
382 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
383 } else {
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
384 gtk_widget_grab_focus(name);
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
385 }
bd8eb3efe14e [gaim-migrate @ 999]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
386
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387 gtk_widget_realize(mainwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 /* Logo at the top */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 style = gtk_widget_get_style(mainwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 pm = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392 &style->bg[GTK_STATE_NORMAL], (gchar **)aol_logo);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 pmw = gtk_pixmap_new( pm, mask);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
394 gtk_table_attach(GTK_TABLE(table), pmw, 0,2,0,1,0,0,5,5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 gtk_widget_show(pmw);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
396 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 800
diff changeset
397 gdk_bitmap_unref(mask);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
398
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
399
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
400 aol_icon(mainwindow->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
401 #ifndef _WIN32
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402 gdk_window_set_group(mainwindow->window, mainwindow->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
403 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
405
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
406 gtk_widget_show(mainwindow);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 430
diff changeset
407
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 430
diff changeset
408 SetTickerPrefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
410 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
411
200
bc117fbcf527 [gaim-migrate @ 210]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 184
diff changeset
412 extern void show_debug(GtkObject *);
180
0ff9f19b9b23 [gaim-migrate @ 190]
Rob Flynn <gaim@robflynn.com>
parents: 176
diff changeset
413
614
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
414 #if HAVE_SIGNAL_H
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
415 void sighandler(int sig)
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
416 {
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
417 fprintf(stderr, "God damn, I tripped.\n");
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
418 exit(11); /* signal 11 */
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
419 }
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
420 #endif
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
421
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422 int main(int argc, char *argv[])
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423 {
369
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 357
diff changeset
424 #ifdef ENABLE_NLS
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 357
diff changeset
425 bindtextdomain(PACKAGE, LOCALEDIR);
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 357
diff changeset
426 textdomain(PACKAGE);
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 357
diff changeset
427 #endif
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 357
diff changeset
428
614
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
429 #if HAVE_SIGNAL_H
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
430 /* Let's not violate any PLA's!!!! */
636
072200640327 [gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
431 /* signal(SIGSEGV, sighandler); */
614
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
432 #endif
a3e32af35b30 [gaim-migrate @ 624]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 600
diff changeset
433
546
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
434 if (argc > 1 && !strcmp(argv[1], "--version")) {
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
435 gtk_init(&argc, &argv);
917
f3c23b3c1ed7 [gaim-migrate @ 927]
Rob Flynn <gaim@robflynn.com>
parents: 905
diff changeset
436 set_defaults(FALSE); /* needed for open_url_nw */
546
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
437 load_prefs();
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
438 show_about(0, (void *)1);
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
439 gtk_main();
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
440 return 0;
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
441 }
e312b8b9bee5 [gaim-migrate @ 556]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
442
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443 #ifdef USE_APPLET
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 296
diff changeset
444 init_applet_mgr(argc, argv);
724
e7d812852a7f [gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 705
diff changeset
445 #elif defined USE_GNOME
e7d812852a7f [gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 705
diff changeset
446 gnome_init(PACKAGE,VERSION,argc,argv);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447 #else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 gtk_init(&argc, &argv);
724
e7d812852a7f [gaim-migrate @ 734]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 705
diff changeset
449 #endif /* USE_GNOME */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450
917
f3c23b3c1ed7 [gaim-migrate @ 927]
Rob Flynn <gaim@robflynn.com>
parents: 905
diff changeset
451 set_defaults(FALSE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452 load_prefs();
180
0ff9f19b9b23 [gaim-migrate @ 190]
Rob Flynn <gaim@robflynn.com>
parents: 176
diff changeset
453
176
c99d0b82c8a8 [gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
454 if (general_options & OPT_GEN_DEBUG)
c99d0b82c8a8 [gaim-migrate @ 186]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
455 show_debug(NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456
216
f7e17fb767eb [gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
457 gdk_threads_enter();
f7e17fb767eb [gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
458
784
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
459 #ifdef USE_PERL
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
460 perl_init();
800
022048cde898 [gaim-migrate @ 810]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 792
diff changeset
461 perl_autoload();
784
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
462 #endif
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
463
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465 applet_widget_register_callback(APPLET_WIDGET(applet),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466 "prefs",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 _("Preferences"),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468 show_prefs,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 applet_widget_register_callback(APPLET_WIDGET(applet),
966
f7886476f9d9 [gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
471 "accounts",
f7886476f9d9 [gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
472 _("Accounts"),
f7886476f9d9 [gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
473 (AppletCallbackFunc)account_editor,
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
474 NULL);
97
5b4b7aa8dd9a [gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
475 #ifdef GAIM_PLUGINS
96
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
476 applet_widget_register_callback(APPLET_WIDGET(applet),
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
477 "plugins",
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
478 _("Plugins"),
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
479 GTK_SIGNAL_FUNC(show_plugins),
247f540ea6e1 [gaim-migrate @ 106]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
480 NULL);
97
5b4b7aa8dd9a [gaim-migrate @ 107]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 96
diff changeset
481 #endif /* GAIM_PLUGINS */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 26
diff changeset
483 update_pixmaps();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
484
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
485 applet_widget_gtk_main();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
486 #else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
487
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
488
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
489 static_proto_init();
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
490
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491 show_login();
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 941
diff changeset
492 auto_login();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 gtk_main();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495 #endif /* USE_APPLET */
216
f7e17fb767eb [gaim-migrate @ 226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
496 gdk_threads_leave();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 return 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500 }