void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &buttons) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); CGUIWindowVideoBase::GetContextButtons(itemNumber, buttons); CVideoDatabaseDirectory dir; NODE_TYPE node = dir.GetDirectoryChildType(m_vecItems->GetPath()); if (!item) { // nothing to do here } else if (m_vecItems->IsPath("sources://video/")) { // get the usual shares CGUIDialogContextMenu::GetContextButtons("video", item, buttons); if (!item->IsDVD() && item->GetPath() != "add" && !item->IsParentFolder() && (CProfilesManager::GetInstance().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser)) { CVideoDatabase database; database.Open(); ADDON::ScraperPtr info = database.GetScraperForPath(item->GetPath()); if (!item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath() && !URIUtils::IsUPnP(item->GetPath())) { if (info && info->Content() != CONTENT_NONE) { buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); } } } else { // are we in the playlists location? bool inPlaylists = m_vecItems->IsPath(CUtil::VideoPlaylistsLocation()) || m_vecItems->IsPath("special://videoplaylists/"); if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_artist.empty()) { CMusicDatabase database; database.Open(); if (database.GetArtistByName(StringUtils::Join(item->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator)) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ARTIST, 20396); } if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strAlbum.empty()) { CMusicDatabase database; database.Open(); if (database.GetAlbumByName(item->GetVideoInfoTag()->m_strAlbum) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ALBUM, 20397); } if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strAlbum.empty() && !item->GetVideoInfoTag()->m_artist.empty() && !item->GetVideoInfoTag()->m_strTitle.empty()) { CMusicDatabase database; database.Open(); if (database.GetSongByArtistAndAlbumAndTitle(StringUtils::Join(item->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator), item->GetVideoInfoTag()->m_strAlbum, item->GetVideoInfoTag()->m_strTitle) > -1) { buttons.Add(CONTEXT_BUTTON_PLAY_OTHER, 20398); } } if (!item->IsParentFolder()) { ADDON::ScraperPtr info; VIDEO::SScanSettings settings; GetScraperForItem(item.get(), info, settings); // can we update the database? if (CProfilesManager::GetInstance().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) { if (!g_application.IsVideoScanning() && item->IsVideoDb() && item->HasVideoInfoTag() && (item->GetVideoInfoTag()->m_type == MediaTypeMovie || // movies item->GetVideoInfoTag()->m_type == MediaTypeTvShow || // tvshows item->GetVideoInfoTag()->m_type == MediaTypeSeason || // seasons item->GetVideoInfoTag()->m_type == MediaTypeEpisode || // episodes item->GetVideoInfoTag()->m_type == MediaTypeMusicVideo || // musicvideos item->GetVideoInfoTag()->m_type == "tag" || // tags item->GetVideoInfoTag()->m_type == MediaTypeVideoCollection)) // sets { buttons.Add(CONTEXT_BUTTON_EDIT, 16106); } if (node == NODE_TYPE_TITLE_TVSHOWS) { buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } if (node == NODE_TYPE_ACTOR && !dir.IsAllItem(item->GetPath()) && item->m_bIsFolder) { if (StringUtils::StartsWithNoCase(m_vecItems->GetPath(), "videodb://musicvideos")) // mvids buttons.Add(CONTEXT_BUTTON_SET_ARTIST_THUMB, 13359); else buttons.Add(CONTEXT_BUTTON_SET_ACTOR_THUMB, 20403); } } if (!m_vecItems->IsVideoDb() && !m_vecItems->IsVirtualDirectoryRoot()) { // non-video db items, file operations are allowed if ((CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && CUtil::SupportsWriteFileOperations(item->GetPath())) || (inPlaylists && URIUtils::GetFileName(item->GetPath()) != "PartyMode-Video.xsp" && (item->IsPlayList() || item->IsSmartPlayList()))) { buttons.Add(CONTEXT_BUTTON_DELETE, 117); buttons.Add(CONTEXT_BUTTON_RENAME, 118); } // add "Set/Change content" to folders if (item->m_bIsFolder && !item->IsVideoDb() && !item->IsPlayList() && !item->IsSmartPlayList() && !item->IsLibraryFolder() && !item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath() && !URIUtils::IsUPnP(item->GetPath())) { if (info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); if (info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } if ((!item->HasVideoInfoTag() || item->GetVideoInfoTag()->m_iDbId == -1) && info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SCAN_TO_LIBRARY, 21845); } } }
void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &buttons) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); CGUIWindowVideoBase::GetContextButtons(itemNumber, buttons); if (item && item->GetPropertyBOOL("pluginreplacecontextitems")) return; CVideoDatabaseDirectory dir; NODE_TYPE node = dir.GetDirectoryChildType(m_vecItems->m_strPath); if (!item) { CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); else buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653); } else { ADDON::ScraperPtr info; VIDEO::SScanSettings settings; GetScraperForItem(item.get(), info, settings); if (info && info->Content() == CONTENT_TVSHOWS) buttons.Add(CONTEXT_BUTTON_INFO, item->m_bIsFolder ? 20351 : 20352); else if (info && info->Content() == CONTENT_MUSICVIDEOS) buttons.Add(CONTEXT_BUTTON_INFO,20393); else if (!item->m_bIsFolder && !item->m_strPath.Left(19).Equals("newsmartplaylist://")) buttons.Add(CONTEXT_BUTTON_INFO, 13346); if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strArtist.IsEmpty()) { CMusicDatabase database; database.Open(); if (database.GetArtistByName(item->GetVideoInfoTag()->m_strArtist) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ARTIST, 20396); } if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_strAlbum.size() > 0) { CMusicDatabase database; database.Open(); if (database.GetAlbumByName(item->GetVideoInfoTag()->m_strAlbum) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ALBUM, 20397); } if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_strAlbum.size() > 0 && item->GetVideoInfoTag()->m_strArtist.size() > 0 && item->GetVideoInfoTag()->m_strTitle.size() > 0) { CMusicDatabase database; database.Open(); if (database.GetSongByArtistAndAlbumAndTitle(item->GetVideoInfoTag()->m_strArtist, item->GetVideoInfoTag()->m_strAlbum, item->GetVideoInfoTag()->m_strTitle) > -1) { buttons.Add(CONTEXT_BUTTON_PLAY_OTHER, 20398); } } if (!item->IsParentFolder()) { // can we update the database? if (g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) { if (node == NODE_TYPE_TITLE_TVSHOWS) { CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); else buttons.Add(CONTEXT_BUTTON_UPDATE_TVSHOW, 13349); } if ((info && info->Content() == CONTENT_TVSHOWS && item->m_bIsFolder) || (item->IsVideoDb() && item->HasVideoInfoTag() && !item->m_bIsFolder)) { if (item->m_bIsFolder || item->GetVideoInfoTag()->m_playCount > 0) buttons.Add(CONTEXT_BUTTON_MARK_UNWATCHED, 16104); //Mark as UnWatched if (item->m_bIsFolder || item->GetVideoInfoTag()->m_playCount == 0) buttons.Add(CONTEXT_BUTTON_MARK_WATCHED, 16103); //Mark as Watched if (node != NODE_TYPE_SEASONS) buttons.Add(CONTEXT_BUTTON_EDIT, 16105); //Edit Title } if (m_database.HasContent(VIDEODB_CONTENT_TVSHOWS) && item->HasVideoInfoTag() && !item->m_bIsFolder && item->GetVideoInfoTag()->m_iEpisode == -1 && item->GetVideoInfoTag()->m_strArtist.IsEmpty()) // movie entry { if (m_database.IsLinkedToTvshow(item->GetVideoInfoTag()->m_iDbId)) buttons.Add(CONTEXT_BUTTON_UNLINK_MOVIE,20385); buttons.Add(CONTEXT_BUTTON_LINK_MOVIE,20384); } if (node == NODE_TYPE_SEASONS && item->m_bIsFolder) buttons.Add(CONTEXT_BUTTON_SET_SEASON_THUMB, 20371); if (item->m_strPath.Left(14).Equals("videodb://1/7/") && item->m_strPath.size() > 14 && item->m_bIsFolder) // sets { buttons.Add(CONTEXT_BUTTON_EDIT, 16105); buttons.Add(CONTEXT_BUTTON_SET_MOVIESET_THUMB, 20435); buttons.Add(CONTEXT_BUTTON_DELETE, 646); } if (node == NODE_TYPE_ACTOR && !dir.IsAllItem(item->m_strPath) && item->m_bIsFolder) { if (m_vecItems->m_strPath.Left(11).Equals("videodb://3")) // mvids buttons.Add(CONTEXT_BUTTON_SET_ARTIST_THUMB, 13359); else buttons.Add(CONTEXT_BUTTON_SET_ACTOR_THUMB, 20403); } if (item->IsVideoDb() && item->HasVideoInfoTag() && (!item->m_bIsFolder || node == NODE_TYPE_TITLE_TVSHOWS)) { if (info && info->Content() == CONTENT_TVSHOWS) { if(item->GetVideoInfoTag()->m_iBookmarkId != -1 && item->GetVideoInfoTag()->m_iBookmarkId != 0) { buttons.Add(CONTEXT_BUTTON_UNLINK_BOOKMARK, 20405); } } buttons.Add(CONTEXT_BUTTON_DELETE, 646); } // this should ideally be non-contextual (though we need some context for non-tv show node I guess) CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) { if (node != NODE_TYPE_TITLE_TVSHOWS) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); } else buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653); } //Set default and/or clear default NODE_TYPE nodetype = CVideoDatabaseDirectory::GetDirectoryType(item->m_strPath); if (!item->IsParentFolder() && !m_vecItems->m_strPath.Equals("special://videoplaylists/") && (nodetype == NODE_TYPE_ROOT || nodetype == NODE_TYPE_OVERVIEW || nodetype == NODE_TYPE_TVSHOWS_OVERVIEW || nodetype == NODE_TYPE_MOVIES_OVERVIEW || nodetype == NODE_TYPE_MUSICVIDEOS_OVERVIEW)) { if (!item->m_strPath.Equals(g_settings.m_defaultVideoLibSource)) buttons.Add(CONTEXT_BUTTON_SET_DEFAULT, 13335); // set default if (strcmp(g_settings.m_defaultVideoLibSource, "")) buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // clear default } if ((CVideoDatabaseDirectory::GetDirectoryChildType(item->m_strPath) == NODE_TYPE_TITLE_MOVIES || CVideoDatabaseDirectory::GetDirectoryChildType(item->m_strPath) == NODE_TYPE_TITLE_MUSICVIDEOS || item->m_strPath.Equals("videodb://1/") || item->m_strPath.Equals("videodb://4/") || item->m_strPath.Equals("videodb://6/")) && nodetype != NODE_TYPE_RECENTLY_ADDED_MOVIES) { buttons.Add(CONTEXT_BUTTON_MARK_WATCHED, 16103); //Mark as Watched buttons.Add(CONTEXT_BUTTON_MARK_UNWATCHED, 16104); //Mark as UnWatched } if (m_vecItems->m_strPath.Equals("special://videoplaylists/")) { // video playlists, file operations are allowed if (!item->IsReadOnly()) { buttons.Add(CONTEXT_BUTTON_DELETE, 117); buttons.Add(CONTEXT_BUTTON_RENAME, 118); } } if (item->IsPlugin() || item->m_strPath.Left(9).Equals("script://") || m_vecItems->IsPlugin()) buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045); } } CGUIWindowVideoBase::GetNonContextButtons(itemNumber, buttons); }
void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &buttons) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); CGUIWindowVideoBase::GetContextButtons(itemNumber, buttons); if (item && item->GetProperty("pluginreplacecontextitems").asBoolean()) return; CVideoDatabaseDirectory dir; NODE_TYPE node = dir.GetDirectoryChildType(m_vecItems->GetPath()); if (!item) { // nothing to do here } else if (m_vecItems->IsPath("sources://video/")) { // get the usual shares CGUIDialogContextMenu::GetContextButtons("video", item, buttons); // add scan button somewhere here if (g_application.IsVideoScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning if (!item->IsDVD() && item->GetPath() != "add" && !item->IsParentFolder() && (CProfilesManager::GetInstance().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser)) { CVideoDatabase database; database.Open(); ADDON::ScraperPtr info = database.GetScraperForPath(item->GetPath()); if (!item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath() && !URIUtils::IsUPnP(item->GetPath())) { if (info && info->Content() != CONTENT_NONE) { buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); } } } else { // are we in the playlists location? bool inPlaylists = m_vecItems->IsPath(CUtil::VideoPlaylistsLocation()) || m_vecItems->IsPath("special://videoplaylists/"); if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_artist.empty()) { CMusicDatabase database; database.Open(); if (database.GetArtistByName(StringUtils::Join(item->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator)) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ARTIST, 20396); } if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_strAlbum.size() > 0) { CMusicDatabase database; database.Open(); if (database.GetAlbumByName(item->GetVideoInfoTag()->m_strAlbum) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ALBUM, 20397); } if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_strAlbum.size() > 0 && item->GetVideoInfoTag()->m_artist.size() > 0 && item->GetVideoInfoTag()->m_strTitle.size() > 0) { CMusicDatabase database; database.Open(); if (database.GetSongByArtistAndAlbumAndTitle(StringUtils::Join(item->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator), item->GetVideoInfoTag()->m_strAlbum, item->GetVideoInfoTag()->m_strTitle) > -1) { buttons.Add(CONTEXT_BUTTON_PLAY_OTHER, 20398); } } if (!item->IsParentFolder()) { ADDON::ScraperPtr info; VIDEO::SScanSettings settings; GetScraperForItem(item.get(), info, settings); if (info && info->Content() == CONTENT_TVSHOWS) buttons.Add(CONTEXT_BUTTON_INFO, item->m_bIsFolder ? 20351 : 20352); else if (info && info->Content() == CONTENT_MUSICVIDEOS) buttons.Add(CONTEXT_BUTTON_INFO,20393); else if (info && info->Content() == CONTENT_MOVIES) buttons.Add(CONTEXT_BUTTON_INFO, 13346); // can we update the database? if (CProfilesManager::GetInstance().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) { if (!item->IsPlugin() && !item->IsScript() && !item->IsLiveTV() && !item->IsAddonsPath() && item->GetPath() != "sources://video/" && item->GetPath() != "special://videoplaylists/" && !StringUtils::StartsWith(item->GetPath(), "newsmartplaylist://") && !StringUtils::StartsWith(item->GetPath(), "newplaylist://") && !StringUtils::StartsWith(item->GetPath(), "newtag://")) { if (item->m_bIsFolder) { // Have both options for folders since we don't know whether all childs are watched/unwatched buttons.Add(CONTEXT_BUTTON_MARK_UNWATCHED, 16104); //Mark as UnWatched buttons.Add(CONTEXT_BUTTON_MARK_WATCHED, 16103); //Mark as Watched } else { if (item->GetOverlayImage() == "OverlayWatched.png") buttons.Add(CONTEXT_BUTTON_MARK_UNWATCHED, 16104); //Mark as UnWatched else buttons.Add(CONTEXT_BUTTON_MARK_WATCHED, 16103); //Mark as Watched } } if (!g_application.IsVideoScanning() && item->IsVideoDb() && item->HasVideoInfoTag() && (item->GetVideoInfoTag()->m_type == MediaTypeMovie || // movies item->GetVideoInfoTag()->m_type == MediaTypeTvShow || // tvshows item->GetVideoInfoTag()->m_type == MediaTypeSeason || // seasons item->GetVideoInfoTag()->m_type == MediaTypeEpisode || // episodes item->GetVideoInfoTag()->m_type == MediaTypeMusicVideo || // musicvideos item->GetVideoInfoTag()->m_type == "tag" || // tags item->GetVideoInfoTag()->m_type == MediaTypeVideoCollection)) // sets { buttons.Add(CONTEXT_BUTTON_EDIT, 16106); } if (node == NODE_TYPE_TITLE_TVSHOWS) { if (g_application.IsVideoScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } if (node == NODE_TYPE_ACTOR && !dir.IsAllItem(item->GetPath()) && item->m_bIsFolder) { if (StringUtils::StartsWithNoCase(m_vecItems->GetPath(), "videodb://musicvideos")) // mvids buttons.Add(CONTEXT_BUTTON_SET_ARTIST_THUMB, 13359); else buttons.Add(CONTEXT_BUTTON_SET_ACTOR_THUMB, 20403); } } if (!m_vecItems->IsVideoDb() && !m_vecItems->IsVirtualDirectoryRoot()) { // non-video db items, file operations are allowed if ((CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && CUtil::SupportsWriteFileOperations(item->GetPath())) || (inPlaylists && URIUtils::GetFileName(item->GetPath()) != "PartyMode-Video.xsp" && (item->IsPlayList() || item->IsSmartPlayList()))) { buttons.Add(CONTEXT_BUTTON_DELETE, 117); buttons.Add(CONTEXT_BUTTON_RENAME, 118); } // add "Set/Change content" to folders if (item->m_bIsFolder && !item->IsVideoDb() && !item->IsPlayList() && !item->IsSmartPlayList() && !item->IsLibraryFolder() && !item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath() && !URIUtils::IsUPnP(item->GetPath())) { if (info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); if (info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } if (item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin()) buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045); } CContextMenuManager::GetInstance().AddVisibleItems(item, buttons); } }
void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &buttons) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); CGUIWindowVideoBase::GetContextButtons(itemNumber, buttons); if (item && item->GetPropertyBOOL("pluginreplacecontextitems")) return; CVideoDatabaseDirectory dir; NODE_TYPE node = dir.GetDirectoryChildType(m_vecItems->m_strPath); if (!item) { CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); else buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653); } else if (m_vecItems->m_strPath.Equals("sources://video/")) { // get the usual shares CGUIDialogContextMenu::GetContextButtons("video", item, buttons); // add scan button somewhere here CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning if (!item->IsDVD() && item->m_strPath != "add" && (g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser)) { CVideoDatabase database; database.Open(); ADDON::ScraperPtr info = database.GetScraperForPath(item->m_strPath); if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning())) { if (!item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath()) { if (info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); } } if (info && (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning()))) buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } else { ADDON::ScraperPtr info; VIDEO::SScanSettings settings; GetScraperForItem(item.get(), info, settings); if (info && info->Content() == CONTENT_TVSHOWS) buttons.Add(CONTEXT_BUTTON_INFO, item->m_bIsFolder ? 20351 : 20352); else if (info && info->Content() == CONTENT_MUSICVIDEOS) buttons.Add(CONTEXT_BUTTON_INFO,20393); else if (!item->m_bIsFolder && !item->m_strPath.Left(19).Equals("newsmartplaylist://")) buttons.Add(CONTEXT_BUTTON_INFO, 13346); if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strArtist.IsEmpty()) { CMusicDatabase database; database.Open(); if (database.GetArtistByName(item->GetVideoInfoTag()->m_strArtist) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ARTIST, 20396); } if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_strAlbum.size() > 0) { CMusicDatabase database; database.Open(); if (database.GetAlbumByName(item->GetVideoInfoTag()->m_strAlbum) > -1) buttons.Add(CONTEXT_BUTTON_GO_TO_ALBUM, 20397); } if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_strAlbum.size() > 0 && item->GetVideoInfoTag()->m_strArtist.size() > 0 && item->GetVideoInfoTag()->m_strTitle.size() > 0) { CMusicDatabase database; database.Open(); if (database.GetSongByArtistAndAlbumAndTitle(item->GetVideoInfoTag()->m_strArtist, item->GetVideoInfoTag()->m_strAlbum, item->GetVideoInfoTag()->m_strTitle) > -1) { buttons.Add(CONTEXT_BUTTON_PLAY_OTHER, 20398); } } if (!item->IsParentFolder()) { // can we update the database? if (g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) { if (node == NODE_TYPE_TITLE_TVSHOWS) { CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); else buttons.Add(CONTEXT_BUTTON_UPDATE_TVSHOW, 13349); } if (!item->IsPlugin() && !item->IsLiveTV() && !item->IsAddonsPath() && item->m_strPath != "sources://video/" && item->m_strPath != "special://videoplaylists/") { if (item->m_bIsFolder) { // Have both options for folders since we don't know whether all childs are watched/unwatched buttons.Add(CONTEXT_BUTTON_MARK_UNWATCHED, 16104); //Mark as UnWatched buttons.Add(CONTEXT_BUTTON_MARK_WATCHED, 16103); //Mark as Watched } else { if (item->GetOverlayImage().Equals("OverlayWatched.png")) buttons.Add(CONTEXT_BUTTON_MARK_UNWATCHED, 16104); //Mark as UnWatched else buttons.Add(CONTEXT_BUTTON_MARK_WATCHED, 16103); //Mark as Watched } } if ((node == NODE_TYPE_TITLE_TVSHOWS) || (item->IsVideoDb() && item->HasVideoInfoTag() && !item->m_bIsFolder)) { buttons.Add(CONTEXT_BUTTON_EDIT, 16105); //Edit Title } if (m_database.HasContent(VIDEODB_CONTENT_TVSHOWS) && item->HasVideoInfoTag() && !item->m_bIsFolder && item->GetVideoInfoTag()->m_iEpisode == -1 && item->GetVideoInfoTag()->m_strArtist.IsEmpty() && item->GetVideoInfoTag()->m_iDbId >= 0) // movie entry { if (m_database.IsLinkedToTvshow(item->GetVideoInfoTag()->m_iDbId)) buttons.Add(CONTEXT_BUTTON_UNLINK_MOVIE,20385); buttons.Add(CONTEXT_BUTTON_LINK_MOVIE,20384); } if (node == NODE_TYPE_SEASONS && item->m_bIsFolder) buttons.Add(CONTEXT_BUTTON_SET_SEASON_THUMB, 20371); if (item->m_strPath.Left(14).Equals("videodb://1/7/") && item->m_strPath.size() > 14 && item->m_bIsFolder) // sets { buttons.Add(CONTEXT_BUTTON_EDIT, 16105); buttons.Add(CONTEXT_BUTTON_SET_MOVIESET_THUMB, 20435); buttons.Add(CONTEXT_BUTTON_DELETE, 646); } if (node == NODE_TYPE_ACTOR && !dir.IsAllItem(item->m_strPath) && item->m_bIsFolder) { if (m_vecItems->m_strPath.Left(11).Equals("videodb://3")) // mvids buttons.Add(CONTEXT_BUTTON_SET_ARTIST_THUMB, 13359); else buttons.Add(CONTEXT_BUTTON_SET_ACTOR_THUMB, 20403); } if (item->IsVideoDb() && item->HasVideoInfoTag() && (!item->m_bIsFolder || node == NODE_TYPE_TITLE_TVSHOWS)) { if (info && info->Content() == CONTENT_TVSHOWS) { if(item->GetVideoInfoTag()->m_iBookmarkId != -1 && item->GetVideoInfoTag()->m_iBookmarkId != 0) { buttons.Add(CONTEXT_BUTTON_UNLINK_BOOKMARK, 20405); } } buttons.Add(CONTEXT_BUTTON_DELETE, 646); } // this should ideally be non-contextual (though we need some context for non-tv show node I guess) CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (pScanDlg && pScanDlg->IsScanning()) { if (node != NODE_TYPE_TITLE_TVSHOWS) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); } else buttons.Add(CONTEXT_BUTTON_UPDATE_LIBRARY, 653); } if (!m_vecItems->IsVideoDb() && !m_vecItems->IsVirtualDirectoryRoot()) { // non-video db items, file operations are allowed if (g_guiSettings.GetBool("filelists.allowfiledeletion") && CUtil::SupportsFileOperations(item->m_strPath)) { buttons.Add(CONTEXT_BUTTON_DELETE, 117); buttons.Add(CONTEXT_BUTTON_RENAME, 118); } // add "Set/Change content" to folders if (item->m_bIsFolder && !item->IsPlayList() && !item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath()) { CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning())) { if (info && info->Content() != CONTENT_NONE) buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20442); else buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); } } } if (item->IsPlugin() || item->m_strPath.Left(9).Equals("script://") || m_vecItems->IsPlugin()) buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045); } } CGUIWindowVideoBase::GetNonContextButtons(itemNumber, buttons); }