From 5a41246341f33cff0350f47fa53c37eb9659f246 Mon Sep 17 00:00:00 2001 From: Marc Olson Date: Mon, 20 Aug 2018 15:46:08 -0700 Subject: [PATCH] Create dialog to rescan for new headsets If the headset is plugged in (or repluged) after the library is initialized, the library does not pick it up. This adds an action allowing the user to trigger a rescan. Signed-off-by: Marc Olson Signed-off-by: David Woodhouse --- headset.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/headset.c b/headset.c index 002fab4..970431a 100644 --- a/headset.c +++ b/headset.c @@ -40,6 +40,15 @@ headset_show_about_plugin(PurplePluginAction *action) NULL, NULL); } +static void +headset_reinit_headset(PurplePluginAction *action) +{ + shutdown_headset(); + init_headset(); + purple_notify_info(action->context, + "Headset media plugin", "Headset rescanned.", NULL); +} + static GList* headset_plugin_actions(PurplePlugin *plugin, gpointer context) @@ -51,6 +60,10 @@ headset_plugin_actions(PurplePlugin *plugin, headset_show_about_plugin); acts = g_list_append(acts, act); + act = purple_plugin_action_new(_("Rescan headset..."), + headset_reinit_headset); + acts = g_list_append(acts, act); + return acts; } -- 2.50.1