This is an automated email from the git hooks/post-receive script. b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r in repository panel-plugins/xfce4-pulseaudio-plugin.
commit e9a1fba17684602a2ccaefd5291f36b7c11d096d Author: Sean Davis <[email protected]> Date: Sun Feb 25 08:08:50 2018 -0500 Management of known players, notebook-style preferences (Bug #13903) --- panel-plugin/pulseaudio-config.c | 197 ++++++++++++- panel-plugin/pulseaudio-config.h | 9 + panel-plugin/pulseaudio-dialog.c | 106 ++++++- panel-plugin/pulseaudio-dialog.glade | 553 ++++++++++++++++++++++++----------- panel-plugin/pulseaudio-menu.c | 3 + 5 files changed, 691 insertions(+), 177 deletions(-) diff --git a/panel-plugin/pulseaudio-config.c b/panel-plugin/pulseaudio-config.c index 5b54df5..e2767bc 100644 --- a/panel-plugin/pulseaudio-config.c +++ b/panel-plugin/pulseaudio-config.c @@ -55,6 +55,7 @@ #define DEFAULT_ENABLE_MPRIS FALSE #define DEFAULT_ENABLE_MULTIMEDIA_KEYS FALSE #endif +#define DEFAULT_BLACKLISTED_PLAYERS "" #define DEFAULT_MPRIS_PLAYERS "" #define DEFAULT_ENABLE_WNCK FALSE @@ -90,6 +91,7 @@ struct _PulseaudioConfig gchar *mixer_command; gboolean enable_mpris; gchar *mpris_players; + gchar *blacklisted_players; gboolean enable_wnck; }; @@ -106,6 +108,7 @@ enum PROP_MIXER_COMMAND, PROP_ENABLE_MPRIS, PROP_MPRIS_PLAYERS, + PROP_BLACKLISTED_PLAYERS, PROP_ENABLE_WNCK, N_PROPERTIES, }; @@ -209,6 +212,16 @@ pulseaudio_config_class_init (PulseaudioConfigClass *klass) g_object_class_install_property (gobject_class, + PROP_BLACKLISTED_PLAYERS, + g_param_spec_string ("blacklisted-players", + NULL, NULL, + DEFAULT_BLACKLISTED_PLAYERS, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + + + g_object_class_install_property (gobject_class, PROP_ENABLE_WNCK, g_param_spec_boolean ("enable-wnck", NULL, NULL, DEFAULT_ENABLE_WNCK, @@ -239,6 +252,7 @@ pulseaudio_config_init (PulseaudioConfig *config) config->mixer_command = g_strdup (DEFAULT_MIXER_COMMAND); config->enable_mpris = DEFAULT_ENABLE_MPRIS; config->mpris_players = g_strdup (DEFAULT_MPRIS_PLAYERS); + config->blacklisted_players = g_strdup (DEFAULT_BLACKLISTED_PLAYERS); config->enable_wnck = DEFAULT_ENABLE_WNCK; } @@ -299,6 +313,10 @@ pulseaudio_config_get_property (GObject *object, g_value_set_string (value, config->mpris_players); break; + case PROP_BLACKLISTED_PLAYERS: + g_value_set_string (value, config->blacklisted_players); + break; + case PROP_ENABLE_WNCK: g_value_set_boolean (value, config->enable_wnck); break; @@ -405,6 +423,13 @@ pulseaudio_config_set_property (GObject *object, g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0); break; + case PROP_BLACKLISTED_PLAYERS: + g_free (config->blacklisted_players); + config->blacklisted_players = g_value_dup_string (value); + g_object_notify (G_OBJECT (config), "blacklisted-players"); + g_signal_emit (G_OBJECT (config), pulseaudio_config_signals [CONFIGURATION_CHANGED], 0); + break; + case PROP_ENABLE_WNCK: val_bool = g_value_get_boolean(value); if (config->enable_wnck != val_bool) @@ -572,7 +597,10 @@ pulseaudio_config_add_mpris_player (PulseaudioConfig *config, } players_string = g_strjoinv (";", players); - player_string = g_strjoin (";", players_string, player, NULL); + if (g_strv_length (players) > 0) + player_string = g_strjoin (";", players_string, player, NULL); + else + player_string = g_strdup (player); player_list = g_strsplit(player_string, ";", 0); pulseaudio_config_set_mpris_players (config, player_list); @@ -585,6 +613,169 @@ pulseaudio_config_add_mpris_player (PulseaudioConfig *config, +static gchar ** +pulseaudio_config_get_blacklisted_players (PulseaudioConfig *config) +{ + if (!IS_PULSEAUDIO_CONFIG (config)) + { + return g_strsplit (DEFAULT_BLACKLISTED_PLAYERS, ";", 1); + } + + return g_strsplit (config->blacklisted_players, ";", 0); +} + + + +static void +pulseaudio_config_set_blacklisted_players (PulseaudioConfig *config, + gchar **players) +{ + GSList *player_array; + gchar *player_string; + GValue src = { 0, }; + guint index = 0; + guint i = 0; + GSList *list = NULL; + + g_return_if_fail (IS_PULSEAUDIO_CONFIG (config)); + + player_array = NULL; + for (i = 0; i < g_strv_length (players); i++) + { + player_array = g_slist_prepend (player_array, players[i]); + } + + player_array = g_slist_sort (player_array, (GCompareFunc) compare_players); + + for (list = player_array; list != NULL; list = g_slist_next (list)) + { + players[index] = list->data; + index++; + } + + g_slist_free (player_array); + + player_string = g_strjoinv (";", players); + + g_value_init(&src, G_TYPE_STRING); + g_value_set_static_string(&src, player_string); + + pulseaudio_config_set_property (G_OBJECT (config), PROP_BLACKLISTED_PLAYERS, &src, NULL); + + g_free (player_string); +} + + + +void +pulseaudio_config_player_blacklist_add (PulseaudioConfig *config, + const gchar *player) +{ + gchar **players; + gchar **player_list; + gchar *players_string; + gchar *player_string; + + players = pulseaudio_config_get_blacklisted_players (config); + if (g_strv_contains ((const char * const *) players, player)) + { + g_strfreev(players); + return; + } + + players_string = g_strjoinv (";", players); + if (g_strv_length (players) > 0) + player_string = g_strjoin (";", players_string, player, NULL); + else + player_string = g_strdup (player); + + player_list = g_strsplit(player_string, ";", 0); + + pulseaudio_config_set_blacklisted_players (config, player_list); + + g_strfreev (player_list); + g_free (player_string); + g_free (players_string); + g_strfreev (players); +} + + + +void +pulseaudio_config_player_blacklist_remove (PulseaudioConfig *config, + const gchar *player) +{ + GString *string; + gchar **players; + gchar **player_list; + gchar *player_string; + guint i; + + string = g_string_new (""); + + players = pulseaudio_config_get_blacklisted_players (config); + if (players != NULL) + { + for (i = 0; i < g_strv_length (players); i++) + { + if (g_strcmp0(player, players[i]) != 0) + { + string = g_string_append (string, players[0]); + } + } + } + + player_string = g_string_free (string, FALSE); + player_list = g_strsplit(player_string, ";", 0); + + pulseaudio_config_set_blacklisted_players (config, player_list); + + g_strfreev (player_list); + g_free (player_string); + g_strfreev (players); +} + + + +gboolean +pulseaudio_config_player_blacklist_lookup (PulseaudioConfig *config, + gchar *player) +{ + gchar **players; + gboolean found = FALSE; + players = pulseaudio_config_get_blacklisted_players (config); + if (g_strv_contains ((const char * const *) players, player)) + { + found = TRUE; + } + + g_strfreev(players); + return found; +} + + + +void +pulseaudio_config_clear_known_players (PulseaudioConfig *config) +{ + gchar *player_string; + GValue src = { 0, }; + + g_return_if_fail (IS_PULSEAUDIO_CONFIG (config)); + + player_string = g_strdup (""); + + g_value_init(&src, G_TYPE_STRING); + g_value_set_static_string(&src, player_string); + + pulseaudio_config_set_property (G_OBJECT (config), PROP_BLACKLISTED_PLAYERS, &src, NULL); + pulseaudio_config_set_property (G_OBJECT (config), PROP_MPRIS_PLAYERS, &src, NULL); + + g_free (player_string); +} + + + void pulseaudio_config_set_can_raise_wnck (PulseaudioConfig *config, gboolean can_raise) @@ -654,6 +845,10 @@ pulseaudio_config_new (const gchar *property_base) xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "mpris-players"); g_free (property); + property = g_strconcat (property_base, "/blacklisted-players", NULL); + xfconf_g_property_bind (channel, property, G_TYPE_STRING, config, "blacklisted-players"); + g_free (property); + property = g_strconcat (property_base, "/enable-wnck", NULL); xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "enable-wnck"); g_free (property); diff --git a/panel-plugin/pulseaudio-config.h b/panel-plugin/pulseaudio-config.h index 24715f9..cb34a8e 100644 --- a/panel-plugin/pulseaudio-config.h +++ b/panel-plugin/pulseaudio-config.h @@ -52,6 +52,15 @@ void pulseaudio_config_set_mpris_players (PulseaudioC void pulseaudio_config_add_mpris_player (PulseaudioConfig *config, gchar *player); +void pulseaudio_config_player_blacklist_add (PulseaudioConfig *config, + const gchar *player); +void pulseaudio_config_player_blacklist_remove (PulseaudioConfig *config, + const gchar *player); +gboolean pulseaudio_config_player_blacklist_lookup (PulseaudioConfig *config, + gchar *player); + +void pulseaudio_config_clear_known_players (PulseaudioConfig *config); + void pulseaudio_config_set_can_raise_wnck (PulseaudioConfig *config, gboolean can_raise); gboolean pulseaudio_config_get_can_raise_wnck (PulseaudioConfig *config); diff --git a/panel-plugin/pulseaudio-dialog.c b/panel-plugin/pulseaudio-dialog.c index a5bc5cc..2c37f12 100644 --- a/panel-plugin/pulseaudio-dialog.c +++ b/panel-plugin/pulseaudio-dialog.c @@ -73,6 +73,9 @@ struct _PulseaudioDialog GObject *dialog; PulseaudioConfig *config; + + GtkWidget *treeview; + GtkWidget *revealer; }; @@ -146,11 +149,62 @@ pulseaudio_dialog_run_mixer (PulseaudioDialog *dialog, static void +pulseaudio_dialog_player_toggled_cb (GtkCellRendererToggle *toggle, gchar *path, gpointer user_data) +{ + PulseaudioDialog *dialog = PULSEAUDIO_DIALOG (user_data); + GtkTreeModel *model; + GtkTreePath *treepath; + GtkTreeIter iter; + GValue hidden_val = {0,}, player_val = {0,}; + gboolean hidden; + const gchar *player; + + model = GTK_TREE_MODEL(gtk_tree_view_get_model(GTK_TREE_VIEW(dialog->treeview))); + treepath = gtk_tree_path_new_from_string (path); + gtk_tree_model_get_iter (model, &iter, treepath); + + gtk_tree_model_get_value (model, &iter, 1, &player_val); + gtk_tree_model_get_value (model, &iter, 2, &hidden_val); + hidden = !g_value_get_boolean(&hidden_val); + player = g_value_get_string(&player_val); + + gtk_list_store_set(GTK_LIST_STORE(model), &iter, 2, hidden, -1); + + if (hidden) + pulseaudio_config_player_blacklist_add (dialog->config, player); + else + pulseaudio_config_player_blacklist_remove (dialog->config, player); +} + + + +static void +pulseaudio_dialog_clear_players_cb (GtkButton *button, + gpointer *user_data) +{ + PulseaudioDialog *dialog = PULSEAUDIO_DIALOG (user_data); + GtkListStore *liststore; + + pulseaudio_config_clear_known_players (dialog->config); + + liststore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(dialog->treeview))); + gtk_list_store_clear (liststore); + + gtk_revealer_set_reveal_child (GTK_REVEALER(dialog->revealer), TRUE); +} + + + +static void pulseaudio_dialog_build (PulseaudioDialog *dialog) { - GtkBuilder *builder = GTK_BUILDER (dialog); - GObject *object; - GError *error = NULL; + GtkBuilder *builder = GTK_BUILDER (dialog); + GObject *object; + GtkListStore *liststore; + GtkTreeIter iter; + GError *error = NULL; + gchar **players; + guint i; if (xfce_titled_dialog_get_type () == 0) return; @@ -206,8 +260,8 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog) G_CALLBACK (pulseaudio_dialog_run_mixer), dialog); #ifdef HAVE_MPRIS2 - object = gtk_builder_get_object (builder, "checkbutton-mpris-support"); - g_return_if_fail (GTK_IS_CHECK_BUTTON (object)); + object = gtk_builder_get_object (builder, "switch-mpris-support"); + g_return_if_fail (GTK_IS_SWITCH (object)); g_object_bind_property (G_OBJECT (dialog->config), "enable-mpris", G_OBJECT (object), "active", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); @@ -222,22 +276,54 @@ pulseaudio_dialog_build (PulseaudioDialog *dialog) G_OBJECT(object), "sensitive", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); + object = gtk_builder_get_object(builder, "section_mp_content_1"); + g_object_bind_property(G_OBJECT(dialog->config), "enable-mpris", + G_OBJECT(object), "sensitive", + G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); + + object = gtk_builder_get_object(builder, "section_mp_content_2"); + g_object_bind_property(G_OBJECT(dialog->config), "enable-mpris", + G_OBJECT(object), "sensitive", + G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); + + /* Populate the liststore */ + dialog->treeview = GTK_WIDGET(gtk_builder_get_object(builder, "player_tree_view")); + liststore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(dialog->treeview))); + players = pulseaudio_config_get_mpris_players (dialog->config); + if (players != NULL) + { + for (i = 0; i < g_strv_length (players); i++) + { + gtk_list_store_append(liststore, &iter); + gtk_list_store_set(liststore, &iter, + 0, players[i], + 1, players[i], + 2, pulseaudio_config_player_blacklist_lookup(dialog->config, players[i]), + -1); + } + } + g_strfreev (players); + + object = gtk_builder_get_object(builder, "col_hidden_renderer"); + g_signal_connect (object, "toggled", (GCallback) pulseaudio_dialog_player_toggled_cb, dialog); + + object = gtk_builder_get_object(builder, "clear_players"); + g_signal_connect (object, "clicked", (GCallback) pulseaudio_dialog_clear_players_cb, dialog); + + dialog->revealer = GTK_WIDGET(gtk_builder_get_object(builder, "restart_revealer")); + object = gtk_builder_get_object(builder, "checkbutton-wnck"); g_return_if_fail(GTK_IS_CHECK_BUTTON(object)); #ifdef HAVE_WNCK g_object_bind_property(G_OBJECT(dialog->config), "enable-wnck", G_OBJECT(object), "active", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); - - g_object_bind_property(G_OBJECT(dialog->config), "enable-mpris", - G_OBJECT(object), "sensitive", - G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL); #else gtk_widget_set_visible(GTK_WIDGET(object), FALSE); #endif #else - object = gtk_builder_get_object (builder, "media-player-frame"); + object = gtk_builder_get_object (builder, "section_mp_content"); gtk_widget_set_visible (GTK_WIDGET (object), FALSE); #endif } diff --git a/panel-plugin/pulseaudio-dialog.glade b/panel-plugin/pulseaudio-dialog.glade index 4e50e28..1a6d33d 100644 --- a/panel-plugin/pulseaudio-dialog.glade +++ b/panel-plugin/pulseaudio-dialog.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.20.2 --> <interface> <requires lib="gtk+" version="3.20"/> <requires lib="libxfce4ui-2" version="4.11"/> @@ -8,6 +8,21 @@ <property name="can_focus">False</property> <property name="icon_name">xfce4-pulseaudio-plugin</property> </object> + <object class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">edit-clear</property> + </object> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name icon_name --> + <column type="gchararray"/> + <!-- column-name label --> + <column type="gchararray"/> + <!-- column-name hidden --> + <column type="gboolean"/> + </columns> + </object> <object class="XfceTitledDialog" id="dialog"> <property name="can_focus">False</property> <property name="title" translatable="yes">PulseAudio Panel Plugin</property> @@ -64,196 +79,212 @@ </packing> </child> <child> - <object class="GtkBox" id="vbox1"> + <object class="GtkNotebook" id="sections"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="border_width">6</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> <child> - <object class="GtkFrame" id="frame1"> + <object class="GtkBox" id="section_general_content"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="border_width">12</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> <child> - <object class="GtkAlignment" id="alignment1"> + <object class="GtkFrame" id="frame1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> - <property name="right_padding">12</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> <child> - <object class="GtkBox" id="vbox2"> + <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> - <child> - <object class="GtkCheckButton" id="checkbutton-keyboard-shortcuts"> - <property name="label" translatable="yes">Enable keyboard _shortcuts for volume control</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Enables volume control using multimedia keys. Make sure no other application that listens to these keys (e.g. xfce4-volumed) is running in the background.</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> <child> - <object class="GtkCheckButton" id="checkbutton-show-notifications"> - <property name="label" translatable="yes">Show _notifications when volume changes</property> + <object class="GtkBox" id="vbox2"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Enables on-screen volume notifications.</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="checkbutton-keyboard-shortcuts"> + <property name="label" translatable="yes">Enable keyboard _shortcuts for volume control</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Enables volume control using multimedia keys. Make sure no other application that listens to these keys (e.g. xfce4-volumed) is running in the background.</property> + <property name="halign">start</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton-show-notifications"> + <property name="label" translatable="yes">Show _notifications when volume changes</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes">Enables on-screen volume notifications.</property> + <property name="halign">start</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Behaviour</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> </child> - <child type="label"> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Behaviour</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> <child> - <object class="GtkAlignment" id="alignment2"> + <object class="GtkFrame" id="frame2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> - <property name="right_padding">12</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> <child> - <object class="GtkGrid"> + <object class="GtkAlignment" id="alignment2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> <child> - <object class="GtkLabel" id="label2"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Audio _Mixer</property> - <property name="use_underline">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Audio _Mixer</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry-mixer-command"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Audio mixer command that can be executed from the context menu, e.g. "pavucontrol", "unity-control-center sound".</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button-run-mixer"> + <property name="label" translatable="yes">_Run Audio Mixer...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">start</property> + <property name="image">image1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">2</property> + </packing> + </child> </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="entry-mixer-command"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Audio mixer command that can be executed from the context menu, e.g. "pavucontrol", "unity-control-center sound".</property> - <property name="hexpand">True</property> - <property name="invisible_char">•</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="button-run-mixer"> - <property name="label" translatable="yes">_Run Audio Mixer...</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="halign">start</property> - <property name="image">image1</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">2</property> - </packing> </child> </object> </child> + <child type="label"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Sound Settings</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Sound settings</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="section_general"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">General</property> + </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> + <property name="tab_fill">False</property> </packing> </child> <child> - <object class="GtkFrame" id="media-player-frame"> + <object class="GtkBox" id="section_mp_content"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="border_width">10</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> <child> - <object class="GtkAlignment" id="alignment3"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> - <property name="right_padding">12</property> + <property name="margin_left">2</property> + <property name="margin_right">2</property> + <property name="orientation">vertical</property> <child> <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> <child> - <object class="GtkCheckButton" id="checkbutton-mpris-support"> - <property name="label" translatable="yes">Control playback of media players</property> + <object class="GtkLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="draw_indicator">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Control Playback of Media Players</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> <packing> <property name="expand">False</property> @@ -262,58 +293,248 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="checkbutton-multimedia-keys"> - <property name="label" translatable="yes">Enable multimedia keys for playback control</property> + <object class="GtkSwitch" id="switch-mpris-support"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="draw_indicator">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> + <property name="pack_type">end</property> <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="section_mp_content_1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">3</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> <child> - <object class="GtkCheckButton" id="checkbutton-wnck"> - <property name="label" translatable="yes">Enable experimental window focus support</property> + <object class="GtkBox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="checkbutton-multimedia-keys"> + <property name="label" translatable="yes">Enable multimedia keys for playback control</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton-wnck"> + <property name="label" translatable="yes">Enable experimental window focus support</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> </child> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> </child> - <child type="label"> - <object class="GtkLabel" id="label4"> + <child> + <object class="GtkFrame" id="section_mp_content_2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Media Players</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <property name="margin_left">2</property> + <property name="margin_right">2</property> + <property name="margin_bottom">12</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="player_tree_view"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="model">liststore1</property> + <property name="headers_clickable">False</property> + <property name="enable_search">False</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="col_icon"> + <child> + <object class="GtkCellRendererPixbuf" id="col_icon_renderer"/> + <attributes> + <attribute name="icon-name">0</attribute> + </attributes> + </child> + </object> + </child> + <child> + <object class="GtkTreeViewColumn" id="col_label"> + <property name="title" translatable="yes">Title</property> + <property name="expand">True</property> + <child> + <object class="GtkCellRendererText" id="col_label_renderer"/> + <attributes> + <attribute name="text">1</attribute> + </attributes> + </child> + </object> + </child> + <child> + <object class="GtkTreeViewColumn" id="col_hidden"> + <property name="title" translatable="yes">Hidden</property> + <child> + <object class="GtkCellRendererToggle" id="col_hidden_renderer"/> + <attributes> + <attribute name="active">2</attribute> + </attributes> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="clear_players"> + <property name="label" translatable="yes">Clear Known Items</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">start</property> + <property name="image">image2</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRevealer" id="restart_revealer"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">Please restart your panel for additional players to be displayed.</property> + <property name="wrap">True</property> + <property name="xalign">0</property> + <attributes> + <attribute name="style" value="italic"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Known Media Players</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> + <property name="position">1</property> </packing> </child> + <child type="tab"> + <object class="GtkLabel" id="section_mp"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Media Players</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <placeholder/> + </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> diff --git a/panel-plugin/pulseaudio-menu.c b/panel-plugin/pulseaudio-menu.c index b32a54d..1941759 100644 --- a/panel-plugin/pulseaudio-menu.c +++ b/panel-plugin/pulseaudio-menu.c @@ -567,6 +567,9 @@ pulseaudio_menu_new (PulseaudioVolume *volume, { for (i = 0; i < g_strv_length (players); i++) { + if (pulseaudio_config_player_blacklist_lookup (menu->config, players[i])) + continue; + mi = mpris_menu_item_new_from_player_name (players[i]); if (mi != NULL) { -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
