# HG changeset patch
# Node ID d8482acd8a89
# Parent  03d370326c4e
diff --git a/libpurple/plugins/autoaccept/autoaccept.c b/libpurple/plugins/autoaccept/autoaccept.c
--- a/libpurple/plugins/autoaccept/autoaccept.c
+++ b/libpurple/plugins/autoaccept/autoaccept.c
@@ -251,44 +251,6 @@ context_menu(PurpleBlistNode *node, GLis
 	(*menu) = g_list_prepend(*menu, action);
 }
 
-static PurplePluginPrefFrame *
-get_plugin_pref_frame(PurplePlugin *plugin)
-{
-	PurplePluginPrefFrame *frame;
-	PurplePluginPref *pref;
-
-	frame = purple_plugin_pref_frame_new();
-
-	/* XXX: Is there a better way than this? There really should be. */
-	pref = purple_plugin_pref_new_with_name_and_label(PREF_PATH, _("Path to save the files in\n"
-								"(Please provide the full path)"));
-	purple_plugin_pref_frame_add(frame, pref);
-
-	pref = purple_plugin_pref_new_with_name_and_label(PREF_STRANGER,
-					_("When a file-transfer request arrives from a user who is\n"
-                      "*not* on your buddy list:"));
-	purple_plugin_pref_set_pref_type(pref, PURPLE_PLUGIN_PREF_CHOICE);
-	purple_plugin_pref_add_choice(pref, _("Ask"), GINT_TO_POINTER(FT_ASK));
-	purple_plugin_pref_add_choice(pref, _("Auto Accept"), GINT_TO_POINTER(FT_ACCEPT));
-	purple_plugin_pref_add_choice(pref, _("Auto Reject"), GINT_TO_POINTER(FT_REJECT));
-	purple_plugin_pref_frame_add(frame, pref);
-
-	pref = purple_plugin_pref_new_with_name_and_label(PREF_NOTIFY,
-					_("Notify with a popup when an autoaccepted file transfer is complete\n"
-					  "(only when there's no conversation with the sender)"));
-	purple_plugin_pref_frame_add(frame, pref);
-
-	pref = purple_plugin_pref_new_with_name_and_label(PREF_NEWDIR,
-			_("Create a new directory for each user"));
-	purple_plugin_pref_frame_add(frame, pref);
-
-	pref = purple_plugin_pref_new_with_name_and_label(PREF_ESCAPE,
-			_("Escape the filenames"));
-	purple_plugin_pref_frame_add(frame, pref);
-
-	return frame;
-}
-
 static GPluginPluginInfo *
 auto_accept_query(GError **error)
 {
@@ -304,7 +266,7 @@ auto_accept_query(GError **error)
 		"authors",        authors,
 		"website",        PURPLE_WEBSITE,
 		"abi-version",    PURPLE_ABI_VERSION,
-		"pref-frame-cb",  get_plugin_pref_frame,
+		"settings-schema", SETTINGS_SCHEMA_ID,
 		NULL
 	);
 }
diff --git a/libpurple/plugins/joinpart/joinpart.c b/libpurple/plugins/joinpart/joinpart.c
--- a/libpurple/plugins/joinpart/joinpart.c
+++ b/libpurple/plugins/joinpart/joinpart.c
@@ -189,37 +189,6 @@ static gboolean clean_users_hash(GHashTa
 	return TRUE;
 }
 
