]> www.infradead.org Git - users/dwmw2/pidgin-headset.git/commitdiff
Create dialog to rescan for new headsets
authorMarc Olson <marcolso@amazon.com>
Mon, 20 Aug 2018 22:46:08 +0000 (15:46 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Mon, 20 Aug 2018 23:16:05 +0000 (00:16 +0100)
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 <marcolso@amazon.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
headset.c

index 002fab4ea2edec84c35eb82d26e01ac031940fdc..970431abe574a0e2fc68bdf4fde2175a277a557c 100644 (file)
--- 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;
 }