bool CGUIWindowVideoFiles::OnPlayMedia(int iItem) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); if (pItem->IsDVD()) return CAutorun::PlayDisc(); if (pItem->m_bIsShareOrDrive) return false; if (pItem->m_strPath == "add" && pItem->GetLabel() == g_localizeStrings.Get(1026)) // 'add source button' in empty root { if (CGUIDialogMediaSource::ShowAndAddMediaSource("video")) { Update(""); return true; } return false; } else { AddFileToDatabase(pItem.get()); return CGUIWindowVideoBase::OnPlayMedia(iItem); } }
void CGUIWindowJukeboxSongs::PlayItem(CFileItemPtr pItem) { // unlike additemtoplaylist, we need to check the items here // before calling it since the current playlist will be stopped // and cleared! // we're at the root source listing if (m_vecItems->IsVirtualDirectoryRoot() && !pItem->IsDVD()) return; #ifdef HAS_DVD_DRIVE if (pItem->IsDVD()) MEDIA_DETECT::CAutorun::PlayDiscAskResume(pItem->GetPath()); else #endif CGUIWindowJukeboxBase::PlayItem(pItem); }
bool CPlay::Execute(const CFileItemPtr& item) const { #ifdef HAS_DVD_DRIVE if (item->IsDVD() || item->IsCDDA()) return MEDIA_DETECT::CAutorun::PlayDisc(item->GetPath(), true, true); #endif SetPathAndPlay(CFileItem(*item)); return true; };
bool CGUIWindowPictures::ShowPicture(int iItem, bool startSlideShow) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); CStdString strPicture = pItem->GetPath(); #ifdef HAS_DVD_DRIVE if (pItem->IsDVD()) return MEDIA_DETECT::CAutorun::PlayDiscAskResume(m_vecItems->Get(iItem)->GetPath()); #endif if (pItem->m_bIsShareOrDrive) return false; CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW); if (!pSlideShow) return false; if (g_application.m_pPlayer->IsPlayingVideo()) g_application.StopPlaying(); pSlideShow->Reset(); for (int i = 0; i < (int)m_vecItems->Size();++i) { CFileItemPtr pItem = m_vecItems->Get(i); if (!pItem->m_bIsFolder && !(URIUtils::IsRAR(pItem->GetPath()) || URIUtils::IsZIP(pItem->GetPath())) && (pItem->IsPicture() || ( CSettings::Get().GetBool("pictures.showvideos") && pItem->IsVideo()))) { pSlideShow->Add(pItem.get()); } } if (pSlideShow->NumSlides() == 0) return false; pSlideShow->Select(strPicture); if (startSlideShow) pSlideShow->StartSlideShow(); else { CVariant param; param["player"]["speed"] = 1; param["player"]["playerid"] = PLAYLIST_PICTURE; ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::Player, "xbmc", "OnPlay", pSlideShow->GetCurrentSlide(), param); } m_slideShowStarted = true; g_windowManager.ActivateWindow(WINDOW_SLIDESHOW); return true; }
bool CResume::Execute(const CFileItemPtr& item) const { #ifdef HAS_DVD_DRIVE if (item->IsDVD() || item->IsCDDA()) return MEDIA_DETECT::CAutorun::PlayDisc(item->GetPath(), true, false); #endif CFileItem cpy(*item); cpy.m_lStartOffset = STARTOFFSET_RESUME; SetPathAndPlay(std::move(cpy)); return true; };
bool CGUIWindowPrograms::OnPlayMedia(int iItem) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); if (pItem->IsDVD()) return MEDIA_DETECT::CAutorun::PlayDisc(); if (pItem->m_bIsFolder) return false; // launch xbe... char szPath[1024]; char szParameters[1024]; m_database.IncTimesPlayed(pItem->GetPath()); int iRegion = m_iRegionSet?m_iRegionSet:GetRegion(iItem); DWORD dwTitleId = 0; if (!pItem->IsOnDVD()) dwTitleId = m_database.GetTitleId(pItem->GetPath()); if (!dwTitleId) dwTitleId = CUtil::GetXbeID(pItem->GetPath()); CStdString strTrainer = m_database.GetActiveTrainer(dwTitleId); if (strTrainer != "") { CTrainer trainer; if (trainer.Load(strTrainer)) { m_database.GetTrainerOptions(strTrainer,dwTitleId,trainer.GetOptions(),trainer.GetNumberOfOptions()); CUtil::InstallTrainer(trainer); } } m_database.Close(); memset(szParameters, 0, sizeof(szParameters)); strcpy(szPath, pItem->GetPath().c_str()); if (pItem->IsShortCut()) { CUtil::RunShortcut(pItem->GetPath().c_str()); return false; } if (strlen(szParameters)) CUtil::RunXBE(szPath, szParameters,F_VIDEO(iRegion)); else CUtil::RunXBE(szPath,NULL,F_VIDEO(iRegion)); return true; }
bool CGUIWindowPrograms::OnPlayMedia(int iItem) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); #ifdef HAS_DVD_DRIVE if (pItem->IsDVD()) return MEDIA_DETECT::CAutorun::PlayDiscAskResume(m_vecItems->Get(iItem)->GetPath()); #endif if (pItem->m_bIsFolder) return false; return false; }
void CGUIWindowFileManager::OnSort(int iList) { /* 歌方: 1、 卦指: 1、 傍苧: 1、 */ // always sort the list by label in ascending order for (int i = 0; i < m_vecItems[iList]->Size(); i++) { CFileItemPtr pItem = m_vecItems[iList]->Get(i); if (pItem->m_bIsFolder && (!pItem->m_dwSize || pItem->GetPath().Equals("add"))) pItem->SetLabel2(""); else pItem->SetFileSizeLabel(); // Set free space on disc if (pItem->m_bIsShareOrDrive) { if (pItem->IsHD()) { ULARGE_INTEGER ulBytesFree; if (GetDiskFreeSpaceEx(pItem->GetPath().c_str(), &ulBytesFree, NULL, NULL)) { pItem->m_dwSize = ulBytesFree.QuadPart; pItem->SetFileSizeLabel(); } } else if (pItem->IsDVD() && g_mediaManager.IsDiscInDrive()) { ULARGE_INTEGER ulBytesTotal; if (GetDiskFreeSpaceEx(pItem->GetPath().c_str(), NULL, &ulBytesTotal, NULL)) { pItem->m_dwSize = ulBytesTotal.QuadPart; pItem->SetFileSizeLabel(); } } } // if (pItem->m_bIsShareOrDrive) } m_vecItems[iList]->Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); }
bool CGUIWindowPictures::ShowPicture(int iItem, bool startSlideShow) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); CStdString strPicture = pItem->GetPath(); #ifdef HAS_DVD_DRIVE if (pItem->IsDVD()) return MEDIA_DETECT::CAutorun::PlayDiscAskResume(m_vecItems->Get(iItem)->GetPath()); #endif if (pItem->m_bIsShareOrDrive) return false; CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW); if (!pSlideShow) return false; if (g_application.IsPlayingVideo()) g_application.StopPlaying(); pSlideShow->Reset(); for (int i = 0; i < (int)m_vecItems->Size();++i) { CFileItemPtr pItem = m_vecItems->Get(i); if (!pItem->m_bIsFolder && !(URIUtils::IsRAR(pItem->GetPath()) || URIUtils::IsZIP(pItem->GetPath())) && (pItem->IsPicture() || ( g_guiSettings.GetBool("pictures.showvideos") && pItem->IsVideo()))) { pSlideShow->Add(pItem.get()); } } if (pSlideShow->NumSlides() == 0) return false; pSlideShow->Select(strPicture); if (startSlideShow) pSlideShow->StartSlideShow(false); m_slideShowStarted = true; g_windowManager.ActivateWindow(WINDOW_SLIDESHOW); return true; }
void CGUIWindowFileManager::OnSort(int iList) { using namespace KODI::PLATFORM::FILESYSTEM; // always sort the list by label in ascending order for (int i = 0; i < m_vecItems[iList]->Size(); i++) { CFileItemPtr pItem = m_vecItems[iList]->Get(i); if (pItem->m_bIsFolder && (!pItem->m_dwSize || pItem->IsPath("add"))) pItem->SetLabel2(""); else pItem->SetFileSizeLabel(); // Set free space on disc if (pItem->m_bIsShareOrDrive) { if (pItem->IsHD()) { std::error_code ec; auto freeSpace = space(pItem->GetPath(), ec); if (ec.value() == 0) { pItem->m_dwSize = freeSpace.free; pItem->SetFileSizeLabel(); } } else if (pItem->IsDVD() && g_mediaManager.IsDiscInDrive()) { std::error_code ec; auto freeSpace = space(pItem->GetPath(), ec); if (ec.value() == 0) { pItem->m_dwSize = freeSpace.capacity; pItem->SetFileSizeLabel(); } } } // if (pItem->m_bIsShareOrDrive) } m_vecItems[iList]->Sort(SortByLabel, SortOrderAscending); }
bool CGUIWindowPrograms::OnPlayMedia(int iItem) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); if (pItem->m_strPath == "add" && pItem->GetLabel() == g_localizeStrings.Get(1026)) // 'add source button' in empty root { if (CGUIDialogMediaSource::ShowAndAddMediaSource("programs")) { Update(""); return true; } return false; } if (pItem->IsDVD()) return MEDIA_DETECT::CAutorun::PlayDisc(); if (pItem->m_bIsFolder) return false; return false; }
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); }
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 CGUIDialogContextMenu::GetContextButtons(const std::string &type, const CFileItemPtr& item, CContextButtons &buttons) { // Add buttons to the ContextMenu that should be visible for both sources and autosourced items if (item && item->IsRemovable()) { if (item->IsDVD() || item->IsCDDA()) { // We need to check if there is a detected is inserted! buttons.Add(CONTEXT_BUTTON_PLAY_DISC, 341); // Play CD/DVD! if (CGUIWindowVideoBase::HasResumeItemOffset(item.get())) buttons.Add(CONTEXT_BUTTON_RESUME_DISC, CGUIWindowVideoBase::GetResumeString(*(item.get()))); // Resume Disc buttons.Add(CONTEXT_BUTTON_EJECT_DISC, 13391); // Eject/Load CD/DVD! } else // Must be HDD { buttons.Add(CONTEXT_BUTTON_EJECT_DRIVE, 13420); // Eject Removable HDD! } } // Next, Add buttons to the ContextMenu that should ONLY be visible for sources and not autosourced items CMediaSource *share = GetShare(type, item.get()); if (CProfilesManager::Get().GetCurrentProfile().canWriteSources() || g_passwordManager.bMasterUser) { if (share) { // Note. from now on, remove source & disable plugin should mean the same thing //TODO might be smart to also combine editing source & plugin settings into one concept/dialog // Note. Temporarily disabled ability to remove plugin sources until installer is operational CURL url(share->strPath); bool isAddon = ADDON::TranslateContent(url.GetProtocol()) != CONTENT_NONE; if (!share->m_ignore && !isAddon) buttons.Add(CONTEXT_BUTTON_EDIT_SOURCE, 1027); // Edit Source else { ADDON::AddonPtr plugin; if (ADDON::CAddonMgr::Get().GetAddon(url.GetHostName(), plugin)) if (plugin->HasSettings()) buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045); // Plugin Settings } if (type != "video") buttons.Add(CONTEXT_BUTTON_SET_DEFAULT, 13335); // Set as Default if (!share->m_ignore && !isAddon) buttons.Add(CONTEXT_BUTTON_REMOVE_SOURCE, 522); // Remove Source buttons.Add(CONTEXT_BUTTON_SET_THUMB, 20019); } if (!GetDefaultShareNameByType(type).empty()) buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // Clear Default } if (share && LOCK_MODE_EVERYONE != CProfilesManager::Get().GetMasterProfile().getLockMode()) { if (share->m_iHasLock == 0 && (CProfilesManager::Get().GetCurrentProfile().canWriteSources() || g_passwordManager.bMasterUser)) buttons.Add(CONTEXT_BUTTON_ADD_LOCK, 12332); else if (share->m_iHasLock == 1) buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335); else if (share->m_iHasLock == 2) { buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335); bool maxRetryExceeded = false; if (CSettings::Get().GetInt("masterlock.maxretries") != 0) maxRetryExceeded = (share->m_iBadPwdCount >= CSettings::Get().GetInt("masterlock.maxretries")); if (maxRetryExceeded) buttons.Add(CONTEXT_BUTTON_RESET_LOCK, 12334); else buttons.Add(CONTEXT_BUTTON_CHANGE_LOCK, 12356); } } if (share && !g_passwordManager.bMasterUser && item->m_iHasLock == 1) buttons.Add(CONTEXT_BUTTON_REACTIVATE_LOCK, 12353); }
void CGUIWindowMusicBase::PlayItem(int iItem) { // restrictions should be placed in the appropiate window code // only call the base code if the item passes since this clears // the current playlist const CFileItemPtr pItem = m_vecItems->Get(iItem); #ifdef HAS_DVD_DRIVE if (pItem->IsDVD()) { MEDIA_DETECT::CAutorun::PlayDiscAskResume(pItem->GetPath()); return; } #endif // if its a folder, build a playlist if ((pItem->m_bIsFolder && !pItem->IsPlugin()) || (g_windowManager.GetActiveWindow() == WINDOW_MUSIC_NAV && pItem->IsPlayList())) { // make a copy so that we can alter the queue state CFileItemPtr item(new CFileItem(*m_vecItems->Get(iItem))); // Allow queuing of unqueueable items // when we try to queue them directly if (!item->CanQueue()) item->SetCanQueue(true); // skip ".." if (item->IsParentFolder()) return; CFileItemList queuedItems; AddItemToPlayList(item, queuedItems); if (g_partyModeManager.IsEnabled()) { g_partyModeManager.AddUserSongs(queuedItems, true); return; } /* std::string strPlayListDirectory = m_vecItems->GetPath(); URIUtils::RemoveSlashAtEnd(strPlayListDirectory); */ g_playlistPlayer.ClearPlaylist(PLAYLIST_MUSIC); g_playlistPlayer.Reset(); g_playlistPlayer.Add(PLAYLIST_MUSIC, queuedItems); g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC); // play! g_playlistPlayer.Play(); } else if (pItem->IsPlayList()) { // load the playlist the old way LoadPlayList(pItem->GetPath()); } else { // just a single item, play it // TODO: Add music-specific code for single playback of an item here (See OnClick in MediaWindow, and OnPlayMedia below) OnClick(iItem); } }
void CGUIDialogContextMenu::GetContextButtons(const CStdString &type, const CFileItemPtr item, CContextButtons &buttons) { // Add buttons to the ContextMenu that should be visible for both sources and autosourced items if (item && item->IsRemovable()) { if (item->IsDVD() || item->IsCDDA()) { // We need to check if there is a detected is inserted! if ( g_mediaManager.IsDiscInDrive() ) buttons.Add(CONTEXT_BUTTON_PLAY_DISC, 341); // Play CD/DVD! buttons.Add(CONTEXT_BUTTON_EJECT_DISC, 13391); // Eject/Load CD/DVD! } else // Must be HDD { buttons.Add(CONTEXT_BUTTON_EJECT_DRIVE, 13420); // Eject Removable HDD! } } // Next, Add buttons to the ContextMenu that should ONLY be visible for sources and not autosourced items CMediaSource *share = GetShare(type, item.get()); if (g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].canWriteSources() || g_passwordManager.bMasterUser) { if (share) { if (!share->m_ignore) buttons.Add(CONTEXT_BUTTON_EDIT_SOURCE, 1027); // Edit Source buttons.Add(CONTEXT_BUTTON_SET_DEFAULT, 13335); // Set as Default if (!share->m_ignore) buttons.Add(CONTEXT_BUTTON_REMOVE_SOURCE, 522); // Remove Source buttons.Add(CONTEXT_BUTTON_SET_THUMB, 20019); } if (!GetDefaultShareNameByType(type).IsEmpty()) buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // Clear Default buttons.Add(CONTEXT_BUTTON_ADD_SOURCE, 1026); // Add Source } if (share && LOCK_MODE_EVERYONE != g_settings.m_vecProfiles[0].getLockMode()) { if (share->m_iHasLock == 0 && (g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].canWriteSources() || g_passwordManager.bMasterUser)) buttons.Add(CONTEXT_BUTTON_ADD_LOCK, 12332); else if (share->m_iHasLock == 1) buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335); else if (share->m_iHasLock == 2) { buttons.Add(CONTEXT_BUTTON_REMOVE_LOCK, 12335); bool maxRetryExceeded = false; if (g_guiSettings.GetInt("masterlock.maxretries") != 0) maxRetryExceeded = (share->m_iBadPwdCount >= g_guiSettings.GetInt("masterlock.maxretries")); if (maxRetryExceeded) buttons.Add(CONTEXT_BUTTON_RESET_LOCK, 12334); else buttons.Add(CONTEXT_BUTTON_CHANGE_LOCK, 12356); } } if (share && !g_passwordManager.bMasterUser && item->m_iHasLock == 1) buttons.Add(CONTEXT_BUTTON_REACTIVATE_LOCK, 12353); }
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 CGUIWindowVideoFiles::GetContextButtons(int itemNumber, CContextButtons &buttons) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (item) { // are we in the playlists location? if (m_vecItems->IsVirtualDirectoryRoot()) { // get the usual shares, and anything for all media windows CGUIDialogContextMenu::GetContextButtons("video", item, buttons); CGUIMediaWindow::GetContextButtons(itemNumber, buttons); // add scan button somewhere here if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning if (g_guiSettings.GetBool("videolibrary.enabled") && !item->IsDVD() && item->m_strPath != "add" && (g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].canWriteDatabases() || g_passwordManager.bMasterUser)) { CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN); if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning())) buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); CVideoDatabase database; database.Open(); SScraperInfo info; if (item && database.GetScraperForPath(item->m_strPath,info)) { if (!info.strPath.IsEmpty() && !info.strContent.IsEmpty()) if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning())) buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } } else { CGUIWindowVideoBase::GetContextButtons(itemNumber, buttons); if (!item->GetPropertyBOOL("pluginreplacecontextitems")) { // Movie Info button if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); if (g_guiSettings.GetBool("videolibrary.enabled") && (g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].canWriteDatabases() || g_passwordManager.bMasterUser)) { SScraperInfo info; VIDEO::SScanSettings settings; int iFound = GetScraperForItem(item.get(), info, settings); int infoString = 13346; if (info.strContent.Equals("tvshows")) infoString = item->m_bIsFolder ? 20351 : 20352; if (info.strContent.Equals("musicvideos")) infoString = 20393; if (item->m_bIsFolder) { if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning())) if (!item->IsPlayList()) buttons.Add(CONTEXT_BUTTON_SET_CONTENT, 20333); if (iFound==0) { // scraper not set - allow movie information or set content CStdString strPath(item->m_strPath); CUtil::AddSlashAtEnd(strPath); if ((info.strContent.Equals("movies") && m_database.HasMovieInfo(strPath)) || (info.strContent.Equals("tvshows") && m_database.HasTvShowInfo(strPath))) buttons.Add(CONTEXT_BUTTON_INFO, infoString); } else { // scraper found - allow movie information, scan for new content, or set different type of content if (!info.strContent.Equals("musicvideos")) buttons.Add(CONTEXT_BUTTON_INFO, infoString); if (!info.strPath.IsEmpty() && !info.strContent.IsEmpty()) if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning())) buttons.Add(CONTEXT_BUTTON_SCAN, 13349); } } else { // single file if ((info.strContent.Equals("movies") && (iFound > 0 || m_database.HasMovieInfo(item->m_strPath))) || m_database.HasEpisodeInfo(item->m_strPath) || info.strContent.Equals("musicvideos")) { buttons.Add(CONTEXT_BUTTON_INFO, infoString); } m_database.Open(); if (!item->IsParentFolder()) { if (!m_database.HasMovieInfo(item->m_strPath) && !m_database.HasEpisodeInfo(item->m_strPath)) buttons.Add(CONTEXT_BUTTON_ADD_TO_LIBRARY, 527); // Add to Database } m_database.Close(); } } } if (!item->IsParentFolder()) { if ((m_vecItems->m_strPath.Equals("special://videoplaylists/")) || g_guiSettings.GetBool("filelists.allowfiledeletion")) { // video playlists or file operations are allowed if (!item->IsReadOnly()) { buttons.Add(CONTEXT_BUTTON_DELETE, 117); buttons.Add(CONTEXT_BUTTON_RENAME, 118); } } } if (m_vecItems->IsPlugin() && item->HasVideoInfoTag() && !item->GetPropertyBOOL("pluginreplacecontextitems")) buttons.Add(CONTEXT_BUTTON_INFO,13346); // only movie information for now } } else { if (pScanDlg && pScanDlg->IsScanning()) buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353); // Stop Scanning } if(!(item && item->GetPropertyBOOL("pluginreplacecontextitems"))) { if (!m_vecItems->IsVirtualDirectoryRoot()) buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523); CGUIWindowVideoBase::GetNonContextButtons(itemNumber, buttons); } }
bool CGUIWindowVideoFiles::OnMessage(CGUIMessage& message) { switch ( message.GetMessage() ) { case GUI_MSG_WINDOW_INIT: { // check for a passed destination path CStdString strDestination = message.GetStringParam(); if (!strDestination.IsEmpty()) { message.SetStringParam(""); g_stSettings.m_iVideoStartWindow = GetID(); CLog::Log(LOGINFO, "Attempting to quickpath to: %s", strDestination.c_str()); // reset directory path, as we have effectively cleared it here m_history.ClearPathHistory(); } // is this the first time accessing this window? // a quickpath overrides the a default parameter if ((m_vecItems->m_strPath == "?" || m_vecItems->m_strPath == "") && strDestination.IsEmpty()) { m_vecItems->m_strPath = strDestination = g_settings.m_defaultVideoSource; CLog::Log(LOGINFO, "Attempting to default to: %s", strDestination.c_str()); } // try to open the destination path if (!strDestination.IsEmpty()) { // open root if (strDestination.Equals("$ROOT")) { m_vecItems->m_strPath = ""; CLog::Log(LOGINFO, " Success! Opening root listing."); } // open playlists location else if (strDestination.Equals("$PLAYLISTS")) { m_vecItems->m_strPath = "special://videoplaylists/"; CLog::Log(LOGINFO, " Success! Opening destination path: %s", m_vecItems->m_strPath.c_str()); } else { // default parameters if the jump fails m_vecItems->m_strPath = ""; bool bIsSourceName = false; SetupShares(); VECSOURCES shares; m_rootDir.GetSources(shares); int iIndex = CUtil::GetMatchingSource(strDestination, shares, bIsSourceName); if (iIndex > -1) { bool bDoStuff = true; if (iIndex < shares.size() && shares[iIndex].m_iHasLock == 2) { CFileItem item(shares[iIndex]); if (!g_passwordManager.IsItemUnlocked(&item,"video")) { m_vecItems->m_strPath = ""; // no u don't bDoStuff = false; CLog::Log(LOGINFO, " Failure! Failed to unlock destination path: %s", strDestination.c_str()); } } // set current directory to matching share if (bDoStuff) { if (bIsSourceName) m_vecItems->m_strPath=shares[iIndex].strPath; else m_vecItems->m_strPath=strDestination; CLog::Log(LOGINFO, " Success! Opened destination path: %s", strDestination.c_str()); } } else { CLog::Log(LOGERROR, " Failed! Destination parameter (%s) does not match a valid source!", strDestination.c_str()); } } // check for network up if (CUtil::IsRemote(m_vecItems->m_strPath) && !WaitForNetwork()) m_vecItems->m_strPath.Empty(); SetHistoryForPath(m_vecItems->m_strPath); } return CGUIWindowVideoBase::OnMessage(message); } break; case GUI_MSG_CLICKED: { int iControl = message.GetSenderId(); //if (iControl == CONTROL_BTNSCAN) //{ // OnScan(); // } /*else*/ if (iControl == CONTROL_STACK) { // toggle between the following states: // 0 : no stacking // 1 : stacking g_stSettings.m_iMyVideoStack++; if (g_stSettings.m_iMyVideoStack > STACK_SIMPLE) g_stSettings.m_iMyVideoStack = STACK_NONE; g_settings.Save(); UpdateButtons(); Update( m_vecItems->m_strPath ); } else if (iControl == CONTROL_BTNPLAYLISTS) { if (!m_vecItems->m_strPath.Equals("special://videoplaylists/")) { CStdString strParent = m_vecItems->m_strPath; UpdateButtons(); Update("special://videoplaylists/"); } } // list/thumb panel else if (m_viewControl.HasControl(iControl)) { int iItem = m_viewControl.GetSelectedItem(); int iAction = message.GetParam1(); const CFileItemPtr pItem = m_vecItems->Get(iItem); // use play button to add folders of items to temp playlist if (iAction == ACTION_PLAYER_PLAY && pItem->m_bIsFolder && !pItem->IsParentFolder()) { if (pItem->IsDVD()) return CAutorun::PlayDisc(); if (pItem->m_bIsShareOrDrive) return false; // if playback is paused or playback speed != 1, return if (g_application.IsPlayingVideo()) { if (g_application.m_pPlayer->IsPaused()) return false; if (g_application.GetPlaySpeed() != 1) return false; } // not playing, or playback speed == 1 // queue folder or playlist into temp playlist and play if ((pItem->m_bIsFolder && !pItem->IsParentFolder()) || pItem->IsPlayList()) PlayItem(iItem); return true; } } } } return CGUIWindowVideoBase::OnMessage(message); }