annotate src/dialogs.c @ 2527:c9e316b04048

[gaim-migrate @ 2540] You can now specify which protocol to add buddies to. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Thu, 18 Oct 2001 00:24:08 +0000
parents 1b7a1133962d
children 44b56faccb22
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
2090
b66aca8e8dce [gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
23 #include <config.h>
349
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>
967
17ff662183b2 [gaim-migrate @ 977]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
32 #include <ctype.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <sys/socket.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <netdb.h>
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
35 #include <netinet/in.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include <arpa/inet.h>
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
39 #include <errno.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 #include "gaim.h"
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
43 #include "gtkimhtml.h"
1270
babea41afa7e [gaim-migrate @ 1280]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1267
diff changeset
44 #include "prpl.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
46 #include "pixmaps/gnome_preferences.xpm"
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
47 #include "pixmaps/cancel.xpm"
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
48 #include "pixmaps/save.xpm"
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
49 #include "pixmaps/ok.xpm"
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
50 #include "pixmaps/add.xpm"
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
51 #include "pixmaps/warn.xpm"
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
52 #include "pixmaps/close.xpm"
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
53
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
54 #include "pixmaps/angel.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
55 #include "pixmaps/bigsmile.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
56 #include "pixmaps/burp.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
57 #include "pixmaps/crossedlips.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
58 #include "pixmaps/cry.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
59 #include "pixmaps/embarrassed.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
60 #include "pixmaps/kiss.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
61 #include "pixmaps/moneymouth.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
62 #include "pixmaps/sad.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
63 #include "pixmaps/scream.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
64 #include "pixmaps/smile.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
65 #include "pixmaps/smile8.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
66 #include "pixmaps/think.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
67 #include "pixmaps/tongue.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
68 #include "pixmaps/wink.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
69 #include "pixmaps/yell.xpm"
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
70
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
71 #include "pixmaps/aimicon.xpm"
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
72
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
73 #include "pixmaps/aol_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
74 #include "pixmaps/free_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
75 #include "pixmaps/dt_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
76 #include "pixmaps/admin_icon.xpm"
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
77
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
78 #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
79
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
80 #define PATHSIZE 1024
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
81
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
82 int smiley_array[FACE_TOTAL];
728
a509d6fad0de [gaim-migrate @ 738]
Todd Kulesza <fflewddur>
parents: 717
diff changeset
83 GdkColor bgcolor;
a509d6fad0de [gaim-migrate @ 738]
Todd Kulesza <fflewddur>
parents: 717
diff changeset
84 GdkColor fgcolor;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
85
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
86 static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
87 static GtkWidget *infodialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 static GList *dialogwindows = NULL;
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
89 static GtkWidget *importdialog;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
90 static struct gaim_connection *importgc;
2344
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
91 static GtkWidget *icondlg;
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
92 static GtkWidget *aliasdlg = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
93 static GtkWidget *aliasentry = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
94 static GtkWidget *aliasname = NULL;
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
95 static GtkWidget *rename_dialog = NULL;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
96 static GtkWidget *rename_bud_dialog = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
97
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 struct create_away {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
99 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
100 GtkWidget *entry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
101 GtkWidget *text;
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
102 struct away_message *mess;
1
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 struct warning {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
107 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
108 GtkWidget *anon;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
109 char *who;
976
2586b2a3725e [gaim-migrate @ 986]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 967
diff changeset
110 struct gaim_connection *gc;
1
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 struct addbuddy {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
114 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
115 GtkWidget *combo;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
116 GtkWidget *entry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
117 GtkWidget *entry_for_alias;
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
118 GtkWidget *account;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
119 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 struct addperm {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
123 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
124 GtkWidget *entry;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
125 struct gaim_connection *gc;
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
126 gboolean permit;
1
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 struct addbp {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
130 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
131 GtkWidget *nameentry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
132 GtkWidget *messentry;
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
133 GtkWidget *commentry;
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
134 GtkWidget *command;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135 GtkWidget *sendim;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136 GtkWidget *openwindow;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
137 GtkWidget *p_signon;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
138 GtkWidget *p_unaway;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
139 GtkWidget *p_unidle;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
140 GtkWidget *save;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
141 GtkWidget *menu;
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
142 GtkWidget *sound;
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
143 GtkWidget *soundentry;
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
144
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
145 struct aim_user *user;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 struct findbyemail {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150 GtkWidget *emailentry;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
151 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
152 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154 struct findbyinfo {
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
155 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 GtkWidget *firstentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 GtkWidget *middleentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 GtkWidget *lastentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 GtkWidget *maidenentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161 GtkWidget *cityentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162 GtkWidget *stateentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 GtkWidget *countryentry;
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166 struct info_dlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 GtkWidget *close;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 struct set_info_dlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 GtkWidget *window;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
175 GtkWidget *menu;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
176 struct aim_user *user;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
178 GtkWidget *save;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181
2344
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
182 struct set_icon_dlg {
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
183 GtkWidget *window;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
184 struct aim_user *user;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
185 GtkWidget *ok;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
186 GtkWidget *cancel;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
187 GtkWidget *entry;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
188 };
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
189
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190 struct set_dir_dlg {
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
191 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193 GtkWidget *first;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 GtkWidget *middle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 GtkWidget *last;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196 GtkWidget *maiden;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 GtkWidget *city;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 GtkWidget *state;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 GtkWidget *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 GtkWidget *web;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 GtkWidget *save;
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 struct linkdlg {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 GtkWidget *window;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209 GtkWidget *url;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211 GtkWidget *toggle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 GtkWidget *entry;
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
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
215 struct passwddlg {
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
216 GtkWidget *window;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
217 GtkWidget *ok;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
218 GtkWidget *cancel;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
219 GtkWidget *original;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
220 GtkWidget *new1;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
221 GtkWidget *new2;
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
222 struct gaim_connection *gc;
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
223 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 /* Destroys */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
229 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
230 {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
231 gchar *object_data;
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
232 object_data = gtk_object_get_user_data(GTK_OBJECT(w));
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
233
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
234 if (GTK_IS_COLOR_SELECTION_DIALOG(w)) {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
235 set_state_lock(1);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
236 if (w == c->fg_color_dialog) {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
237 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->fgcolorbtn), FALSE);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
238 c->fg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
239 } else {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
240 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->bgcolorbtn), FALSE);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
241 c->bg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
242 }
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
243 set_state_lock(0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
244 } else if (GTK_IS_FONT_SELECTION_DIALOG(w)) {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
245 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
246 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
247 set_state_lock(0);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
248 c->font_dialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
249 } else if (!g_strcasecmp(object_data, "smiley dialog")) {
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
250 set_state_lock(1);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
251 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
252 set_state_lock(0);
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
253 c->smiley_dialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
254 } else if (!g_strcasecmp(object_data, "log dialog")) {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
255 set_state_lock(1);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
256 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
257 set_state_lock(0);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
258 c->log_dialog = NULL;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
259 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
260
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
261 dialogwindows = g_list_remove(dialogwindows, w);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
262 gtk_widget_destroy(w);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
263
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
264 return FALSE;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
265 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 static void destroy_dialog(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
269 GtkWidget *dest;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
270
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
271 if (!GTK_IS_WIDGET(w2))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
272 dest = w;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
273 else
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
274 dest = w2;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
275
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
276 if (dest == imdialog)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277 imdialog = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
279 if (dest == infodialog)
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
280 infodialog = NULL;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
281
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
282 if (dest == importdialog) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283 importdialog = NULL;
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
284 importgc = NULL;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
285 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286
2344
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
287 if (dest == icondlg)
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
288 icondlg = NULL;
19ea44f74a88 [gaim-migrate @ 2357]
Rob Flynn <gaim@robflynn.com>
parents: 2334
diff changeset
289
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
290 if (dest == aliasdlg) {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
291 aliasdlg = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
292 aliasentry = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
293 aliasname = NULL;
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
294 }
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
295
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
296 if (dest == rename_dialog)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
297 rename_dialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
298
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
299 if (dest == rename_bud_dialog)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
300 rename_bud_dialog = NULL;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
301
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
302 dialogwindows = g_list_remove(dialogwindows, dest);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
303 gtk_widget_destroy(dest);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308 void destroy_all_dialogs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
310 GList *d = dialogwindows;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
311
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
312 while (d) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
313 destroy_dialog(NULL, d->data);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
314 d = d->next;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
315 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
316
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
317 g_list_free(dialogwindows);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
318 dialogwindows = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
320 if (awaymessage)
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
321 do_im_back(NULL, NULL);
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
322
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
323 if (imdialog) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
324 destroy_dialog(NULL, imdialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
325 imdialog = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
326 }
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
327
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
328 if (infodialog) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
329 destroy_dialog(NULL, infodialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
330 infodialog = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
331 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
332
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
333 if (importdialog) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
334 destroy_dialog(NULL, importdialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
335 importdialog = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
336 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
337
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
338 if (icondlg) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
339 destroy_dialog(NULL, icondlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
340 icondlg = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
341 }
1
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 static void do_warn(GtkWidget *widget, struct warning *w)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
346 serv_warn(w->gc, w->who, (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->anon))) ? 1 : 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
347
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
348 destroy_dialog(NULL, w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
351 static void free_warn_data(GtkObject *obj, struct warning *w)
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
352 {
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
353 g_free(w);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
354 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355
976
2586b2a3725e [gaim-migrate @ 986]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 967
diff changeset
356 void show_warn_dialog(struct gaim_connection *gc, char *who)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
358 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
359 GtkWidget *warn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
360 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 GtkWidget *vbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
362 GtkWidget *bbox;
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
363 GtkWidget *frame;
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
364 GtkWidget *fbox;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
365 char buf[128];
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
366
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
367 struct warning *w = g_new0(struct warning, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
368 w->who = who;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
369 w->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
370
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
371 w->window = gtk_window_new(GTK_WINDOW_DIALOG);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
372 dialogwindows = g_list_prepend(dialogwindows, w->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
373 gtk_window_set_wmclass(GTK_WINDOW(w->window), "warning", "Gaim");
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
374 gtk_window_set_policy(GTK_WINDOW(w->window), FALSE, FALSE, TRUE);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
375 gtk_window_set_title(GTK_WINDOW(w->window), _("Gaim - Warn user?"));
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
376 gtk_container_set_border_width(GTK_CONTAINER(w->window), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
377 gtk_signal_connect(GTK_OBJECT(w->window), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
378 GTK_SIGNAL_FUNC(destroy_dialog), w->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
379 gtk_signal_connect(GTK_OBJECT(w->window), "delete_event", GTK_SIGNAL_FUNC(free_warn_data), w);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
380 gtk_widget_realize(w->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
381 aol_icon(w->window->window);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
382
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
383 fbox = gtk_vbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
384 gtk_container_add(GTK_CONTAINER(w->window), fbox);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
385 gtk_widget_show(fbox);
467
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
386
04f4ed4e34fc [gaim-migrate @ 477]
Rob Flynn <gaim@robflynn.com>
parents: 463
diff changeset
387 frame = gtk_frame_new(_("Warn"));
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
388 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
389 gtk_widget_show(frame);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
390
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
391 vbox = gtk_vbox_new(FALSE, 5);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
392 gtk_container_add(GTK_CONTAINER(frame), vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
393 gtk_widget_show(vbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
394
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
395 g_snprintf(buf, 127, _("Do you really want to warn %s?"), who);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
396 label = gtk_label_new(buf);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
397 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
398 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
399
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
400 w->anon = gtk_check_button_new_with_label(_("Warn anonymously?"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
401 gtk_box_pack_start(GTK_BOX(vbox), w->anon, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
402 gtk_widget_show(w->anon);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
403
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
404 label = gtk_label_new(_("Anonymous warnings are less harsh."));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
405 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
406 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
407
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
408 bbox = gtk_hbox_new(TRUE, 10);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
409 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
410 gtk_widget_show(bbox);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
411
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
412 warn = picture_button(w->window, _("Warn"), warn_xpm);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
413 gtk_box_pack_start(GTK_BOX(bbox), warn, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
414 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(do_warn), w);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
415
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
416 cancel = picture_button(w->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
417 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
418 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), w->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
419
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
420 gtk_widget_show(w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
425 /* The dialog for getting an error */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
428 GtkWidget *do_error_dialog(char *message, char *title)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
430 GtkWidget *d;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
431 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
432 GtkWidget *close;
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435 d = gtk_dialog_new();
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
436 gtk_window_set_policy(GTK_WINDOW(d), FALSE, FALSE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
437 gtk_widget_realize(d);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
438 label = gtk_label_new(message);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
439 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
441 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
442
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
443 close = picture_button(d, _("Close"), cancel_xpm);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 488
diff changeset
444
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
445 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5);
463
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
446
be7cf1868b76 [gaim-migrate @ 473]
Rob Flynn <gaim@robflynn.com>
parents: 459
diff changeset
447 gtk_container_set_border_width(GTK_CONTAINER(d), 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 gtk_window_set_title(GTK_WINDOW(d), title);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 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
450 aol_icon(d->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452 gtk_widget_show(d);
2143
e257c17864eb [gaim-migrate @ 2153]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2137
diff changeset
453 gtk_widget_grab_focus(close);
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1815
diff changeset
454 return d;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
457
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459 static void do_im(GtkWidget *widget, GtkWidget *imentry)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
461 char *who;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
462 struct conversation *c;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
463
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
464 who = g_strdup(gtk_entry_get_text(GTK_ENTRY(imentry)));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465 destroy_dialog(NULL, imdialog);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
466 imdialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
467
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
468 if (!g_strcasecmp(who, "")) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
469 g_free(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
473 c = find_conversation(who);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
474
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
475 if (c == NULL) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
476 c = new_conversation(who);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
477 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
478 gdk_window_raise(c->window->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
479 }
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
480 g_free(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
481 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
483 static void do_info(GtkWidget *widget, GtkWidget *infoentry)
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
484 {
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
485 char *who;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
486
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
487 who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(infoentry))));
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
488 destroy_dialog(NULL, infodialog);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
489 infodialog = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
490
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
491 if (!g_strcasecmp(who, "")) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
492 g_free(who);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
493 return;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
494 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
495
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
496 /* what do we want to do about this case? */
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
497 if (connections)
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
498 serv_get_info(connections->data, who);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
499
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
500 g_free(who);
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
501 }
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
502
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503 void show_ee_dialog(int ee)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
505 GtkWidget *ok;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507 GtkWidget *box;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
508 GtkWidget *eedialog;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 eedialog = gtk_window_new(GTK_WINDOW_DIALOG);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
511 gtk_widget_realize(eedialog);
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
512 ok = picture_button(eedialog, _("OK"), ok_xpm);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
513 box = gtk_vbox_new(FALSE, 10);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
514
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515 if (ee == 0)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516 label = gtk_label_new("Amazing! Simply Amazing!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 else if (ee == 1)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518 label = gtk_label_new("Pimpin\' Penguin Style! *Waddle Waddle*");
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
519 else if (ee == 2)
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
520 label = gtk_label_new("You should be me. I'm so cute!");
2472
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2411
diff changeset
521 else if (ee == 3)
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2411
diff changeset
522 label = gtk_label_new("Now that's what I like!");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523 else
2472
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2411
diff changeset
524 label = gtk_label_new("Ahh, and excellent choice!");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
526 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527 gtk_widget_show(ok);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
528
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530 gtk_box_pack_start(GTK_BOX(box), ok, FALSE, FALSE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532 gtk_widget_show(box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 gtk_container_add(GTK_CONTAINER(eedialog), box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 gtk_window_set_title(GTK_WINDOW(eedialog), "Gaim - SUPRISE!");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
537 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), eedialog);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538 gtk_widget_realize(eedialog);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
539 aol_icon(eedialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541 gtk_widget_show(eedialog);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
544 void show_im_dialog()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
546 GtkWidget *mainbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
547 GtkWidget *frame;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
548 GtkWidget *fbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
549 GtkWidget *bbox;
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
550 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 GtkWidget *imentry;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
552 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
553
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
554 if (!imdialog) {
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
555 imdialog = gtk_window_new(GTK_WINDOW_DIALOG);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
556 gtk_window_set_wmclass(GTK_WINDOW(imdialog), "imdialog", "Gaim");
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
557 gtk_window_set_policy(GTK_WINDOW(imdialog), FALSE, TRUE, TRUE);
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
558 gtk_window_set_title(GTK_WINDOW(imdialog), _("Gaim - IM user"));
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
559 gtk_signal_connect(GTK_OBJECT(imdialog), "destroy",
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
560 GTK_SIGNAL_FUNC(destroy_dialog), imdialog);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
561 gtk_widget_realize(imdialog);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
562 aol_icon(imdialog->window);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
563
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
564 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
565 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
566 gtk_container_add(GTK_CONTAINER(imdialog), mainbox);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
567
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
568 frame = gtk_frame_new(_("Send Instant Message"));
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
569 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
570
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
571 fbox = gtk_hbox_new(FALSE, 5);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
572 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
573 gtk_container_add(GTK_CONTAINER(frame), fbox);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
574
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
575 label = gtk_label_new(_("IM who:"));
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
576 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
577
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
578 imentry = gtk_entry_new();
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
579 gtk_box_pack_start(GTK_BOX(fbox), imentry, TRUE, TRUE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
580 gtk_signal_connect(GTK_OBJECT(imentry), "activate", GTK_SIGNAL_FUNC(do_im), imentry);
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
581 gtk_widget_grab_focus(imentry);
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
582
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
583 bbox = gtk_hbox_new(FALSE, 5);
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
584 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
585
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
586 button = picture_button(imdialog, _("Cancel"), cancel_xpm);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
587 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
588 gtk_signal_connect(GTK_OBJECT(button), "clicked",
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
589 GTK_SIGNAL_FUNC(destroy_dialog), imdialog);
455
430bde33209b [gaim-migrate @ 465]
Rob Flynn <gaim@robflynn.com>
parents: 454
diff changeset
590
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
591 button = picture_button(imdialog, _("OK"), ok_xpm);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
592 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
593 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_im), imentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
594 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
595
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
596 gtk_widget_show_all(imdialog);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
598
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
599 void show_info_dialog()
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
600 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
601 GtkWidget *mainbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
602 GtkWidget *frame;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
603 GtkWidget *fbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
604 GtkWidget *bbox;
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
605 GtkWidget *button;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
606 GtkWidget *infoentry;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
607 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
608
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
609 if (!infodialog) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
610
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
611 infodialog = gtk_window_new(GTK_WINDOW_DIALOG);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
612 gtk_window_set_wmclass(GTK_WINDOW(infodialog), "infodialog", "Gaim");
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
613 gtk_window_set_policy(GTK_WINDOW(infodialog), FALSE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
614 gtk_widget_realize(infodialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
615
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
616 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
617 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
618 gtk_container_add(GTK_CONTAINER(infodialog), mainbox);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
619
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
620 frame = gtk_frame_new(_("Get User Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
621 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
1225
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
622
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
623 fbox = gtk_hbox_new(FALSE, 5);
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
624 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
625 gtk_container_add(GTK_CONTAINER(frame), fbox);
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
626
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
627 label = gtk_label_new(_("User:"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
628 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
629 gtk_widget_show(label);
1225
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
630
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
631 infoentry = gtk_entry_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
632 gtk_box_pack_start(GTK_BOX(fbox), infoentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
633
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
634 /* Handle closes right */
1225
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
635 gtk_signal_connect(GTK_OBJECT(infoentry), "activate",
9c6dc2b2ad61 [gaim-migrate @ 1235]
Rob Flynn <gaim@robflynn.com>
parents: 1224
diff changeset
636 GTK_SIGNAL_FUNC(do_info), infoentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
637 gtk_signal_connect(GTK_OBJECT(infodialog), "destroy",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
638 GTK_SIGNAL_FUNC(destroy_dialog), infodialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
639
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
640 /* Buttons */
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
641 bbox = gtk_hbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
642 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
643
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
644 button = picture_button(infodialog, _("Cancel"), cancel_xpm);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
645 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
646 gtk_signal_connect(GTK_OBJECT(button), "clicked",
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
647 GTK_SIGNAL_FUNC(destroy_dialog), infodialog);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
648
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
649 button = picture_button(infodialog, _("OK"), ok_xpm);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
650 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
651 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_info), infoentry);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
652
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
653 /* Finish up */
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
654 gtk_window_set_title(GTK_WINDOW(infodialog), _("Gaim - Get User Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
655 gtk_widget_grab_focus(infoentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
656
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
657 aol_icon(infodialog->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
658 }
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
659 gtk_widget_show_all(infodialog);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
660 }
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
661
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
664 /* The dialog for adding buddies */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
665 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
666
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
667 extern void add_callback(GtkWidget *, struct conversation *);
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
668
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 void do_add_buddy(GtkWidget *w, struct addbuddy *a)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 {
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
671 char *grp, *who, *whoalias;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
672 struct conversation *c;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
673
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 who = gtk_entry_get_text(GTK_ENTRY(a->entry));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
675 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
676 whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
677
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
678 c = find_conversation(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679
1171
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
680 if (a->gc) {
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
681 add_buddy(a->gc, grp, who, whoalias);
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
682 serv_add_buddy(a->gc, who);
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
683 } else if (connections) {
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
684 add_buddy(connections->data, grp, who, whoalias);
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
685 serv_add_buddy(connections->data, who);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
686 a->gc = connections->data;
1171
11f8829f82fb [gaim-migrate @ 1181]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1169
diff changeset
687 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
689 if (c != NULL) {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1344
diff changeset
690 update_buttons_by_protocol(c);
654
ea811c6dd3e0 [gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 653
diff changeset
691 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
692
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
693 do_export(a->gc);
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
694
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
695 destroy_dialog(NULL, a->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
698 void do_add_group(GtkWidget *w, struct addbuddy *a)
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
699 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
700 char *grp;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
701
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
702 grp = gtk_entry_get_text(GTK_ENTRY(a->entry));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
703
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
704 if (a->gc)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
705 add_group(a->gc, grp);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
706 else if (connections) {
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
707 add_group(connections->data, grp);
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
708 a->gc = connections->data;
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
709 }
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
710
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
711 do_export(a->gc);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
712
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
713 destroy_dialog(NULL, a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
714 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
715
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
716
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
717 static GList *groups_tree(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
718 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
719 GList *tmp = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
720 char *tmp2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
721 struct group *g;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
722 GSList *grp = gc->groups;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
723
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
724 if (!grp) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
725 tmp2 = g_strdup(_("Buddies"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
726 tmp = g_list_append(tmp, tmp2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
728 while (grp) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
729 g = (struct group *)grp->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
730 tmp2 = g->name;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
731 tmp = g_list_append(tmp, tmp2);
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 935
diff changeset
732 grp = g_slist_next(grp);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733 }
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 return tmp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
737
825
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
738 static void free_dialog(GtkWidget *w, struct addbuddy *a)
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
739 {
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
740 g_free(a);
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
741 }
9108277c95e9 [gaim-migrate @ 835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
742
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
743
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
744 void show_add_group(struct gaim_connection *gc)
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
745 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
746 GtkWidget *cancel;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
747 GtkWidget *add;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
748 GtkWidget *label;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
749 GtkWidget *bbox;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
750 GtkWidget *vbox;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
751 GtkWidget *topbox;
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
752 GtkWidget *frame;
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
753
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
754 struct addbuddy *a = g_new0(struct addbuddy, 1);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
755 a->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
756
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
757 a->window = gtk_window_new(GTK_WINDOW_DIALOG);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
758 gtk_window_set_wmclass(GTK_WINDOW(a->window), "add_group", "Gaim");
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
759 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE);
837
113205ae7e72 [gaim-migrate @ 847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 832
diff changeset
760 gtk_widget_realize(a->window);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
761 dialogwindows = g_list_prepend(dialogwindows, a->window);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
762
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
763 bbox = gtk_hbox_new(TRUE, 10);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
764 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
765 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
766
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
767 a->entry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
768 /* Put the buttons in the box */
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
769
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
770 add = picture_button(a->window, _("Add"), add_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
771
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
772 cancel = picture_button(a->window, _("Cancel"), cancel_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
773
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
774 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
775 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
776
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
777 frame = gtk_frame_new(NULL);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
778 gtk_frame_set_label(GTK_FRAME(frame), _("Add Group"));
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
779
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
780 label = gtk_label_new(_("Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
781 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
782 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
783 gtk_box_pack_start(GTK_BOX(topbox), a->entry, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
784
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
785 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
786 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
787 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
788
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
789 /* Handle closes right */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
790 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
791 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(free_dialog), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
792 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
793 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_add_group), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
794 gtk_signal_connect(GTK_OBJECT(a->entry), "activate", GTK_SIGNAL_FUNC(do_add_group), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
795 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
796 gtk_widget_show(add);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
797 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
798 gtk_widget_show(a->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
799 gtk_widget_show(topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
800 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
801 gtk_widget_show(vbox);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
802 gtk_widget_show(frame);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
803 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
804 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
805 gtk_container_add(GTK_CONTAINER(frame), vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
806 gtk_container_add(GTK_CONTAINER(a->window), frame);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
807 gtk_container_set_border_width(GTK_CONTAINER(a->window), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
808 gtk_widget_realize(a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
809 aol_icon(a->window->window);
577
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 gtk_widget_show(a->window);
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
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
814 static void addbuddy_select_account(GtkObject *w, struct gaim_connection *gc)
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
815 {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
816 struct addbuddy *b = gtk_object_get_user_data(w);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
817
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
818 b->gc = gc;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
819 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
820
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
821 static void create_online_user_names(struct addbuddy *b)
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
822 {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
823 char buf[2048]; /* Never hurts to be safe ;-) */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
824 GSList *g = connections;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
825 struct gaim_connection *c;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
826 GtkWidget *menu, *opt;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
827 int count = 0;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
828 int place = 0;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
829
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
830 menu = gtk_menu_new();
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
831
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
832 while (g) {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
833 c = (struct gaim_connection *)g->data;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
834 g_snprintf(buf, sizeof(buf), "%s (%s)",
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
835 c->username, (*c->prpl->name)());
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
836 opt = gtk_menu_item_new_with_label(buf);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
837 gtk_object_set_user_data(GTK_OBJECT(opt), b);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
838 gtk_signal_connect(GTK_OBJECT(opt), "activate",
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
839 GTK_SIGNAL_FUNC(addbuddy_select_account),
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
840 c);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
841 gtk_widget_show(opt);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
842 gtk_menu_append(GTK_MENU(menu), opt);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
843
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
844 /* Now check to see if it's our current menu */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
845 if (c == b->gc) {
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
846 place = count;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
847 gtk_menu_item_activate(GTK_MENU_ITEM(opt));
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
848 gtk_option_menu_set_history(GTK_OPTION_MENU(b->account), count);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
849
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
850 /* Do the cha cha cha */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
851 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
852
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
853 count++;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
854
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
855 g = g->next;
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
856 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
857
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
858 gtk_option_menu_remove_menu(GTK_OPTION_MENU(b->account));
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
859 gtk_option_menu_set_menu(GTK_OPTION_MENU(b->account), menu);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
860 gtk_option_menu_set_history(GTK_OPTION_MENU(b->account), place);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
861
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
862 gtk_widget_show(b->account);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
863 gtk_widget_show(b->account->parent);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
864
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
865 }
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
866
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
867 void show_add_buddy(struct gaim_connection *gc, char *buddy, char *group)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
868 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
869 GtkWidget *mainbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
870 GtkWidget *frame;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
871 GtkWidget *table;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
872 GtkWidget *bbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
874 GtkWidget *add;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 GtkWidget *label;
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
876 GList *tmp;
236
62d470738cc7 [gaim-migrate @ 246]
Rob Flynn <gaim@robflynn.com>
parents: 234
diff changeset
877
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
878 struct addbuddy *a = g_new0(struct addbuddy, 1);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
879 a->gc = gc;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
880
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
881 a->window = gtk_window_new(GTK_WINDOW_DIALOG);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
882 gtk_window_set_wmclass(GTK_WINDOW(a->window), "add_buddy", "Gaim");
459
fb1d671e168e [gaim-migrate @ 469]
Rob Flynn <gaim@robflynn.com>
parents: 458
diff changeset
883 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
884 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Buddy"));
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
885
837
113205ae7e72 [gaim-migrate @ 847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 832
diff changeset
886 gtk_widget_realize(a->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
887 aol_icon(a->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
888 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
889 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", GTK_SIGNAL_FUNC(free_dialog), a);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
890 dialogwindows = g_list_prepend(dialogwindows, a->window);
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
891
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
892 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
893 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
894 gtk_container_add(GTK_CONTAINER(a->window), mainbox);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
895
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
896 frame = gtk_frame_new(_("Add Buddy"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
897 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
898 gtk_widget_show(frame);
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
899
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
900 table = gtk_table_new(3, 3, FALSE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
901 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
902 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
903 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
904 gtk_container_add(GTK_CONTAINER(frame), table);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
905
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
906 label = gtk_label_new(_("Contact"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
907 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
908
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
909 a->entry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
910 gtk_table_attach_defaults(GTK_TABLE(table), a->entry, 1, 2, 0, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
911 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
912 if (buddy != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
913 gtk_entry_set_text(GTK_ENTRY(a->entry), buddy);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
914 gtk_signal_connect(GTK_OBJECT(a->entry), "activate", GTK_SIGNAL_FUNC(do_add_buddy), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
915
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
916 label = gtk_label_new(_("Alias"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
917 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
918
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
919 a->entry_for_alias = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
920 gtk_table_attach_defaults(GTK_TABLE(table), a->entry_for_alias, 1, 2, 1, 2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
921
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
922 label = gtk_label_new(_("Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
923 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
924
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
925 a->combo = gtk_combo_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
926 gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree(gc ? gc : connections->data));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
927 if (group != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
928 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
929 gtk_table_attach_defaults(GTK_TABLE(table), a->combo, 1, 2, 2, 3);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
930
2527
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
931 /* Set up stuff for the account box */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
932 label = gtk_label_new(_("Add To"));
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
933 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
934
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
935 a->account = gtk_option_menu_new();
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
936 gtk_table_attach_defaults(GTK_TABLE(table), a->account, 1, 2, 3, 4);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
937
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
938 create_online_user_names(a);
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
939
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
940 /* End of account box */
c9e316b04048 [gaim-migrate @ 2540]
Rob Flynn <gaim@robflynn.com>
parents: 2493
diff changeset
941
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
942 bbox = gtk_hbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
943 gtk_box_pack_start(GTK_BOX(mainbox), bbox, TRUE, TRUE, 0);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
944
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
945 cancel = picture_button(a->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
946 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
947 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), a->window);
1151
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
948
428372cc1e39 [gaim-migrate @ 1161]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1144
diff changeset
949 add = picture_button(a->window, _("Add"), add_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
950 gtk_box_pack_end(GTK_BOX(bbox), add, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
951 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_add_buddy), a);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
952
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1191
diff changeset
953 gtk_widget_show_all(a->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
956
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
957 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958 /* The dialog for new buddy pounces */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
959 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
960
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
961
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
962 void do_new_bp(GtkWidget *w, struct addbp *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
963 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
964 struct buddy_pounce *bp = g_new0(struct buddy_pounce, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
965
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
966 if (strlen(gtk_entry_get_text(GTK_ENTRY(b->nameentry))) == 0) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
967 do_error_dialog(_("Please enter a buddy to pounce."), _("Buddy Pounce Error"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
968 g_free(bp);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
969 return;
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
970 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
971
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
972 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
973 g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry)));
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
974 g_snprintf(bp->command, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->commentry)));
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
975 g_snprintf(bp->sound, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->soundentry)));
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
976 g_snprintf(bp->pouncer, 80, "%s", b->user->username);
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
977
1155
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1151
diff changeset
978 bp->protocol = b->user->protocol;
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1151
diff changeset
979
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
980 bp->options = 0;
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
981
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
982 if (GTK_TOGGLE_BUTTON(b->openwindow)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
983 bp->options |= OPT_POUNCE_POPUP;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
984
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
985 if (GTK_TOGGLE_BUTTON(b->sendim)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
986 bp->options |= OPT_POUNCE_SEND_IM;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
987
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
988 if (GTK_TOGGLE_BUTTON(b->command)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
989 bp->options |= OPT_POUNCE_COMMAND;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
990
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
991 if (GTK_TOGGLE_BUTTON(b->sound)->active)
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
992 bp->options |= OPT_POUNCE_SOUND;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
993
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
994 if (GTK_TOGGLE_BUTTON(b->p_signon)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
995 bp->options |= OPT_POUNCE_SIGNON;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
996
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
997 if (GTK_TOGGLE_BUTTON(b->p_unaway)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
998 bp->options |= OPT_POUNCE_UNAWAY;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
999
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1000 if (GTK_TOGGLE_BUTTON(b->p_unidle)->active)
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1001 bp->options |= OPT_POUNCE_UNIDLE;
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1002
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1003 if (GTK_TOGGLE_BUTTON(b->save)->active)
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1004 bp->options |= OPT_POUNCE_SAVE;
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
1005
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1006 buddy_pounces = g_list_append(buddy_pounces, bp);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1007
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1008 do_bp_menu();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1009
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1010 destroy_dialog(NULL, b->window);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1011
786
ffb824f6cd24 [gaim-migrate @ 796]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1012 save_prefs();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1013 g_free(b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1014 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1016 static void pounce_choose(GtkWidget *opt, struct addbp *b)
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1017 {
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1018 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt));
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1019 b->user = u;
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1020 }
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1021
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1022 static void pounce_user_menu(struct addbp *b, GtkWidget *box)
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1023 {
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1024 GtkWidget *hbox;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1025 GtkWidget *label;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1026 GtkWidget *optmenu;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1027 GtkWidget *menu;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1028 GtkWidget *opt;
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2393
diff changeset
1029 GSList *u = aim_users;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1030 struct aim_user *a;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1031
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1032 hbox = gtk_hbox_new(FALSE, 5);
1140
249b040f6a83 [gaim-migrate @ 1150]
Rob Flynn <gaim@robflynn.com>
parents: 1139
diff changeset
1033 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1034 gtk_widget_show(hbox);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1035
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1036 label = gtk_label_new(_("Pounce buddy as:"));
1140
249b040f6a83 [gaim-migrate @ 1150]
Rob Flynn <gaim@robflynn.com>
parents: 1139
diff changeset
1037 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1038 gtk_widget_show(label);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1039
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1040 optmenu = gtk_option_menu_new();
1140
249b040f6a83 [gaim-migrate @ 1150]
Rob Flynn <gaim@robflynn.com>
parents: 1139
diff changeset
1041 gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 0);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1042 gtk_widget_show(optmenu);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1043
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1044 menu = gtk_menu_new();
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1045
1157
27c528068f28 [gaim-migrate @ 1167]
Rob Flynn <gaim@robflynn.com>
parents: 1156
diff changeset
1046 /* We should go ahead and set this in order to prevent problems */
27c528068f28 [gaim-migrate @ 1167]
Rob Flynn <gaim@robflynn.com>
parents: 1156
diff changeset
1047 if (u) {
27c528068f28 [gaim-migrate @ 1167]
Rob Flynn <gaim@robflynn.com>
parents: 1156
diff changeset
1048 a = (struct aim_user *)u->data;
27c528068f28 [gaim-migrate @ 1167]
Rob Flynn <gaim@robflynn.com>
parents: 1156
diff changeset
1049 b->user = a;
27c528068f28 [gaim-migrate @ 1167]
Rob Flynn <gaim@robflynn.com>
parents: 1156
diff changeset
1050 }
27c528068f28 [gaim-migrate @ 1167]
Rob Flynn <gaim@robflynn.com>
parents: 1156
diff changeset
1051
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1052 while (u) {
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1053 a = (struct aim_user *)u->data;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1054 opt = gtk_menu_item_new_with_label(a->username);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1055 gtk_object_set_user_data(GTK_OBJECT(opt), a);
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1056 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(pounce_choose), b);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1057 gtk_menu_append(GTK_MENU(menu), opt);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1058 gtk_widget_show(opt);
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1059 u = u->next;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1060 }
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1061
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1062 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1155
diff changeset
1063 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu),
2397
520257562955 [gaim-migrate @ 2410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2393
diff changeset
1064 g_slist_index(aim_users,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1065 ((struct gaim_connection *)connections->data)->user));
1230
5395053cdee1 [gaim-migrate @ 1240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
1066 b->user = ((struct gaim_connection *)connections->data)->user;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1067
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1068 b->menu = optmenu;
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1069 }
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1126
diff changeset
1070
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1072 void show_new_bp(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 GtkWidget *vbox;
1140
249b040f6a83 [gaim-migrate @ 1150]
Rob Flynn <gaim@robflynn.com>
parents: 1139
diff changeset
1077 GtkWidget *hbox;
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1078 GtkWidget *button;
1174
f81cf8c2db05 [gaim-migrate @ 1184]
Rob Flynn <gaim@robflynn.com>
parents: 1172
diff changeset
1079 GtkWidget *sep;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1080
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1081 struct addbp *b = g_new0(struct addbp, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1082
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1083 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1084 dialogwindows = g_list_prepend(dialogwindows, b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1085 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1086 gtk_window_set_wmclass(GTK_WINDOW(b->window), "new_bp", "Gaim");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1087 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - New Buddy Pounce"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1088 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1141
8f4ce8b74901 [gaim-migrate @ 1151]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1140
diff changeset
1089 gtk_widget_realize(b->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1090 aol_icon(b->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1091
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1092 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1093 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1094 gtk_container_add(GTK_CONTAINER(b->window), vbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1095 gtk_widget_show(vbox);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1096
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1097 pounce_user_menu(b, vbox);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1098
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1099 hbox = gtk_hbox_new(FALSE, 5);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1100 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1101 gtk_widget_show(hbox);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1102
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1103 label = gtk_label_new(_("Buddy:"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1104 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1105 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1106
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1107 b->nameentry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1108 gtk_box_pack_start(GTK_BOX(hbox), b->nameentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1109 if (name !=NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1110 gtk_entry_set_text(GTK_ENTRY(b->nameentry), name);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1111 gtk_window_set_focus(GTK_WINDOW(b->window), b->nameentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1112 gtk_widget_show(b->nameentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1113
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1114 sep = gtk_hseparator_new();
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1115 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1116 gtk_widget_show(sep);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1117
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1118 b->p_signon = gtk_check_button_new_with_label(_("Pounce on sign on"));
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1119 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_signon), TRUE);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1120 gtk_box_pack_start(GTK_BOX(vbox), b->p_signon, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1121 gtk_widget_show(b->p_signon);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1122
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1123 b->p_unaway = gtk_check_button_new_with_label(_("Pounce on return from away"));
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1124 gtk_box_pack_start(GTK_BOX(vbox), b->p_unaway, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1125 gtk_widget_show(b->p_unaway);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1126
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1127 b->p_unidle = gtk_check_button_new_with_label(_("Pounce on return from idle"));
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1128 gtk_box_pack_start(GTK_BOX(vbox), b->p_unidle, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1129 gtk_widget_show(b->p_unidle);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1130
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1131 sep = gtk_hseparator_new();
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1132 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1133 gtk_widget_show(sep);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1134
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1135 b->openwindow = gtk_check_button_new_with_label(_("Open IM window on pounce"));
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1136 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->openwindow), FALSE);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1137 gtk_box_pack_start(GTK_BOX(vbox), b->openwindow, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1138 gtk_widget_show(b->openwindow);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1139
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1140 b->sendim = gtk_check_button_new_with_label(_("Send IM on pounce"));
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1141 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sendim), TRUE);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1142 gtk_box_pack_start(GTK_BOX(vbox), b->sendim, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1143 gtk_widget_show(b->sendim);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1144
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1145 hbox = gtk_hbox_new(FALSE, 5);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1146 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1147 gtk_widget_show(hbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1148
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1149 label = gtk_label_new(_("Message:"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1150 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1151 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1152
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1153 b->messentry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1154 gtk_box_pack_start(GTK_BOX(hbox), b->messentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1155 gtk_signal_connect(GTK_OBJECT(b->messentry), "activate", GTK_SIGNAL_FUNC(do_new_bp), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1156 gtk_widget_show(b->messentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1157
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1158 gtk_signal_connect(GTK_OBJECT(b->sendim), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1159 b->messentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1160
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1161 b->command = gtk_check_button_new_with_label(_("Execute command on pounce"));
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1162 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->command), FALSE);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1163 gtk_box_pack_start(GTK_BOX(vbox), b->command, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1164 gtk_widget_show(b->command);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1165
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1166 hbox = gtk_hbox_new(FALSE, 5);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1167 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1168 gtk_widget_show(hbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1169
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1170 label = gtk_label_new(_("Command:"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1171 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1172 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1173
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1174 b->commentry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1175 gtk_box_pack_start(GTK_BOX(hbox), b->commentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1176 gtk_signal_connect(GTK_OBJECT(b->commentry), "activate", GTK_SIGNAL_FUNC(do_new_bp), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1177 gtk_widget_show(b->commentry);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1178
1388
7dc0a8bb4dcb [gaim-migrate @ 1398]
Rob Flynn <gaim@robflynn.com>
parents: 1387
diff changeset
1179 gtk_widget_set_sensitive(b->commentry, FALSE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1180 gtk_signal_connect(GTK_OBJECT(b->command), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1181 b->commentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1182
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1183 b->sound = gtk_check_button_new_with_label(_("Play sound on pounce"));
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1184 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sound), FALSE);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1185 gtk_box_pack_start(GTK_BOX(vbox), b->sound, FALSE, FALSE, 0);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1186 gtk_widget_show(b->sound);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1187
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1188 hbox = gtk_hbox_new(FALSE, 5);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1189 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1190 gtk_widget_show(hbox);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1191
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1192 label = gtk_label_new(_("Sound:"));
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1193 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1194 gtk_widget_show(label);
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1195
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1196 b->soundentry = gtk_entry_new();
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1197 gtk_box_pack_start(GTK_BOX(hbox), b->soundentry, TRUE, TRUE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1198 gtk_signal_connect(GTK_OBJECT(b->soundentry), "activate", GTK_SIGNAL_FUNC(do_new_bp), b);
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1199 gtk_widget_show(b->soundentry);
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1200
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1663
diff changeset
1201 gtk_widget_set_sensitive(b->soundentry, FALSE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1202 gtk_signal_connect(GTK_OBJECT(b->sound), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1203 b->soundentry);
1388
7dc0a8bb4dcb [gaim-migrate @ 1398]
Rob Flynn <gaim@robflynn.com>
parents: 1387
diff changeset
1204
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1205 sep = gtk_hseparator_new();
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1206 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1207 gtk_widget_show(sep);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1225
diff changeset
1208
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1209 b->save = gtk_check_button_new_with_label(_("Save this pounce after activation"));
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1210 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->save), FALSE);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1211 gtk_box_pack_start(GTK_BOX(vbox), b->save, FALSE, FALSE, 0);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1212 gtk_widget_show(b->save);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1213
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1214 sep = gtk_hseparator_new();
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1215 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1216 gtk_widget_show(sep);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1217
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1218 bbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1219 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1220 gtk_widget_show(bbox);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1221
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1222 button = picture_button(b->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1223 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1224 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1225
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1226 button = picture_button(b->window, _("OK"), ok_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1227 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_new_bp), b);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1228 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
443
a86882c351f0 [gaim-migrate @ 453]
Rob Flynn <gaim@robflynn.com>
parents: 442
diff changeset
1229
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1230 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1231 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1234
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1236 /* The dialog for SET INFO / SET DIR INFO */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1238
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1239 void do_save_info(GtkWidget *widget, struct set_info_dlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1240 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241 gchar *junk;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1242 struct gaim_connection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1243
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1244 junk = gtk_editable_get_chars(GTK_EDITABLE(b->text), 0, -1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1245
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1246 if (b->user) {
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1247 strncpy_withhtml(b->user->user_info, junk, sizeof b->user->user_info);
1074
2cff18c2f9c6 [gaim-migrate @ 1084]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1072
diff changeset
1248 gc = b->user->gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1249
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1250 save_prefs();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1251
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1252 if (gc)
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1253 serv_set_info(gc, b->user->user_info);
122
521db4bf5f28 [gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
1254 }
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1255 g_free(junk);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1256 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1257 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1258 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1259
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1260 void do_set_dir(GtkWidget *widget, struct set_dir_dlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1262 char *first = gtk_entry_get_text(GTK_ENTRY(b->first));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1263 int web = GTK_TOGGLE_BUTTON(b->web)->active;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1264 char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265 char *last = gtk_entry_get_text(GTK_ENTRY(b->last));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1266 char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1267 char *city = gtk_entry_get_text(GTK_ENTRY(b->city));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1268 char *state = gtk_entry_get_text(GTK_ENTRY(b->state));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1269 char *country = gtk_entry_get_text(GTK_ENTRY(b->country));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1270
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1271 serv_set_dir(b->gc, first, middle, last, maiden, city, state, country, web);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1272
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1273 destroy_dialog(NULL, b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1275 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1277 void show_set_dir(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1278 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1279 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1280 GtkWidget *bot;
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1281 GtkWidget *vbox;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1282 GtkWidget *hbox;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1283 GtkWidget *frame;
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1284 GtkWidget *fbox;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1285 char buf[256];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1286
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1287 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1288 if (!g_slist_find(connections, gc))
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1289 gc = connections->data;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1290 b->gc = gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1291
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1292 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1293 dialogwindows = g_list_prepend(dialogwindows, b->window);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1294 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_dir", "Gaim");
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1295 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1296 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set Dir Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1297 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1298 gtk_widget_realize(b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1299 aol_icon(b->window->window);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1300
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1301 fbox = gtk_vbox_new(FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1302 gtk_container_add(GTK_CONTAINER(b->window), fbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1303 gtk_widget_show(fbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1304
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1305 frame = gtk_frame_new(_("Directory Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1306 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1307 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1308 gtk_widget_show(frame);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1309
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1310 vbox = gtk_vbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1311 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1312 gtk_container_add(GTK_CONTAINER(frame), vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1313 gtk_widget_show(vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1314
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1315 g_snprintf(buf, sizeof(buf), "Setting Dir Info for %s:", gc->username);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1316 label = gtk_label_new(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1317 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1318 gtk_widget_show(label);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1319
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1320 b->first = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1321 b->middle = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1322 b->last = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1323 b->maiden = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1324 b->city = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1325 b->state = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1326 b->country = gtk_entry_new();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1327 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
1328
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1329 /* Line 1 */
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1330 label = gtk_label_new(_("First Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1331 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1332
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1333 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1334 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1335 gtk_box_pack_end(GTK_BOX(hbox), b->first, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1336
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1337 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1338 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1339
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1340 /* Line 2 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1341 label = gtk_label_new(_("Middle Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1342 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1343
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1344 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1345 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1346 gtk_box_pack_end(GTK_BOX(hbox), b->middle, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1347
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1348 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1349 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1350
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1351
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1352 /* Line 3 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1353 label = gtk_label_new(_("Last Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1354 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1355
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1356 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1357 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1358 gtk_box_pack_end(GTK_BOX(hbox), b->last, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1359
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1360 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1361 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1362
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1363 /* Line 4 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1364 label = gtk_label_new(_("Maiden Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1365 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1366
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1367 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1368 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1369 gtk_box_pack_end(GTK_BOX(hbox), b->maiden, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1370
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1371 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1372 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1373
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1374 /* Line 5 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1375 label = gtk_label_new(_("City"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1376 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1377
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1378 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1379 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1380 gtk_box_pack_end(GTK_BOX(hbox), b->city, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1381
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1382 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1383 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1384
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1385 /* Line 6 */
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1386 label = gtk_label_new(_("State"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1387 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1388
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1389 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1390 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1391 gtk_box_pack_end(GTK_BOX(hbox), b->state, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1392
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1393 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1394 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1395
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1396 /* Line 7 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1397 label = gtk_label_new(_("Country"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1398 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1399
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1400 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1401 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1402 gtk_box_pack_end(GTK_BOX(hbox), b->country, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1403
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1404 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1405 gtk_widget_show(hbox);
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1406
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1407 /* Line 8 */
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1408
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1409 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1410 gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1411 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1412 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
484
a9e485c388c4 [gaim-migrate @ 494]
Rob Flynn <gaim@robflynn.com>
parents: 483
diff changeset
1413
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1414 gtk_widget_show(b->first);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1415 gtk_widget_show(b->middle);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1416 gtk_widget_show(b->last);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1417 gtk_widget_show(b->maiden);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1418 gtk_widget_show(b->city);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1419 gtk_widget_show(b->state);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1420 gtk_widget_show(b->country);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1421 gtk_widget_show(b->web);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1422
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1423 /* And add the buttons */
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1424
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1425 bot = gtk_hbox_new(FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1426 gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 0);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1427 gtk_widget_show(bot);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1428
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1429 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1430 gtk_box_pack_end(GTK_BOX(bot), b->cancel, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1431 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1432
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1433 b->save = picture_button(b->window, _("Save"), save_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1434 gtk_box_pack_end(GTK_BOX(bot), b->save, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1435 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_set_dir), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1436
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1437 gtk_window_set_focus(GTK_WINDOW(b->window), b->first);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1438
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1439 gtk_widget_show(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1440 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1441
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1442 void do_change_password(GtkWidget *widget, struct passwddlg *b)
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1443 {
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1444 gchar *orig, *new1, *new2;
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1445
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1446 orig = gtk_entry_get_text(GTK_ENTRY(b->original));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1447 new1 = gtk_entry_get_text(GTK_ENTRY(b->new1));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1448 new2 = gtk_entry_get_text(GTK_ENTRY(b->new2));
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1449
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
1450 if (g_strcasecmp(new1, new2)) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1451 do_error_dialog(_("New Passwords Do Not Match"), _("Gaim - Change Password Error"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1452 return;
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1453 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1454
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1455 if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1456 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
1457 return;
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
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1460 serv_change_passwd(b->gc, orig, new1);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1461
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1462 destroy_dialog(NULL, b->window);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1463 g_free(b);
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1464 }
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1465
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1466 void show_change_passwd(struct gaim_connection *gc)
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1467 {
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1468 GtkWidget *hbox;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1469 GtkWidget *label;
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1470 GtkWidget *vbox;
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1471 GtkWidget *fbox;
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1472 GtkWidget *frame;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1473 char buf[256];
454
c9d87901afff [gaim-migrate @ 464]
Rob Flynn <gaim@robflynn.com>
parents: 452
diff changeset
1474
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1475 struct passwddlg *b = g_new0(struct passwddlg, 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1476 if (!g_slist_find(connections, gc))
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1477 gc = connections->data;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1478 b->gc = gc;
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1479
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1480 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1481 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1482 gtk_window_set_wmclass(GTK_WINDOW(b->window), "change_passwd", "Gaim");
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1483 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Password Change"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1484 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1485 gtk_widget_realize(b->window);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1486 aol_icon(b->window->window);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1487 dialogwindows = g_list_prepend(dialogwindows, b->window);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1488
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1489 fbox = gtk_vbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1490 gtk_container_border_width(GTK_CONTAINER(fbox), 5);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1491 gtk_container_add(GTK_CONTAINER(b->window), fbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1492 gtk_widget_show(fbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1493
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1494 frame = gtk_frame_new(_("Change Password"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1495 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1496 gtk_widget_show(frame);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1497
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1498 vbox = gtk_vbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1499 gtk_container_border_width(GTK_CONTAINER(vbox), 5);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1500 gtk_container_add(GTK_CONTAINER(frame), vbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1501 gtk_widget_show(vbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1502
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1503 g_snprintf(buf, sizeof(buf), "Changing password for %s:", gc->username);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1504 label = gtk_label_new(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1505 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1506 gtk_widget_show(label);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1507
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1508 /* First Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1509 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1510 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1511 gtk_widget_show(hbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1512
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1513 label = gtk_label_new(_("Original Password"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1514 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1515 gtk_widget_show(label);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1516
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1517 b->original = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1518 gtk_entry_set_visibility(GTK_ENTRY(b->original), FALSE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1519 gtk_box_pack_end(GTK_BOX(hbox), b->original, FALSE, FALSE, 0);
149
9d684979f507 [gaim-migrate @ 159]
Rob Flynn <gaim@robflynn.com>
parents: 146
diff changeset
1520 gtk_widget_show(b->original);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1521
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1522 /* Next Line */
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1523 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1524 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1525 gtk_widget_show(hbox);
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1526
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1527 label = gtk_label_new(_("New Password"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1528 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1529 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1530
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1531 b->new1 = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1532 gtk_entry_set_visibility(GTK_ENTRY(b->new1), FALSE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1533 gtk_box_pack_end(GTK_BOX(hbox), b->new1, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1534 gtk_widget_show(b->new1);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1535
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1536 /* Next Line */
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1537 hbox = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1538 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1539 gtk_widget_show(hbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1540
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1541 label = gtk_label_new(_("New Password (again)"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1542 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1543 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1544
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1545 b->new2 = gtk_entry_new();
160
aaa8f0a2140e [gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 149
diff changeset
1546 gtk_entry_set_visibility(GTK_ENTRY(b->new2), FALSE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1547 gtk_box_pack_end(GTK_BOX(hbox), b->new2, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1548 gtk_widget_show(b->new2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1549
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1550 /* Now do our row of buttons */
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1551 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1552 gtk_box_pack_start(GTK_BOX(fbox), hbox, FALSE, FALSE, 0);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1553 gtk_widget_show(hbox);
475
f5772f2d83ee [gaim-migrate @ 485]
Rob Flynn <gaim@robflynn.com>
parents: 471
diff changeset
1554
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1555 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1556 gtk_box_pack_end(GTK_BOX(hbox), b->cancel, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1557 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1558
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1559 b->ok = picture_button(b->window, _("OK"), ok_xpm);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1560 gtk_box_pack_end(GTK_BOX(hbox), b->ok, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1561 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", GTK_SIGNAL_FUNC(do_change_password), b);
978
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1562
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1563
563c409e26a1 [gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 976
diff changeset
1564 gtk_widget_show(b->window);
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1565 }
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 137
diff changeset
1566
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1567 void show_set_info(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1568 {
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1569 GtkWidget *buttons;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1570 GtkWidget *label;
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1571 GtkWidget *vbox;
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1572 gchar *buf;
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1573 struct aim_user *tmp;
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1288
diff changeset
1574
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1575 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1576 if (!g_slist_find(connections, gc))
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1577 gc = connections->data;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1578 tmp = gc->user;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1579 b->user = tmp;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1580
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1581 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1582 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_info", "Gaim");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1583 dialogwindows = g_list_prepend(dialogwindows, b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1584 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1585 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
1586 gtk_widget_realize(b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1587 aol_icon(b->window->window);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1588
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1589 vbox = gtk_vbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1590 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1591 gtk_container_add(GTK_CONTAINER(b->window), vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1592 gtk_widget_show(vbox);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1593
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1594 buf = g_malloc(256);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1595 g_snprintf(buf, 256, "Changing info for %s:", tmp->username);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1596 label = gtk_label_new(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1597 g_free(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1598 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1599 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1600
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1601 b->text = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1602 gtk_text_set_word_wrap(GTK_TEXT(b->text), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1603 gtk_text_set_editable(GTK_TEXT(b->text), TRUE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1604 gtk_widget_set_usize(b->text, 300, 200);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1605 buf = g_malloc(strlen(tmp->user_info) + 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1606 strncpy_nohtml(buf, tmp->user_info, strlen(tmp->user_info) + 1);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1607 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, buf, -1);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1608 g_free(buf);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1609 gtk_box_pack_start(GTK_BOX(vbox), b->text, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610 gtk_widget_show(b->text);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1611 gtk_window_set_focus(GTK_WINDOW(b->window), b->text);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1612
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1613 buttons = gtk_hbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1614 gtk_box_pack_start(GTK_BOX(vbox), buttons, FALSE, FALSE, 0);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1615 gtk_widget_show(buttons);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1616
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1617 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1618 gtk_box_pack_end(GTK_BOX(buttons), b->cancel, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1619 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1620
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1621 b->save = picture_button(b->window, _("Save"), save_xpm);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1622 gtk_box_pack_end(GTK_BOX(buttons), b->save, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1623 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_save_info), b);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
1624
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1625 gtk_widget_show(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1626
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1627 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1628
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1629 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1630 /* The dialog for the info requests */
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
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1633 static void info_dlg_free(GtkWidget *b, struct info_dlg *d)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1634 {
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1049
diff changeset
1635 g_free(d);
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1049
diff changeset
1636 }
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1049
diff changeset
1637
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1638 gchar **info_img_handler(gchar *url)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1639 {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1640 if (!g_strcasecmp(url, "free_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1641 return free_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1642 if (!g_strcasecmp(url, "aol_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1643 return aol_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1644 if (!g_strcasecmp(url, "dt_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1645 return dt_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1646 if (!g_strcasecmp(url, "admin_icon.gif"))
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1647 return admin_icon_xpm;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1648 return NULL;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1649 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1650
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1651 void g_show_info_text(char *info, ...)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1652 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1653 GtkWidget *ok;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1654 GtkWidget *label;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1655 GtkWidget *text;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1656 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1657 GtkWidget *sw;
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1658 gint options = 0;
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1659 char *more_info;
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1660 va_list ap;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1661
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1662 struct info_dlg *b = g_new0(struct info_dlg, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1663
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1664 va_start(ap, info);
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1665
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1666 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
887
c0ff16ef5e75 [gaim-migrate @ 897]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 873
diff changeset
1667 gtk_window_set_title(GTK_WINDOW(b->window), "Gaim");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1668 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1669 bbox = gtk_vbox_new(FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1670 gtk_container_add(GTK_CONTAINER(b->window), bbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1671 gtk_widget_realize(GTK_WIDGET(b->window));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1672 ok = picture_button(b->window, _("OK"), ok_xpm);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1673 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1674 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(info_dlg_free), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1675 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1676
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1677 label = gtk_label_new(_("Below are the results of your search: "));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1678
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1679 sw = gtk_scrolled_window_new(NULL, NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1680 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1681 text = gtk_imhtml_new(NULL, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1682 b->text = text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1683 gtk_container_add(GTK_CONTAINER(sw), text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1684
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1685 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1686 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1687 gtk_widget_set_usize(sw, 300, 250);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1688 gtk_imhtml_set_img_handler(GTK_IMHTML(text), info_img_handler);
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
1689 gaim_setup_imhtml(text);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1690
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1691 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1692 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
1693 gtk_box_pack_start(GTK_BOX(bbox), ok, FALSE, FALSE, 0);
619
faa7603ae02e [gaim-migrate @ 629]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1694
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1695 aol_icon(b->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1696 gtk_widget_show_all(b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1697
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
1698 if (convo_options & OPT_CONVO_IGNORE_COLOUR)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1699 options ^= GTK_IMHTML_NO_COLOURS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
1700 if (convo_options & OPT_CONVO_IGNORE_FONTS)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1701 options ^= GTK_IMHTML_NO_FONTS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
1702 if (convo_options & OPT_CONVO_IGNORE_SIZES)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
1703 options ^= GTK_IMHTML_NO_SIZES;
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1704 options ^= GTK_IMHTML_NO_COMMENTS;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1705 options ^= GTK_IMHTML_NO_TITLE;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1706 options ^= GTK_IMHTML_NO_NEWLINE;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1707 options ^= GTK_IMHTML_NO_SCROLL;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1708 gtk_imhtml_append_text(GTK_IMHTML(b->text), info, options);
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1709 while ((more_info = va_arg(ap, char *)) != NULL)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1710 gtk_imhtml_append_text(GTK_IMHTML(b->text), more_info, options);
2137
18722ae5b882 [gaim-migrate @ 2147]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1711 va_end(ap);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1399
diff changeset
1712 gtk_imhtml_append_text(GTK_IMHTML(b->text), "<BR>", 0);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 334
diff changeset
1713
550
6bd2bbc1b6c8 [gaim-migrate @ 560]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
1714 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
1715 }
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 245
diff changeset
1716
1
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 /* The dialog for adding to permit/deny */
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1721
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1722 static void do_add_perm(GtkWidget *w, struct addperm *p)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1723 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1724
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1725 char *who;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1726 char *name;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1727
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1728
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1729 who = gtk_entry_get_text(GTK_ENTRY(p->entry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1730
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1731 name = g_malloc(strlen(who) + 2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1732 g_snprintf(name, strlen(who) + 2, "%s", who);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1733
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1734 if (!p->permit) {
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1735 GSList *d = p->gc->deny;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1736 char *n;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1737 n = g_strdup(normalize(name));
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1738 while (d) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
1739 if (!g_strcasecmp(n, normalize(d->data)))
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1740 break;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1741 d = d->next;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1742 }
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1743 g_free(n);
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1744 if (!d) {
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1745 p->gc->deny = g_slist_append(p->gc->deny, name);
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1746 build_block_list();
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1747 serv_add_deny(p->gc, name);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
1748 do_export(p->gc);
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1749 } else
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1750 g_free(name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1751 } else {
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1752 GSList *d = p->gc->permit;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1753 char *n;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1754 n = g_strdup(normalize(name));
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1755 while (d) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1979
diff changeset
1756 if (!g_strcasecmp(n, normalize(d->data)))
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1757 break;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1758 d = d->next;
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1759 }
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1760 g_free(n);
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1761 if (!d) {
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1762 p->gc->permit = g_slist_append(p->gc->permit, name);
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1763 build_allow_list();
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1764 serv_add_permit(p->gc, name);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
1765 do_export(p->gc);
1126
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1766 } else
c8118e7ec981 [gaim-migrate @ 1136]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1767 g_free(name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1768 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1769
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1770 destroy_dialog(NULL, p->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1771 }
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1774
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1775 void show_add_perm(struct gaim_connection *gc, char *who, gboolean permit)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1776 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1777 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1778 GtkWidget *add;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1779 GtkWidget *label;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1780 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1781 GtkWidget *vbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1782 GtkWidget *topbox;
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1783 GtkWidget *frame;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1784
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1785 struct addperm *p = g_new0(struct addperm, 1);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1786 p->gc = gc;
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1787 p->permit = permit;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1788
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1789 p->window = gtk_window_new(GTK_WINDOW_DIALOG);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1790 gtk_container_set_border_width(GTK_CONTAINER(p->window), 5);
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1791 gtk_window_set_policy(GTK_WINDOW(p->window), FALSE, FALSE, TRUE);
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1792 gtk_widget_realize(p->window);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1793
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1794 dialogwindows = g_list_prepend(dialogwindows, p->window);
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1795
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1796 bbox = gtk_hbox_new(TRUE, 10);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1797 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1798 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1799 p->entry = gtk_entry_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1800
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1801 if (permit)
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1802 frame = gtk_frame_new(_("Permit"));
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1803 else
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1804 frame = gtk_frame_new(_("Deny"));
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1805
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1806 /* Build Add Button */
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1807
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1808 if (permit)
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1809 add = picture_button(p->window, _("Permit"), add_xpm);
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1810 else
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1811 add = picture_button(p->window, _("Deny"), add_xpm);
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1812 cancel = picture_button(p->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1813
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1814 /* End of Cancel Button */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1815 if (who != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1816 gtk_entry_set_text(GTK_ENTRY(p->entry), who);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1817
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1818 /* Put the buttons in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1819
486
1045f51bcae7 [gaim-migrate @ 496]
Rob Flynn <gaim@robflynn.com>
parents: 485
diff changeset
1820 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1821 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1822
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1823 label = gtk_label_new(_("Add"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1824 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1825 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1826 gtk_box_pack_start(GTK_BOX(topbox), p->entry, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1827 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1828 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1829 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
1830 gtk_container_add(GTK_CONTAINER(frame), vbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1831
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1832
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1833 /* Handle closes right */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1834 gtk_signal_connect(GTK_OBJECT(p->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), p->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1835 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), p->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1836 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_add_perm), p);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1837 gtk_signal_connect(GTK_OBJECT(p->entry), "activate", GTK_SIGNAL_FUNC(do_add_perm), p);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1838
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1839 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1840 gtk_widget_show(add);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1841 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1842 gtk_widget_show(p->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1843 gtk_widget_show(topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1844 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1845 gtk_widget_show(vbox);
487
e1021544e257 [gaim-migrate @ 497]
Rob Flynn <gaim@robflynn.com>
parents: 486
diff changeset
1846 gtk_widget_show(frame);
1144
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1847 if (permit)
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1848 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Permit"));
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1849 else
b1454d019277 [gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1141
diff changeset
1850 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Deny"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1851 gtk_window_set_focus(GTK_WINDOW(p->window), p->entry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1852 gtk_container_add(GTK_CONTAINER(p->window), frame);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1853 gtk_widget_realize(p->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1854 aol_icon(p->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1855
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1856 gtk_widget_show(p->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1857 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1858
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1859
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1860 /*------------------------------------------------------------------------*/
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1861 /* Functions Called To Add A Log */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1862 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1863
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1864 void cancel_log(GtkWidget *widget, struct conversation *c)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1865 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1866 if (c->wood) {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1867 set_state_lock(1);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1868 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1869 set_state_lock(0);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1870 }
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1871 dialogwindows = g_list_remove(dialogwindows, c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1872 gtk_widget_destroy(c->log_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1873 c->log_dialog = NULL;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1874 }
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1875
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1876 void do_log(GtkWidget *w, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1877 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1878 struct log_conversation *l;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1879 char buf[128];
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1880 char *file;
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1881 char path[PATHSIZE];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1882
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1883 if (!find_log_info(c->name)) {
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1884 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->log_dialog));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1885 strncpy(path, file, PATHSIZE - 1);
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1886 if (file_is_dir(path, c->log_dialog)) {
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1887 return;
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1888 }
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
1889
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1890 l = (struct log_conversation *)g_new0(struct log_conversation, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1891 strcpy(l->name, c->name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1892 strcpy(l->filename, file);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1893 log_conversations = g_list_append(log_conversations, l);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1894
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1895 if (c != NULL) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1896 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1897 gtk_window_set_title(GTK_WINDOW(c->window), buf);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1898 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1899 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1900
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1901 save_prefs();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1902 cancel_log(NULL, c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1903 }
1
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);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
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"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1911
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1912 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(c->log_dialog));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
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);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1917 gtk_signal_connect(GTK_OBJECT(c->log_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1918 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1919 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1920 GTK_SIGNAL_FUNC(do_log), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1921 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1922 "clicked", GTK_SIGNAL_FUNC(cancel_log), c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1923 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1924
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1925 g_free(buf);
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 24
diff changeset
1926
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1927 gtk_widget_show(c->log_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
1928 gdk_window_raise(c->log_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1929 }
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 /* Find Buddy By Email */
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1935 void do_find_info(GtkWidget *w, struct findbyinfo *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1936 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1937 char *first;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1938 char *middle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1939 char *last;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1940 char *maiden;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1941 char *city;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1942 char *state;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1943 char *country;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1944
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1945 first = gtk_entry_get_text(GTK_ENTRY(b->firstentry));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1946 middle = gtk_entry_get_text(GTK_ENTRY(b->middleentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1947 last = gtk_entry_get_text(GTK_ENTRY(b->lastentry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1948 maiden = gtk_entry_get_text(GTK_ENTRY(b->maidenentry));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1949 city = gtk_entry_get_text(GTK_ENTRY(b->cityentry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1950 state = gtk_entry_get_text(GTK_ENTRY(b->stateentry));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1951 country = gtk_entry_get_text(GTK_ENTRY(b->countryentry));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1952
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
1953 serv_dir_search(b->gc, first, middle, last, maiden, city, state, country, "");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1954 destroy_dialog(NULL, b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1955 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1956
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1957 void do_find_email(GtkWidget *w, struct findbyemail *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1958 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1959 char *email;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1960
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1961 email = gtk_entry_get_text(GTK_ENTRY(b->emailentry));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1962
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
1963 if (b->gc)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1964 serv_dir_search(b->gc, "", "", "", "", "", "", "", email);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
1965 else
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1966 serv_dir_search(connections->data, "", "", "", "", "", "", "", email);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1967
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1968 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1969 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1970
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
1971 void show_find_info(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1972 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1973 GtkWidget *cancel;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1974 GtkWidget *ok;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1975 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1976 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1977 GtkWidget *vbox;
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1978 GtkWidget *hbox;
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1979 GtkWidget *fbox;
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1980 GtkWidget *frame;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1981
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1982 struct findbyinfo *b = g_new0(struct findbyinfo, 1);
2393
a7ecfd3f7714 [gaim-migrate @ 2406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2382
diff changeset
1983 b->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1984 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
1985 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
1986 gtk_window_set_wmclass(GTK_WINDOW(b->window), "find_info", "Gaim");
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1987 gtk_widget_show(b->window);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1988
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1989 dialogwindows = g_list_prepend(dialogwindows, b->window);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1990
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1991 frame = gtk_frame_new(_("Search for Buddy"));
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1992 fbox = gtk_vbox_new(FALSE, 5);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1993
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1994 /* Build OK Button */
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
1995
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1996 ok = picture_button(b->window, _("OK"), ok_xpm);
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
1997 cancel = picture_button(b->window, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1998
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
1999 bbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2000 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2001 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2002
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2003 b->firstentry = gtk_entry_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2004 b->middleentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2005 b->lastentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2006 b->maidenentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2007 b->cityentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2008 b->stateentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2009 b->countryentry = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2010
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2011 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2012 gtk_box_pack_end(GTK_BOX(bbox), ok, FALSE, FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2013
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2014 /* Line 1 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2015 label = gtk_label_new(_("First Name"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2016 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2017
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2018 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2019 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2020 gtk_box_pack_end(GTK_BOX(hbox), b->firstentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2021
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2022 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2023 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2024
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2025 /* Line 2 */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2026
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2027 label = gtk_label_new(_("Middle Name"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2028 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2029
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2030 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2031 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2032 gtk_box_pack_end(GTK_BOX(hbox), b->middleentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2033
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2034 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2035 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2036
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2037 /* Line 3 */
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 label = gtk_label_new(_("Last Name"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2040 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2041
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2042 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2043 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2044 gtk_box_pack_end(GTK_BOX(hbox), b->lastentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2045
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2046 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2047 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2048
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2049 /* Line 4 */
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 label = gtk_label_new(_("Maiden Name"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2052 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2053
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2054 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2055 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2056 gtk_box_pack_end(GTK_BOX(hbox), b->maidenentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2057
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2058 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2059 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2060
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2061 /* Line 5 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2062
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2063 label = gtk_label_new(_("City"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2064 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2065
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2066 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2067 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2068 gtk_box_pack_end(GTK_BOX(hbox), b->cityentry, FALSE, FALSE, 0);
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 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2071 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2072
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2073 /* Line 6 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2074 label = gtk_label_new(_("State"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2075 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2076
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2077 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2078 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2079 gtk_box_pack_end(GTK_BOX(hbox), b->stateentry, FALSE, FALSE, 0);
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 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2082 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2083
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2084 /* Line 7 */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2085 label = gtk_label_new(_("Country"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2086 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2087
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2088 hbox = gtk_hbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2089 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2090 gtk_box_pack_end(GTK_BOX(hbox), b->countryentry, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2091
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2092 gtk_widget_show(hbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2093 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2094
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2095 /* Merge The Boxes */
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2096
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2097 gtk_container_add(GTK_CONTAINER(frame), vbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2098 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2099 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2100
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2101 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2102 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2103 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(do_find_info), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2104
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2105 gtk_widget_show(ok);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2106 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2107 gtk_widget_show(b->firstentry);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2108 gtk_widget_show(b->middleentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2109 gtk_widget_show(b->lastentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2110 gtk_widget_show(b->maidenentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2111 gtk_widget_show(b->cityentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2112 gtk_widget_show(b->stateentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2113 gtk_widget_show(b->countryentry);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2114 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2115 gtk_widget_show(vbox);
479
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2116 gtk_widget_show(frame);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2117 gtk_widget_show(fbox);
d4651fd334c1 [gaim-migrate @ 489]
Rob Flynn <gaim@robflynn.com>
parents: 478
diff changeset
2118
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2119 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Info"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2120 gtk_window_set_focus(GTK_WINDOW(b->window), b->firstentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2121 gtk_container_add(GTK_CONTAINER(b->window), fbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2122 gtk_container_border_width(GTK_CONTAINER(b->window), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2123 gtk_widget_realize(b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2124 aol_icon(b->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2125
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2126 gtk_widget_show(b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2127 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2128
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2129 void show_find_email(struct gaim_connection *gc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2130 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2131 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2132 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2133 GtkWidget *vbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2134 GtkWidget *frame;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2135 GtkWidget *topbox;
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2136 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2137
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2138 struct findbyemail *b = g_new0(struct findbyemail, 1);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2139 if (g_slist_find(connections, gc))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2140 b->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2141 b->window = gtk_window_new(GTK_WINDOW_DIALOG);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2142 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
2143 gtk_window_set_wmclass(GTK_WINDOW(b->window), "find_email", "Gaim");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2144 gtk_widget_realize(b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2145 aol_icon(b->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2146 dialogwindows = g_list_prepend(dialogwindows, b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2147 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2148 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Email"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2149
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2150 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2151 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2152 gtk_container_add(GTK_CONTAINER(b->window), vbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2153
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2154 frame = gtk_frame_new(_("Search for Buddy"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2155 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2156
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2157 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2158 gtk_container_add(GTK_CONTAINER(frame), topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2159 gtk_container_set_border_width(GTK_CONTAINER(topbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2160
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2161 label = gtk_label_new(_("Email"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2162 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2163
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2164 b->emailentry = gtk_entry_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2165 gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2166 gtk_signal_connect(GTK_OBJECT(b->emailentry), "activate", GTK_SIGNAL_FUNC(do_find_email), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2167 gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1488
diff changeset
2168
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2169 bbox = gtk_hbox_new(FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2170 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2171
603
9b0717b4a490 [gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
2172 button = picture_button(b->window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2173 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), b->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2174 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2175
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2176 button = picture_button(b->window, _("OK"), ok_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2177 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_find_email), b);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2178 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
444
e7885c54ed2f [gaim-migrate @ 454]
Rob Flynn <gaim@robflynn.com>
parents: 443
diff changeset
2179
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2180 gtk_widget_show_all(b->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2181 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2182
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2183 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2184 /* Link Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2185 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2186
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2187 void cancel_link(GtkWidget *widget, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2188 {
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2189 if (c->link) {
62
03b65653798b [gaim-migrate @ 72]
Rob Flynn <gaim@robflynn.com>
parents: 61
diff changeset
2190 set_state_lock(1);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2191 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
2192 set_state_lock(0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2193 }
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2194 destroy_dialog(NULL, c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2195 c->link_dialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2196 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2197
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2198 void do_add_link(GtkWidget *widget, struct linkdlg *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2199 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2200 char *open_tag;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2201 char *urltext, *showtext;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2202 open_tag = g_malloc(2048);
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 urltext = gtk_entry_get_text(GTK_ENTRY(b->url));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2206 showtext = gtk_entry_get_text(GTK_ENTRY(b->text));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2207
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2208 g_snprintf(open_tag, 2048, "<A HREF=\"%s\">%s", urltext, showtext);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2209 surround(b->entry, open_tag, "</A>");
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 g_free(open_tag);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2212 destroy_dialog(NULL, b->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2213 }
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
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2216 void show_add_link(GtkWidget *linky, struct conversation *c)
1
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 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2219 GtkWidget *bbox;
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2220 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2221 GtkWidget *label;
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2222 GtkWidget *frame;
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2223 GtkWidget *fbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2224
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2225 if (!c->link_dialog) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2226 struct linkdlg *b = g_new0(struct linkdlg, 1);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2227 c->link_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2228 gtk_window_set_wmclass(GTK_WINDOW(c->link_dialog), "add_link", "Gaim");
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2229 dialogwindows = g_list_prepend(dialogwindows, c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2230
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2231 gtk_widget_set_usize(c->link_dialog, 270, 165);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2232 gtk_window_set_policy(GTK_WINDOW(c->link_dialog), FALSE, FALSE, TRUE);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2233 gtk_widget_show(c->link_dialog);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2234
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2235 vbox = gtk_vbox_new(FALSE, 10);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2236 bbox = gtk_hbox_new(TRUE, 10);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2237 frame = gtk_frame_new(_("Insert Link"));
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2238 fbox = gtk_vbox_new(FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2239
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2240 /* Build OK Button */
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2241
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2242 b->ok = picture_button(c->link_dialog, _("OK"), ok_xpm);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2243 b->cancel = picture_button(c->link_dialog, _("Cancel"), cancel_xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2244
651
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2245 gtk_widget_set_usize(b->ok, 75, 30);
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2246 gtk_widget_set_usize(b->cancel, 75, 30);
650687b7ca0e [gaim-migrate @ 661]
Rob Flynn <gaim@robflynn.com>
parents: 650
diff changeset
2247
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2248 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
2249 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
2250 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2251
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2252 b->url = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2253 b->text = gtk_entry_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2254
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2255 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2256 label = gtk_label_new(_("URL"));
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2257 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2258 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
2259 gtk_widget_show(label);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2260 gtk_widget_show(hbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2261 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2262
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2263 hbox = gtk_hbox_new(FALSE, 5);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2264 label = gtk_label_new(_("Description"));
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2265 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2266 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
2267 gtk_widget_show(label);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2268 gtk_widget_show(hbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2269 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2270
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2271 gtk_widget_show(b->url);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2272 gtk_widget_show(b->text);
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2273 gtk_widget_show(frame);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2274 gtk_widget_show(fbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2275
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2276 gtk_container_add(GTK_CONTAINER(frame), vbox);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2277 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5);
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
2278 gtk_box_pack_start(GTK_BOX(fbox), bbox, TRUE, TRUE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2279 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2280
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2281 gtk_signal_connect(GTK_OBJECT(c->link_dialog), "destroy",
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2282 GTK_SIGNAL_FUNC(cancel_link), c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2283 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", GTK_SIGNAL_FUNC(cancel_link), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2284 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", GTK_SIGNAL_FUNC(do_add_link), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2285
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2286 gtk_container_add(GTK_CONTAINER(c->link_dialog), fbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2287 gtk_container_border_width(GTK_CONTAINER(c->link_dialog), 10);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2288 gtk_window_set_title(GTK_WINDOW(c->link_dialog), _("GAIM - Add URL"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2289 gtk_window_set_focus(GTK_WINDOW(c->link_dialog), b->url);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2290 b->window = c->link_dialog;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2291 b->toggle = linky;
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 609
diff changeset
2292 b->entry = c->entry;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2293 gtk_widget_realize(c->link_dialog);
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2294 aol_icon(c->link_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2295
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2296 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2297
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2298 gtk_widget_show(c->link_dialog);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 607
diff changeset
2299 gdk_window_raise(c->link_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2300 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2301
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2302
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 /* Color Selection Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2305 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2306
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2307 static GtkWidget *fgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2308 static GtkWidget *bgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2309
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2310 void cancel_fgcolor(GtkWidget *widget, struct conversation *c)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2311 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2312 if (c->fgcolorbtn && widget) {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2313 set_state_lock(1);
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 843
diff changeset
2314 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->fgcolorbtn), FALSE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2315 set_state_lock(0);
61
72e6a6eb1852 [gaim-migrate @ 71]
Rob Flynn <gaim@robflynn.com>
parents: 38
diff changeset
2316 }
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2317 dialogwindows = g_list_remove(dialogwindows, c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2318 gtk_widget_destroy(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2319 c->fg_color_dialog = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2320 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2321
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2322 void cancel_bgcolor(GtkWidget *widget, struct conversation *c)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2323 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2324 if (c->bgcolorbtn && widget) {
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2325 set_state_lock(1);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2326 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->bgcolorbtn), FALSE);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2327 set_state_lock(0);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2328 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2329 dialogwindows = g_list_remove(dialogwindows, c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2330 gtk_widget_destroy(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2331 c->bg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2332 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2333
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2334 void do_fgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2335 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2336 gdouble color[3];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2337 GdkColor text_color;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2338 struct conversation *c;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2339 char *open_tag;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2340
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2341 open_tag = g_malloc(30);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2342
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2343 gtk_color_selection_get_color(colorsel, color);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2344
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2345 c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
411
a330017b3aa4 [gaim-migrate @ 421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 401
diff changeset
2346 /* GTK_IS_EDITABLE(c->entry); huh? */
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2347
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2348 text_color.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2349 text_color.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2350 text_color.blue = ((guint16)(color[2] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2351
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
2352 c->fgcol = text_color;
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
2353 c->hasfg = 1;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2354 g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2355 text_color.blue);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2356 surround(c->entry, open_tag, "</FONT>");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1238
diff changeset
2357 debug_printf("#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2358 g_free(open_tag);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2359 cancel_fgcolor(NULL, c);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2360 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2361
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2362 void do_bgcolor(GtkWidget *widget, GtkColorSelection *colorsel)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2363 {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2364 gdouble color[3];
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2365 GdkColor text_color;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2366 struct conversation *c;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2367 char *open_tag;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2368
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2369 open_tag = g_malloc(30);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2370
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2371 gtk_color_selection_get_color(colorsel, color);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2372
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2373 c = gtk_object_get_user_data(GTK_OBJECT(colorsel));
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2374 /* GTK_IS_EDITABLE(c->entry); huh? */
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2375
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2376 text_color.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2377 text_color.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2378 text_color.blue = ((guint16)(color[2] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2379
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2380 c->bgcol = text_color;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2381 c->hasbg = 1;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2382 g_snprintf(open_tag, 25, "<BODY BGCOLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2383 text_color.blue);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2384 surround(c->entry, open_tag, "</BODY>");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1238
diff changeset
2385 debug_printf("#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2386 g_free(open_tag);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2387 cancel_bgcolor(NULL, c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2388 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2389
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2390 static void destroy_colorsel(GtkWidget *w, gpointer d)
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2391 {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2392 if (d) {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2393 gtk_widget_destroy(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2394 fgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2395 } else {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2396 gtk_widget_destroy(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2397 bgcseld = NULL;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2398 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2399 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2400
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2401 static void apply_color_dlg(GtkWidget *w, gpointer d)
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2402 {
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2403 gdouble color[3];
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2404 if ((int)d == 1) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2405 gtk_color_selection_get_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2406 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), color);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2407 destroy_colorsel(NULL, (void *)1);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2408
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2409 fgcolor.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2410 fgcolor.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2411 fgcolor.blue = ((guint16)(color[2] * 65535)) >> 8;
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 858
diff changeset
2412 update_color(NULL, pref_fg_picture);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1748
diff changeset
2413 update_convo_color(TRUE);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2414 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2415 gtk_color_selection_get_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2416 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), color);
675
b77c039c9d3d [gaim-migrate @ 685]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
2417 destroy_colorsel(NULL, (void *)0);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2418
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2419 bgcolor.red = ((guint16)(color[0] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2420 bgcolor.green = ((guint16)(color[1] * 65535)) >> 8;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2421 bgcolor.blue = ((guint16)(color[2] * 65535)) >> 8;
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 858
diff changeset
2422 update_color(NULL, pref_bg_picture);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1748
diff changeset
2423 update_convo_color(FALSE);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2424 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2425 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2426
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2427 void show_fgcolor_dialog(struct conversation *c, GtkWidget *color)
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 GtkWidget *colorsel;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2430 gdouble fgclr[3];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2431
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2432 if (color == NULL) { /* we came from the prefs */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2433 if (fgcseld)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2434 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2435 fgclr[0] = (gdouble)(fgcolor.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2436 fgclr[1] = (gdouble)(fgcolor.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2437 fgclr[2] = (gdouble)(fgcolor.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2438
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2439 fgcseld = gtk_color_selection_dialog_new(_("Select Text Color"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2440 gtk_color_selection_set_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2441 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), fgclr);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2442 gtk_signal_connect(GTK_OBJECT(fgcseld), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2443 GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2444 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2445 "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2446 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2447 GTK_SIGNAL_FUNC(apply_color_dlg), (void *)1);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2448 gtk_widget_realize(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2449 aol_icon(fgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2450 gtk_widget_show(fgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2451 gdk_window_raise(fgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2452 return;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2453 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2454
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2455 if (!c->fg_color_dialog) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2456 fgclr[0] = (gdouble)(c->fgcol.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2457 fgclr[1] = (gdouble)(c->fgcol.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2458 fgclr[2] = (gdouble)(c->fgcol.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2459
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2460 c->fg_color_dialog = gtk_color_selection_dialog_new(_("Select Text Color"));
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2461 colorsel = GTK_COLOR_SELECTION_DIALOG(c->fg_color_dialog)->colorsel;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2462 gtk_color_selection_set_color(GTK_COLOR_SELECTION(colorsel), fgclr);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2463 gtk_object_set_user_data(GTK_OBJECT(colorsel), c);
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2464
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2465 gtk_signal_connect(GTK_OBJECT(c->fg_color_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2466 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2467 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->fg_color_dialog)->ok_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2468 "clicked", GTK_SIGNAL_FUNC(do_fgcolor), colorsel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2469 gtk_signal_connect(GTK_OBJECT
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2470 (GTK_COLOR_SELECTION_DIALOG(c->fg_color_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2471 "clicked", GTK_SIGNAL_FUNC(cancel_fgcolor), c);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2472
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2473 gtk_widget_realize(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2474 aol_icon(c->fg_color_dialog->window);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2475 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2476
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2477 gtk_widget_show(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2478 gdk_window_raise(c->fg_color_dialog->window);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2479 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2480
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2481 void show_bgcolor_dialog(struct conversation *c, GtkWidget *color)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2482 {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2483 GtkWidget *colorsel;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2484 gdouble bgclr[3];
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2485
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2486 if (color == NULL) { /* we came from the prefs */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2487 if (bgcseld)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2488 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2489 bgclr[0] = (gdouble)(bgcolor.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2490 bgclr[1] = (gdouble)(bgcolor.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2491 bgclr[2] = (gdouble)(bgcolor.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2492
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2493 bgcseld = gtk_color_selection_dialog_new(_("Select Background Color"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2494 gtk_color_selection_set_color(GTK_COLOR_SELECTION
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2495 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), bgclr);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2496 gtk_signal_connect(GTK_OBJECT(bgcseld), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2497 GTK_SIGNAL_FUNC(destroy_colorsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2498 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2499 "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2500 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2501 GTK_SIGNAL_FUNC(apply_color_dlg), (void *)2);
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2502 gtk_widget_realize(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2503 aol_icon(bgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2504 gtk_widget_show(bgcseld);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2505 gdk_window_raise(bgcseld->window);
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2506 return;
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2507 }
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
2508
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2509 if (!c->bg_color_dialog) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2510 bgclr[0] = (gdouble)(c->bgcol.red) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2511 bgclr[1] = (gdouble)(c->bgcol.green) / 255;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2512 bgclr[2] = (gdouble)(c->bgcol.blue) / 255;
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2513
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2514 c->bg_color_dialog = gtk_color_selection_dialog_new(_("Select Text Color"));
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2515 colorsel = GTK_COLOR_SELECTION_DIALOG(c->bg_color_dialog)->colorsel;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2516 gtk_color_selection_set_color(GTK_COLOR_SELECTION(colorsel), bgclr);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2517 gtk_object_set_user_data(GTK_OBJECT(colorsel), c);
2209
9b8b32ae3b41 [gaim-migrate @ 2219]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2143
diff changeset
2518
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2519 gtk_signal_connect(GTK_OBJECT(c->bg_color_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2520 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2521 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->bg_color_dialog)->ok_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2522 "clicked", GTK_SIGNAL_FUNC(do_bgcolor), colorsel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2523 gtk_signal_connect(GTK_OBJECT
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2524 (GTK_COLOR_SELECTION_DIALOG(c->bg_color_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2525 "clicked", GTK_SIGNAL_FUNC(cancel_bgcolor), c);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2526
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2527 gtk_widget_realize(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2528 aol_icon(c->bg_color_dialog->window);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2529 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2530
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2531 gtk_widget_show(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
2532 gdk_window_raise(c->bg_color_dialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2533 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2534
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2535 /*------------------------------------------------------------------------*/
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2536 /* Font Selection Dialog */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2537 /*------------------------------------------------------------------------*/
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2538
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2539 void cancel_font(GtkWidget *widget, struct conversation *c)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2540 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2541 if (c->font && widget) {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2542 set_state_lock(1);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2543 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2544 set_state_lock(0);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2545 }
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2546 dialogwindows = g_list_remove(dialogwindows, c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2547 gtk_widget_destroy(c->font_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2548 c->font_dialog = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2549 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2550
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2551 void apply_font(GtkWidget *widget, GtkFontSelection *fontsel)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2552 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2553 /* this could be expanded to include font size, weight, etc.
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2554 but for now only works with font face */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2555 int i, j = 0, k = 0;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2556 char *fontname;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2557 char font[64];
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2558 struct conversation *c = gtk_object_get_user_data(GTK_OBJECT(fontsel));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2559
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2560 if (c) {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2561 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
2562
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2563 for (i = 0; i < strlen(fontname); i++) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2564 if (fontname[i] == '-') {
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2565 if (++j > 2)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2566 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2567 } else if (j == 2)
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2568 font[k++] = fontname[i];
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2569 }
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2570 font[k] = '\0';
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2571
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1238
diff changeset
2572 debug_printf("Setting font face %s\n", font);
488
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 487
diff changeset
2573
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2574 set_font_face(font, c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2575 } else {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2576 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2577
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2578 for (i = 0; i < strlen(fontname); i++) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2579 if (fontname[i] == '-') {
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2580 if (++j > 2)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2581 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2582 } else if (j == 2)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2583 fontface[k++] = fontname[i];
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2584 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2585 fontface[k] = '\0';
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2586 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2587
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2588 cancel_font(NULL, c);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2589 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2590
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2591 static GtkWidget *fontseld;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2592
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2593 void destroy_fontsel(GtkWidget *w, gpointer d)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2594 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2595 gtk_widget_destroy(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2596 fontseld = NULL;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2597 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2598
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2599 void apply_font_dlg(GtkWidget *w, GtkWidget *f)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2600 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2601 int i, j = 0, k = 0;
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2602 char *fontname;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 657
diff changeset
2603
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2604 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
2605 destroy_fontsel(0, 0);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2606 for (i = 0; i < strlen(fontname); i++) {
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2607 if (fontname[i] == '-') {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2608 if (++j > 2)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2609 break;
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2610 } else if (j == 2)
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2611 fontface[k++] = fontname[i];
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2612 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2613 fontface[k] = '\0';
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1748
diff changeset
2614 update_convo_font();
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2615 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2616
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2617 void show_font_dialog(struct conversation *c, GtkWidget *font)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2618 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2619
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2620 if (!font) { /* we came from the prefs dialog */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2621 if (fontseld)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2622 return;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2623 fontseld = gtk_font_selection_dialog_new(_("Select Font"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2624 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2625 DEFAULT_FONT_NAME);
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2626
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2627 gtk_object_set_user_data(GTK_OBJECT(fontseld), NULL);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2628 gtk_signal_connect(GTK_OBJECT(fontseld), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2629 GTK_SIGNAL_FUNC(destroy_fontsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2630 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2631 "clicked", GTK_SIGNAL_FUNC(destroy_fontsel), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2632 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->ok_button), "clicked",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2633 GTK_SIGNAL_FUNC(apply_font_dlg), NULL);
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2634 gtk_widget_realize(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2635 aol_icon(fontseld->window);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2636 gtk_widget_show(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2637 gdk_window_raise(fontseld->window);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2638 return;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2639 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2640
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2641 if (!c->font_dialog) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2642 c->font_dialog = gtk_font_selection_dialog_new(_("Select Font"));
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 231
diff changeset
2643
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2644 if (font)
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2645 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
2646 else
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
2647 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), NULL);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2648
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2649 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *) c->font_dialog,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2650 DEFAULT_FONT_NAME);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2651
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2652 gtk_signal_connect(GTK_OBJECT(c->font_dialog), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2653 GTK_SIGNAL_FUNC(delete_event_dialog), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2654 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->ok_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2655 "clicked", GTK_SIGNAL_FUNC(apply_font), c->font_dialog);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2656 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2657 "clicked", GTK_SIGNAL_FUNC(cancel_font), c);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2658
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2659 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *) c->font_dialog,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2660 DEFAULT_FONT_NAME);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2661
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2662 gtk_widget_realize(c->font_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2663
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2664 aol_icon(c->font_dialog->window);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2665 }
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2666 gtk_widget_show(c->font_dialog);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 308
diff changeset
2667 gdk_window_raise(c->font_dialog->window);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2668 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2669
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
2670 /*------------------------------------------------------------------------*/
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2671 /* The dialog for import/export */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2672 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2673
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2674 static void do_import_dialog(GtkWidget *w, struct gaim_connection *gc)
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2675 {
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2676 char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2677 if (file_is_dir(file, importdialog)) {
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2678 return;
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2679 }
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2680 do_import(importgc, file);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2681 do_export(importgc);
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2682 destroy_dialog(NULL, importdialog);
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2683 }
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2684
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2685 static void set_import_gc(gpointer data, struct gaim_connection *gc)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2686 {
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2687 importgc = gc;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2688 }
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2689
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2690 static void create_import_dropdown(GtkFileSelection *fs)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2691 {
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2692 GtkWidget *hbox;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2693 GtkWidget *label;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2694 GSList *g = connections;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2695 struct gaim_connection *c;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2696 GtkWidget *optmenu;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2697 GtkWidget *menu;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2698 char buf[256];
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2699 GtkWidget *opt;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2700
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2701 if (!connections)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2702 return;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2703 importgc = connections->data;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2704 if (!connections->next)
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2705 return;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2706
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2707 hbox = gtk_hbox_new(FALSE, 0);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2708 gtk_box_pack_end(GTK_BOX(fs->action_area), hbox, FALSE, FALSE, 0);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2709 gtk_widget_show(hbox);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2710
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2711 optmenu = gtk_option_menu_new();
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2712 gtk_box_pack_end(GTK_BOX(hbox), optmenu, FALSE, FALSE, 5);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2713 gtk_widget_show(optmenu);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2714
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2715 label = gtk_label_new(_("Import to:"));
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2716 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 5);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2717 gtk_widget_show(label);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2718
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2719 menu = gtk_menu_new();
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2720
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2721 while (g) {
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2722 c = (struct gaim_connection *)g->data;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2723 g_snprintf(buf, sizeof buf, "%s (%s)", c->username, (*c->prpl->name)());
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2724 opt = gtk_menu_item_new_with_label(buf);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2725 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_import_gc), c);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2726 gtk_widget_show(opt);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2727 gtk_menu_append(GTK_MENU(menu), opt);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2728 g = g->next;
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2729 }
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2730
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2731 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2732 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0);
229
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2733 }
e8ea7f37e28f [gaim-migrate @ 239]
Syd Logan <slogan>
parents: 228
diff changeset
2734
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2735 void show_import_dialog()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2736 {
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2737 char *buf = g_malloc(BUF_LEN);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2738 if (!importdialog) {
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2739 importdialog = gtk_file_selection_new(_("Gaim - Import Buddy List"));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2740
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2741 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(importdialog));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2742
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2743 g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME"));
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2744
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2745 gtk_file_selection_set_filename(GTK_FILE_SELECTION(importdialog), buf);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2746 gtk_signal_connect(GTK_OBJECT(importdialog), "destroy",
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2747 GTK_SIGNAL_FUNC(destroy_dialog), importdialog);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2748
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2749 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->ok_button),
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2750 "clicked", GTK_SIGNAL_FUNC(do_import_dialog), NULL);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2751 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->cancel_button),
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2752 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), importdialog);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2753
2493
1b7a1133962d [gaim-migrate @ 2506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2472
diff changeset
2754 create_import_dropdown(GTK_FILE_SELECTION(importdialog));
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 198
diff changeset
2755 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
2756
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2757 g_free(buf);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2758 gtk_widget_show(importdialog);
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
2759 gdk_window_raise(importdialog->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2760 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2761
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2762 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2763 /* The dialog for new away messages */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2764 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2765
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2766 static struct away_message *save_away_message(struct create_away *ca)
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2767 {
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2768 struct away_message *am;
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2769 guint text_len;
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2770 gchar *away_message;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2771
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2772 if (!ca->mess)
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2773 am = g_new0(struct away_message, 1);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2774 else
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2775 am = ca->mess;
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2776
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2777 g_snprintf(am->name, sizeof(am->name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2778 text_len = gtk_text_get_length(GTK_TEXT(ca->text));
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2779 away_message = gtk_editable_get_chars(GTK_EDITABLE(ca->text), 0, text_len);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2780
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2781 g_snprintf(am->message, sizeof(am->message), "%s", away_message);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2782 g_free(away_message);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2783
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2784 if (!ca->mess) {
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2785 away_messages = g_slist_insert_sorted(away_messages, am, sort_awaymsg_list);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2786 }
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2787
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2788 save_prefs();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2789 do_away_menu();
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2790 if (prefs_away_list != NULL)
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 935
diff changeset
2791 gtk_list_select_item(GTK_LIST(prefs_away_list), g_slist_index(away_messages, am));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2792
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2793 return am;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2794 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2795
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2796 int check_away_mess(struct create_away *ca, int type)
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2797 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2798 if ((strlen(gtk_entry_get_text(GTK_ENTRY(ca->entry))) == 0) && (type == 1)) {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2799 /* We shouldn't allow a blank title */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2800 do_error_dialog(_("You cannot create an away message with a blank title"),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2801 _("Gaim - Error"));
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2802 return 0;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2803 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2804
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2805 if ((gtk_text_get_length(GTK_TEXT(ca->text)) == 0) && (type <= 1)) {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2806 /* We shouldn't allow a blank message */
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2807 do_error_dialog(_("You cannot create an empty away message"), _("Gaim - Error"));
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2808 return 0;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2809 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2810
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2811 return 1;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2812 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2813
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2814 void save_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2815 {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2816 if (!check_away_mess(ca, 1))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2817 return;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2818
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2819 save_away_message(ca);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2820 destroy_dialog(NULL, ca->window);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2821 g_free(ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2822 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2823
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2824 void use_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2825 {
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2826 static struct away_message am;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2827 guint text_len;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2828 gchar *away_message;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2829
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2830 if (!check_away_mess(ca, 0))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2831 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2832
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2833 g_snprintf(am.name, sizeof(am.name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2834 text_len = gtk_text_get_length(GTK_TEXT(ca->text));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2835 if (text_len < 0)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2836 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2837 away_message = gtk_editable_get_chars(GTK_EDITABLE(ca->text), 0, text_len);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2838
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2839 g_snprintf(am.message, sizeof(am.message), "%s", away_message);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2840 g_free(away_message);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2841
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2842 do_away_message(NULL, &am);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2843
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2844 destroy_dialog(NULL, ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2845 g_free(ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2846 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2847
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2848 void su_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2849 {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2850 if (!check_away_mess(ca, 1))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
2851 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2852 do_away_message(NULL, save_away_message(ca));
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2853 destroy_dialog(NULL, ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2854 g_free(ca);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
2855 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2856
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2857 void create_away_mess(GtkWidget *widget, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2858 {
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2859 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2860 GtkWidget *titlebox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2861 GtkWidget *tbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2862 GtkWidget *sw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2863 GtkWidget *label;
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2864 GtkWidget *frame;
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2865 GtkWidget *fbox;
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2866 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2867
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2868 struct create_away *ca = g_new0(struct create_away, 1);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2869
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2870 /* Set up window */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2871 ca->window = gtk_window_new(GTK_WINDOW_DIALOG);
1369
0b4278a90323 [gaim-migrate @ 1379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1365
diff changeset
2872 gtk_widget_set_usize(ca->window, -1, 250);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2873 gtk_container_border_width(GTK_CONTAINER(ca->window), 5);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
2874 gtk_window_set_wmclass(GTK_WINDOW(ca->window), "away_mess", "Gaim");
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2875 gtk_window_set_title(GTK_WINDOW(ca->window), _("Gaim - New away message"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2876 gtk_signal_connect(GTK_OBJECT(ca->window), "delete_event",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2877 GTK_SIGNAL_FUNC(destroy_dialog), ca->window);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2878 gtk_widget_realize(ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2879 aol_icon(ca->window->window);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2880
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2881 tbox = gtk_vbox_new(FALSE, 5);
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2882 gtk_container_add(GTK_CONTAINER(ca->window), tbox);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2883 gtk_widget_show(tbox);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2884
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2885 frame = gtk_frame_new(_("New away message"));
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2886 gtk_box_pack_start(GTK_BOX(tbox), frame, TRUE, TRUE, 0);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2887 gtk_widget_show(frame);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2888
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
2889 fbox = gtk_vbox_new(FALSE, 5);
1224
0bbe3aaa6a3e [gaim-migrate @ 1234]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1216
diff changeset
2890 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2891 gtk_container_add(GTK_CONTAINER(frame), fbox);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2892 gtk_widget_show(fbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2893
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2894 titlebox = gtk_hbox_new(FALSE, 5);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2895 gtk_box_pack_start(GTK_BOX(fbox), titlebox, FALSE, FALSE, 0);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2896 gtk_widget_show(titlebox);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2897
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2898 label = gtk_label_new(_("Away title: "));
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
2899 gtk_box_pack_start(GTK_BOX(titlebox), label, FALSE, FALSE, 0);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
2900 gtk_widget_show(label);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2901
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2902 ca->entry = gtk_entry_new();
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
2903 gtk_box_pack_start(GTK_BOX(titlebox), ca->entry, TRUE, TRUE, 0);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2904 gtk_widget_grab_focus(ca->entry);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2905 gtk_widget_show(ca->entry);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2906
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2907 sw = gtk_scrolled_window_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2908 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2909 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2910 gtk_box_pack_start(GTK_BOX(fbox), sw, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2911 gtk_widget_show(sw);
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 ca->text = gtk_text_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2914 gtk_text_set_word_wrap(GTK_TEXT(ca->text), TRUE);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
2915 gtk_text_set_editable(GTK_TEXT(ca->text), TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2916 gtk_container_add(GTK_CONTAINER(sw), ca->text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2917 gtk_widget_show(ca->text);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2918
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2919 if (dummy && GTK_LIST(prefs_away_list)->selection) {
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2920 GtkWidget *item = GTK_LIST(prefs_away_list)->selection->data;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2921 struct away_message *amt = gtk_object_get_user_data(GTK_OBJECT(item));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2922 int pos = 0;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2923 gtk_entry_set_text(GTK_ENTRY(ca->entry), amt->name);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2924 gtk_editable_insert_text(GTK_EDITABLE(ca->text), amt->message,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2925 strlen(amt->message), &pos);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2926 ca->mess = amt;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2927 }
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
2928
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2929 hbox = gtk_hbox_new(FALSE, 5);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2930 gtk_box_pack_start(GTK_BOX(tbox), hbox, FALSE, FALSE, 0);
439
9e5a6c35dd64 [gaim-migrate @ 449]
Rob Flynn <gaim@robflynn.com>
parents: 423
diff changeset
2931 gtk_widget_show(hbox);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2932
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2933 button = picture_button(ca->window, _("Cancel"), cancel_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2934 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), ca->window);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2935 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2936
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2937 button = picture_button(ca->window, _("Use"), gnome_preferences_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2938 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(use_away_mess), ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2939 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2940
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2941 button = picture_button(ca->window, _("Save & Use"), add_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2942 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(su_away_mess), ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2943 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2944
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2945 button = picture_button(ca->window, _("Save"), ok_xpm);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2946 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(save_away_mess), ca);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2947 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2948
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
2949 gtk_widget_show(ca->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2950 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2951
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2952 /* smiley dialog */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2953
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2954 void close_smiley_dialog(GtkWidget *widget, struct conversation *c)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2955 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2956 if (c->smiley) {
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2957 set_state_lock(1);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2958 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2959 set_state_lock(0);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 567
diff changeset
2960 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2961 dialogwindows = g_list_remove(dialogwindows, c->smiley_dialog);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2962 gtk_widget_destroy(c->smiley_dialog);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2963 c->smiley_dialog = NULL;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2964 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2965
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2966 void set_smiley_array(GtkWidget *widget, int smiley_type)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2967 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2968 int i;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2969
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2970 for (i = 0; i < FACE_TOTAL; i++)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2971 smiley_array[i] = 0;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2972
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2973 smiley_array[smiley_type] = 1;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2974
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2975 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2976 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2977
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2978 void insert_smiley_text(GtkWidget *widget, struct conversation *c)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2979 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2980 char *smiley_text;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2981 int i;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2982
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2983 for (i = 0; i < FACE_TOTAL; i++)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2984 if (smiley_array[i] == 1)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2985 break;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
2986
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2987 switch (i) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2988 case (FACE_ANGEL):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2989 smiley_text = g_strndup("O:-)", strlen("O:-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2990 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2991 case (FACE_BIGSMILE):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2992 smiley_text = g_strndup(":-D", strlen(":-D"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2993 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2994 case (FACE_BURP):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2995 smiley_text = g_strndup(":-!", strlen(":-!"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2996 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2997 case (FACE_CROSSEDLIPS):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2998 smiley_text = g_strndup(":-X", strlen(":-X"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
2999 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3000 case (FACE_CRY):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3001 smiley_text = g_strndup(":'(", strlen(":'("));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3002 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3003 case (FACE_EMBARRASSED):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3004 smiley_text = g_strndup(":-[", strlen(":-["));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3005 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3006 case (FACE_KISS):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3007 smiley_text = g_strndup(":-*", strlen(":-*"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3008 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3009 case (FACE_MONEYMOUTH):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3010 smiley_text = g_strndup(":-$", strlen(":-$"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3011 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3012 case (FACE_SAD):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3013 smiley_text = g_strndup(":-(", strlen(":-("));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3014 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3015 case (FACE_SCREAM):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3016 smiley_text = g_strndup("=-O", strlen("=-O"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3017 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3018 case (FACE_SMILE):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3019 smiley_text = g_strndup(":-)", strlen(":-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3020 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3021 case (FACE_SMILE8):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3022 smiley_text = g_strndup("8-)", strlen("8-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3023 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3024 case (FACE_THINK):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3025 smiley_text = g_strndup(":-/", strlen(":-/"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3026 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3027 case (FACE_TONGUE):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3028 smiley_text = g_strndup(":-P", strlen(":-p"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3029 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3030 case (FACE_WINK):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3031 smiley_text = g_strndup(";-)", strlen(";-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3032 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3033 case (FACE_YELL):
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3034 smiley_text = g_strndup(">:o", strlen(">:o"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3035 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3036 default:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3037 smiley_text = g_strndup(":-)", strlen(":-)"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3038 break;
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3039 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3040
751
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3041 /* surround(c->entry, smiley_text, ""); */
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3042
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3043 if (GTK_EDITABLE(c->entry)->has_selection) {
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3044 int finish = GTK_EDITABLE(c->entry)->selection_end_pos;
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3045 gtk_editable_insert_text(GTK_EDITABLE(c->entry),
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3046 smiley_text, strlen(smiley_text), &finish);
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3047 } else {
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3048 int pos = GTK_EDITABLE(c->entry)->current_pos;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3049 gtk_editable_insert_text(GTK_EDITABLE(c->entry), smiley_text, strlen(smiley_text), &pos);
751
a022b57ed84a [gaim-migrate @ 761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
3050 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3051
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3052 g_free(smiley_text);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3053
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3054 close_smiley_dialog(NULL, c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3055
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3056 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3057 }
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3058
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3059 static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3060 int face)
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3061 {
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3062 GtkWidget *tpm;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3063 GdkBitmap *mask;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3064 GdkPixmap *dpm;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3065 GtkWidget *button;
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3066
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3067 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
3068 tpm = gtk_pixmap_new(dpm, mask);
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3069 gtk_widget_show(tpm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
3070 gdk_pixmap_unref(dpm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 786
diff changeset
3071 gdk_bitmap_unref(mask);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3072 button =
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3073 gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3074 NULL, tpm, GTK_SIGNAL_FUNC(set_smiley_array), (int *)face);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3075 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
3076
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3077 /* these look really weird with borders */
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3078 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3079 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3080
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3081 void show_smiley_dialog(struct conversation *c, GtkWidget *widget)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3082 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3083 GtkWidget *dialog;
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3084 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
3085 GtkWidget *win;
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3086 GtkWidget *bbox;
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 if (c->smiley_dialog)
558
f1b8f03db83f [gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 555
diff changeset
3089 return;
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3090
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3091 win = c->window;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3092
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3093 dialog = gtk_window_new(GTK_WINDOW_DIALOG);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
3094 gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 887
diff changeset
3095 gtk_window_set_wmclass(GTK_WINDOW(dialog), "smiley_dialog", "Gaim");
934
e5da96def4bd [gaim-migrate @ 944]
Rob Flynn <gaim@robflynn.com>
parents: 928
diff changeset
3096 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3097
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3098 /* setup boxes */
582
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3099 vbox = gtk_vbox_new(TRUE, 5);
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3100 bbox = gtk_hbox_new(FALSE, 5);
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3101
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3102 smiley_box_1 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3103 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
3104 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
3105 smiley_box_4 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3106
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3107 /* setup buttons */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3108
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3109 /* pack buttons */
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3110 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
3111 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
3112 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
3113 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
3114
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3115 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
3116 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
3117 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
3118 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
3119
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3120 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
3121 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
3122 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
3123 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
3124
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3125 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
3126 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
3127 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
3128 toolbar_add_smiley(c, smiley_box_4, yell_xpm, win, FACE_YELL);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3129
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3130 /* pack containers */
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3131 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_1, TRUE, TRUE, 0);
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3132 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
3133 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
3134 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
3135
7409d7ae6621 [gaim-migrate @ 592]
Rob Flynn <gaim@robflynn.com>
parents: 579
diff changeset
3136 gtk_container_add(GTK_CONTAINER(dialog), vbox);
579
7b501c39a6ee [gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 577
diff changeset
3137 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3138
605
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3139 /* connect signals */
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3140 gtk_object_set_user_data(GTK_OBJECT(dialog), "smiley dialog");
1dbc72baf900 [gaim-migrate @ 615]
Todd Kulesza <fflewddur>
parents: 603
diff changeset
3141 gtk_signal_connect(GTK_OBJECT(dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3142
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3143 /* show everything */
567
102afb84ce45 [gaim-migrate @ 577]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 558
diff changeset
3144 gtk_window_set_title(GTK_WINDOW(dialog), _("Smile!"));
584
56f7cb624e9e [gaim-migrate @ 594]
Todd Kulesza <fflewddur>
parents: 582
diff changeset
3145 gtk_widget_show_all(dialog);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3146
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3147 c->smiley_dialog = dialog;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3148
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
3149 return;
558
f1b8f03db83f [gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 555
diff changeset
3150 }
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3151
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3152 static void do_alias_bud(GtkWidget *w, struct buddy *b)
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3153 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3154 char *al = gtk_entry_get_text(GTK_ENTRY(aliasname));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3155 g_snprintf(b->show, sizeof(b->show), "%s", (al && strlen(al)) ? al : b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3156 handle_buddy_rename(b, b->name);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
3157 do_export(b->gc);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 699
diff changeset
3158 destroy_dialog(aliasdlg, aliasdlg);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3159 }
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3160
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3161 void alias_dialog_bud(struct buddy *b)
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3162 {
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3163 GtkWidget *frame;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3164 GtkWidget *vbox;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3165 GtkWidget *bbox;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3166 GtkWidget *cancel;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3167 static GtkWidget *add = NULL;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3168 GtkWidget *label;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3169 GtkWidget *topbox;
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3170 static int a, c;
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3171
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3172 if (aliasdlg)
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3173 gtk_widget_destroy(aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3174
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3175 aliasdlg = gtk_window_new(GTK_WINDOW_DIALOG);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3176 gtk_window_set_policy(GTK_WINDOW(aliasdlg), FALSE, FALSE, TRUE);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3177 gtk_window_set_wmclass(GTK_WINDOW(aliasdlg), "alias_dialog", "Gaim");
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3178 gtk_widget_realize(aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3179 dialogwindows = g_list_prepend(dialogwindows, aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3180
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3181 bbox = gtk_hbox_new(TRUE, 10);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3182 topbox = gtk_hbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3183 vbox = gtk_vbox_new(FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3184
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3185 aliasentry = gtk_entry_new();
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3186 aliasname = gtk_entry_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3187 /* Put the buttons in the box */
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3188
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3189 add = picture_button(aliasdlg, _("Alias"), add_xpm);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3190
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3191 cancel = picture_button(aliasdlg, _("Cancel"), cancel_xpm);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3192
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3193 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3194 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3195
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3196 frame = gtk_frame_new(NULL);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3197 gtk_frame_set_label(GTK_FRAME(frame), _("Alias Buddy"));
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3198
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3199 label = gtk_label_new(_("Buddy"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3200 gtk_widget_show(label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3201 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3202 gtk_box_pack_start(GTK_BOX(topbox), aliasentry, FALSE, FALSE, 5);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3203 gtk_entry_set_editable(GTK_ENTRY(aliasentry), FALSE);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3204 label = gtk_label_new(_("Alias"));
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3205 gtk_widget_show(label);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3206 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3207 gtk_box_pack_start(GTK_BOX(topbox), aliasname, FALSE, FALSE, 5);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3208
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3209 gtk_entry_set_text(GTK_ENTRY(aliasentry), b->name);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3210 gtk_entry_set_text(GTK_ENTRY(aliasname), b->show);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3211
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3212 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3213 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3214 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3215
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3216 /* Handle closes right */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3217 gtk_signal_connect(GTK_OBJECT(aliasdlg), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), aliasdlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3218 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), aliasdlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3219 a = gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(do_alias_bud), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3220 c = gtk_signal_connect(GTK_OBJECT(aliasname), "activate", GTK_SIGNAL_FUNC(do_alias_bud), b);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3221 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3222 gtk_widget_show(add);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3223 gtk_widget_show(cancel);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3224 gtk_widget_show(aliasentry);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3225 gtk_widget_show(aliasname);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3226 gtk_widget_show(topbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3227 gtk_widget_show(bbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3228 gtk_widget_show(vbox);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3229 gtk_widget_show(frame);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3230 gtk_window_set_title(GTK_WINDOW(aliasdlg), _("Gaim - Alias Buddy"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3231 gtk_window_set_focus(GTK_WINDOW(aliasdlg), aliasentry);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3232 gtk_container_add(GTK_CONTAINER(frame), vbox);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3233 gtk_container_add(GTK_CONTAINER(aliasdlg), frame);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3234 gtk_container_set_border_width(GTK_CONTAINER(aliasdlg), 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3235 gtk_widget_realize(aliasdlg);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3236 aol_icon(aliasdlg->window);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3237
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3238 gtk_widget_show(aliasdlg);
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
3239 }
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3240
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3241
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3242 static gboolean dont_destroy(gpointer a, gpointer b, gpointer c)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3243 {
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3244 return TRUE;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3245 }
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3246
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3247 static void do_save_log(GtkWidget *w, GtkWidget *filesel)
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3248 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3249 char *file;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3250 char path[PATHSIZE];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3251 char buf[BUF_LONG];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3252 char error[BUF_LEN];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3253 FILE *fp_old, *fp_new;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3254 char filename[PATHSIZE];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3255 char *name;
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3256 char *tmp;
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3257
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3258 name = gtk_object_get_user_data(GTK_OBJECT(filesel));
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3259 tmp = gaim_user_dir();
1897
97b1667e1255 [gaim-migrate @ 1907]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1841
diff changeset
3260 g_snprintf(filename, PATHSIZE, "%s/logs/%s%s", tmp,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3261 name ? normalize(name) : "system", name ? ".log" : "");
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3262 g_free(tmp);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3263
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3264 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3265 strncpy(path, file, PATHSIZE - 1);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3266 if (file_is_dir(path, filesel))
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3267 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3268
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3269 if ((fp_new = fopen(path, "w")) == NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3270 g_snprintf(error, BUF_LONG,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3271 "Can't open file %s for writing - %s", path, strerror(errno));
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3272 do_error_dialog(error, "Error");
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3273 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3274 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3275
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3276 if ((fp_old = fopen(filename, "r")) == NULL) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3277 g_snprintf(error, BUF_LONG,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3278 "Can't open file %s for reading - %s", filename, strerror(errno));
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3279 do_error_dialog(error, "Error");
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3280 fclose(fp_new);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3281 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3282 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3283
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3284 while (fgets(buf, BUF_LONG, fp_old))
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3285 fputs(buf, fp_new);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3286 fclose(fp_old);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3287 fclose(fp_new);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3288
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3289 dialogwindows = g_list_remove(dialogwindows, filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3290 gtk_widget_destroy(filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3291
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3292 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3293 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3294
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3295 static void show_save_log(GtkWidget *w, gchar *name)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3296 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3297 GtkWidget *filesel;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3298 gchar buf[BUF_LEN];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3299
1897
97b1667e1255 [gaim-migrate @ 1907]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1841
diff changeset
3300 g_snprintf(buf, BUF_LEN - 1, "%s/%s%s", getenv("HOME"),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3301 name ? normalize(name) : "system", name ? ".log" : "");
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3302
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3303 filesel = gtk_file_selection_new(_("Gaim - Save Log File"));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3304 dialogwindows = g_list_prepend(dialogwindows, filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3305 gtk_signal_connect(GTK_OBJECT(filesel), "delete_event",
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3306 GTK_SIGNAL_FUNC(destroy_dialog), filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3307
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3308 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(filesel));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3309 gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel), buf);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3310 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button),
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3311 "clicked", GTK_SIGNAL_FUNC(do_save_log), filesel);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3312 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filesel)->cancel_button),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3313 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), filesel);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3314 gtk_object_set_user_data(GTK_OBJECT(filesel), name);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3315
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3316 gtk_widget_realize(filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3317 aol_icon(filesel->window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3318 gtk_widget_show(filesel);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3319
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3320 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3321 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3322
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3323 static void do_clear_log_file(GtkWidget *w, gchar *name)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3324 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3325 gchar buf[256];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3326 gchar filename[256];
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3327 GtkWidget *window;
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3328 char *tmp;
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3329
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3330 tmp = gaim_user_dir();
1897
97b1667e1255 [gaim-migrate @ 1907]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1841
diff changeset
3331 g_snprintf(filename, 256, "%s/logs/%s%s", tmp,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3332 name ? normalize(name) : "system", name ? ".log" : "");
1722
1edc8b545d6f [gaim-migrate @ 1732]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
3333 g_free(tmp);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3334
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3335 if ((remove(filename)) == -1) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3336 g_snprintf(buf, 256, _("Unable to remove file %s - %s"), filename, strerror(errno));
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3337 do_error_dialog(buf, _("Error"));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3338 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3339
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3340 window = gtk_object_get_user_data(GTK_OBJECT(w));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3341 destroy_dialog(NULL, window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3342 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3343
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3344 static void show_clear_log(GtkWidget *w, gchar *name)
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3345 {
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3346 GtkWidget *window;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3347 GtkWidget *box;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3348 GtkWidget *hbox;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3349 GtkWidget *button;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3350 GtkWidget *label;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3351 GtkWidget *hsep;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3352
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3353 window = gtk_window_new(GTK_WINDOW_DIALOG);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3354 dialogwindows = g_list_prepend(dialogwindows, window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3355 gtk_window_set_wmclass(GTK_WINDOW(window), "dialog", "Gaim");
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3356 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3357 gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3358 gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3359 gtk_widget_realize(window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3360 aol_icon(window->window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3361
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3362 box = gtk_vbox_new(FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3363 gtk_container_add(GTK_CONTAINER(window), box);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3364
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3365 label = gtk_label_new(_("Really clear log?"));
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3366 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 15);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3367
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3368 hsep = gtk_hseparator_new();
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3369 gtk_box_pack_start(GTK_BOX(box), hsep, FALSE, FALSE, 0);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3370
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3371 hbox = gtk_hbox_new(FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3372 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3373 gtk_widget_show(hbox);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3374
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3375 button = picture_button(window, _("Cancel"), cancel_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3376 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3377 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3378 gtk_widget_show(button);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3379
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3380 button = picture_button(window, _("Okay"), ok_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3381 gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(GTK_OBJECT(w)));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3382 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_clear_log_file), name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3383 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3384 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3385 gtk_widget_show(button);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3386
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3387 gtk_widget_show_all(window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3388
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3389 return;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3390 }
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3391
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3392 void show_log(char *name)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3393 {
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3394 gchar filename[256];
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3395 gchar buf[BUF_LONG];
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3396 GString *string;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3397 FILE *fp;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3398 GtkWidget *window;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3399 GtkWidget *box;
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3400 GtkWidget *hbox;
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3401 GtkWidget *sw;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3402 GtkWidget *layout;
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3403 GtkWidget *close_button;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3404 GtkWidget *clear_button;
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3405 GtkWidget *save_button;
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3406 int options;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3407 guint block;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3408
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3409 string = g_string_new("");
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3410
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3411 if (name) {
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3412 char *tmp = gaim_user_dir();
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3413 g_snprintf(filename, 256, "%s/logs/%s.log", tmp, normalize(name));
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3414 g_free(tmp);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3415 } else {
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3416 char *tmp = gaim_user_dir();
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3417 g_snprintf(filename, 256, "%s/logs/system", tmp);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3418 g_free(tmp);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
3419 }
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3420 if ((fp = fopen(filename, "r")) == NULL) {
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3421 g_snprintf(buf, BUF_LONG, "Unable to open log file %s", filename);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3422 do_error_dialog(buf, "Error!");
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3423 return;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3424 }
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3425
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3426 options = GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_TITLE | GTK_IMHTML_NO_SCROLL;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
3427 if (convo_options & OPT_CONVO_IGNORE_COLOUR)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3428 options ^= GTK_IMHTML_NO_COLOURS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
3429 if (convo_options & OPT_CONVO_IGNORE_FONTS)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3430 options ^= GTK_IMHTML_NO_FONTS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2228
diff changeset
3431 if (convo_options & OPT_CONVO_IGNORE_SIZES)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3432 options ^= GTK_IMHTML_NO_SIZES;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3433
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3434 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3435 dialogwindows = g_list_prepend(dialogwindows, window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3436 gtk_window_set_wmclass(GTK_WINDOW(window), "log", "Gaim");
1648
09445224e2d9 [gaim-migrate @ 1658]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
3437 if (name)
09445224e2d9 [gaim-migrate @ 1658]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
3438 g_snprintf(buf, BUF_LONG, "Gaim - Conversations with %s", name);
09445224e2d9 [gaim-migrate @ 1658]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
3439 else
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3440 g_snprintf(buf, BUF_LONG, "Gaim - System Log");
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3441 gtk_window_set_title(GTK_WINDOW(window), buf);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3442 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3443 gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3444 block = gtk_signal_connect(GTK_OBJECT(window), "delete_event",
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3445 GTK_SIGNAL_FUNC(dont_destroy), window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3446 gtk_widget_realize(window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3447 aol_icon(window->window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3448
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3449 box = gtk_vbox_new(FALSE, 5);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3450 gtk_container_add(GTK_CONTAINER(window), box);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3451
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3452 sw = gtk_scrolled_window_new(NULL, NULL);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3453 gtk_box_pack_start(GTK_BOX(box), sw, TRUE, TRUE, 0);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3454 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3455 gtk_widget_set_usize(sw, 390, 220);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3456
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3457 layout = gtk_imhtml_new(NULL, NULL);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3458 gtk_signal_connect(GTK_OBJECT(layout), "url_clicked", open_url_nw, NULL);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3459 gtk_container_add(GTK_CONTAINER(sw), layout);
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
3460 gaim_setup_imhtml(layout);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3461
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3462 hbox = gtk_hbox_new(FALSE, 0);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3463 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3464 gtk_widget_show(hbox);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3465
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3466 close_button = picture_button(window, _("Close"), cancel_xpm);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3467 gtk_box_pack_end(GTK_BOX(hbox), close_button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3468 gtk_widget_set_sensitive(close_button, FALSE);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3469
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3470 clear_button = picture_button(window, _("Clear"), close_xpm);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3471 gtk_object_set_user_data(GTK_OBJECT(clear_button), window);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3472 gtk_box_pack_end(GTK_BOX(hbox), clear_button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3473 gtk_widget_set_sensitive(clear_button, FALSE);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3474
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3475 save_button = picture_button(window, _("Save"), save_xpm);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3476 gtk_box_pack_end(GTK_BOX(hbox), save_button, FALSE, FALSE, 5);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3477 gtk_widget_set_sensitive(save_button, FALSE);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3478
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3479 gtk_widget_show_all(window);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3480
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3481 while (fgets(buf, BUF_LONG, fp)) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3482 if (strlen(buf) >= 5 && (!strncmp(buf + strlen(buf) - 5, "<BR>\n", 5)))
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3483 /* take off the \n */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3484 buf[strlen(buf) - 1] = '\0';
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3485 if (!name ||(strlen(buf) >= 21 && strstr(buf, "---- New C"))) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3486 gtk_imhtml_append_text(GTK_IMHTML(layout), string->str, options);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3487 g_string_free(string, TRUE);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3488 string = g_string_new(buf);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3489 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3490 string = g_string_append(string, buf);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3491 }
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3492 while (gtk_events_pending())
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3493 gtk_main_iteration();
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3494 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3495 gtk_imhtml_append_text(GTK_IMHTML(layout), string->str, options);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3496 gtk_imhtml_append_text(GTK_IMHTML(layout), "<BR>", options);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3497
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3498 gtk_signal_disconnect(GTK_OBJECT(window), block);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3499 gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(destroy_dialog), window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3500 gtk_signal_connect(GTK_OBJECT(close_button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3501 gtk_signal_connect(GTK_OBJECT(clear_button), "clicked", GTK_SIGNAL_FUNC(show_clear_log), name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3502 gtk_signal_connect(GTK_OBJECT(save_button), "clicked", GTK_SIGNAL_FUNC(show_save_log), name);
1488
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3503 gtk_widget_set_sensitive(close_button, TRUE);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3504 gtk_widget_set_sensitive(clear_button, TRUE);
55246babdeb3 [gaim-migrate @ 1498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1484
diff changeset
3505 gtk_widget_set_sensitive(save_button, TRUE);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3506
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3507 fclose(fp);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3508 g_string_free(string, TRUE);
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3509
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3510 return;
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
3511 }
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3512
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3513 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3514 /* The dialog for renaming groups */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3515 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3516
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3517 static void do_rename_group(GtkObject *obj, GtkWidget *entry)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3518 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3519 char *new_name;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3520 struct group *g;
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3521 struct group *orig;
1841
93f0629d4099 [gaim-migrate @ 1851]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
3522 struct gaim_connection *gc;
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3523
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3524 new_name = gtk_entry_get_text(GTK_ENTRY(entry));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3525 g = gtk_object_get_user_data(obj);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3526
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3527 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, g->name)) {
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3528 char *prevname;
1841
93f0629d4099 [gaim-migrate @ 1851]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
3529 gc = g->gc;
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3530 if ((orig = find_group(g->gc, new_name)) != NULL) {
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3531 orig->members = g_slist_concat(orig->members, g->members);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3532 handle_group_rename(orig, g->name);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3533 g->gc->groups = g_slist_remove(g->gc->groups, g);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3534 /* FIXME, i don't like calling this. it's sloppy. */ build_edit_tree();
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3535 g_free(g);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3536 } else {
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3537 prevname = g_strdup(g->name);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3538 g_snprintf(g->name, sizeof(g->name), "%s", new_name);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3539 handle_group_rename(g, prevname);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3540 g_free(prevname);
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1736
diff changeset
3541 }
1841
93f0629d4099 [gaim-migrate @ 1851]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
3542 do_export(gc);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3543 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3544
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3545 destroy_dialog(rename_dialog, rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3546 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3547
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3548 void show_rename_group(GtkWidget *unused, struct group *g)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3549 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3550 GtkWidget *mainbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3551 GtkWidget *frame;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3552 GtkWidget *fbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3553 GtkWidget *bbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3554 GtkWidget *button;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3555 GtkWidget *name_entry;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3556 GtkWidget *label;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3557
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3558 if (!rename_dialog) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3559 rename_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3560 gtk_window_set_wmclass(GTK_WINDOW(rename_dialog), "rename_dialog", "Gaim");
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3561 gtk_window_set_policy(GTK_WINDOW(rename_dialog), FALSE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3562 gtk_window_set_title(GTK_WINDOW(rename_dialog), _("Gaim - Rename Group"));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3563 gtk_signal_connect(GTK_OBJECT(rename_dialog), "destroy",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3564 GTK_SIGNAL_FUNC(destroy_dialog), rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3565 gtk_widget_realize(rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3566 aol_icon(rename_dialog->window);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3567
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3568 mainbox = gtk_vbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3569 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3570 gtk_container_add(GTK_CONTAINER(rename_dialog), mainbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3571
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3572 frame = gtk_frame_new(_("Rename Group"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3573 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3574
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3575 fbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3576 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3577 gtk_container_add(GTK_CONTAINER(frame), fbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3578
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3579 label = gtk_label_new(_("New name:"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3580 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3581
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3582 name_entry = gtk_entry_new();
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3583 gtk_box_pack_start(GTK_BOX(fbox), name_entry, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3584 gtk_object_set_user_data(GTK_OBJECT(name_entry), g);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3585 gtk_entry_set_text(GTK_ENTRY(name_entry), g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3586 gtk_signal_connect(GTK_OBJECT(name_entry), "activate",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3587 GTK_SIGNAL_FUNC(do_rename_group), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3588 gtk_widget_grab_focus(name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3589
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3590 bbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3591 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3592
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3593 button = picture_button(rename_dialog, _("Cancel"), cancel_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3594 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3595 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3596 GTK_SIGNAL_FUNC(destroy_dialog), rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3597
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3598 button = picture_button(rename_dialog, _("OK"), ok_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3599 gtk_object_set_user_data(GTK_OBJECT(button), g);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3600 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3601 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3602 GTK_SIGNAL_FUNC(do_rename_group), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3603 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3604
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3605 gtk_widget_show_all(rename_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3606 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3607
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3608 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3609 /* The dialog for renaming buddies */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3610 /*------------------------------------------------------------------------*/
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3611
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3612 static void do_rename_buddy(GtkObject *obj, GtkWidget *entry)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3613 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3614 char *new_name;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3615 struct buddy *b;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3616
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3617 new_name = gtk_entry_get_text(GTK_ENTRY(entry));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3618 b = gtk_object_get_user_data(obj);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3619
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3620 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3621 char *prevname = g_strdup(b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3622 serv_remove_buddy(b->gc, b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3623 if (!strcmp(b->name, b->show))
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3624 g_snprintf(b->show, sizeof(b->show), "%s", new_name);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3625 g_snprintf(b->name, sizeof(b->name), "%s", new_name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3626 serv_add_buddy(b->gc, b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3627 handle_buddy_rename(b, prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3628 g_free(prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3629 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3630
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3631 destroy_dialog(rename_bud_dialog, rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3632 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3633
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3634 void show_rename_buddy(GtkWidget *unused, struct buddy *b)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3635 {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3636 GtkWidget *mainbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3637 GtkWidget *frame;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3638 GtkWidget *fbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3639 GtkWidget *bbox;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3640 GtkWidget *button;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3641 GtkWidget *name_entry;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3642 GtkWidget *label;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3643
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3644 if (!rename_bud_dialog) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3645 rename_bud_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3646 gtk_window_set_wmclass(GTK_WINDOW(rename_bud_dialog), "rename_bud_dialog", "Gaim");
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3647 gtk_window_set_policy(GTK_WINDOW(rename_bud_dialog), FALSE, TRUE, TRUE);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3648 gtk_window_set_title(GTK_WINDOW(rename_bud_dialog), _("Gaim - Rename Buddy"));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3649 gtk_signal_connect(GTK_OBJECT(rename_bud_dialog), "destroy",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3650 GTK_SIGNAL_FUNC(destroy_dialog), rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3651 gtk_widget_realize(rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3652 aol_icon(rename_bud_dialog->window);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3653
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3654 mainbox = gtk_vbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3655 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3656 gtk_container_add(GTK_CONTAINER(rename_bud_dialog), mainbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3657
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3658 frame = gtk_frame_new(_("Rename Buddy"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3659 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3660
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3661 fbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3662 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3663 gtk_container_add(GTK_CONTAINER(frame), fbox);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3664
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3665 label = gtk_label_new(_("New name:"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3666 gtk_box_pack_start(GTK_BOX(fbox), label, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3667
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3668 name_entry = gtk_entry_new();
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3669 gtk_box_pack_start(GTK_BOX(fbox), name_entry, TRUE, TRUE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3670 gtk_object_set_user_data(GTK_OBJECT(name_entry), b);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3671 gtk_entry_set_text(GTK_ENTRY(name_entry), b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3672 gtk_signal_connect(GTK_OBJECT(name_entry), "activate",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3673 GTK_SIGNAL_FUNC(do_rename_buddy), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3674 gtk_widget_grab_focus(name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3675
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3676 bbox = gtk_hbox_new(FALSE, 5);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3677 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3678
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3679 button = picture_button(rename_bud_dialog, _("Cancel"), cancel_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3680 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3681 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3682 GTK_SIGNAL_FUNC(destroy_dialog), rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3683
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3684 button = picture_button(rename_bud_dialog, _("OK"), ok_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3685 gtk_object_set_user_data(GTK_OBJECT(button), b);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3686 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3687 gtk_signal_connect(GTK_OBJECT(button), "clicked",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3688 GTK_SIGNAL_FUNC(do_rename_buddy), name_entry);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3689 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3690
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3691 gtk_widget_show_all(rename_bud_dialog);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1722
diff changeset
3692 }
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3693
2377
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
3694 #ifdef USE_PERL
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
3695
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3696 static GtkWidget *perl_config = NULL;
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3697 static char *perl_last_dir = NULL;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3698
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3699 static void cfdes(GtkWidget *m, gpointer n)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3700 {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3701 if (perl_config)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3702 gtk_widget_destroy(perl_config);
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3703 perl_config = NULL;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3704 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3705
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3706 static void do_load(GtkWidget *m, gpointer n)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3707 {
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3708 const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(perl_config));
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3709 gchar *f = NULL;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3710 if (!file || !strlen(file)) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3711 return;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3712 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3713
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3714 if (file_is_dir(file, perl_config)) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3715 return;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3716 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3717
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3718 if (perl_last_dir) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3719 g_free(perl_last_dir);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3720 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3721 perl_last_dir = g_dirname(file);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3722
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3723 debug_printf("Loading perl script: %s\n", file);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3724
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3725 f = g_strdup(file);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3726 perl_load_file(f);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3727 g_free(f);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3728 cfdes(perl_config, NULL);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3729 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3730
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3731 void load_perl_script()
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3732 {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3733 char *buf, *temp;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3734
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3735 if (perl_config) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3736 gtk_widget_show(perl_config);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3737 gdk_window_raise(perl_config->window);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3738 return;
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3739 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3740
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3741 /* Below is basically stolen from plugins.c */
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3742 perl_config = gtk_file_selection_new(_("Gaim - Select Perl Script"));
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3743
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3744 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(perl_config));
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3745
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3746 if (!perl_last_dir) {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3747 temp = gaim_user_dir();
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3748 buf = g_strconcat(temp, G_DIR_SEPARATOR_S, NULL);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3749 g_free(temp);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3750 } else {
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3751 buf = g_strconcat(perl_last_dir, G_DIR_SEPARATOR_S, NULL);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3752 }
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3753
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3754 gtk_file_selection_set_filename(GTK_FILE_SELECTION(perl_config), buf);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3755 gtk_file_selection_complete(GTK_FILE_SELECTION(perl_config), "*.pl");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3756 gtk_signal_connect(GTK_OBJECT(perl_config), "destroy", GTK_SIGNAL_FUNC(cfdes), perl_config);
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3757
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3758 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(perl_config)->ok_button),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3759 "clicked", GTK_SIGNAL_FUNC(do_load), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3760
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3761 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(perl_config)->cancel_button),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
3762 "clicked", GTK_SIGNAL_FUNC(cfdes), NULL);
2370
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3763
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3764 g_free(buf);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3765 gtk_widget_show(perl_config);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3766 gdk_window_raise(perl_config->window);
25e7c2a68ed2 [gaim-migrate @ 2383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2344
diff changeset
3767 }
2377
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
3768
466b29d35b85 [gaim-migrate @ 2390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
3769 #endif /* USE_PERL */
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3770
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3771 static GdkPixmap *icon_pm = NULL;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3772 static GdkBitmap *icon_bm = NULL;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3773
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3774 void aol_icon(GdkWindow *w)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3775 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3776 #ifndef _WIN32
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3777 if (icon_pm == NULL) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3778 icon_pm = gdk_pixmap_create_from_xpm_d(w, &icon_bm, NULL, (gchar **)aimicon_xpm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3779 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3780 gdk_window_set_icon(w, NULL, icon_pm, icon_bm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3781 if (mainwindow)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3782 gdk_window_set_group(w, mainwindow->window);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3783 #endif
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3784 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3785
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3786 GtkWidget *picture_button(GtkWidget *window, char *text, char **xpm)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3787 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3788 GtkWidget *button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3789 GtkWidget *button_box, *button_box_2, *button_box_3;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3790 GtkWidget *label;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3791 GdkBitmap *mask;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3792 GdkPixmap *pm;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3793 GtkWidget *pixmap;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3794
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3795 button = gtk_button_new();
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3796 if (misc_options & OPT_MISC_COOL_LOOK)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3797 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3798
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3799 button_box = gtk_hbox_new(FALSE, 5);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3800 gtk_container_add(GTK_CONTAINER(button), button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3801
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3802 button_box_2 = gtk_hbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3803 button_box_3 = gtk_hbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3804 gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3805 gtk_box_pack_start(GTK_BOX(button_box), button_box_3, TRUE, TRUE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3806 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3807 pixmap = gtk_pixmap_new(pm, mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3808 gtk_box_pack_end(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3809
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3810 if (text) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3811 label = gtk_label_new(text);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3812 gtk_box_pack_start(GTK_BOX(button_box_3), label, FALSE, FALSE, 2);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3813 gtk_widget_show(label);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3814 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3815
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3816 gtk_widget_show(pixmap);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3817 gtk_widget_show(button_box_2);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3818 gtk_widget_show(button_box_3);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3819 gtk_widget_show(button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3820
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3821 /* this causes clipping on lots of buttons with long text */
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3822 /* gtk_widget_set_usize(button, 75, 30);*/
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3823 gtk_widget_show(button);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3824 gdk_pixmap_unref(pm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3825 gdk_bitmap_unref(mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3826
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3827 return button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3828 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3829
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3830 static GtkTooltips *button_tips = NULL;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3831 GtkWidget *picture_button2(GtkWidget *window, char *text, char **xpm, short dispstyle)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3832 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3833 GtkWidget *button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3834 GtkWidget *button_box, *button_box_2;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3835 GdkBitmap *mask;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3836 GdkPixmap *pm;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3837 GtkWidget *pixmap;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3838 GtkWidget *label;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3839
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3840 if (!button_tips)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3841 button_tips = gtk_tooltips_new();
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3842 button = gtk_button_new();
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3843 if (misc_options & OPT_MISC_COOL_LOOK)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3844 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3845
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3846 button_box = gtk_hbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3847 gtk_container_add(GTK_CONTAINER(button), button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3848
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3849 button_box_2 = gtk_vbox_new(FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3850
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3851 gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3852 gtk_widget_show(button_box_2);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3853 gtk_widget_show(button_box);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3854 if (dispstyle == 2 || dispstyle == 0) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3855 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3856 pixmap = gtk_pixmap_new(pm, mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3857 gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3858
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3859 gtk_widget_show(pixmap);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3860
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3861 gdk_pixmap_unref(pm);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3862 gdk_bitmap_unref(mask);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3863 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3864
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3865 if (dispstyle == 2 || dispstyle == 1) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3866 label = gtk_label_new(text);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3867 gtk_widget_show(label);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3868 gtk_box_pack_end(GTK_BOX(button_box_2), label, FALSE, FALSE, 0);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3869 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3870
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3871 gtk_tooltips_set_tip(button_tips, button, text, "Gaim");
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3872 gtk_widget_show(button);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3873 return button;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3874 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3875
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3876 int file_is_dir(const char *path, GtkWidget *w)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3877 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3878 struct stat st;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3879 char *name;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3880
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3881 if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3882 /* append a / if needed */
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3883 if (path[strlen(path) - 1] != '/') {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3884 name = g_strconcat(path, "/", NULL);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3885 } else {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3886 name = g_strdup(path);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3887 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3888 gtk_file_selection_set_filename(GTK_FILE_SELECTION(w), name);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3889 g_free(name);
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3890 return 1;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3891 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3892
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3893 return 0;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2377
diff changeset
3894 }