Index: plugins/extplacement.c =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/extplacement.c,v retrieving revision 1.1 diff -u -p -r1.1 extplacement.c --- plugins/extplacement.c 1 Jun 2004 01:55:55 -0000 1.1 +++ plugins/extplacement.c 5 Jun 2004 09:25:06 -0000 @@ -1,8 +1,28 @@ +/* + * Extra conversation placement options for Gaim + * + * Gaim is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + #include "internal.h" #include "conversation.h" -#define EXTPLACEMENT_OPT "/plugins/core/nosnilmot/extplacement" - static void conv_placement_last_created_win_split(GaimConversation *conv) { @@ -25,10 +45,7 @@ conv_placement_by_number(GaimConversatio { GaimConvWindow *win = NULL; - if (gaim_prefs_get_bool("/core/conversations/combine_chat_im")) - win = g_list_last(gaim_get_windows())->data; - else - win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv)); + win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv)); if (win == NULL) { win = gaim_conv_window_new(); @@ -36,7 +53,7 @@ conv_placement_by_number(GaimConversatio gaim_conv_window_add_conversation(win, conv); gaim_conv_window_show(win); } else { - int max_count = gaim_prefs_get_int(EXTPLACEMENT_OPT "/placement_number"); + int max_count = gaim_prefs_get_int("/plugins/gtk/extplacement/placement_number"); int count = gaim_conv_window_get_conversation_count(win); if (count < max_count) @@ -64,13 +81,11 @@ conv_placement_by_number(GaimConversatio static gboolean plugin_load(GaimPlugin *plugin) { - gaim_prefs_add_none("/plugins/core/nosnilmot"); - gaim_prefs_add_none("/plugins/core/nosnilmot/extplacement"); - gaim_prefs_add_int(EXTPLACEMENT_OPT "/placement_number", 4); gaim_conv_placement_add_fnc("im_chat", _("Separate IM and Chat windows"), &conv_placement_last_created_win_split); gaim_conv_placement_add_fnc("number", _("By conversation count"), &conv_placement_by_number); + gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement"); return TRUE; } @@ -79,6 +94,7 @@ plugin_unload(GaimPlugin *plugin) { gaim_conv_placement_remove_fnc("im_chat"); gaim_conv_placement_remove_fnc("number"); + gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement"); return TRUE; } @@ -93,7 +109,7 @@ get_plugin_pref_frame(GaimPlugin *plugin gaim_plugin_pref_frame_add(frame, ppref); ppref = gaim_plugin_pref_new_with_name_and_label( - EXTPLACEMENT_OPT "/placement_number", + "/plugins/gtk/extplacement/placement_number", "Number of conversations per window"); gaim_plugin_pref_set_bounds(ppref, 1, 50); gaim_plugin_pref_frame_add(frame, ppref); @@ -109,26 +125,22 @@ static GaimPluginInfo info = { GAIM_PLUGIN_API_VERSION, /**< api_version */ GAIM_PLUGIN_STANDARD, /**< type */ - NULL, /**< ui_requirement */ + GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ 0, /**< flags */ NULL, /**< dependencies */ GAIM_PRIORITY_DEFAULT, /**< priority */ - - "core-nosnilmot-extplacement", /**< id */ + "gtk-extplacement", /**< id */ N_("ExtPlacement"), /**< name */ VERSION, /**< version */ - /** summary */ - N_("Extra conversation placement options."), + N_("Extra conversation placement options."), /**< summary */ /** description */ N_("Either restrict the number of conversations per windows" " or use separate windows for IMs and Chats"), "Stu Tomlinson ", /**< author */ - "http://www.nosnilmot.com/gaim/plugins/", /**< homepage */ - + GAIM_WEBSITE, /**< homepage */ plugin_load, /**< load */ plugin_unload, /**< unload */ NULL, /**< destroy */ - NULL, /**< ui_info */ NULL, /**< extra_info */ &prefs_info, /**< prefs_info */ @@ -138,6 +150,8 @@ static GaimPluginInfo info = static void init_plugin(GaimPlugin *plugin) { + gaim_prefs_add_none("/plugins/gtk/extplacement"); + gaim_prefs_add_int("/plugins/gtk/extplacement/placement_number", 4); } GAIM_INIT_PLUGIN(extplacement, init_plugin, info)