Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

clean up context menu entries #1488

Merged
merged 1 commit into from

3 participants

@dersphere

IMO the current mass of context menu entries is very confusing to new users so I created a list of entries which are (imo) contextual wrong and removed them. Most of them are add-on (both, script and plugin) related.

I committed very fine grained to have a detailed description on each remove. Of course I will squash all changes you want have applied into one commit later.

Please see details in each commit.

I know that my commits are even increasing the complexity of context menu entry creation but refactoring the hole context menu system exceeds my code knowledge.

@NedScott

Stop scanning might be good to leave in regardless of where someone is. If you're on an ARM device, like an R-Pi or an ATV2, one might want to stop a library scan since these devices will really struggle to do anything while updating the library, including video add-ons.

@dersphere

@NedScott: What about showing "stop scanning" if database is scanning but not showing "update library" when no scan is in progress?

@NedScott

@dersphere Yeah, that would make sense.

@dersphere

I squashed the changes into one commit with all requested changes.

Ready for next round :)

@MartijnKaijser

@dersphere
Maybe also hide "scan for new content" (tvshows) while already scanning.

@dersphere

@MartijnKaijser:
Button "Scan for new content" while on a source which contains TV-Shows was already correct. ("Scan for new Content" or "Stop Scanning" depending on IsVideoScanning)
Which button on which item do you exactly mean?

@dersphere

@MartijnKaijser: Could you please recheck?

@MartijnKaijser

So far works for me (of i have covered them all).

@dersphere

@cptspiff: Is that something you consider merging in this (final) window?

@ghost

yes.

@dersphere

Just ping me if you want something to be changed.

@MartijnKaijser

@dersphere
Could you rebase?

@dersphere

@MartijnKaijser: Should be rebased now.

@dersphere dersphere 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
63e9122
@MartijnKaijser MartijnKaijser merged commit 1ce0cf2 into xbmc:master
@tru tru referenced this pull request from a commit in plexinc/plex-home-theater-public
@tru tru Avoid trying to load photo play queues since we don't support them.
Fixes #1488
3d9057f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2012
  1. @dersphere

    context menu cleanup

    dersphere authored
    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
This page is out of date. Refresh to see the latest.
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,6 +368,7 @@ 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);
@@ -375,7 +376,7 @@ void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &bu
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
+ 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())
Something went wrong with that request. Please try again.