comparison pidgin/gtkthemes.c @ 15823:32c366eeeb99

sed -ie 's/gaim/purple/g'
author Sean Egan <seanegan@gmail.com>
date Mon, 19 Mar 2007 07:01:17 +0000
parents a830f9756f23
children e4805a4be652
comparison
equal deleted inserted replaced
15822:84b0f9b23ede 15823:32c366eeeb99
1 /* 1 /*
2 * Themes for Gaim 2 * Themes for Purple
3 * 3 *
4 * Gaim is the legal property of its developers, whose names are too numerous 4 * Purple is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this 5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution. 6 * source distribution.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
177 177
178 if (!theme->name || !theme->desc || !theme->author) { 178 if (!theme->name || !theme->desc || !theme->author) {
179 GSList *already_freed = NULL; 179 GSList *already_freed = NULL;
180 struct smiley_list *wer = theme->list, *wer2; 180 struct smiley_list *wer = theme->list, *wer2;
181 181
182 gaim_debug_error("gtkthemes", "Invalid file format, not loading smiley theme from '%s'\n", file); 182 purple_debug_error("gtkthemes", "Invalid file format, not loading smiley theme from '%s'\n", file);
183 183
184 while (wer) { 184 while (wer) {
185 while (wer->smileys) { 185 while (wer->smileys) {
186 GtkIMHtmlSmiley *uio = wer->smileys->data; 186 GtkIMHtmlSmiley *uio = wer->smileys->data;
187 if (uio->icon) 187 if (uio->icon)
243 current_smiley_theme->list = NULL; 243 current_smiley_theme->list = NULL;
244 g_slist_free(already_freed); 244 g_slist_free(already_freed);
245 } 245 }
246 current_smiley_theme = theme; 246 current_smiley_theme = theme;
247 247
248 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { 248 for (cnv = purple_get_conversations(); cnv != NULL; cnv = cnv->next) {
249 GaimConversation *conv = cnv->data; 249 PurpleConversation *conv = cnv->data;
250 250
251 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { 251 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
252 pidginthemes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); 252 pidginthemes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml);
253 pidginthemes_smiley_themeize(PIDGIN_CONVERSATION(conv)->entry); 253 pidginthemes_smiley_themeize(PIDGIN_CONVERSATION(conv)->entry);
254 } 254 }
262 const gchar *file; 262 const gchar *file;
263 gchar *path; 263 gchar *path;
264 int l; 264 int l;
265 265
266 char* probedirs[3]; 266 char* probedirs[3];
267 probedirs[0] = g_build_filename(DATADIR, "pixmaps", "gaim", "smileys", NULL); 267 probedirs[0] = g_build_filename(DATADIR, "pixmaps", "purple", "smileys", NULL);
268 probedirs[1] = g_build_filename(gaim_user_dir(), "smileys", NULL); 268 probedirs[1] = g_build_filename(purple_user_dir(), "smileys", NULL);
269 probedirs[2] = 0; 269 probedirs[2] = 0;
270 for (l=0; probedirs[l]; l++) { 270 for (l=0; probedirs[l]; l++) {
271 dir = g_dir_open(probedirs[l], 0, NULL); 271 dir = g_dir_open(probedirs[l], 0, NULL);
272 if (dir) { 272 if (dir) {
273 while ((file = g_dir_read_name(dir))) { 273 while ((file = g_dir_read_name(dir))) {
287 g_free(probedirs[l]); 287 g_free(probedirs[l]);
288 } 288 }
289 } 289 }
290 290
291 GSList *pidginthemes_get_proto_smileys(const char *id) { 291 GSList *pidginthemes_get_proto_smileys(const char *id) {
292 GaimPlugin *proto; 292 PurplePlugin *proto;
293 struct smiley_list *list, *def; 293 struct smiley_list *list, *def;
294 294
295 if ((current_smiley_theme == NULL) || (current_smiley_theme->list == NULL)) 295 if ((current_smiley_theme == NULL) || (current_smiley_theme->list == NULL))
296 return NULL; 296 return NULL;
297 297
298 def = list = current_smiley_theme->list; 298 def = list = current_smiley_theme->list;
299 299
300 if (id == NULL) 300 if (id == NULL)
301 return def->smileys; 301 return def->smileys;
302 302
303 proto = gaim_find_prpl(id); 303 proto = purple_find_prpl(id);
304 304
305 while (list) { 305 while (list) {
306 if (!strcmp(list->sml, "default")) 306 if (!strcmp(list->sml, "default"))
307 def = list; 307 def = list;
308 else if (proto && !strcmp(proto->info->name, list->sml)) 308 else if (proto && !strcmp(proto->info->name, list->sml))
316 316
317 void pidginthemes_init() 317 void pidginthemes_init()
318 { 318 {
319 GSList *l; 319 GSList *l;
320 const char *current_theme = 320 const char *current_theme =
321 gaim_prefs_get_string("/gaim/gtk/smileys/theme"); 321 purple_prefs_get_string("/purple/gtk/smileys/theme");
322 322
323 pidginthemes_smiley_theme_probe(); 323 pidginthemes_smiley_theme_probe();
324 324
325 for (l = smiley_themes; l; l = l->next) { 325 for (l = smiley_themes; l; l = l->next) {
326 struct smiley_theme *smile = l->data; 326 struct smiley_theme *smile = l->data;