annotate src/dialogs.c @ 710:efd72a117875

[gaim-migrate @ 720] yay, icq-style aliasing. joy. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 17 Aug 2000 13:07:52 +0000
parents f8acdd22065a
children d7c39f12eb89
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: 338
diff changeset
22 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
23 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <sys/types.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <fcntl.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <sys/socket.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <netdb.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <arpa/inet.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include "gtkhtml.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
43 #include "pixmaps/cancel.xpm"
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
44 #include "pixmaps/save.xpm"
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
45 #include "pixmaps/ok.xpm"
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
46 #include "pixmaps/add.xpm"
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
47 #include "pixmaps/warn.xpm"
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
48 #include "pixmaps/gnome_remove.xpm"
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
49
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
50 #include "pixmaps/angel.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
51 #include "pixmaps/bigsmile.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
52 #include "pixmaps/burp.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
53 #include "pixmaps/crossedlips.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
54 #include "pixmaps/cry.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
55 #include "pixmaps/embarrassed.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
56 #include "pixmaps/kiss.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
57 #include "pixmaps/moneymouth.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
58 #include "pixmaps/sad.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
59 #include "pixmaps/scream.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
60 #include "pixmaps/smile.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
61 #include "pixmaps/smile8.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
62 #include "pixmaps/think.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
63 #include "pixmaps/tongue.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
64 #include "pixmaps/wink.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
65 #include "pixmaps/yell.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
66
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
67 #define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1"
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
68
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
69 int smiley_array[FACE_TOTAL];
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
70
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 static GList *dialogwindows = NULL;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
73 static GtkWidget *exportdialog, *importdialog;
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
74 static GtkWidget *aliasdlg = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
75 static GtkWidget *aliasentry = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
76 static GtkWidget *aliasname = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
77
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 struct create_away {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80 GtkWidget *entry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 GtkWidget *checkbx;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86 struct warning {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 GtkWidget *anon;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 char *who;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92 struct addbuddy {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 GtkWidget *combo;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 GtkWidget *entry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 struct addperm {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 GSList *buttons;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 GtkWidget *entry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104 struct addbp {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 GtkWidget *nameentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 GtkWidget *messentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108 GtkWidget *sendim;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 GtkWidget *openwindow;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 struct findbyemail {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114 GtkWidget *emailentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117 struct findbyinfo {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 GtkWidget *firstentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 GtkWidget *middleentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 GtkWidget *lastentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 GtkWidget *maidenentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 GtkWidget *cityentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124 GtkWidget *stateentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125 GtkWidget *countryentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 struct registerdlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 GtkWidget *name;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131 GtkWidget *email;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 GtkWidget *uname;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133 GtkWidget *sname;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 GtkWidget *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 struct info_dlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140 GtkWidget *close;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
141 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
144 struct set_info_dlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147 GtkWidget *save;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
151 struct set_dir_dlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
152 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153 GtkWidget *first;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154 GtkWidget *middle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
155 GtkWidget *last;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156 GtkWidget *maiden;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 GtkWidget *city;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 GtkWidget *state;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 GtkWidget *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 GtkWidget *web;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162 GtkWidget *save;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 struct linkdlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 GtkWidget *url;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171 GtkWidget *toggle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172 GtkWidget *entry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
175 struct passwddlg {
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
176 GtkWidget *window;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
177 GtkWidget *ok;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
178 GtkWidget *cancel;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
179 GtkWidget *original;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
180 GtkWidget *new1;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
181 GtkWidget *new2;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
182 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185 /* Function to Send an Email */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 static int g_sendemail(char *name, char *email, int uname, int sname, char *country)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190 static char email_data[2000];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
191 int sock;
253
5b28ef2b550e [gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
192 struct in_addr *host;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193 /* char data[3]; */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 FILE *sockfile;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 char uname_output;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196 FILE *tmpfile;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 char filename[128];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 char buf[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 int i=0, tmpfd=-1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 while (i<10000 && tmpfd < 0) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 g_snprintf(filename, 128, "/tmp/gaim_%s%d.tmp", current_user->username, i++);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 tmpfd = open(filename, O_RDWR|O_CREAT|O_EXCL, 0600);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 if(tmpfd < 0) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 if (uname)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
214 g_snprintf(buf, sizeof(buf), "uname -a > %s", filename);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215 system(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
216 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217
253
5b28ef2b550e [gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
218 host = (struct in_addr *)get_address(REG_SRVR);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219 if (!host)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220 {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
221 printf(_("Error Resolving Mail Server.\n"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224
253
5b28ef2b550e [gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
225 if ((sock = connect_address(host->s_addr, REG_PORT)) < 0)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
227 printf(_("Error Connecting to Socket.\n"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 sockfile = fdopen(sock, "r+");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 g_snprintf(email_data, sizeof(email_data), "mail from: %s\n", REG_EMAIL_ADDR);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234 fputs(email_data, sockfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236 g_snprintf(email_data, sizeof(email_data), "rcpt to: %s\n", REG_EMAIL_ADDR);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 fputs(email_data, sockfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 g_snprintf(email_data, sizeof(email_data), "data\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 fputs(email_data, sockfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 g_snprintf(email_data, sizeof(email_data), "Subject: Registration Information\n\nBelow is the submitted Registration Information\n----------------------------------\nName: %s\nEmail: %s\nCountry: %s\nSName: %s\nGAIM: v%s\nUname: ", name, email, country, sname ? current_user->username : "N/A", VERSION);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 fputs(email_data, sockfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 if (uname)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246 tmpfile = fopen(filename, "r");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 while (!feof(tmpfile))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249 uname_output = fgetc(tmpfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
250 if (!feof(tmpfile))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251 fputc(uname_output, sockfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 fclose(tmpfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 unlink(filename);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 g_snprintf(email_data, sizeof(email_data), "\n.\nquit\n\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259 fputs(email_data, sockfile);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261 /* while (fgets(data, 2, sockfile)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
264 /* I don't think the above is necessary... */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
265
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266 close(sock);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268 return 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
270
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
271 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
272 /* Destroys */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
273 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
274
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
275 static gint delete_event_dialog(GtkWidget *w, GdkEventAny *e, struct conversation *c)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
276 {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
277 gchar *object_data;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
278 dialogwindows = g_list_remove(dialogwindows, w);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
279 gtk_widget_destroy(w);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
280
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
281 object_data = gtk_object_get_user_data(GTK_OBJECT(w));
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
282
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
283 if (GTK_IS_COLOR_SELECTION_DIALOG(w))
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
284 {
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
285 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
286 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->palette), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
287 set_state_lock(0);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
288 c->color_dialog = NULL;
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
289 }
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
290 else if (GTK_IS_FONT_SELECTION_DIALOG(w))
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
291 {
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
292 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
293 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
294 set_state_lock(0);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
295 c->font_dialog = NULL;
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
296 }
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
297 else if (!g_strcasecmp(object_data, "smiley dialog"))
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
298 {
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
299 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
300 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
301 set_state_lock(0);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
302 c->smiley_dialog = NULL;
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
303 }
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
304 else if (!g_strcasecmp(object_data, "log dialog"))
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
305 {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
306 set_state_lock(1);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
307 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
308 set_state_lock(0);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
309 c->log_dialog = NULL;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
310 }
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
311
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
312 return FALSE;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
313 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315 static void destroy_dialog(GtkWidget *w, GtkWidget *w2)
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 GtkWidget *dest;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319 if (!GTK_IS_WIDGET(w2))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320 dest = w;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 dest = w2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324 if (dest == imdialog)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325 imdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 if (dest == exportdialog)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328 exportdialog = NULL;
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 if (dest == importdialog)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 importdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
333 if (dest == aliasdlg) {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
334 aliasdlg = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
335 aliasentry = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
336 aliasname = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
337 }
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
338
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 dialogwindows = g_list_remove(dialogwindows, dest);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 gtk_widget_destroy(dest);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 void destroy_all_dialogs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 GList *d = dialogwindows;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 while(d) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 destroy_dialog(NULL, d->data);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 d = d->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
352 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354 g_list_free(dialogwindows);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355 dialogwindows = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
357 if (awaymessage)
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
358 do_im_back(NULL, NULL);
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
359
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
360 if (imdialog) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 destroy_dialog(NULL, imdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 imdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
363 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
364
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
365 if (exportdialog) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 destroy_dialog(NULL, exportdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
367 exportdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
368 }
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 if (importdialog) {
607
01a9c6998719 [gaim-migrate @ 617]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 605
diff changeset
371 destroy_dialog(NULL, importdialog);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
372 importdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
373 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
376 static void do_warn(GtkWidget *widget, struct warning *w)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
377 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
378 serv_warn(w->who, (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->anon))) ?
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
379 1 : 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381 destroy_dialog(NULL, w->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
382 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
383
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
384
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
385 void show_warn_dialog(char *who)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
386 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388 GtkWidget *warn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 GtkWidget *bbox;
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
392 GtkWidget *frame;
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
393 GtkWidget *fbox;
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
394
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 struct warning *w = g_new0(struct warning, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 char *buf = g_malloc(128);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
398 w->window = gtk_window_new(GTK_WINDOW_DIALOG);
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
399 gtk_window_set_policy(GTK_WINDOW(w->window), FALSE, FALSE, TRUE);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
400 gtk_widget_show(w->window);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
401 dialogwindows = g_list_prepend(dialogwindows, w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402 bbox = gtk_hbox_new(TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
403 vbox = gtk_vbox_new(FALSE, 5);
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
404 fbox = gtk_vbox_new(FALSE, 5);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
405
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
406 frame = gtk_frame_new(_("Warn"));
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
407
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
408 warn = picture_button(w->window, _("Warn"), warn_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
409
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
410 cancel = picture_button(w->window, _("Cancel"), cancel_xpm);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
411
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
412 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
413 {
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
414 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
415 gtk_button_set_relief(GTK_BUTTON(warn), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
416 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
417
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
418 /* Put the buttons in the box */
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
419
485
a15d87ea1d4c [gaim-migrate @ 495]
Rob Flynn <gaim@robflynn.com>
parents: 484
diff changeset
420 gtk_box_pack_start(GTK_BOX(bbox), warn, FALSE, FALSE, 5);
a15d87ea1d4c [gaim-migrate @ 495]
Rob Flynn <gaim@robflynn.com>
parents: 484
diff changeset
421 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
423 g_snprintf(buf, 127, _("Do you really want to warn %s?"), who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424 label = gtk_label_new(buf);
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
425 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 gtk_widget_show(label);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
427 w->anon = gtk_check_button_new_with_label(_("Warn anonymously?"));
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
428 gtk_box_pack_start(GTK_BOX(vbox), w->anon, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
430 label = gtk_label_new(_("Anonymous warnings are less harsh."));
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
431 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
432 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
433
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
434 w->who = who;
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
435
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
436 gtk_container_add(GTK_CONTAINER(frame), vbox);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
437
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
438 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
439 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 gtk_signal_connect(GTK_OBJECT(w->window), "delete_event",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443 GTK_SIGNAL_FUNC(destroy_dialog), w->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
445 GTK_SIGNAL_FUNC(destroy_dialog), w->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 gtk_signal_connect(GTK_OBJECT(warn), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447 GTK_SIGNAL_FUNC(do_warn), w);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 /* Finish up */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 gtk_widget_show(w->anon);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451 gtk_widget_show(vbox);
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
452 gtk_widget_show(frame);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
453 gtk_widget_show(fbox);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
454
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
455 gtk_window_set_title(GTK_WINDOW(w->window), _("Gaim - Warn user?"));
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
456 gtk_container_add(GTK_CONTAINER(w->window), fbox);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
457 gtk_container_set_border_width(GTK_CONTAINER(w->window), 5);
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
458 gtk_widget_realize(w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459 aol_icon(w->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461 gtk_widget_show(w->window);
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
462 g_free(buf);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
463 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 /* The dialog for getting an error */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 void
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 do_error_dialog(char *message, char *title)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
473 GtkWidget *d;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
474 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
475 GtkWidget *close;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
476
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
477
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478 d = gtk_dialog_new();
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
479 gtk_window_set_policy(GTK_WINDOW(d), FALSE, FALSE, TRUE);
471
4d0b703a094c [gaim-migrate @ 481]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 470
diff changeset
480 gtk_widget_realize(d);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
481 label = gtk_label_new(message);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
483 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
484 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
485 label, FALSE, FALSE, 5);
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
486
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
487 close = picture_button(d, _("Close"), cancel_xpm);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
488
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
489 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
490 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
491
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 close, FALSE, FALSE, 5);
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
494
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
495 gtk_container_set_border_width(GTK_CONTAINER(d), 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 gtk_window_set_title(GTK_WINDOW(d), title);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 aol_icon(d->window);
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 gtk_widget_show(d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
501 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
505 void show_error_dialog(char *d)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
508 int no = atoi(d);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
509 char *w;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 char buf[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511 char buf2[32];
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
512
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
513 #ifdef GAIM_PLUGINS
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
514 GList *c = callbacks;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
515 struct gaim_callback *g;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
516 void (*function)(int, void *);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
517 while (c) {
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
518 g = (struct gaim_callback *)c->data;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
519 if (g->event == event_error && g->function != NULL) {
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
520 function = g->function;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
521 (*function)(no, g->data);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
522 }
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
523 c = c->next;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
524 }
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
525 #endif
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
526
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
527 if (USE_OSCAR)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
528 w = d + 4;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
529 else
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
530 w = strtok(NULL, ":");
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
531
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533 switch(no) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 case 69:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
535 g_snprintf(buf, sizeof(buf), _("Unable to write file %s."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 case 169:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
538 g_snprintf(buf, sizeof(buf), _("Unable to read file %s."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540 case 269:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
541 g_snprintf(buf, sizeof(buf), _("Message too long, last %s bytes truncated."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543 case 901:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
544 g_snprintf(buf, sizeof(buf), _("%s not currently logged in."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 case 902:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
547 g_snprintf(buf, sizeof(buf), _("Warning of %s not allowed."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549 case 903:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
550 g_snprintf(buf, sizeof(buf), _("A message has been dropped, you are exceeding the server speed limit."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552 case 950:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
553 g_snprintf(buf, sizeof(buf), _("Chat in %s is not available."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555 case 960:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
556 g_snprintf(buf, sizeof(buf), _("You are sending messages too fast to %s."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
558 case 961:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
559 g_snprintf(buf, sizeof(buf), _("You missed an IM from %s because it was too big."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561 case 962:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
562 g_snprintf(buf, sizeof(buf), _("You missed an IM from %s because it was sent too fast."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
564 case 970:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
565 g_snprintf(buf, sizeof(buf), _("Failure."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567 case 971:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
568 g_snprintf(buf, sizeof(buf), _("Too many matches."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570 case 972:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
571 g_snprintf(buf, sizeof(buf), _("Need more qualifiers."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573 case 973:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
574 g_snprintf(buf, sizeof(buf), _("Dir service temporarily unavailable."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576 case 974:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
577 g_snprintf(buf, sizeof(buf), _("Email lookup restricted."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
579 case 975:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
580 g_snprintf(buf, sizeof(buf), _("Keyword ignored."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
581 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 case 976:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
583 g_snprintf(buf, sizeof(buf), _("No keywords."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585 case 977:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
586 g_snprintf(buf, sizeof(buf), _("User has no directory information."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
587 /* g_snprintf(buf, sizeof(buf), "Language not supported."); */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
588 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589 case 978:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
590 g_snprintf(buf, sizeof(buf), _("Country not supported."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
591 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592 case 979:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
593 g_snprintf(buf, sizeof(buf), _("Failure unknown: %s."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
594 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
595 case 980:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
596 g_snprintf(buf, sizeof(buf), _("Incorrect nickname or password."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
598 case 981:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
599 g_snprintf(buf, sizeof(buf), _("The service is temporarily unavailable."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
601 case 982:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
602 g_snprintf(buf, sizeof(buf), _("Your warning level is currently too high to log in."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
603 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
604 case 983:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
605 g_snprintf(buf, sizeof(buf), _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
606 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
607 case 989:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
608 g_snprintf(buf, sizeof(buf), _("An unknown signon error has occurred: %s."), w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
609 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
610 default:
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
611 g_snprintf(buf, sizeof(buf), _("An unknown error, %d, has occured. Info: %s"), no, w);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
612 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
613
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
614 g_snprintf(buf2, sizeof(buf2), _("Gaim - Error %d"), no);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
615
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
616
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
617 do_error_dialog(buf, buf2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
619 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
620
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
621 static void do_im(GtkWidget *widget, GtkWidget *imentry)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
622 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
623 char *who;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 struct conversation *c;
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
625
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626 who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(imentry))));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 destroy_dialog(NULL, imdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628 imdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630 if (!strcasecmp(who, "")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
631 g_free(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
633 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 c = find_conversation(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637 if (c == NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 c = new_conversation(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
639 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640 gdk_window_raise(c->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642 g_free(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645 void show_ee_dialog(int ee)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 GtkWidget *box;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 GtkWidget *eedialog;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 eedialog = gtk_window_new(GTK_WINDOW_DIALOG);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
653 ok = gtk_button_new_with_label(_("OK"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654 box = gtk_vbox_new(FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
656
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
657 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
658 gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
659
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660 if (ee == 0)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 label = gtk_label_new("Amazing! Simply Amazing!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 else if (ee == 1)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 label = gtk_label_new("Pimpin\' Penguin Style! *Waddle Waddle*");
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
664 else if (ee == 2)
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
665 label = gtk_label_new("You should be me. I'm so cute!");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
666 else
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
667 label = gtk_label_new("Now that's what I like!");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
668
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 gtk_widget_show(ok);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673 gtk_box_pack_start(GTK_BOX(box), ok, FALSE, FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 gtk_widget_show(box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 gtk_container_add(GTK_CONTAINER(eedialog), box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 gtk_window_set_title(GTK_WINDOW(eedialog), "Gaim - SUPRISE!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
680 gtk_signal_connect(GTK_OBJECT(ok), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
681 GTK_SIGNAL_FUNC(destroy_dialog), eedialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 gtk_widget_realize(eedialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 aol_icon(eedialog->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
685 gtk_widget_show(eedialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
687
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688 void show_im_dialog(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
689 {
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
690 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
691 GtkWidget *imentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
692 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
693 GtkWidget *ebox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 GtkWidget *label;
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
696 GtkWidget *frame;
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
697 GtkWidget *fbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
698
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
699 if (!imdialog) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
700
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
701 imdialog = gtk_window_new(GTK_WINDOW_DIALOG);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
702 gtk_widget_set_usize(imdialog, 255, 105);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
703 gtk_container_border_width(GTK_CONTAINER(imdialog), 5);
458
4f09ffbd2a78 [gaim-migrate @ 468]
Rob Flynn <gaim@robflynn.com>
parents: 455
diff changeset
704 gtk_window_set_policy(GTK_WINDOW(imdialog), FALSE, FALSE, TRUE);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
705 gtk_widget_show(imdialog);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
706
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
707 bbox = gtk_hbox_new(TRUE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
708 vbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
709 ebox = gtk_hbox_new(FALSE, 2);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
710 fbox = gtk_vbox_new(TRUE, 10);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
711
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
712 frame = gtk_frame_new(_("Send Instant Message"));
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
713
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
714 imentry = gtk_entry_new();
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
715
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
716 button = picture_button(imdialog, _("OK"), ok_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
717 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
718 gtk_signal_connect(GTK_OBJECT(button), "clicked",
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
719 GTK_SIGNAL_FUNC(do_im), imentry);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
720
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
721 button = picture_button(imdialog, _("Cancel"), cancel_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
722 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
723 gtk_signal_connect(GTK_OBJECT(button), "clicked",
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
724 GTK_SIGNAL_FUNC(destroy_dialog), imdialog);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
725
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
726 label = gtk_label_new(_("IM who: "));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 gtk_box_pack_start(GTK_BOX(ebox), label, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
729
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
730 gtk_box_pack_start(GTK_BOX(ebox), imentry, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
731
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
732 gtk_box_pack_start(GTK_BOX(vbox), ebox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
734
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
735 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 gtk_signal_connect(GTK_OBJECT(imentry), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
737 GTK_SIGNAL_FUNC(do_im), imentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
738 gtk_signal_connect(GTK_OBJECT(imdialog), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739 GTK_SIGNAL_FUNC(destroy_dialog), imdialog);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
740
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
741 /* Finish up */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
742 gtk_widget_show(ebox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
743 gtk_widget_show(imentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
744 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
745 gtk_widget_show(vbox);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
746 gtk_widget_show(fbox);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
747 gtk_widget_show(frame);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
748 gtk_container_add(GTK_CONTAINER(frame), vbox);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
749 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
750 gtk_window_set_title(GTK_WINDOW(imdialog), _("Gaim - IM user"));
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
751 gtk_container_add(GTK_CONTAINER(imdialog), fbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
752 gtk_widget_grab_focus(imentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753 gtk_widget_realize(imdialog);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
754
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
755 aol_icon(imdialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
758 gtk_widget_show(imdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 /* The dialog for adding buddies */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
764 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
766 extern void add_callback(GtkWidget *, struct conversation *);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
767
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
768 void do_add_buddy(GtkWidget *w, struct addbuddy *a)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
769 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
770 char *grp, *who;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
771 struct conversation *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
772
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 who = gtk_entry_get_text(GTK_ENTRY(a->entry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
775
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
776 c = find_conversation(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
777
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
778 add_buddy(grp, who, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
779
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
780 if (c != NULL) {
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
781 GtkWidget *parent = c->add_button->parent;
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
782 gtk_widget_destroy(c->add_button);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
783 c->add_button = picture_button2(c->window, NULL, gnome_remove_xpm);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
784 gtk_signal_connect(GTK_OBJECT(c->add_button), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
785 gtk_box_pack_end(GTK_BOX(parent), c->add_button, FALSE, FALSE, 0);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
786 gtk_box_reorder_child(GTK_BOX(parent), c->add_button, 1);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
787 gtk_widget_show(c->add_button);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
788 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
789
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
790 build_edit_tree();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
791
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
792 serv_save_config();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
793
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 serv_add_buddy(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
795
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
796 do_export( (GtkWidget *) NULL, 0 );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
797
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
798 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 destroy_dialog(NULL, a->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
803 void do_add_group(GtkWidget *w, struct addbuddy *a)
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
804 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
805 char *grp;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
806
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
807 grp = gtk_entry_get_text(GTK_ENTRY(a->entry));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
808
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
809 add_group(grp);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
810
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
811 build_edit_tree();
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
812
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
813 serv_save_config();
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
814
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
815 do_export( (GtkWidget *) NULL, 0 );
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
816
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
817 update_num_groups();
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
818
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
819 destroy_dialog(NULL, a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
820 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
821
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
822
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
823 static GList *groups_tree()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
824 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
825 GList *tmp=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
826 char *tmp2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
827 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
828 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
829
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
830 if (!grp) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
831 tmp2 = g_strdup(_("Buddies"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
832 tmp = g_list_append(tmp, tmp2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
833 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
834 while(grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
835 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
836 tmp2 = g->name;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
837 tmp=g_list_append(tmp, tmp2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
838 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
839 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
840 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
841 return tmp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
845 void show_add_group()
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
846 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
847 GtkWidget *cancel;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
848 GtkWidget *add;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
849 GtkWidget *label;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
850 GtkWidget *bbox;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
851 GtkWidget *vbox;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
852 GtkWidget *topbox;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
853 GtkWidget *frame;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
854
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
855 struct addbuddy *a = g_new0(struct addbuddy, 1);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
856
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
857 a->window = gtk_window_new(GTK_WINDOW_DIALOG);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
858 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
859 gtk_widget_show(a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
860 dialogwindows = g_list_prepend(dialogwindows, a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
861
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
862 bbox = gtk_hbox_new(TRUE, 10);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
863 topbox = gtk_hbox_new(FALSE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
864 vbox = gtk_vbox_new(FALSE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
865
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
866 a->entry = gtk_entry_new();
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
867 /* Put the buttons in the box */
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
868
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
869 add = picture_button(a->window, _("Add"), add_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
870
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
871 cancel = picture_button(a->window, _("Cancel"), cancel_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
872
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
873 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
874 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
875
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
876 frame = gtk_frame_new(NULL);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
877 gtk_frame_set_label(GTK_FRAME(frame), _("Add Group"));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
878
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
879 label = gtk_label_new(_("Group"));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
880 gtk_widget_show(label);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
881 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
882 gtk_box_pack_start(GTK_BOX(topbox), a->entry, FALSE, FALSE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
883
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
884 /* And the boxes in the box */
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
885 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
886 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
887
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
888 /* Handle closes right */
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
889 gtk_signal_connect(GTK_OBJECT(a->window), "destroy",
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
890 GTK_SIGNAL_FUNC(destroy_dialog), a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
891 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
892 GTK_SIGNAL_FUNC(destroy_dialog), a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
893 gtk_signal_connect(GTK_OBJECT(add), "clicked",
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
894 GTK_SIGNAL_FUNC(do_add_group), a);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
895 gtk_signal_connect(GTK_OBJECT(a->entry), "activate",
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
896 GTK_SIGNAL_FUNC(do_add_group), a);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
897 /* Finish up */
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
898 gtk_widget_show(add);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
899 gtk_widget_show(cancel);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
900 gtk_widget_show(a->entry);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
901 gtk_widget_show(topbox);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
902 gtk_widget_show(bbox);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
903 gtk_widget_show(vbox);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
904 gtk_widget_show(frame);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
905 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Group"));
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
906 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
907 gtk_container_add(GTK_CONTAINER(frame), vbox);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
908 gtk_container_add(GTK_CONTAINER(a->window), frame);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
909 gtk_container_set_border_width(GTK_CONTAINER(a->window), 5);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
910 gtk_widget_realize(a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
911 aol_icon(a->window->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
912
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
913 gtk_widget_show(a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
914 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
915
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
916 void show_add_buddy(char *buddy, char *group)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
917 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
918 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
919 GtkWidget *add;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
921 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
922 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923 GtkWidget *topbox;
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
924 GtkWidget *frame;
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
925
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
926 struct addbuddy *a = g_new0(struct addbuddy, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
927
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
928 a->window = gtk_window_new(GTK_WINDOW_DIALOG);
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
929 gtk_widget_set_usize(a->window, 480, 105);
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
930 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE);
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
931 gtk_widget_show(a->window);
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
932 dialogwindows = g_list_prepend(dialogwindows, a->window);
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
933
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
934 bbox = gtk_hbox_new(TRUE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
935 topbox = gtk_hbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
936 vbox = gtk_vbox_new(FALSE, 5);
244
25518ef9efe6 [gaim-migrate @ 254]
Rob Flynn <gaim@robflynn.com>
parents: 238
diff changeset
937
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
938 a->entry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
939 a->combo = gtk_combo_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940 /* Fix the combo box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
941 gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree());
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
942 /* Put the buttons in the box */
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
943
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
944 add = picture_button(a->window, _("Add"), add_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
945 cancel = picture_button(a->window, _("Cancel"), cancel_xpm);
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
946
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
947 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
948 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
949
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
950 frame = gtk_frame_new(NULL);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
951 gtk_frame_set_label(GTK_FRAME(frame), _("Add Buddy"));
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
952
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
953 label = gtk_label_new(_("Buddy"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
956 gtk_box_pack_start(GTK_BOX(topbox), a->entry, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
957 if (buddy != NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958 gtk_entry_set_text(GTK_ENTRY(a->entry), buddy);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
959
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
960 label = gtk_label_new(_("Group"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
961 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
962 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
963 gtk_box_pack_start(GTK_BOX(topbox), a->combo, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
964
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
965 if (group != NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
966 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
967
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
968 /* And the boxes in the box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
969 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
970 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
971
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
972 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
973 gtk_signal_connect(GTK_OBJECT(a->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
974 GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
975 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
976 GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
977 gtk_signal_connect(GTK_OBJECT(add), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
978 GTK_SIGNAL_FUNC(do_add_buddy), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
979 gtk_signal_connect(GTK_OBJECT(a->entry), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
980 GTK_SIGNAL_FUNC(do_add_buddy), a);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
981 /* Finish up */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
982 gtk_widget_show(add);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
983 gtk_widget_show(cancel);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
984 gtk_widget_show(a->combo);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
985 gtk_widget_show(a->entry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
986 gtk_widget_show(topbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
987 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
988 gtk_widget_show(vbox);
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
989 gtk_widget_show(frame);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
990 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Buddy"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
991 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry);
245
7cdc778e6e55 [gaim-migrate @ 255]
Rob Flynn <gaim@robflynn.com>
parents: 244
diff changeset
992 gtk_container_add(GTK_CONTAINER(frame), vbox);
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
993 gtk_container_add(GTK_CONTAINER(a->window), frame);
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
994 gtk_container_set_border_width(GTK_CONTAINER(a->window), 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
995 gtk_widget_realize(a->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
996 aol_icon(a->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
997
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
998 gtk_widget_show(a->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
999 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1000
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1001
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1002 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1003 /* The dialog for new buddy pounces */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1004 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1005
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1006
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1007 void do_new_bp(GtkWidget *w, struct addbp *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1008 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1009 struct buddy_pounce *bp = g_new0(struct buddy_pounce, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1010
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1011 g_snprintf(bp->name, 80, "%s", gtk_entry_get_text(GTK_ENTRY(b->nameentry)));
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1012 g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry)));
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1013
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1014 if (GTK_TOGGLE_BUTTON(b->openwindow)->active)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015 bp->popup = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1016 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1017 bp->popup = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1018
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1019 if (GTK_TOGGLE_BUTTON(b->sendim)->active)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020 bp->sendim = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1021 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1022 bp->sendim = 0;
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1023
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1024 buddy_pounces = g_list_append(buddy_pounces, bp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1025
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1026 do_bp_menu();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1027
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1028 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1029 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1030 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1031
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1032
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1033 void show_new_bp(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1034 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1035 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1036 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1037 GtkWidget *vbox;
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1038 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1039
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1040 struct addbp *b = g_new0(struct addbp, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1041
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1042 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
458
4f09ffbd2a78 [gaim-migrate @ 468]
Rob Flynn <gaim@robflynn.com>
parents: 455
diff changeset
1043 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1044 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1045 dialogwindows = g_list_prepend(dialogwindows, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1046 bbox = gtk_hbox_new(TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1047 vbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1048 b->nameentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1049 b->messentry = gtk_entry_new();
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1050
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1051 /* Build OK Button */
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1052
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1053 button = picture_button(b->window, _("OK"), ok_xpm);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1054 gtk_signal_connect(GTK_OBJECT(button), "clicked",
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1055 GTK_SIGNAL_FUNC(do_new_bp), b);
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1056 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5);
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1057
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1058 button = picture_button(b->window, _("Cancel"), cancel_xpm);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1059 gtk_signal_connect(GTK_OBJECT(button), "clicked",
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1060 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1061 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5);
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1062
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1063 /* Put the buttons in the box */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1064 label = gtk_label_new(_("Buddy To Pounce:"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1065 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1066 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1067 gtk_box_pack_start(GTK_BOX(vbox), b->nameentry, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1068
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1069 b->openwindow = gtk_check_button_new_with_label(_("Open IM Window on Buddy Logon"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1070 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->openwindow), FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1072 b->sendim = gtk_check_button_new_with_label(_("Send IM on Buddy Logon"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sendim), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 gtk_widget_show(b->openwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 gtk_widget_show(b->sendim);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1077 gtk_box_pack_start(GTK_BOX(vbox), b->openwindow, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1078 gtk_box_pack_start(GTK_BOX(vbox), b->sendim, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1080 label = gtk_label_new(_("Message to send:"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1081 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1082 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1083 gtk_box_pack_start(GTK_BOX(vbox), b->messentry, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1084
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1085
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1086 /* And the boxes in the box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1087 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1088
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1089 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1090 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1091 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1092 gtk_signal_connect(GTK_OBJECT(b->messentry), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1093 GTK_SIGNAL_FUNC(do_new_bp), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1094
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1095
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1096 /* Finish up */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1097 gtk_widget_show(b->nameentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1098 gtk_widget_show(b->messentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1099 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1100 gtk_widget_show(vbox);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1101 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - New Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1102 if (name != NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1103 gtk_entry_set_text(GTK_ENTRY(b->nameentry), name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1104 gtk_window_set_focus(GTK_WINDOW(b->window), b->messentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1105 } else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106 gtk_window_set_focus(GTK_WINDOW(b->window), b->nameentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1107 gtk_container_add(GTK_CONTAINER(b->window), vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 gtk_container_border_width(GTK_CONTAINER(b->window), 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109 gtk_widget_realize(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1111 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1112
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1113
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1114
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1115 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1116 /* The dialog for SET INFO / SET DIR INFO */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1118
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1119 void do_save_info(GtkWidget *widget, struct set_info_dlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1120 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1121 gchar *junk;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1122 char *buf;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1123
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1124 junk = gtk_editable_get_chars(GTK_EDITABLE(b->text), 0, -1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1125
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1126 g_snprintf(current_user->user_info, sizeof(current_user->user_info), "%s", junk);
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1127
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1128 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1129
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 62
diff changeset
1130 buf = g_malloc(strlen(current_user->user_info) * 4);
122
521db4bf5f28 [gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
1131 if (!buf) {
521db4bf5f28 [gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
1132 buf = g_malloc(1);
521db4bf5f28 [gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
1133 buf[0] = 0;
521db4bf5f28 [gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
1134 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135 g_snprintf(buf, strlen(current_user->user_info) * 2, "%s", current_user->user_info);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1136 escape_text(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1137 serv_set_info(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1138 g_free(buf);
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1139 g_free(junk);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1140 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1141 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1142 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1143
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1144 void do_set_dir(GtkWidget *widget, struct set_dir_dlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1145 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1146 char *first = gtk_entry_get_text(GTK_ENTRY(b->first));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1147 int web = GTK_TOGGLE_BUTTON(b->web)->active;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1148 char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1149 char *last = gtk_entry_get_text(GTK_ENTRY(b->last));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1150 char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1151 char *city = gtk_entry_get_text(GTK_ENTRY(b->city));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1152 char *state = gtk_entry_get_text(GTK_ENTRY(b->state));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1153 char *country = gtk_entry_get_text(GTK_ENTRY(b->country));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1154
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1155
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1156 serv_set_dir(first, middle, last, maiden, city, state, country, web);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1157
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1158 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1159 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1160 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1161
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1162 void show_set_dir()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1163 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1164 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1165 GtkWidget *bot;
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1166 GtkWidget *vbox;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1167 GtkWidget *hbox;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1168 GtkWidget *frame;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1169 GtkWidget *fbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1170
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1171 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1172
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1173 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1174 gtk_widget_set_usize(b->window, 300, 320);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1175 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1176 gtk_widget_show(b->window);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1177
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1178 dialogwindows = g_list_prepend(dialogwindows, b->window);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1179
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1180 vbox = gtk_vbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1181 fbox = gtk_vbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1182
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1183 frame = gtk_frame_new(_("Directory Info"));
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1184
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1185 /* Build Save Button */
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1186
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1187 b->save = picture_button(b->window, _("Save"), save_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1188
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1189 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1190
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1191 bot = gtk_hbox_new(TRUE, 10);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1192
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1193 gtk_box_pack_start(GTK_BOX(bot), b->save, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1194 gtk_box_pack_start(GTK_BOX(bot), b->cancel, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1195
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1196 gtk_widget_show(bot);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1197
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1198 b->first = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1199 b->middle = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1200 b->last = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1201 b->maiden = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1202 b->city = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1203 b->state = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1204 b->country = gtk_entry_new();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1205 b->web = gtk_check_button_new_with_label(_("Allow Web Searches To Find Your Info"));
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1206
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1207 /* Line 1 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1208 label = gtk_label_new(_("First Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1209 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1211 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1212 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1213 gtk_box_pack_end(GTK_BOX(hbox), b->first, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1214
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1215 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1216 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1217
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1218 /* Line 2 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1219 label = gtk_label_new(_("Middle Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1220 gtk_widget_show(label);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1221
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1222 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1223 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1224 gtk_box_pack_end(GTK_BOX(hbox), b->middle, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1225
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1226 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1227 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1228
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1229
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1230 /* Line 3 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1231 label = gtk_label_new(_("Last Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232 gtk_widget_show(label);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1233
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1234 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1235 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1236 gtk_box_pack_end(GTK_BOX(hbox), b->last, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1237
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1238 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1239 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1240
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1241 /* Line 4 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1242 label = gtk_label_new(_("Maiden Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1243 gtk_widget_show(label);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1244
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1245 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1246 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1247 gtk_box_pack_end(GTK_BOX(hbox), b->maiden, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1248
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1249 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1250 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1251
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1252 /* Line 5 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1253 label = gtk_label_new(_("City"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1254 gtk_widget_show(label);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1255
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1256 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1257 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1258 gtk_box_pack_end(GTK_BOX(hbox), b->city, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1259
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1260 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1261 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1262
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1263 /* Line 6 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1264 label = gtk_label_new(_("State"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265 gtk_widget_show(label);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1266
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1267 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1268 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1269 gtk_box_pack_end(GTK_BOX(hbox), b->state, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1270
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1271 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1272 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1273
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1274 /* Line 7 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1275 label = gtk_label_new(_("Country"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276 gtk_widget_show(label);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1277
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1278 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1279 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1280 gtk_box_pack_end(GTK_BOX(hbox), b->country, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1281
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1282 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1283 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1284
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1285 /* Line 8 */
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1286
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1287 hbox = gtk_hbox_new(FALSE, 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1288 gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1289 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1290 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1291
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1292 /* And add the buttons */
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1293 gtk_container_add(GTK_CONTAINER(frame), vbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1294 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1295 gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 2);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1296
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1297
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1298 gtk_widget_show(vbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1299 gtk_widget_show(fbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1300
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1301 gtk_widget_show(frame);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1302 gtk_widget_show(b->first);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1303 gtk_widget_show(b->middle);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1304 gtk_widget_show(b->last);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1305 gtk_widget_show(b->maiden);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1306 gtk_widget_show(b->city);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1307 gtk_widget_show(b->state);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1308 gtk_widget_show(b->country);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1309 gtk_widget_show(b->web);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1310
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1311 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1312 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1313 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1314 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1315 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_set_dir), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1317 gtk_container_add(GTK_CONTAINER(b->window), fbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1318 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1319
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1320 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set Dir Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1321 gtk_window_set_focus(GTK_WINDOW(b->window), b->first);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1322 gtk_widget_realize(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1323 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1324
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1325 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1326 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1327
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1328 void do_change_password(GtkWidget *widget, struct passwddlg *b)
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1329 {
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1330 gchar *orig, *new1, *new2;
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1331
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1332 orig = gtk_entry_get_text(GTK_ENTRY(b->original));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1333 new1 = gtk_entry_get_text(GTK_ENTRY(b->new1));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1334 new2 = gtk_entry_get_text(GTK_ENTRY(b->new2));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1335
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1336 if (strcasecmp(new1, new2)) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1337 do_error_dialog(_("New Passwords Do Not Match"), _("Gaim - Change Password Error"));
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1338 return ;
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1339 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1340
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1341 if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1342 do_error_dialog(_("Fill out all fields completely"), _("Gaim - Change Password Error"));
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1343 return;
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1344 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1345
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 236
diff changeset
1346 serv_change_passwd(orig, new1);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1347
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1348 destroy_dialog(NULL, b->window);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1349 g_free(b);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1350 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1351
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1352 void show_change_passwd()
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1353 {
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1354 GtkWidget *hbox;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1355 GtkWidget *label;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1356 GtkWidget *vbox;
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1357 GtkWidget *fbox;
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1358 GtkWidget *frame;
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1359
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1360 struct passwddlg *b = g_new0(struct passwddlg, 1);
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1361
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1362 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
476
48346068df3b [gaim-migrate @ 486]
Rob Flynn <gaim@robflynn.com>
parents: 475
diff changeset
1363 gtk_widget_set_usize(b->window, 325, 195);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1364 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1365 gtk_widget_show(b->window);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1366
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1367 dialogwindows = g_list_prepend(dialogwindows, b->window);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1368
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1369 frame = gtk_frame_new(_("Change Password"));
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1370 fbox = gtk_vbox_new(FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1371
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1372 /* Build OK Button */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1373
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1374 b->ok = picture_button(b->window, _("OK"), ok_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1375 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1376
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1377 /* Create our vbox */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1378 vbox = gtk_vbox_new(FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1379
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1380
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1381 /* First Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1382 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1383 label = gtk_label_new(_("Original Password"));
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1384 gtk_widget_show(label);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1385
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1386 b->original = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1387 gtk_entry_set_visibility(GTK_ENTRY(b->original), FALSE);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1388 gtk_widget_show(b->original);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1389
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1390 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1391 gtk_box_pack_end(GTK_BOX(hbox), b->original, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1392
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1393 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1394
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1395 gtk_widget_show(hbox);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1396
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1397 /* Next Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1398 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1399 label = gtk_label_new(_("New Password"));
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1400 gtk_widget_show(label);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1401 b->new1 = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1402 gtk_entry_set_visibility(GTK_ENTRY(b->new1), FALSE);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1403 gtk_widget_show(b->new1);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1404
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1405 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1406 gtk_box_pack_end(GTK_BOX(hbox), b->new1, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1407
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1408 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1409 gtk_widget_show(hbox);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1410
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1411 /* Next Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1412 hbox = gtk_hbox_new(FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1413 label = gtk_label_new(_("New Password (again)"));
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1414 gtk_widget_show(label);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1415 b->new2 = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1416 gtk_entry_set_visibility(GTK_ENTRY(b->new2), FALSE);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1417 gtk_widget_show(b->new2);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1418
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1419 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1420 gtk_box_pack_end(GTK_BOX(hbox), b->new2, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1421
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1422 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1423
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1424 gtk_widget_show(hbox);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1425
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1426 /* Now do our row of buttons */
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1427 hbox = gtk_hbox_new(TRUE, TRUE);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1428 gtk_box_pack_start(GTK_BOX(hbox), b->ok, FALSE, FALSE, 5);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1429 gtk_box_pack_start(GTK_BOX(hbox), b->cancel, FALSE, FALSE, 5);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1430
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1431 gtk_widget_show(hbox);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1432
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1433 /* Pack our entries into a frame */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1434 gtk_container_add(GTK_CONTAINER(frame), vbox);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1435
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1436 /* Add our frame to our frame box */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1437 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1438
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1439 /* And add our row of buttons */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1440 gtk_box_pack_start(GTK_BOX(fbox), hbox, FALSE, FALSE, 5);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1441
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1442
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1443 gtk_widget_show(vbox);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1444 gtk_widget_show(frame);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1445 gtk_widget_show(fbox);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1446
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1447 gtk_container_add(GTK_CONTAINER(b->window), fbox);
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1448
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1449 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1450 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Password Change"));
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1451
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1452 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1453 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1454 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked",
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1455 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1456 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked",
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1457 GTK_SIGNAL_FUNC(do_change_password), b);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1458
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1459
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1460 }
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1461
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1462 void show_set_info()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1463 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1464 GtkWidget *bot;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1465 GtkWidget *top;
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1466
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1467 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1468
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1469 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1470 dialogwindows = g_list_prepend(dialogwindows, b->window);
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1471 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1472
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1473 bot = gtk_hbox_new(TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1474 top = gtk_vbox_new(FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1475
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1476 /* Build OK Button */
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1477
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1478 b->save = picture_button(b->window, _("Save"), save_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1479 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1480
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1481 gtk_box_pack_start(GTK_BOX(bot), b->save, FALSE, FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1482 gtk_box_pack_start(GTK_BOX(bot), b->cancel, FALSE, FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1483
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1484 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1485 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1486 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1487 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1488 gtk_signal_connect(GTK_OBJECT(b->save), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1489 GTK_SIGNAL_FUNC(do_save_info), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1490
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1491 gtk_widget_show(bot);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1492
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1493
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1494 b->text = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1495 gtk_text_set_word_wrap(GTK_TEXT(b->text), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1496 gtk_text_set_editable(GTK_TEXT(b->text), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1497 gtk_widget_set_usize(b->text, 350, 100);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1498 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, current_user->user_info, -1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1499
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1500 gtk_widget_show(b->text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1501
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1502 gtk_box_pack_start(GTK_BOX(top), b->text, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1503 gtk_widget_show(top);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1504
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1505 gtk_box_pack_start(GTK_BOX(top), bot, FALSE, FALSE, 10);
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1506
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1507 gtk_container_add(GTK_CONTAINER(b->window), top);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1508 gtk_container_border_width(GTK_CONTAINER(b->window), 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1509 gtk_widget_realize(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1510 aol_icon(b->window->window);
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1511
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1512 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1513 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1514
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1515 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1516
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1517 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1518 /* The dialog for registration information */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1519 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1520
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1521 void do_register_dialog(GtkWidget *widget, struct registerdlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1522 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1523 char *email = gtk_entry_get_text(GTK_ENTRY(b->email));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1524 char *name = gtk_entry_get_text(GTK_ENTRY(b->name));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1525 int uname = GTK_TOGGLE_BUTTON(b->uname)->active;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1526 int sname = GTK_TOGGLE_BUTTON(b->sname)->active;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1527 char *country = gtk_entry_get_text(GTK_ENTRY(b->country));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1528
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1529 general_options |= OPT_GEN_REGISTERED;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1530 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1531
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1532 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1533
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1534 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1535
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1536 g_sendemail(name, email, uname, sname, country);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1537 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1538
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1539 void set_reg_flag(GtkWidget *widget, struct registerdlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1540 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1541 general_options |= OPT_GEN_REGISTERED;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1542 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1543 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1544 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1545 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1546
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1547 void show_register_dialog()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1548 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1549 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1550 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1551 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1552 GtkWidget *table;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1553 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1554 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1555
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1556 struct registerdlg *b = g_new0(struct registerdlg, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1557 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1558 dialogwindows = g_list_prepend(dialogwindows, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1559
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1560 cancel = gtk_button_new_with_label(_("Cancel"));
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1561 ok = gtk_button_new_with_label(_("Send"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1562
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1563 bbox = gtk_hbox_new(TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1564 table = gtk_table_new(6, 2, TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1565 vbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1566
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1567 b->name = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1568 b->email = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1569 b->uname = gtk_check_button_new_with_label("Send the output of uname -a with registration");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1570 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->uname), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1571 b->sname = gtk_check_button_new_with_label("Send my screenname with registration");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1572 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sname), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1573 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1574 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1575
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1576 label = gtk_label_new("This list will not, in any way, be distributed and\nwill be used for internal census purposes only.\nAll fields are completely optional.");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1577 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1578 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 2, 0, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1579
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1580 label = gtk_label_new("Name");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1581 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1582 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1583 gtk_table_attach_defaults(GTK_TABLE(table), b->name, 1, 2, 1, 2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1584
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1585 label = gtk_label_new("Email");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1586 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1587 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1588 gtk_table_attach_defaults(GTK_TABLE(table), b->email, 1, 2, 2, 3);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1589
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1590 label = gtk_label_new("Country");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1591 b->country = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1592 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1593 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1594 gtk_table_attach_defaults(GTK_TABLE(table), b->country, 1, 2, 3, 4);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1595
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1596 gtk_table_attach_defaults(GTK_TABLE(table), b->sname, 0, 2, 4, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1597 gtk_table_attach_defaults(GTK_TABLE(table), b->uname, 0, 2, 5, 6);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1598
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1599 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1600 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1601
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1602 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1603 {
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1604 gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1605 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1606 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1607
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1608 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1609 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1611 GTK_SIGNAL_FUNC(set_reg_flag), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1612 gtk_signal_connect(GTK_OBJECT(ok), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1613 GTK_SIGNAL_FUNC(do_register_dialog), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1614
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1615 gtk_widget_show(ok);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1616 gtk_widget_show(cancel);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1617 gtk_widget_show(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1618 gtk_widget_show(b->email);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1619 gtk_widget_show(b->uname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1620 gtk_widget_show(b->sname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1621 gtk_widget_show(b->country);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1622 gtk_widget_show(table);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1623 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1624 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1625 gtk_window_set_title(GTK_WINDOW(b->window), "Gaim - Registration");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1626 gtk_window_set_focus(GTK_WINDOW(b->window), b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1627 gtk_container_add(GTK_CONTAINER(b->window), vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1628 gtk_container_border_width(GTK_CONTAINER(b->window), 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1629 gtk_widget_realize(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1630 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1631
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1632 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1633 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1634
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1635
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1636 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1637 /* The dialog for the info requests */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1638 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1639
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1640 void g_show_info_text(char *info)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1641 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1642 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1643 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1644 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1645 GtkWidget *bbox;
619
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1646 GtkWidget *button_box;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1647 GtkWidget *sw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1648
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1649 struct info_dlg *b = g_new0(struct info_dlg, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1650
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1651 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1652 dialogwindows = g_list_prepend(dialogwindows, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1653 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1654 bbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1655 gtk_container_add(GTK_CONTAINER(b->window), bbox);
619
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1656 button_box = gtk_hbox_new(FALSE, 5);
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1657 gtk_widget_realize(GTK_WIDGET(b->window));
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1658 ok = picture_button(b->window, _("OK"), ok_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1659 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1660 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1661 gtk_signal_connect(GTK_OBJECT(ok), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1662 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1663
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1664 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1665 gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
1666
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1667 label = gtk_label_new(_("Below are the results of your search: "));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1668
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1669 sw = gtk_scrolled_window_new (NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1670 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1671 GTK_POLICY_NEVER,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1672 GTK_POLICY_ALWAYS);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1673 text = gtk_html_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1674 b->text = text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1675 gtk_container_add(GTK_CONTAINER(sw), text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1676
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1677 GTK_HTML (text)->hadj->step_increment = 10.0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1678 GTK_HTML (text)->vadj->step_increment = 10.0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1679 gtk_widget_set_usize(sw, 300, 250);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1680
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1681 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1682 gtk_box_pack_start(GTK_BOX(bbox), sw, TRUE, TRUE, 0);
651
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
1683 gtk_box_pack_start(GTK_BOX(bbox), ok, FALSE, FALSE, 0);
619
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1684 /* gtk_box_pack_start(GTK_BOX(button_box), ok, FALSE, FALSE, 0);*/
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1685
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1686 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1687 gtk_widget_show_all(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1688
602
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 595
diff changeset
1689 if (display_options & OPT_DISP_SHOW_SMILEY)
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 595
diff changeset
1690 write_html_with_smileys(b->window, b->text, info);
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 595
diff changeset
1691 else
02ea095a972a [gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 595
diff changeset
1692 gtk_html_append_text(GTK_HTML(b->text), info, 0);
653
c8a3bf382108 [gaim-migrate @ 663]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 652
diff changeset
1693 gtk_html_append_text(GTK_HTML(b->text), "</BODY>", 0);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 334
diff changeset
1694
550
6bd2bbc1b6c8 [gaim-migrate @ 560]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
1695 gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw)), 0);
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1696 }
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1697
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1698 void g_show_info(char *url) {
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1699 char *url_text = grab_url(url);
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1700 g_show_info_text(url_text);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1701 g_free(url_text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1702 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1703
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1704 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1705 /* The dialog for adding to permit/deny */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1706 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1707
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1708
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1709 static void do_add_perm(GtkWidget *w, struct addperm *p)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1710 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1711
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1712 char *who;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1713 char *name;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1714 int d = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1715 GSList *buttons = p->buttons;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1716
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1717
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1718 who = gtk_entry_get_text(GTK_ENTRY(p->entry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1719
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1720 name = g_malloc(strlen(who) + 2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1721 g_snprintf(name, strlen(who) + 2, "%s", who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1722
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1723 while(buttons) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1724 if((int)gtk_object_get_user_data(GTK_OBJECT(buttons->data)) == 1) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1725 if (GTK_TOGGLE_BUTTON(buttons->data)->active)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1726 d = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1727 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1728 buttons = buttons->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1729 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1730
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1731 if (d) {
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1732 GList *d = deny;
676
9c49d2456773 [gaim-migrate @ 686]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 675
diff changeset
1733 char *n = g_strdup(normalize(name));
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1734 while (d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1735 if (!strcmp(n, normalize(d->data)))
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1736 break;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1737 d = d->next;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1738 }
676
9c49d2456773 [gaim-migrate @ 686]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 675
diff changeset
1739 g_free(n);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1740 if (!d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1741 deny = g_list_append(deny, name);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1742 serv_add_deny(name);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1743 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1744 } else {
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1745 GList *d = permit;
676
9c49d2456773 [gaim-migrate @ 686]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 675
diff changeset
1746 char *n = g_strdup(normalize(name));
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1747 while (d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1748 if (!strcmp(n, normalize(d->data)))
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1749 break;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1750 d = d->next;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1751 }
676
9c49d2456773 [gaim-migrate @ 686]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 675
diff changeset
1752 g_free(n);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1753 if (!d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1754 permit = g_list_append(permit, name);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1755 serv_add_permit(name);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
1756 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1757 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1758
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1759
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1760
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1761 build_permit_tree();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1762
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1763 serv_save_config();
300
b32c83750104 [gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 296
diff changeset
1764 do_export(0, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1765
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1766 destroy_dialog(NULL, p->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1767 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1768
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1769
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1770
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1771 void show_add_perm(char *who)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1772 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1773 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1774 GtkWidget *add;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1775 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1776 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1777 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1778 GtkWidget *rbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1779 GtkWidget *topbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1780 GtkWidget *which;
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1781 GtkWidget *frame;
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1782
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1783 struct addperm *p = g_new0(struct addperm, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1784
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1785 p->window = gtk_window_new(GTK_WINDOW_DIALOG);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1786 gtk_container_set_border_width(GTK_CONTAINER(p->window), 5);
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1787 gtk_widget_set_usize(p->window, 310, 130);
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1788 gtk_window_set_policy(GTK_WINDOW(p->window), FALSE, FALSE, TRUE);
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1789 gtk_widget_show(p->window);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1790
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1791 dialogwindows = g_list_prepend(dialogwindows, p->window);
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1792
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1793 bbox = gtk_hbox_new(TRUE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1794 topbox = gtk_hbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1795 vbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1796 rbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1797 p->entry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1798
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1799 frame = gtk_frame_new(_("Permit / Deny"));
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1800
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1801 /* Build Add Button */
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1802
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1803 add = picture_button(p->window, _("Add"), add_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1804 cancel = picture_button(p->window, _("Cancel"), cancel_xpm);
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1805
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1806 /* End of Cancel Button */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1807 if (who != NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1808 gtk_entry_set_text(GTK_ENTRY(p->entry), who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1809
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1810 which = gtk_radio_button_new_with_label(NULL, _("Deny"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1811 gtk_box_pack_start(GTK_BOX(rbox), which, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1812 gtk_object_set_user_data(GTK_OBJECT(which), (int *)1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1813 gtk_widget_show(which);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1814
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1815 which = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(which)), _("Permit"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1816 gtk_box_pack_start(GTK_BOX(rbox), which, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1817 gtk_object_set_user_data(GTK_OBJECT(which), (int *)2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1818 gtk_widget_show(which);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1819
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1820 /* Put the buttons in the box */
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1821
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1822 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1823 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1824
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1825 label = gtk_label_new(_("Add"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1826 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1827 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1828 gtk_box_pack_start(GTK_BOX(topbox), p->entry, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1829 gtk_box_pack_start(GTK_BOX(topbox), rbox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1830 /* And the boxes in the box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1831 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1832 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1833 gtk_container_add(GTK_CONTAINER(frame), vbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1834
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1835
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1836 p->buttons = gtk_radio_button_group(GTK_RADIO_BUTTON(which));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1837 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1838 gtk_signal_connect(GTK_OBJECT(p->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1839 GTK_SIGNAL_FUNC(destroy_dialog), p->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1840 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1841 GTK_SIGNAL_FUNC(destroy_dialog), p->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1842 gtk_signal_connect(GTK_OBJECT(add), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1843 GTK_SIGNAL_FUNC(do_add_perm), p);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1844 gtk_signal_connect(GTK_OBJECT(p->entry), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1845 GTK_SIGNAL_FUNC(do_add_perm), p);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1846
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1847 /* Finish up */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1848 gtk_widget_show(add);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1849 gtk_widget_show(cancel);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1850 gtk_widget_show(p->entry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1851 gtk_widget_show(topbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1852 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1853 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1854 gtk_widget_show(rbox);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1855 gtk_widget_show(frame);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1856 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Permit/Deny"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1857 gtk_window_set_focus(GTK_WINDOW(p->window), p->entry);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1858 gtk_container_add(GTK_CONTAINER(p->window), frame);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1859 gtk_widget_realize(p->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1860 aol_icon(p->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1861
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1862 gtk_widget_show(p->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1863 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1864
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1865
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1866 /*------------------------------------------------------------------------*/
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1867 /* Functions Called To Add A Log */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1868 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1869
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1870 void cancel_log(GtkWidget *widget, struct conversation *c)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1871 {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1872 if (c->wood)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1873 {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1874 set_state_lock(1);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1875 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1876 set_state_lock(0);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1877 }
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1878 dialogwindows = g_list_remove(dialogwindows, c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1879 gtk_widget_destroy(c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1880 c->log_dialog = NULL;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1881 }
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1882
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1883 void do_log(GtkWidget *w, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1884 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1885 struct log_conversation *l;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1886 char buf[128];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1887
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1888 if (!find_log_info(c->name)) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1889 l = (struct log_conversation *)g_new0(struct log_conversation, 1);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1890 strcpy(l->name, c->name);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1891 strcpy(l->filename, gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->log_dialog)));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1892 log_conversations = g_list_append(log_conversations, l);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1893
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1894 if (c != NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1895 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1896 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1897 gtk_window_set_title(GTK_WINDOW(c->window), buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1898 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1899 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1900
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1901 save_prefs();
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1902 cancel_log(NULL, c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1903 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1904
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1905 void show_log_dialog(struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1906 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1907 char *buf = g_malloc(BUF_LEN);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1908
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1909 if (!c->log_dialog) {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1910 c->log_dialog = gtk_file_selection_new(_("Gaim - Log Conversation"));
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1911
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1912 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(c->log_dialog));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1913
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1914 g_snprintf(buf, BUF_LEN - 1, "%s/%s.log", getenv("HOME"), c->name);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1915 gtk_object_set_user_data(GTK_OBJECT(c->log_dialog), "log dialog");
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1916 gtk_file_selection_set_filename(GTK_FILE_SELECTION(c->log_dialog), buf);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1917 gtk_signal_connect(GTK_OBJECT(c->log_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1918 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_log), c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1919 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC(cancel_log), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1920 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1921
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1922 g_free(buf);
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1923
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1924 gtk_widget_show(c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1925 gdk_window_raise(c->log_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1926 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1927
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1928 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1929 /* Find Buddy By Email */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1930 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1931
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1932 void do_find_info(GtkWidget *w, struct findbyinfo *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1933 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1934 char *first;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1935 char *middle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1936 char *last;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1937 char *maiden;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1938 char *city;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1939 char *state;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1940 char *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1941
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1942 first = gtk_entry_get_text(GTK_ENTRY(b->firstentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1943 middle = gtk_entry_get_text(GTK_ENTRY(b->middleentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1944 last = gtk_entry_get_text(GTK_ENTRY(b->lastentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1945 maiden = gtk_entry_get_text(GTK_ENTRY(b->maidenentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1946 city = gtk_entry_get_text(GTK_ENTRY(b->cityentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1947 state = gtk_entry_get_text(GTK_ENTRY(b->stateentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1948 country = gtk_entry_get_text(GTK_ENTRY(b->countryentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1949
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1950 serv_dir_search(first, middle, last, maiden, city, state, country, "");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1951 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1952 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1953
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1954 void do_find_email(GtkWidget *w, struct findbyemail *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1955 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1956 char *email;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1957
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1958 email = gtk_entry_get_text(GTK_ENTRY(b->emailentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1959
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1960 serv_dir_search("","","","","","","", email);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1961
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1962 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1963 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1964
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1965 void show_find_info()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1966 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1967 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1968 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1969 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1970 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1971 GtkWidget *vbox;
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1972 GtkWidget *hbox;
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1973 GtkWidget *fbox;
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1974 GtkWidget *frame;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1975
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1976 struct findbyinfo *b = g_new0(struct findbyinfo, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1977 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
480
320c2f9c0315 [gaim-migrate @ 490]
Rob Flynn <gaim@robflynn.com>
parents: 479
diff changeset
1978 gtk_widget_set_usize(b->window, 350, 320);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1979 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1980 gtk_widget_show(b->window);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1981
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1982 dialogwindows = g_list_prepend(dialogwindows, b->window);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1983
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1984
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1985 frame = gtk_frame_new(_("Search for Buddy"));
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1986 fbox = gtk_vbox_new(FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1987
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1988 /* Build OK Button */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1989
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1990 ok = picture_button(b->window, _("OK"), ok_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1991 cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1992
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1993 bbox = gtk_hbox_new(TRUE, 10);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1994 vbox = gtk_vbox_new(FALSE, 2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1995
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1996 b->firstentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1997 b->middleentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1998 b->lastentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1999 b->maidenentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2000 b->cityentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2001 b->stateentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2002 b->countryentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2003
595
3fd5311a3894 [gaim-migrate @ 605]
Todd Kulesza <fflewddur>
parents: 593
diff changeset
2004 gtk_box_pack_start(GTK_BOX(bbox), ok, FALSE, FALSE, 10);
483
1a9d2b345b79 [gaim-migrate @ 493]
Rob Flynn <gaim@robflynn.com>
parents: 480
diff changeset
2005 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2006
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2007 /* Line 1 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2008 label = gtk_label_new(_("First Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2009 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2010
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2011 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2012 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2013 gtk_box_pack_end(GTK_BOX(hbox), b->firstentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2014
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2015 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2016 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2017
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2018 /* Line 2 */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2019
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2020 label = gtk_label_new(_("Middle Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2021 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2022
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2023 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2024 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2025 gtk_box_pack_end(GTK_BOX(hbox), b->middleentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2026
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2027 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2028 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2029
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2030 /* Line 3 */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2031
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2032 label = gtk_label_new(_("Last Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2033 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2034
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2035 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2036 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2037 gtk_box_pack_end(GTK_BOX(hbox), b->lastentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2038
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2039 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2040 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2041
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2042 /* Line 4 */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2043
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2044 label = gtk_label_new(_("Maiden Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2045 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2046
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2047 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2048 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2049 gtk_box_pack_end(GTK_BOX(hbox), b->maidenentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2050
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2051 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2052 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2053
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2054 /* Line 5 */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2055
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2056 label = gtk_label_new(_("City"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2057 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2058
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2059 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2060 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2061 gtk_box_pack_end(GTK_BOX(hbox), b->cityentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2062
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2063 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2064 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2065
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2066 /* Line 6 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2067 label = gtk_label_new(_("State"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2068 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2069
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2070 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2071 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2072 gtk_box_pack_end(GTK_BOX(hbox), b->stateentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2073
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2074 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2075 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2076
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2077 /* Line 7 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2078 label = gtk_label_new(_("Country"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2079 gtk_widget_show(label);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2080
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2081 hbox = gtk_hbox_new(FALSE, 2);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2082 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2083 gtk_box_pack_end(GTK_BOX(hbox), b->countryentry, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2084
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2085 gtk_widget_show(hbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2086 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2087
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2088 /* Merge The Boxes */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2089
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2090 gtk_container_add(GTK_CONTAINER(frame), vbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2091 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2092 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2093
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2094 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2095 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2096 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2097 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2098 gtk_signal_connect(GTK_OBJECT(ok), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2099 GTK_SIGNAL_FUNC(do_find_info), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2100
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2101 gtk_widget_show(ok);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2102 gtk_widget_show(cancel);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2103 gtk_widget_show(b->firstentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2104 gtk_widget_show(b->middleentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2105 gtk_widget_show(b->lastentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2106 gtk_widget_show(b->maidenentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2107 gtk_widget_show(b->cityentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2108 gtk_widget_show(b->stateentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2109 gtk_widget_show(b->countryentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2110 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2111 gtk_widget_show(vbox);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2112 gtk_widget_show(frame);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2113 gtk_widget_show(fbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2114
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2115 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2116 gtk_window_set_focus(GTK_WINDOW(b->window), b->firstentry);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2117 gtk_container_add(GTK_CONTAINER(b->window), fbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2118 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2119 gtk_widget_realize(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2120 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2121
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2122 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2123 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2124
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2125 void show_find_email()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2126 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2127 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2128 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2129 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2130 GtkWidget *topbox;
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2131 GtkWidget *frame;
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2132 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2133
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2134 struct findbyemail *b = g_new0(struct findbyemail, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2135 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
477
73abe7a50119 [gaim-migrate @ 487]
Rob Flynn <gaim@robflynn.com>
parents: 476
diff changeset
2136 gtk_widget_set_usize(b->window, 240, 110);
478
62595dbc99aa [gaim-migrate @ 488]
Rob Flynn <gaim@robflynn.com>
parents: 477
diff changeset
2137 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2138 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2139 dialogwindows = g_list_prepend(dialogwindows, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2140
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2141 frame = gtk_frame_new(_("Search for Buddy"));
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2142
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2143 bbox = gtk_hbox_new(TRUE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2144 topbox = gtk_hbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2145 vbox = gtk_vbox_new(FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2146
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2147 b->emailentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2148
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2149 /* Build OK Button */
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2150
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2151 button = picture_button(b->window, _("OK"), ok_xpm);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2152 gtk_signal_connect(GTK_OBJECT(button), "clicked",
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2153 GTK_SIGNAL_FUNC(do_find_email), b);
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2154 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5);
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2155
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2156 button = picture_button(b->window, _("Cancel"), cancel_xpm);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2157 gtk_signal_connect(GTK_OBJECT(button), "clicked",
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2158 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2159 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5);
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2160
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2161 label = gtk_label_new(_("Email"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2162 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2163 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2164 gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2165
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2166 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2167 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2168
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2169 gtk_signal_connect(GTK_OBJECT(b->window), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2170 GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2171 gtk_signal_connect(GTK_OBJECT(b->emailentry), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2172 GTK_SIGNAL_FUNC(do_find_email), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2173
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2174 gtk_container_add(GTK_CONTAINER(frame), vbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2175 gtk_widget_show(b->emailentry);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2176 gtk_widget_show(frame);
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2177 gtk_widget_show(topbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2178 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2179 gtk_widget_show(vbox);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2180 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Email"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2181 gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2182 gtk_container_add(GTK_CONTAINER(b->window), frame);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2183 gtk_container_border_width(GTK_CONTAINER(b->window), 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2184 gtk_widget_realize(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2185 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2186
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2187 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2188 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2189
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2190 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2191 /* Link Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2192 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2193
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2194 void cancel_link(GtkWidget *widget, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2195 {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2196 if (c->link) {
62
03b65653798b [gaim-migrate @ 72]
Rob Flynn <gaim@robflynn.com>
parents: 61
diff changeset
2197 set_state_lock(1);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2198 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->link), FALSE);
62
03b65653798b [gaim-migrate @ 72]
Rob Flynn <gaim@robflynn.com>
parents: 61
diff changeset
2199 set_state_lock(0);
03b65653798b [gaim-migrate @ 72]
Rob Flynn <gaim@robflynn.com>
parents: 61
diff changeset
2200 }
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2201 destroy_dialog(NULL, c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2202 c->link_dialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2203 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2204
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2205 void do_add_link(GtkWidget *widget, struct linkdlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2206 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2207 char *open_tag;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2208 char *urltext, *showtext;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2209 open_tag = g_malloc(2048);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2210
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2211
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2212 urltext = gtk_entry_get_text(GTK_ENTRY(b->url));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2213 showtext = gtk_entry_get_text(GTK_ENTRY(b->text));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2214
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2215 g_snprintf(open_tag, 2048, "<A HREF=\"%s\">%s", urltext, showtext);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2216 surround(b->entry, open_tag, "</A>");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2217
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2218 g_free(open_tag);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2219 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2220 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2221
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2222
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2223 void show_add_link(GtkWidget *linky, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2224 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2225 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2226 GtkWidget *bbox;
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2227 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2228 GtkWidget *label;
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2229 GtkWidget *frame;
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2230 GtkWidget *fbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2231
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2232 if (!c->link_dialog) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2233 struct linkdlg *b = g_new0(struct linkdlg, 1);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2234 c->link_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2235 dialogwindows = g_list_prepend(dialogwindows, c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2236
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2237 gtk_widget_set_usize(c->link_dialog, 270, 165);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2238 gtk_window_set_policy(GTK_WINDOW(c->link_dialog), FALSE, FALSE, TRUE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2239 gtk_widget_show(c->link_dialog);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2240
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2241 vbox = gtk_vbox_new(FALSE, 10);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2242 bbox = gtk_hbox_new(TRUE, 10);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2243 frame = gtk_frame_new(_("Insert Link"));
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2244 fbox = gtk_vbox_new(FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2245
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2246 /* Build OK Button */
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2247
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2248 b->ok = picture_button(c->link_dialog, _("OK"), ok_xpm);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2249 b->cancel = picture_button(c->link_dialog, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2250
651
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2251 gtk_widget_set_usize(b->ok, 75, 30);
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2252 gtk_widget_set_usize(b->cancel, 75, 30);
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2253
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2254 gtk_box_pack_start(GTK_BOX(bbox), b->ok, FALSE, FALSE, 10);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2255 gtk_box_pack_end(GTK_BOX(bbox), b->cancel, FALSE, FALSE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2256 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2257
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2258 b->url = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2259 b->text = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2260
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2261 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2262 label = gtk_label_new(_("URL"));
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2263 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2264 gtk_box_pack_end(GTK_BOX(hbox), b->url, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2265 gtk_widget_show(label);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2266 gtk_widget_show(hbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2267 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2268
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2269 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2270 label = gtk_label_new(_("Description"));
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2271 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2272 gtk_box_pack_end(GTK_BOX(hbox), b->text, FALSE, FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2273 gtk_widget_show(label);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2274 gtk_widget_show(hbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2275 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2276
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2277 gtk_widget_show(b->url);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2278 gtk_widget_show(b->text);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2279 gtk_widget_show(frame);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2280 gtk_widget_show(fbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2281
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2282 gtk_container_add(GTK_CONTAINER(frame), vbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2283 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2284 gtk_box_pack_start(GTK_BOX(fbox), bbox, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2285 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2286
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2287 gtk_signal_connect(GTK_OBJECT(c->link_dialog), "destroy",
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2288 GTK_SIGNAL_FUNC(cancel_link), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2289 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked",
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2290 GTK_SIGNAL_FUNC(cancel_link), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2291 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2292 GTK_SIGNAL_FUNC(do_add_link), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2293
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2294 gtk_container_add(GTK_CONTAINER(c->link_dialog ), fbox);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2295 gtk_container_border_width(GTK_CONTAINER(c->link_dialog ), 10);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2296 gtk_window_set_title(GTK_WINDOW(c->link_dialog ), _("GAIM - Add URL"));
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2297 gtk_window_set_focus(GTK_WINDOW(c->link_dialog ), b->url);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2298 b->window = c->link_dialog;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2299 b->toggle = linky;
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 609
diff changeset
2300 b->entry = c->entry;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2301 gtk_widget_realize(c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2302 aol_icon(c->link_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2303
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2304 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2305
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2306 gtk_widget_show(c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2307 gdk_window_raise(c->link_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2308 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2309
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2310
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2311 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2312 /* Color Selection Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2313 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2314
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2315 static GtkWidget *fgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2316 static GtkWidget *bgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2317
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2318 void cancel_color(GtkWidget *widget, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2319 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2320 if (c->palette && widget)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2321 {
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2322 set_state_lock(1);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2323 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->palette), FALSE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2324 set_state_lock(0);
61
72e6a6eb1852 [gaim-migrate @ 71]
Rob Flynn <gaim@robflynn.com>
parents: 38
diff changeset
2325 }
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2326 dialogwindows = g_list_remove(dialogwindows, c->color_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2327 gtk_widget_destroy(c->color_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2328 c->color_dialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2329 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2330
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2331 void do_color(GtkWidget *widget, GtkColorSelection *colorsel)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2332 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2333 gdouble color[3];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2334 GdkColor text_color;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2335 struct conversation *c;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2336 char *open_tag;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2337
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2338 open_tag = g_malloc(30);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2339
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2340 gtk_color_selection_get_color (colorsel, color);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2341
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2342 c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
411
a330017b3aa4 [gaim-migrate @ 421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 401
diff changeset
2343 /* GTK_IS_EDITABLE(c->entry); huh? */
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2344
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2345 text_color.red = ((guint16)(color[0]*65535))>>8;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2346 text_color.green = ((guint16)(color[1]*65535))>>8;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2347 text_color.blue = ((guint16)(color[2]*65535))>>8;
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
2348 c->fgcol = text_color;
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
2349 c->hasfg = 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2350
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2351 g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green, text_color.blue);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2352 surround(c->entry, open_tag, "</FONT>");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2353 sprintf(debug_buff,"#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2354 debug_print(debug_buff);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2355 g_free(open_tag);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2356 cancel_color(NULL, c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2357 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2358
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2359 static void destroy_colorsel(GtkWidget *w, gpointer d)
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2360 {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2361 if (d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2362 gtk_widget_destroy(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2363 fgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2364 } else {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2365 gtk_widget_destroy(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2366 bgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2367 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2368 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2369
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2370 static void apply_color_dlg(GtkWidget *w, gpointer d)
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2371 {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2372 gdouble color[3];
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2373 if ((int)d == 1) {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2374 gtk_color_selection_get_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), color);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2375 destroy_colorsel(NULL, (void *)1);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2376
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 684
diff changeset
2377 fgcolor.red = ((guint16)(color[0]*65535))>>8;
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 684
diff changeset
2378 fgcolor.green = ((guint16)(color[1]*65535))>>8;
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 684
diff changeset
2379 fgcolor.blue = ((guint16)(color[2]*65535))>>8;
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2380 } else {
675
b77c039c9d3d [gaim-migrate @ 685]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
2381 gtk_color_selection_get_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), color);
b77c039c9d3d [gaim-migrate @ 685]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
2382 destroy_colorsel(NULL, (void *)0);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2383
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 684
diff changeset
2384 bgcolor.red = ((guint16)(color[0]*65535))>>8;
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 684
diff changeset
2385 bgcolor.green = ((guint16)(color[1]*65535))>>8;
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 684
diff changeset
2386 bgcolor.blue = ((guint16)(color[2]*65535))>>8;
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2387 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2388 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2389
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2390 void show_color_dialog(struct conversation *c, GtkWidget *color)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2391 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2392 GtkWidget *colorsel;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2393
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2394 if ((int)color == 1) { /* foreground */
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2395 if (fgcseld) return;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2396 fgcseld = gtk_color_selection_dialog_new(_("Select Text Color"));
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2397 gtk_signal_connect(GTK_OBJECT(fgcseld), "delete_event", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2398 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2399 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_color_dlg), (void *)1);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2400 gtk_widget_realize(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2401 aol_icon(fgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2402 gtk_widget_show(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2403 gdk_window_raise(fgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2404 return;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2405 } else if ((int)color == 2) { /* background */
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2406 if (bgcseld) return;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2407 bgcseld = gtk_color_selection_dialog_new(_("Select Background Color"));
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2408 gtk_signal_connect(GTK_OBJECT(bgcseld), "delete_event", GTK_SIGNAL_FUNC(destroy_colorsel), NULL);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2409 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), NULL);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2410 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_color_dlg), (void *)2);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2411 gtk_widget_realize(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2412 aol_icon(bgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2413 gtk_widget_show(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2414 gdk_window_raise(bgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2415 return;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2416 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2417
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2418 if (!c->color_dialog)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2419 {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2420 c->color_dialog = gtk_color_selection_dialog_new(_("Select Text Color"));
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2421 colorsel = GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->colorsel;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2422
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2423 gtk_object_set_user_data(GTK_OBJECT(colorsel), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2424
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2425 gtk_signal_connect(GTK_OBJECT(c->color_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2426 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_color), colorsel);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2427 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC(cancel_color), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2428
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2429 gtk_widget_realize(c->color_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2430 aol_icon(c->color_dialog->window);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2431 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2432
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2433 gtk_widget_show(c->color_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2434 gdk_window_raise(c->color_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2435 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2436
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2437 /*------------------------------------------------------------------------*/
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2438 /* Font Selection Dialog */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2439 /*------------------------------------------------------------------------*/
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2440
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2441 void cancel_font(GtkWidget *widget, struct conversation *c)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2442 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2443 if (c->font && widget)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2444 {
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2445 set_state_lock(1);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2446 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2447 set_state_lock(0);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2448 }
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2449 dialogwindows = g_list_remove(dialogwindows, c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2450 gtk_widget_destroy(c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2451 c->font_dialog = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2452 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2453
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2454 void apply_font(GtkWidget *widget, GtkFontSelection *fontsel)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2455 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2456 /* this could be expanded to include font size, weight, etc.
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2457 but for now only works with font face */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2458 int i, j = 0, k = 0;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2459 char *fontname;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2460 char font[64];
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2461 struct conversation *c = gtk_object_get_user_data(GTK_OBJECT(fontsel));
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2462
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2463 if (c)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2464 {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2465 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel));
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2466
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2467 for (i = 0; i < strlen(fontname); i++)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2468 {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2469 if (fontname[i] == '-')
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2470 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2471 if (++j > 2)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2472 break;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2473 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2474 else if (j == 2)
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2475 font[k++] = fontname[i];
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2476 }
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2477 font[k] = '\0';
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2478
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2479 sprintf(debug_buff, "Setting font face %s\n", font);
488
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 487
diff changeset
2480 debug_print(debug_buff);
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 487
diff changeset
2481
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2482 set_font_face(font, c);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2483 }
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2484 else
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2485 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2486 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel));
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2487
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2488 for (i = 0; i < strlen(fontname); i++)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2489 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2490 if (fontname[i] == '-')
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2491 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2492 if (++j > 2)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2493 break;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2494 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2495 else if (j == 2)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2496 fontface[k++] = fontname[i];
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2497 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2498 fontface[k] = '\0';
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2499 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2500
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2501 cancel_font(NULL, c);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2502 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2503
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2504 static GtkWidget *fontseld;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2505
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2506 void destroy_fontsel(GtkWidget *w, gpointer d) {
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2507 gtk_widget_destroy(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2508 fontseld = NULL;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2509 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2510
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2511 void apply_font_dlg(GtkWidget *w, GtkWidget *f) {
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2512 int i, j = 0, k = 0;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2513 char *fontname;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2514
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2515 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontseld));
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2516 destroy_fontsel(0, 0);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2517 for (i = 0; i < strlen(fontname); i++) {
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2518 if (fontname[i] == '-') {
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2519 if (++j > 2) break;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2520 } else if (j == 2)
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2521 fontface[k++] = fontname[i];
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2522 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2523 fontface[k] = '\0';
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2524 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2525
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2526 void show_font_dialog(struct conversation *c, GtkWidget *font)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2527 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2528
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2529 if (!font) { /* we came from the prefs dialog */
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2530 if (fontseld) return;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2531 fontseld = gtk_font_selection_dialog_new(_("Select Font"));
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2532 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld), DEFAULT_FONT_NAME);
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2533
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2534 gtk_object_set_user_data(GTK_OBJECT(fontseld), NULL);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2535 gtk_signal_connect(GTK_OBJECT(fontseld), "delete_event", GTK_SIGNAL_FUNC(destroy_fontsel), NULL);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2536 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_fontsel), NULL);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2537 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_font_dlg), NULL);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2538 gtk_widget_realize(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2539 aol_icon(fontseld->window);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2540 gtk_widget_show(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2541 gdk_window_raise(fontseld->window);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2542 return;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2543 }
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2544
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2545 if (!c->font_dialog)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2546 {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2547 c->font_dialog = gtk_font_selection_dialog_new(_("Select Font"));
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2548
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2549 if (font)
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2550 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), c);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2551 else
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2552 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), NULL);
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2553
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2554 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *)c->font_dialog, DEFAULT_FONT_NAME);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2555
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2556 gtk_signal_connect(GTK_OBJECT(c->font_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2557 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_font), c->font_dialog);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2558 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC(cancel_font), c);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2559
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2560 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *)c->font_dialog, DEFAULT_FONT_NAME);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2561
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2562 gtk_widget_realize(c->font_dialog);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2563
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2564 aol_icon(c->font_dialog->window);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2565 }
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2566 gtk_widget_show(c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2567 gdk_window_raise(c->font_dialog->window);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2568 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2569
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2570 /*------------------------------------------------------------------------*/
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2571 /* The dialog for import/export */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2572 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2573
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2574 #define PATHSIZE 1024
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2575
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2576 /* see if a buddy list cache file for this user exists */
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2577
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2578 gboolean
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2579 bud_list_cache_exists( void )
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2580 {
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2581 gboolean ret = FALSE;
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2582 char path[PATHSIZE];
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2583 char *file;
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2584 struct stat sbuf;
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2585 extern char g_screenname[];
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2586
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2587 file = getenv( "HOME" );
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2588 if ( file != (char *) NULL ) {
262
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2589 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname );
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2590 if ( !stat(path, &sbuf) )
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2591 ret = TRUE;
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2592 }
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2593 return ret;
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2594 }
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2595
262
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2596 /* if dummy is 0, save to ~/.gaim/screenname.blist. Else, let user choose */
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2597
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2598 void do_export(GtkWidget *w, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2599 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2600 FILE *f;
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2601 gint show_dialog = (int) dummy;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2602 char *buf = g_malloc(BUF_LONG);
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2603 char *file;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2604 char path[PATHSIZE];
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2605 extern char g_screenname[];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2606
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2607 if ( show_dialog == 1 ) {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2608 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog));
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2609 strncpy( path, file, PATHSIZE - 1 );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2610 }
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2611 else {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2612 file = getenv( "HOME" );
262
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2613 if ( file != (char *) NULL ) {
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2614 FILE *dir;
266
3b5b469d07f7 [gaim-migrate @ 276]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 262
diff changeset
2615 sprintf(buf, "%s/.gaim/", file);
262
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2616 dir = fopen(buf, "r");
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2617 if (!dir)
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2618 mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2619 else
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2620 fclose(dir);
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2621 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname );
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2622 } else
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2623 return;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2624 }
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2625 if ((f = fopen(path,"w"))) {
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
2626 serv_build_config(buf, 8192 - 1, TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2627 fprintf(f, "%s\n", buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2628 fclose(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2629 chmod(buf, S_IRUSR | S_IWUSR);
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2630 } else if ( show_dialog == 1 ) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2631 g_snprintf(buf, BUF_LONG / 2, _("Error writing file %s"), file);
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2632 do_error_dialog(buf, _("Error"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2633 }
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2634 if ( show_dialog == 1 ) {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2635 destroy_dialog(NULL, exportdialog);
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2636 exportdialog = NULL;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2637 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2638
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2639 g_free(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2640
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2641 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2642
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2643
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2644 void show_export_dialog()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2645 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2646 char *buf = g_malloc(BUF_LEN);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2647 if (!exportdialog) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2648 exportdialog = gtk_file_selection_new(_("Gaim - Export Buddy List"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2649
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2650 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(exportdialog));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2651
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2652 g_snprintf(buf, BUF_LEN - 1, "%s/gaim.buddy", getenv("HOME"));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2653
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2654 gtk_file_selection_set_filename(GTK_FILE_SELECTION(exportdialog), buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2655 gtk_signal_connect(GTK_OBJECT(exportdialog), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2656 GTK_SIGNAL_FUNC(destroy_dialog), exportdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2657
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2658 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(exportdialog)->ok_button),
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2659 "clicked", GTK_SIGNAL_FUNC(do_export), (void*)1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2660 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(exportdialog)->cancel_button),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2661 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), exportdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2662
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2663
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2664 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2665
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2666 g_free(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2667
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2668 gtk_widget_show(exportdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2669 gdk_window_raise(exportdialog->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2670
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2671 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2672
262
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2673 /* if dummy is 0, then import from ~/.gaim/screenname.blist, else let user
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2674 choose */
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2675
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2676 void do_import(GtkWidget *w, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2677 {
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2678 gint show_dialog = (int) dummy;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2679 GList *grp, *grp2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2680 char *buf = g_malloc(BUF_LONG);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2681 char *buf2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2682 char *first = g_malloc(64);
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2683 char *file;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2684 char path[PATHSIZE];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2685 FILE *f;
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2686 extern char g_screenname[];
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2687
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2688 if ( show_dialog == 1 ) {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2689 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog));
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2690 strncpy( path, file, PATHSIZE - 1 );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2691 }
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2692 else {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2693 file = getenv( "HOME" );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2694 if ( file != (char *) NULL )
262
07abf2ed6665 [gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 255
diff changeset
2695 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname );
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2696 else
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2697 return;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2698 }
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2699
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2700 if (!(f = fopen(path,"r"))) {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2701 if ( show_dialog == 1 ) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2702 g_snprintf(buf, BUF_LONG / 2, _("Error reading file %s"), file);
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2703 do_error_dialog(buf, _("Error"));
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2704 destroy_dialog(NULL, importdialog);
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2705 importdialog = NULL;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2706 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2707 g_free(buf);
37
d90f556e4aa3 [gaim-migrate @ 46]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
2708 g_free(first);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2709 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2710 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2711
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2712 fgets(first, 64, f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2713
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2714 /* AIM 4 buddy list */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2715 if (!strcasecmp(first, "Config {\n")) {
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2716 debug_print("aim 4\n");
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2717 rewind(f);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2718 translate_blt (f, buf);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2719 sprintf(debug_buff, "%s\n", buf);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2720 debug_print(debug_buff);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2721 buf2 = buf;
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2722 buf = g_malloc(8193);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2723 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2724 g_free(buf2);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2725 /* AIM 3 buddy list */
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2726 } else if (strstr(first, "group") != NULL) {
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2727 debug_print("aim 3\n");
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2728 rewind(f);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2729 translate_lst (f, buf);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2730 sprintf(debug_buff, "%s\n", buf);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2731 debug_print(debug_buff);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2732 buf2 = buf;
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2733 buf = g_malloc(8193);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2734 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2735 g_free(buf2);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2736 /* GAIM buddy list - no translation */
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2737 } else if (first[0] == 'm') {
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2738 rewind(f);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2739 fread(buf, BUF_LONG, 1, f);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2740 buf2 = buf;
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2741 buf = g_malloc(8193);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2742 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2743 g_free(buf2);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2744 /* Something else */
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2745 } else {
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2746 if ( show_dialog == 1 ) {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2747 destroy_dialog(NULL, importdialog);
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2748 importdialog = NULL;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2749 }
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
2750 g_free(buf);
37
d90f556e4aa3 [gaim-migrate @ 46]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
2751 g_free(first);
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2752 fclose( f );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2753 return;
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2754 }
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2755
296
a88b889b692b [gaim-migrate @ 306]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 266
diff changeset
2756 parse_toc_buddy_list(buf, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2757
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2758 serv_save_config();
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2759
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2760 build_edit_tree();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2761 build_permit_tree();
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2762
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2763 fclose( f );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2764
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2765 if ( show_dialog == 1 ) {
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2766 /* save what we just did to cache */
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2767
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2768 do_export( (GtkWidget *) NULL, 0 );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2769 destroy_dialog(NULL, importdialog);
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2770 importdialog = NULL;
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2771 }
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 676
diff changeset
2772
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2773 g_free(buf);
37
d90f556e4aa3 [gaim-migrate @ 46]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
2774 g_free(first);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2775 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2776
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2777 void show_import_dialog()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2778 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2779 char *buf = g_malloc(BUF_LEN);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2780 if (!importdialog) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2781 importdialog = gtk_file_selection_new(_("Gaim - Import Buddy List"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2782
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2783 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(importdialog));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2784
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2785 g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME"));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2786
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2787 gtk_file_selection_set_filename(GTK_FILE_SELECTION(importdialog), buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2788 gtk_signal_connect(GTK_OBJECT(importdialog), "destroy",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2789 GTK_SIGNAL_FUNC(destroy_dialog), importdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2790
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2791 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->ok_button),
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2792 "clicked", GTK_SIGNAL_FUNC(do_import), (void*)1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2793 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->cancel_button),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2794 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), importdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2795
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2796
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2797 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2798
24
7d0ef30fe8c0 [gaim-migrate @ 33]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
2799 g_free(buf);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2800 gtk_widget_show(importdialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2801 gdk_window_raise(importdialog->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2802 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2803
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2804
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2805 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2806 /* The dialog for new away messages */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2807 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2808
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2809 void create_mess(GtkWidget *widget, struct create_away *ca)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2810 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2811 struct away_message *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2812 gchar *away_message;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2813 guint text_len;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2814 int is_checked;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2815
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2816 /* Grab the appropriate data */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2817 b = g_new0(struct away_message, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2818 g_snprintf(b->name, sizeof(b->name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2819
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2820 /* Get proper Length */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2821 text_len = gtk_text_get_length(GTK_TEXT(ca->text));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2822 away_message = gtk_editable_get_chars(GTK_EDITABLE(ca->text), 0, text_len);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2823
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2824 g_snprintf(b->message, sizeof(b->message), "%s", away_message);
38
f60e533679ce [gaim-migrate @ 47]
Rob Flynn <gaim@robflynn.com>
parents: 37
diff changeset
2825 g_free(away_message);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2826 is_checked = GTK_TOGGLE_BUTTON(ca->checkbx)->active;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2827
452
0a2eb65b6909 [gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 444
diff changeset
2828 if (is_checked) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2829 away_messages = g_list_append(away_messages, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2830 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2831 do_away_menu();
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 651
diff changeset
2832 if (prefs_away_list != NULL)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 651
diff changeset
2833 gtk_list_select_item(GTK_LIST(prefs_away_list), g_list_index(away_messages, b));
452
0a2eb65b6909 [gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 444
diff changeset
2834 }
0a2eb65b6909 [gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 444
diff changeset
2835
0a2eb65b6909 [gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 444
diff changeset
2836 /* stick it on the away list */
470
4bf9c74b9e4d [gaim-migrate @ 480]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 467
diff changeset
2837 if (!strlen(b->name))
4bf9c74b9e4d [gaim-migrate @ 480]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 467
diff changeset
2838 g_snprintf(b->name, sizeof(b->name), "I'm away!");
4bf9c74b9e4d [gaim-migrate @ 480]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 467
diff changeset
2839 do_away_message(NULL, b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2840
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2841 destroy_dialog(NULL, ca->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2842 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2843
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2844 void create_away_mess(GtkWidget *widget, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2845 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2846 GtkWidget *bbox;
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2847 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2848 GtkWidget *titlebox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2849 GtkWidget *tbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2850 GtkWidget *sw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2851 GtkWidget *label;
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2852 GtkWidget *frame;
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2853 GtkWidget *fbox;
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2854 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2855
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2856 struct create_away *ca = g_new0(struct create_away, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2857
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2858 /* Set up window */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2859 ca->window = gtk_window_new(GTK_WINDOW_DIALOG);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2860 gtk_widget_set_usize(ca->window, 275, 200);
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2861 gtk_widget_show(ca->window);
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2862 gtk_container_border_width(GTK_CONTAINER(ca->window), 5);
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2863 gtk_window_set_policy(GTK_WINDOW(ca->window), FALSE, FALSE, TRUE);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2864 gtk_window_set_title(GTK_WINDOW(ca->window), _("Gaim - New away message"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2865 gtk_signal_connect(GTK_OBJECT(ca->window),"delete_event",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2866 GTK_SIGNAL_FUNC(destroy_dialog), ca->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2867
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2868 /* Set up our frame */
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2869
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2870 frame = gtk_frame_new(_("New away message"));
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2871
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2872 /* set up container boxes */
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2873 bbox = gtk_hbox_new(FALSE, 0);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2874 fbox = gtk_vbox_new(FALSE, 0);
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2875 hbox = gtk_hbox_new(FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2876 titlebox = gtk_hbox_new(FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2877 tbox = gtk_vbox_new(FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2878
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2879 /* Make a label for away entry */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2880 label = gtk_label_new(_("Away title: "));
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2881 gtk_box_pack_start(GTK_BOX(titlebox), label, TRUE, TRUE, 5);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2882 gtk_widget_show(label);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2883
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2884 /* make away title entry */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2885 ca->entry = gtk_entry_new();
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2886 gtk_box_pack_start(GTK_BOX(titlebox), ca->entry, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2887
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2888 sw = gtk_scrolled_window_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2889 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2890 GTK_POLICY_AUTOMATIC,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2891 GTK_POLICY_AUTOMATIC);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2892 gtk_widget_show(sw);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2893
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2894 /* create and format text box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2895 ca->text = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2896 gtk_text_set_word_wrap(GTK_TEXT(ca->text), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2897 gtk_text_set_editable(GTK_TEXT(ca->text), TRUE );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2898 gtk_container_add(GTK_CONTAINER(sw), ca->text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2899 gtk_widget_show(ca->text);
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2900 gtk_box_pack_start(GTK_BOX(bbox), sw, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2901
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2902 button = picture_button(ca->window, _("Away"), save_xpm);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2903 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_mess), ca);
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2904 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5);
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2905
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2906 button = picture_button(ca->window, _("Cancel"), cancel_xpm);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2907 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), ca->window);
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2908 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2909
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2910 /* Checkbox for showing away msg */
452
0a2eb65b6909 [gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 444
diff changeset
2911 ca->checkbx = gtk_check_button_new_with_label(_("Save for later use"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2912
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2913 /* pack boxes where they belong */
440
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2914 gtk_box_pack_start(GTK_BOX(fbox), titlebox, TRUE, TRUE, 5);
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2915 gtk_box_pack_start(GTK_BOX(fbox), bbox, TRUE, TRUE, 5);
7d61632b2591 [gaim-migrate @ 450]
Syd Logan <slogan>
parents: 439
diff changeset
2916 gtk_box_pack_start(GTK_BOX(fbox), ca->checkbx, TRUE, TRUE, 5);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2917
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2918 gtk_container_add(GTK_CONTAINER(frame), fbox);
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2919 gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2920 gtk_box_pack_start(GTK_BOX(tbox), frame, TRUE, TRUE, 0);
442
fbf45eb2cd4e [gaim-migrate @ 452]
Rob Flynn <gaim@robflynn.com>
parents: 441
diff changeset
2921 gtk_box_pack_start(GTK_BOX(tbox), hbox, TRUE, FALSE, 5);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2922
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2923 gtk_container_add(GTK_CONTAINER(ca->window), tbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2924
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2925 /* let the world see what we have done. */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2926 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2927 gtk_widget_show(ca->checkbx);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2928 gtk_widget_show(ca->entry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2929 gtk_widget_show(titlebox);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2930 gtk_widget_show(hbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2931 gtk_widget_show(tbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2932 gtk_widget_show(bbox);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2933 gtk_widget_show(fbox);
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2934 gtk_widget_show(frame);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2935
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2936 gtk_widget_realize(ca->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2937 aol_icon(ca->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2938 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2939
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2940 /* smiley dialog */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2941
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2942 void close_smiley_dialog(GtkWidget *widget, struct conversation *c)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2943 {
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2944 if (c->smiley)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2945 {
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2946 set_state_lock(1);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2947 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2948 set_state_lock(0);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2949 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2950 dialogwindows = g_list_remove(dialogwindows, c->smiley_dialog);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2951 gtk_widget_destroy(c->smiley_dialog);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2952 c->smiley_dialog = NULL;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2953 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2954
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2955 void set_smiley_array(GtkWidget *widget, int smiley_type)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2956 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2957 int i;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2958
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2959 for (i = 0; i < FACE_TOTAL; i++)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2960 smiley_array[i] = 0;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2961
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2962 smiley_array[smiley_type] = 1;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2963
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2964 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2965 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2966
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2967 void insert_smiley_text(GtkWidget *widget, struct conversation *c)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2968 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2969 char *smiley_text;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2970 int i;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2971
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2972 for (i = 0; i < FACE_TOTAL; i++)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2973 if (smiley_array[i] == 1)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2974 break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2975
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2976 switch (i)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2977 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2978 case (FACE_ANGEL): smiley_text = g_strndup("O:-)", strlen("O:-)")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2979 case (FACE_BIGSMILE): smiley_text = g_strndup(":-D", strlen(":-D")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2980 case (FACE_BURP): smiley_text = g_strndup(":-!", strlen(":-!")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2981 case (FACE_CROSSEDLIPS): smiley_text = g_strndup(":-X", strlen(":-X")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2982 case (FACE_CRY): smiley_text = g_strndup(":'(", strlen(":'(")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2983 case (FACE_EMBARRASSED): smiley_text = g_strndup(":-[", strlen(":-[")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2984 case (FACE_KISS): smiley_text = g_strndup(":-*", strlen(":-*")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2985 case (FACE_MONEYMOUTH): smiley_text = g_strndup(":-$", strlen(":-$")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2986 case (FACE_SAD): smiley_text = g_strndup(":-(", strlen(":-(")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2987 case (FACE_SCREAM): smiley_text = g_strndup("=-O", strlen("=-O")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2988 case (FACE_SMILE): smiley_text = g_strndup(":-)", strlen(":-)")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2989 case (FACE_SMILE8): smiley_text = g_strndup("8-)", strlen("8-)")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2990 case (FACE_THINK): smiley_text = g_strndup(":-/", strlen(":-/")); break;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2991 case (FACE_TONGUE): smiley_text = g_strndup(":-P", strlen(":-p")); break;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2992 case (FACE_WINK): smiley_text = g_strndup(";-)", strlen(";-)")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2993 case (FACE_YELL): smiley_text = g_strndup(">:o", strlen(">:o")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2994 default: smiley_text = g_strndup(":-)", strlen(":-)")); break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2995 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2996
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2997 surround(c->entry, smiley_text, "");
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2998
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2999 g_free(smiley_text);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3000
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3001 close_smiley_dialog(NULL, c);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3002
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3003 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3004 }
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3005
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3006 static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win, int face)
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3007 {
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3008 GtkWidget *tpm;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3009 GdkBitmap *mask;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3010 GdkPixmap *dpm;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3011 GtkWidget *button;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3012
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3013 dpm = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, xpm);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3014 tpm = gtk_pixmap_new(dpm, mask);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3015 gtk_widget_show(tpm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
3016 gdk_pixmap_unref(dpm);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3017 button = gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL, NULL, tpm, GTK_SIGNAL_FUNC(set_smiley_array), (int *)face);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3018 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3019
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3020 /* these look really weird with borders */
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3021 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3022 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3023
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3024 void show_smiley_dialog(struct conversation *c, GtkWidget *widget)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3025 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3026 GtkWidget *dialog;
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3027 GtkWidget *vbox, *smiley_box_1, *smiley_box_2, *smiley_box_3, *smiley_box_4;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3028 GtkWidget *win;
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3029 GtkWidget *bbox;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3030
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3031 if (c->smiley_dialog)
558
f1b8f03db83f [gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 555
diff changeset
3032 return;
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3033
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3034 win = c->window;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3035
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3036 dialog = gtk_window_new(GTK_WINDOW_DIALOG);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3037 gtk_window_set_policy(GTK_WINDOW(dialog), 0, 0, 1);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3038
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3039 /* setup boxes */
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3040 vbox = gtk_vbox_new(TRUE, 5);
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3041 bbox = gtk_hbox_new(FALSE, 5);
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3042
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3043 smiley_box_1 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3044 smiley_box_2 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3045 smiley_box_3 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3046 smiley_box_4 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3047
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3048 /* setup buttons */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3049
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3050 /* pack buttons */
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3051 toolbar_add_smiley(c, smiley_box_1, angel_xpm, win, FACE_ANGEL);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3052 toolbar_add_smiley(c, smiley_box_1, bigsmile_xpm, win, FACE_BIGSMILE);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3053 toolbar_add_smiley(c, smiley_box_1, burp_xpm, win, FACE_BURP);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3054 toolbar_add_smiley(c, smiley_box_1, crossedlips_xpm, win, FACE_CROSSEDLIPS);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3055
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3056 toolbar_add_smiley(c, smiley_box_2, cry_xpm, win, FACE_CRY);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3057 toolbar_add_smiley(c, smiley_box_2, embarrassed_xpm, win, FACE_EMBARRASSED);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3058 toolbar_add_smiley(c, smiley_box_2, kiss_xpm, win, FACE_KISS);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3059 toolbar_add_smiley(c, smiley_box_2, moneymouth_xpm, win, FACE_MONEYMOUTH);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3060
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3061 toolbar_add_smiley(c, smiley_box_3, sad_xpm, win, FACE_SAD);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3062 toolbar_add_smiley(c, smiley_box_3, scream_xpm, win, FACE_SCREAM);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3063 toolbar_add_smiley(c, smiley_box_3, smile_xpm, win, FACE_SMILE);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3064 toolbar_add_smiley(c, smiley_box_3, smile8_xpm, win, FACE_SMILE8);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3065
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3066 toolbar_add_smiley(c, smiley_box_4, think_xpm, win, FACE_THINK);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3067 toolbar_add_smiley(c, smiley_box_4, tongue_xpm, win, FACE_TONGUE);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3068 toolbar_add_smiley(c, smiley_box_4, wink_xpm, win, FACE_WINK);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3069 toolbar_add_smiley(c, smiley_box_4, yell_xpm, win, FACE_YELL);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3070
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3071 /* pack containers */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3072 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_1, TRUE, TRUE, 0);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3073 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_2, TRUE, TRUE, 0);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3074 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_3, TRUE, TRUE, 0);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3075 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_4, TRUE, TRUE, 0);
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3076
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3077 gtk_container_add(GTK_CONTAINER(dialog), vbox);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3078 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3079
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3080 /* connect signals */
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3081 gtk_object_set_user_data(GTK_OBJECT(dialog), "smiley dialog");
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3082 gtk_signal_connect(GTK_OBJECT(dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3083
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3084 /* show everything */
567
102afb84ce45 [gaim-migrate @ 577]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 558
diff changeset
3085 gtk_window_set_title(GTK_WINDOW(dialog), _("Smile!"));
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3086 gtk_widget_show_all(dialog);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3087
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3088 c->smiley_dialog = dialog;
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3089
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3090 return;
558
f1b8f03db83f [gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 555
diff changeset
3091 }
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3092
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3093 static void do_alias(GtkWidget *w, gpointer n)
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3094 {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3095 char *name, *who;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3096 struct buddy *b;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3097 name = g_strdup(gtk_entry_get_text(GTK_ENTRY(aliasentry)));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3098 if ((b = find_buddy(name)) == NULL) {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3099 g_free(name);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3100 destroy_dialog(aliasdlg, aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3101 return;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3102 }
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3103 g_snprintf(b->show, sizeof(b->show), "%s", gtk_entry_get_text(GTK_ENTRY(aliasname)));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3104 do_export(0, 0);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3105 who = g_malloc(sizeof(b->show) + 10);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3106 strcpy(who, b->show);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3107 gtk_label_set(GTK_LABEL(b->label), who);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3108 g_free(who);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3109 set_buddy(b);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3110 g_free(name);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3111 destroy_dialog(aliasdlg, aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3112 }
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3113
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3114 void alias_dialog(struct buddy *b)
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3115 {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3116 GtkWidget *frame;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3117 GtkWidget *vbox;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3118 GtkWidget *bbox;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3119 GtkWidget *cancel;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3120 GtkWidget *add;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3121 GtkWidget *label;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3122 GtkWidget *topbox;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3123
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3124 if (aliasdlg) {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3125 gtk_entry_set_text(GTK_ENTRY(aliasentry), b->name);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3126 gtk_widget_show(aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3127 return;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3128 }
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3129
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3130 aliasdlg = gtk_window_new(GTK_WINDOW_DIALOG);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3131 gtk_window_set_policy(GTK_WINDOW(aliasdlg), FALSE, FALSE, TRUE);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3132 gtk_widget_show(aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3133 dialogwindows = g_list_prepend(dialogwindows, aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3134
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3135 bbox = gtk_hbox_new(TRUE, 10);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3136 topbox = gtk_hbox_new(FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3137 vbox = gtk_vbox_new(FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3138
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3139 aliasentry = gtk_entry_new();
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3140 aliasname = gtk_entry_new();
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3141 /* Put the buttons in the box */
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3142
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3143 add = picture_button(aliasdlg, _("Add"), add_xpm);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3144
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3145 cancel = picture_button(aliasdlg, _("Cancel"), cancel_xpm);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3146
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3147 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3148 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3149
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3150 frame = gtk_frame_new(NULL);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3151 gtk_frame_set_label(GTK_FRAME(frame), _("Alias Buddy"));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3152
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3153 label = gtk_label_new(_("Buddy"));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3154 gtk_widget_show(label);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3155 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3156 gtk_box_pack_start(GTK_BOX(topbox), aliasentry, FALSE, FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3157 label = gtk_label_new(_("Alias"));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3158 gtk_widget_show(label);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3159 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3160 gtk_box_pack_start(GTK_BOX(topbox), aliasname, FALSE, FALSE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3161
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3162 gtk_entry_set_text(GTK_ENTRY(aliasentry), b->name);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3163 gtk_entry_set_text(GTK_ENTRY(aliasname), b->show);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3164
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3165 /* And the boxes in the box */
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3166 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3167 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3168
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3169 /* Handle closes right */
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3170 gtk_signal_connect(GTK_OBJECT(aliasdlg), "destroy",
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3171 GTK_SIGNAL_FUNC(destroy_dialog), aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3172 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3173 GTK_SIGNAL_FUNC(destroy_dialog), aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3174 gtk_signal_connect(GTK_OBJECT(add), "clicked",
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3175 GTK_SIGNAL_FUNC(do_alias), NULL);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3176 gtk_signal_connect(GTK_OBJECT(aliasentry), "activate",
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3177 GTK_SIGNAL_FUNC(do_alias), NULL);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3178 gtk_signal_connect(GTK_OBJECT(aliasname), "activate",
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3179 GTK_SIGNAL_FUNC(do_alias), NULL);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3180 /* Finish up */
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3181 gtk_widget_show(add);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3182 gtk_widget_show(cancel);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3183 gtk_widget_show(aliasentry);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3184 gtk_widget_show(aliasname);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3185 gtk_widget_show(topbox);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3186 gtk_widget_show(bbox);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3187 gtk_widget_show(vbox);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3188 gtk_widget_show(frame);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3189 gtk_window_set_title(GTK_WINDOW(aliasdlg), _("Gaim - Alias Buddy"));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3190 gtk_window_set_focus(GTK_WINDOW(aliasdlg), aliasentry);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3191 gtk_container_add(GTK_CONTAINER(frame), vbox);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3192 gtk_container_add(GTK_CONTAINER(aliasdlg), frame);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3193 gtk_container_set_border_width(GTK_CONTAINER(aliasdlg), 5);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3194 gtk_widget_realize(aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3195 aol_icon(aliasdlg->window);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3196
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3197 gtk_widget_show(aliasdlg);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3198 }