Commit bbe6b12356d671f8e99c6fbdcacc9e2a9ac70f02
- Diff rendering mode:
- inline
- side by side
xbmc/GUIWindowVideoBase.cpp
(0 / 83)
|   | |||
| 81 | 81 | #define CONTROL_PLAY_DVD 6 | |
| 82 | 82 | #define CONTROL_STACK 7 | |
| 83 | 83 | #define CONTROL_BTNSCAN 8 | |
| 84 | #define CONTROL_IMDB 9 | ||
| 85 | 84 | ||
| 86 | 85 | CGUIWindowVideoBase::CGUIWindowVideoBase(int id, const CStdString &xmlFile) | |
| 87 | 86 | : CGUIMediaWindow(id, xmlFile) | |
| … | … | ||
| 262 | 262 | } | |
| 263 | 263 | } | |
| 264 | 264 | } | |
| 265 | else if (iControl == CONTROL_IMDB) | ||
| 266 | { | ||
| 267 | OnManualScrape(); | ||
| 268 | } | ||
| 269 | 265 | } | |
| 270 | 266 | break; | |
| 271 | 267 | } | |
| … | … | ||
| 289 | 289 | CONTROL_SELECT_ITEM(CONTROL_BTNTYPE, nWindow); | |
| 290 | 290 | ||
| 291 | 291 | CONTROL_ENABLE(CONTROL_BTNSCAN); | |
| 292 | CONTROL_ENABLE(CONTROL_IMDB); | ||
| 293 | 292 | ||
| 294 | 293 | CGUIMediaWindow::UpdateButtons(); | |
| 295 | 294 | } | |
| … | … | ||
| 741 | 741 | } while (needsRefresh); | |
| 742 | 742 | m_database.Close(); | |
| 743 | 743 | return listNeedsUpdating; | |
| 744 | } | ||
| 745 | |||
| 746 | void CGUIWindowVideoBase::OnManualScrape() | ||
| 747 | { | ||
| 748 | // NOTE! this only works for movies | ||
| 749 | // previous OnManualIMDB only worked for IMDb, so not a regression! | ||
| 750 | // if we were tracking current content type this would work for all content | ||
| 751 | CStdString strInput; | ||
| 752 | if (!CGUIDialogKeyboard::ShowAndGetInput(strInput, g_localizeStrings.Get(16009), false)) | ||
| 753 | return; | ||
| 754 | |||
| 755 | CFileItem item(strInput); | ||
| 756 | item.m_strPath = "special://temp/"; | ||
| 757 | CFile::Delete(item.GetCachedVideoThumb().c_str()); | ||
| 758 | |||
| 759 | ScraperPtr scraper; | ||
| 760 | m_database.Open(); | ||
| 761 | m_database.GetScraperForPath(m_vecItems->m_strPath, scraper); | ||
| 762 | |||
| 763 | if (!scraper) | ||
| 764 | return; | ||
| 765 | |||
| 766 | ShowIMDB(&item,scraper); | ||
| 767 | |||
| 768 | return; | ||
| 769 | } | ||
| 770 | |||
| 771 | bool CGUIWindowVideoBase::IsCorrectDiskInDrive(const CStdString& strFileName, const CStdString& strDVDLabel) | ||
| 772 | { | ||
| 773 | #ifdef HAS_DVD_DRIVE | ||
| 774 | CCdInfo* pCdInfo = g_mediaManager.GetCdInfo(); | ||
| 775 | if (pCdInfo == NULL) | ||
| 776 | return false; | ||
| 777 | if (!CFile::Exists(strFileName)) | ||
| 778 | return false; | ||
| 779 | CStdString label = pCdInfo->GetDiscLabel().TrimRight(" "); | ||
| 780 | int iLabelCD = label.GetLength(); | ||
| 781 | int iLabelDB = strDVDLabel.GetLength(); | ||
| 782 | if (iLabelDB < iLabelCD) | ||
| 783 | return false; | ||
| 784 | CStdString dbLabel = strDVDLabel.Left(iLabelCD); | ||
| 785 | return (dbLabel == label); | ||
| 786 | #else | ||
| 787 | return false; | ||
| 788 | #endif | ||
| 789 | } | ||
| 790 | |||
| 791 | bool CGUIWindowVideoBase::CheckMovie(const CStdString& strFileName) | ||
| 792 | { | ||
| 793 | if (!m_database.HasMovieInfo(strFileName)) | ||
| 794 | return true; | ||
| 795 | |||
| 796 | CVideoInfoTag movieDetails; | ||
| 797 | m_database.GetMovieInfo(strFileName, movieDetails); | ||
| 798 | CFileItem movieFile(movieDetails.m_strFileNameAndPath, false); | ||
| 799 | if (!movieFile.IsOnDVD()) | ||
| 800 | return true; | ||
| 801 | CGUIDialogOK *pDlgOK = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK); | ||
| 802 | if (!pDlgOK) | ||
| 803 | return true; | ||
| 804 | while (1) | ||
| 805 | { | ||
| 806 | // if (IsCorrectDiskInDrive(strFileName, movieDetails.m_strDVDLabel)) | ||
| 807 | // { | ||
| 808 | return true; | ||
| 809 | // } | ||
| 810 | pDlgOK->SetHeading( 428); | ||
| 811 | pDlgOK->SetLine( 0, 429 ); | ||
| 812 | // pDlgOK->SetLine( 1, movieDetails.m_strDVDLabel ); | ||
| 813 | pDlgOK->SetLine( 2, "" ); | ||
| 814 | pDlgOK->DoModal(); | ||
| 815 | if (!pDlgOK->IsConfirmed()) | ||
| 816 | { | ||
| 817 | break; | ||
| 818 | } | ||
| 819 | } | ||
| 820 | return false; | ||
| 821 | 744 | } | |
| 822 | 745 | ||
| 823 | 746 | void CGUIWindowVideoBase::OnQueueItem(int iItem) |
xbmc/GUIWindowVideoBase.h
(0 / 6)
|   | |||
| 49 | 49 | //! If the user cancels the operation on the menu "false" is returned | |
| 50 | 50 | static bool OnResumeShowMenu(CFileItem &item); | |
| 51 | 51 | ||
| 52 | private: | ||
| 53 | bool IsCorrectDiskInDrive(const CStdString& strFileName, const CStdString& strDVDLabel); | ||
| 54 | 52 | protected: | |
| 55 | 53 | virtual void UpdateButtons(); | |
| 56 | 54 | virtual bool Update(const CStdString &strDirectory); | |
| … | … | ||
| 65 | 65 | virtual void OnDeleteItem(CFileItemPtr pItem); | |
| 66 | 66 | virtual void OnDeleteItem(int iItem); | |
| 67 | 67 | virtual void DoSearch(const CStdString& strSearch, CFileItemList& items) {}; | |
| 68 | virtual CStdString GetQuickpathName(const CStdString& strPath) const {return strPath;}; | ||
| 69 | 68 | ||
| 70 | 69 | bool OnClick(int iItem); | |
| 71 | 70 | void OnRestartItem(int iItem); | |
| … | … | ||
| 74 | 74 | void LoadPlayList(const CStdString& strPlayList, int iPlayList = PLAYLIST_VIDEO); | |
| 75 | 75 | ||
| 76 | 76 | bool ShowIMDB(CFileItem *item, const ADDON::ScraperPtr& content); | |
| 77 | |||
| 78 | void OnManualScrape(); | ||
| 79 | bool CheckMovie(const CStdString& strFileName); | ||
| 80 | 77 | ||
| 81 | 78 | void AddItemToPlayList(const CFileItemPtr &pItem, CFileItemList &queuedItems); | |
| 82 | 79 | void GetStackedFiles(const CStdString &strFileName, std::vector<CStdString> &movies); |
xbmc/GUIWindowVideoFiles.cpp
(0 / 1)
|   | |||
| 53 | 53 | #define CONTROL_PLAY_DVD 6 | |
| 54 | 54 | #define CONTROL_STACK 7 | |
| 55 | 55 | #define CONTROL_BTNSCAN 8 | |
| 56 | #define CONTROL_IMDB 9 | ||
| 57 | 56 | #define CONTROL_BTNPLAYLISTS 13 | |
| 58 | 57 | ||
| 59 | 58 | CGUIWindowVideoFiles::CGUIWindowVideoFiles() |
Comments
Add your comment
Please log in to comment



Add a new comment:
Login or create an account to post a comment