Permalink
Browse files

context menu cleanup

changes:

video:
hide "update library" within or on video add-ons
hide "play from here" in context menu entries on scripts

music:
hide music related context menu entries on add-ons->"Get More..."
hide "update library" within or on video add-ons
hide "scan to library" in context menu entries on music->files->music add-ons
hide "switch media" in context menu entries within music plugin virtual folders

picture:
hide picture related context menu entries on add-ons->"Get More..."
hide "start slideshow( here)" in context menu entries on folders, zip, rar, cbz?, cbr?, scripts
hide "switch media" and "goto root" in context menu entries within or on picture plugins
  • Loading branch information...
dersphere committed Oct 9, 2012
1 parent 39ab944 commit 63e91229f6b57835479916e5ce23e3d0cddf5fdb
@@ -418,7 +418,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
- if (item && (item->GetExtraInfo().Find("lastfm") < 0))
+ if (item && (item->GetExtraInfo().Find("lastfm") < 0) && !item->GetPath().Left(14).Equals("addons://more/"))
{
// are we in the playlists location?
bool inPlaylists = m_vecItems->GetPath().Equals(CUtil::MusicPlaylistsLocation()) ||
@@ -541,7 +541,10 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
if (g_application.IsMusicScanning())
buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning
else
- buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653);
+ {
+ if (!m_vecItems->IsPlugin())
+ buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653);
+ }
CGUIWindowMusicBase::GetNonContextButtons(buttons);
}
@@ -318,7 +318,7 @@ void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &bu
CGUIWindowMusicBase::GetContextButtons(itemNumber, buttons);
if (item->GetProperty("pluginreplacecontextitems").asBoolean())
return;
- if (!item->IsPlayList())
+ if (!item->IsPlayList() && !item->IsPlugin() && !item->IsScript())
{
if (item->IsAudio() && !item->IsLastFM())
buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
@@ -368,14 +368,15 @@ void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &bu
!item->IsLastFM() &&
!item->GetPath().Equals("add") && !item->IsParentFolder() &&
!item->IsPlugin() &&
+ !item->GetPath().Left(9).Equals("addons://") &&
(g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser))
{
buttons.Add(CONTEXT_BUTTON_SCAN, 13352);
}
if (item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045);
}
- if (!m_vecItems->IsVirtualDirectoryRoot())
+ if (!m_vecItems->IsVirtualDirectoryRoot() && !m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
CGUIWindowMusicBase::GetNonContextButtons(buttons);
}
@@ -455,13 +455,15 @@ void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &butt
}
else
{
- if (item)
+ if (item && !item->GetPath().Left(14).Equals("addons://more/"))
{
if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
buttons.Add(CONTEXT_BUTTON_INFO, 24003); // Add-on info
if (!(item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR() || item->IsScript()))
+ {
buttons.Add(CONTEXT_BUTTON_INFO, 13406); // picture info
- buttons.Add(CONTEXT_BUTTON_VIEW_SLIDESHOW, item->m_bIsFolder ? 13317 : 13422); // View Slideshow
+ buttons.Add(CONTEXT_BUTTON_VIEW_SLIDESHOW, item->m_bIsFolder ? 13317 : 13422); // View Slideshow
+ }
if (item->m_bIsFolder)
buttons.Add(CONTEXT_BUTTON_RECURSIVE_SLIDESHOW, 13318); // Recursive Slideshow
@@ -476,9 +478,11 @@ void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &butt
if (item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045);
-
- buttons.Add(CONTEXT_BUTTON_GOTO_ROOT, 20128);
- buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
+ else
+ {
+ buttons.Add(CONTEXT_BUTTON_GOTO_ROOT, 20128);
+ buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
+ }
}
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
@@ -1220,10 +1220,10 @@ void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &but
{
buttons.Add(CONTEXT_BUTTON_RESUME_ITEM, GetResumeString(*(item.get()))); // Resume Video
}
- //if the item isn't a folder, is a member of a list rather than a single item
+ //if the item isn't a folder or script, is a member of a list rather than a single item
//and we're not on the last element of the list,
//then add add either 'play from here' or 'play only this' depending on default behaviour
- if (!item->m_bIsFolder && m_vecItems->Size() > 1 && itemNumber < m_vecItems->Size()-1)
+ if (!(item->m_bIsFolder || item->IsScript()) && m_vecItems->Size() > 1 && itemNumber < m_vecItems->Size()-1)
{
if (!g_guiSettings.GetBool("videoplayer.autoplaynextitem"))
buttons.Add(CONTEXT_BUTTON_PLAY_AND_QUEUE, 13412);
@@ -1030,7 +1030,10 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt
buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353);
}
else
- buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653);
+ {
+ if (!(item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin()))
+ buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653);
+ }
}
if (!m_vecItems->IsVideoDb() && !m_vecItems->IsVirtualDirectoryRoot())

0 comments on commit 63e9122

Please sign in to comment.