comparison plugins/extplacement.c @ 11581:9b3833da6840

[gaim-migrate @ 13851] goodbye GaimConvWindow. Still some problems with this patch: - Scarey warnings console with gaim -d when closing tab - I tried to seperate gtkconv and gtkconvwin, but failed, as a result it has its own header, but the code is in the same file, which is rather weird. Also some code got moved around for no good reason. Feel free to move it back or reorganize it. - I broke the gesters plugin, and just disabled it. Hopefully someone with more time will fix it, it shouldn't take long, but I didn't feel like bothering. - This list is incomplete. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 02 Oct 2005 00:32:49 +0000
parents f8e395a054e2
children dd7392cce819
comparison
equal deleted inserted replaced
11580:24169af08585 11581:9b3833da6840
23 #include "internal.h" 23 #include "internal.h"
24 #include "gtkgaim.h" 24 #include "gtkgaim.h"
25 #include "conversation.h" 25 #include "conversation.h"
26 #include "version.h" 26 #include "version.h"
27 #include "gtkplugin.h" 27 #include "gtkplugin.h"
28 #include "gtkconv.h"
29 #include "gtkconvwin.h"
28 30
29 static void 31 static void
30 conv_placement_by_number(GaimConversation *conv) 32 conv_placement_by_number(GaimGtkConversation *conv)
31 { 33 {
32 GaimConvWindow *win = NULL; 34 GaimGtkWindow *win = NULL;
33 35
34 if (gaim_prefs_get_bool("/plugins/gtk/extplacement/placement_number_separate")) 36 if (gaim_prefs_get_bool("/plugins/gtk/extplacement/placement_number_separate"))
35 win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv)); 37 win = gaim_gtk_conv_window_last_with_type(gaim_conversation_get_type(conv->active_conv));
36 else 38 else
37 win = g_list_last(gaim_get_windows())->data; 39 win = g_list_last(gaim_gtk_conv_windows_get_list())->data;
38 40
39 if (win == NULL) { 41 if (win == NULL) {
40 win = gaim_conv_window_new(); 42 win = gaim_gtk_conv_window_new();
41 43
42 gaim_conv_window_add_conversation(win, conv); 44 gaim_gtk_conv_window_add_gtkconv(win, conv);
43 gaim_conv_window_show(win); 45 gaim_gtk_conv_window_show(win);
44 } else { 46 } else {
45 int max_count = gaim_prefs_get_int("/plugins/gtk/extplacement/placement_number"); 47 int max_count = gaim_prefs_get_int("/plugins/gtk/extplacement/placement_number");
46 int count = gaim_conv_window_get_conversation_count(win); 48 int count = gaim_gtk_conv_window_get_gtkconv_count(win);
47 49
48 if (count < max_count) 50 if (count < max_count)
49 gaim_conv_window_add_conversation(win, conv); 51 gaim_gtk_conv_window_add_gtkconv(win, conv);
50 else { 52 else {
51 GList *l = NULL; 53 GList *l = NULL;
52 54
53 for (l = gaim_get_windows(); l != NULL; l = l->next) { 55 for (l = gaim_gtk_conv_windows_get_list(); l != NULL; l = l->next) {
54 win = (GaimConvWindow *)l->data; 56 win = l->data;
55 57
56 if (gaim_prefs_get_bool("/plugins/gtk/extplacement/placement_number_separate") && 58 if (gaim_prefs_get_bool("/plugins/gtk/extplacement/placement_number_separate") &&
57 gaim_conversation_get_type(gaim_conv_window_get_active_conversation(win)) != gaim_conversation_get_type(conv)) 59 gaim_conversation_get_type(gaim_gtk_conv_window_get_active_conversation(win)) != gaim_conversation_get_type(conv->active_conv))
58 continue; 60 continue;
59 61
60 count = gaim_conv_window_get_conversation_count(win); 62 count = gaim_gtk_conv_window_get_gtkconv_count(win);
61 if (count < max_count) { 63 if (count < max_count) {
62 gaim_conv_window_add_conversation(win, conv); 64 gaim_gtk_conv_window_add_gtkconv(win, conv);
63 return; 65 return;
64 } 66 }
65 } 67 }
66 win = gaim_conv_window_new(); 68 win = gaim_gtk_conv_window_new();
67 69
68 gaim_conv_window_add_conversation(win, conv); 70 gaim_gtk_conv_window_add_gtkconv(win, conv);
69 gaim_conv_window_show(win); 71 gaim_gtk_conv_window_show(win);
70 } 72 }
71 } 73 }
72 } 74 }
73 75
74 static gboolean 76 static gboolean
75 plugin_load(GaimPlugin *plugin) 77 plugin_load(GaimPlugin *plugin)
76 { 78 {
77 gaim_conv_placement_add_fnc("number", _("By conversation count"), 79 gaim_gtkconv_placement_add_fnc("number", _("By conversation count"),
78 &conv_placement_by_number); 80 &conv_placement_by_number);
79 gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement"); 81 gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement");
80 return TRUE; 82 return TRUE;
81 } 83 }
82 84
83 static gboolean 85 static gboolean
84 plugin_unload(GaimPlugin *plugin) 86 plugin_unload(GaimPlugin *plugin)
85 { 87 {
86 gaim_conv_placement_remove_fnc("number"); 88 gaim_gtkconv_placement_remove_fnc("number");
87 gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement"); 89 gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement");
88 return TRUE; 90 return TRUE;
89 } 91 }
90 92
91 static GaimPluginPrefFrame * 93 static GaimPluginPrefFrame *