-static PurplePluginPrefFrame *
-get_plugin_pref_frame(PurplePlugin *plugin)
-{
-	PurplePluginPrefFrame *frame;
-	PurplePluginPref *ppref;
-
-	g_return_val_if_fail(plugin != NULL, FALSE);
-
-	frame = purple_plugin_pref_frame_new();
-
-	ppref = purple_plugin_pref_new_with_label(_("Hide Joins/Parts"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	ppref = purple_plugin_pref_new_with_name_and_label(THRESHOLD_PREF,
-	                                                 /* Translators: Followed by an input request a number of people */
-	                                                 _("For rooms with more than this many people"));
-	purple_plugin_pref_set_bounds(ppref, 0, 1000);
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	ppref = purple_plugin_pref_new_with_name_and_label(DELAY_PREF,
-	                                                 _("If user has not spoken in this many minutes"));
-	purple_plugin_pref_set_bounds(ppref, 0, 8 * 60); /* 8 Hours */
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	ppref = purple_plugin_pref_new_with_name_and_label(HIDE_BUDDIES_PREF,
-	                                                 _("Apply hiding rules to buddies"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	return frame;
-}
-
 static GPluginPluginInfo *
 join_part_query(GError **error)
 {
@@ -240,7 +209,7 @@ join_part_query(GError **error)
 		"authors",        authors,
 		"website",        PURPLE_WEBSITE,
 		"abi-version",    PURPLE_ABI_VERSION,
-		"pref-frame-cb",  get_plugin_pref_frame,
+		"settings-schema", SETTINGS_SCHEMA_ID,
 		NULL
 	);
 }
diff --git a/libpurple/plugins/notification-sound/notification-sound.c b/libpurple/plugins/notification-sound/notification-sound.c
--- a/libpurple/plugins/notification-sound/notification-sound.c
+++ b/libpurple/plugins/notification-sound/notification-sound.c
@@ -246,6 +246,7 @@ notification_sound_query(G_GNUC_UNUSED G
 		"authors", authors,
 		"action-group", group,
 		"action-menu", menu,
+		"settings-schema", SETTINGS_SCHEMA_ID,
 		NULL
 	);
 }
diff --git a/libpurple/plugins/psychic/psychic.c b/libpurple/plugins/psychic/psychic.c
--- a/libpurple/plugins/psychic/psychic.c
+++ b/libpurple/plugins/psychic/psychic.c
@@ -91,36 +91,6 @@ buddy_typing_cb(PurpleAccount *acct, con
 }
 
 
-static PurplePluginPrefFrame *
-get_plugin_pref_frame(PurplePlugin *plugin) {
-
-  PurplePluginPrefFrame *frame;
-  PurplePluginPref *pref;
-
-  frame = purple_plugin_pref_frame_new();
-
-  pref = purple_plugin_pref_new_with_name(PREF_BUDDIES);
-  purple_plugin_pref_set_label(pref, _("Only enable for users on"
-				     " the buddy list"));
-  purple_plugin_pref_frame_add(frame, pref);
-
-  pref = purple_plugin_pref_new_with_name(PREF_STATUS);
-  purple_plugin_pref_set_label(pref, _("Disable when away"));
-  purple_plugin_pref_frame_add(frame, pref);
-
-  pref = purple_plugin_pref_new_with_name(PREF_NOTICE);
-  purple_plugin_pref_set_label(pref, _("Display notification message in"
-				     " conversations"));
-  purple_plugin_pref_frame_add(frame, pref);
-
-  pref = purple_plugin_pref_new_with_name(PREF_RAISE);
-  purple_plugin_pref_set_label(pref, _("Raise psychic conversations"));
-  purple_plugin_pref_frame_add(frame, pref);
-
-  return frame;
-}
-
-
 static GPluginPluginInfo *
 psychic_query(GError **error) {
   const gchar * const authors[] = PLUGIN_AUTHORS;
@@ -135,7 +105,7 @@ psychic_query(GError **error) {
     "authors",        authors,
     "website",        PURPLE_WEBSITE,
     "abi-version",    PURPLE_ABI_VERSION,
-    "pref-frame-cb",  get_plugin_pref_frame,
+    "settings-schema", SETTINGS_SCHEMA_ID,
     NULL
   );
 }
diff --git a/libpurple/plugins/statenotify/statenotify.c b/libpurple/plugins/statenotify/statenotify.c
--- a/libpurple/plugins/statenotify/statenotify.c
+++ b/libpurple/plugins/statenotify/statenotify.c
@@ -23,6 +23,7 @@
 #include <purple.h>
 
 #define STATENOTIFY_PLUGIN_ID "core-statenotify"
+#define SETTINGS_SCHEMA_ID "im.pidgin.Purple.plugin.StateNotify"
 
 static void
 write_status(PurpleBuddy *buddy, const char *message)
@@ -74,7 +75,7 @@ buddy_status_changed_cb(PurpleBuddy *bud
 	available = purple_status_is_available(status);
 	old_available = purple_status_is_available(old_status);
 
-	settings = g_settings_new_with_backend("im.pidgin.Purple.plugin.StateNotify",
+	settings = g_settings_new_with_backend(SETTINGS_SCHEMA_ID,
 	                                       purple_core_get_settings_backend());
 	if(g_settings_get_boolean(settings, "notify-away")) {
 		if (available && !old_available) {
@@ -92,7 +93,7 @@ buddy_idle_changed_cb(PurpleBuddy *buddy
 {
 	GSettings *settings = NULL;
 
-	settings = g_settings_new_with_backend("im.pidgin.Purple.plugin.StateNotify",
+	settings = g_settings_new_with_backend(SETTINGS_SCHEMA_ID,
 	                                       purple_core_get_settings_backend());
 	if(g_settings_get_boolean(settings, "notify-idle")) {
 		if (idle && !old_idle) {
@@ -109,7 +110,7 @@ buddy_signon_cb(PurpleBuddy *buddy, void
 {
 	GSettings *settings = NULL;
 
-	settings = g_settings_new_with_backend("im.pidgin.Purple.plugin.StateNotify",
+	settings = g_settings_new_with_backend(SETTINGS_SCHEMA_ID,
 	                                       purple_core_get_settings_backend());
 	if(g_settings_get_boolean(settings, "notify-signon")) {
 		write_status(buddy, _("%s has signed on."));
@@ -122,7 +123,7 @@ buddy_signoff_cb(PurpleBuddy *buddy, voi
 {
 	GSettings *settings = NULL;
 
-	settings = g_settings_new_with_backend("im.pidgin.Purple.plugin.StateNotify",
+	settings = g_settings_new_with_backend(SETTINGS_SCHEMA_ID,
 	                                       purple_core_get_settings_backend());
 	if(g_settings_get_boolean(settings, "notify-signon")) {
 		write_status(buddy, _("%s has signed off."));
@@ -130,29 +131,6 @@ buddy_signoff_cb(PurpleBuddy *buddy, voi
 	g_object_unref(settings);
 }
 
-static PurplePluginPrefFrame *
-get_plugin_pref_frame(PurplePlugin *plugin)
-{
-	PurplePluginPrefFrame *frame;
-	PurplePluginPref *ppref;
-
-	frame = purple_plugin_pref_frame_new();
-
-	ppref = purple_plugin_pref_new_with_label(_("Notify When"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_away", _("Buddy Goes _Away"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_idle", _("Buddy Goes _Idle"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_signon", _("Buddy _Signs On/Off"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-	return frame;
-}
-
 static GPluginPluginInfo *
 state_notify_query(GError **error)
 {
@@ -173,7 +151,7 @@ state_notify_query(GError **error)
 		"authors",        authors,
 		"website",        PURPLE_WEBSITE,
 		"abi-version",    PURPLE_ABI_VERSION,
-		"pref-frame-cb",  get_plugin_pref_frame,
+		"settings-schema", SETTINGS_SCHEMA_ID,
 		NULL
 	);
 }
