Browse files

Merge pull request #1488 from dersphere/harmonize_context_menu

clean up context menu entries
  • Loading branch information...
2 parents 39a59f7 + 63e9122 commit 1ce0cf2083f2e3e102e736f75348c7ffce9bf728 @MartijnKaijser MartijnKaijser committed Oct 9, 2012
View
7 xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -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);
}
View
5 xbmc/music/windows/GUIWindowMusicSongs.cpp
@@ -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);
}
View
14 xbmc/pictures/GUIWindowPictures.cpp
@@ -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
@pieh
Team Kodi member
pieh added a note Oct 9, 2012

Is this correct? .cbz, .cbr are series of images stored in single archive file (format used for f.e. comics). Same for .zip and .rar - they are directories that can contain images - shouldn't we show that button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ 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);
View
4 xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -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);
View
5 xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -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 1ce0cf2

Please sign in to comment.