[banshee] SourceActions: Hide browser content menu when the source has no browser
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] SourceActions: Hide browser content menu when the source has no browser
- Date: Sun, 22 Jan 2012 16:00:23 +0000 (UTC)
commit 925c3bc189c9d9ec9eb3129b6298e63b5c7beaf6
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sun Jan 22 16:26:33 2012 +0100
SourceActions: Hide browser content menu when the source has no browser
If the active source doesn't have a browser, we hide the whole "Browser
Content" sub-menu, like we already do for the browser placement options.
.../Banshee.Gui/SourceActions.cs | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
index 3a66ad6..6eee273 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
@@ -387,15 +387,23 @@ namespace Banshee.Gui
/*UpdateAction ("NewSmartPlaylistFromSearchAction", (source is LibrarySource || source.Parent is LibrarySource),
!String.IsNullOrEmpty (source.FilterQuery), source);*/
+ IFilterableSource filterable_source = source as IFilterableSource;
+ bool has_browser = filterable_source != null && filterable_source.AvailableFilters.Count > 0;
+
ActionGroup browser_actions = Actions.FindActionGroup ("BrowserView");
if (browser_actions != null) {
- IFilterableSource filterable_source = source as IFilterableSource;
- bool has_browser = filterable_source != null && filterable_source.AvailableFilters.Count > 0;
UpdateAction (browser_actions["BrowserTopAction"], has_browser);
UpdateAction (browser_actions["BrowserLeftAction"], has_browser);
UpdateAction (browser_actions["BrowserVisibleAction"], has_browser);
}
+ ActionGroup browser_config_actions = Actions.FindActionGroup ("BrowserConfiguration");
+ if (browser_config_actions != null) {
+ // TODO: Be more specific than has_browser. Those actions have no effect
+ // on some sources that have a browser, like podcasts or radio.
+ UpdateAction (browser_config_actions["BrowserContentMenuAction"], has_browser);
+ }
+
last_source = source;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]