summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2022-07-31 01:45:36 -0500
committerGary Kramlich <grim@reaperworld.com>2022-07-31 01:45:36 -0500
commit9601c29f074f9fabf6c8dd4012a85d501c800454 (patch)
treee32a04d1ed7f00035c4a17708784a82a188ce6f1
parent4b0d8bfcc6cdf8c987ecdab26ba1e1703c17f3a9 (diff)
downloadpidgin-9601c29f074f9fabf6c8dd4012a85d501c800454.tar.gz
Convert the XMPP discovery plugin to the new GAction/GMenu plugin actions
Testing Done: Verified the action worked as expected. Reviewed at https://reviews.imfreedom.org/r/1557/
-rw-r--r--pidgin/plugins/disco/xmppdisco.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/pidgin/plugins/disco/xmppdisco.c b/pidgin/plugins/disco/xmppdisco.c
index adc6297849..3ce30fa5ba 100644
--- a/pidgin/plugins/disco/xmppdisco.c
+++ b/pidgin/plugins/disco/xmppdisco.c
@@ -583,24 +583,13 @@ void xmpp_disco_service_register(XmppDiscoService *service)
}
static void
-create_dialog(PurplePluginAction *action)
+create_dialog(G_GNUC_UNUSED GSimpleAction *action,
+ G_GNUC_UNUSED GVariant *parameter,
+ G_GNUC_UNUSED gpointer data)
{
pidgin_disco_dialog_new();
}
-static GList *
-actions(PurplePlugin *plugin)
-{
- GList *l = NULL;
- PurplePluginAction *action = NULL;
-
- action = purple_plugin_action_new(_("XMPP Service Discovery"),
- create_dialog);
- l = g_list_prepend(l, action);
-
- return l;
-}
-
static void
signed_off_cb(PurpleConnection *pc, gpointer unused)
{
@@ -614,11 +603,26 @@ signed_off_cb(PurpleConnection *pc, gpointer unused)
static GPluginPluginInfo *
xmpp_disco_query(GError **error)
{
+ GActionEntry entries[] = {
+ {
+ .name = "dialog",
+ .activate = create_dialog,
+ }
+ };
+ GMenu *menu = NULL;
+ GSimpleActionGroup *group = NULL;
const gchar * const authors[] = {
"Paul Aurich <paul@darkrain42.org>",
NULL
};
+ group = g_simple_action_group_new();
+ g_action_map_add_action_entries(G_ACTION_MAP(group), entries,
+ G_N_ELEMENTS(entries), NULL);
+
+ menu = g_menu_new();
+ g_menu_append(menu, _("XMPP Service Discovery"), "dialog");
+
return pidgin_plugin_info_new(
"id", PLUGIN_ID,
"name", N_("XMPP Service Discovery"),
@@ -630,7 +634,8 @@ xmpp_disco_query(GError **error)
"authors", authors,
"website", PURPLE_WEBSITE,
"abi-version", PURPLE_ABI_VERSION,
- "actions-cb", actions,
+ "action-group", group,
+ "action-menu", menu,
NULL
);
}