diff plugins/extplacement.c @ 9179:fb09ed68fbd2

[gaim-migrate @ 9974] updates from nosnilmot committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 05 Jun 2004 17:11:31 +0000
parents bd1ea0a717d7
children 6b96a5a13e68
line wrap: on
line diff
--- a/plugins/extplacement.c	Sat Jun 05 16:14:10 2004 +0000
+++ b/plugins/extplacement.c	Sat Jun 05 17:11:31 2004 +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 @@
 {
 	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 @@
 		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 @@
 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 @@
 {
 	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 @@
 	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 @@
 {
 	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 <stu@nosnilmot.com>",			/**< 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 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)