cleanup: removed GUIWindowVideoFiles as it's no longer required
authorJonathan Marshall <jmarshall@never.you.mind>
Thu, 17 Feb 2011 00:36:54 +0000 (13:36 +1300)
committerJonathan Marshall <jmarshall@never.you.mind>
Tue, 8 Mar 2011 09:41:22 +0000 (22:41 +1300)
12 files changed:
XBMC.xcodeproj/project.pbxproj
project/VS2010Express/XBMC.vcxproj
project/VS2010Express/XBMC.vcxproj.filters
xbmc/Application.cpp
xbmc/dialogs/GUIDialogContextMenu.cpp
xbmc/video/dialogs/GUIDialogVideoInfo.cpp
xbmc/video/dialogs/GUIDialogVideoInfo.h
xbmc/video/windows/GUIWindowVideoBase.cpp
xbmc/video/windows/GUIWindowVideoBase.h
xbmc/video/windows/GUIWindowVideoFiles.cpp [deleted file]
xbmc/video/windows/GUIWindowVideoFiles.h [deleted file]
xbmc/video/windows/Makefile

index 7135432..e2a17b7 100644 (file)
                E38E20C80D25F9FD00618676 /* GUIWindowStartup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18370D25F9FA00618676 /* GUIWindowStartup.cpp */; };
                E38E20C90D25F9FD00618676 /* GUIWindowSystemInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18390D25F9FA00618676 /* GUIWindowSystemInfo.cpp */; };
                E38E20CA0D25F9FD00618676 /* GUIWindowVideoBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E183B0D25F9FA00618676 /* GUIWindowVideoBase.cpp */; };
-               E38E20CB0D25F9FD00618676 /* GUIWindowVideoFiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E183D0D25F9FA00618676 /* GUIWindowVideoFiles.cpp */; };
                E38E20CC0D25F9FD00618676 /* GUIDialogVideoInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E183F0D25F9FA00618676 /* GUIDialogVideoInfo.cpp */; };
                E38E20CD0D25F9FD00618676 /* GUIWindowVideoNav.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18410D25F9FA00618676 /* GUIWindowVideoNav.cpp */; };
                E38E20CE0D25F9FD00618676 /* GUIDialogVideoOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18430D25F9FA00618676 /* GUIDialogVideoOverlay.cpp */; };
                F5A1C9ED0F6B06CF00A96ABD /* GUIWindowStartup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18370D25F9FA00618676 /* GUIWindowStartup.cpp */; };
                F5A1C9EE0F6B06CF00A96ABD /* GUIWindowSystemInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18390D25F9FA00618676 /* GUIWindowSystemInfo.cpp */; };
                F5A1C9EF0F6B06CF00A96ABD /* GUIWindowVideoBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E183B0D25F9FA00618676 /* GUIWindowVideoBase.cpp */; };
-               F5A1C9F00F6B06CF00A96ABD /* GUIWindowVideoFiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E183D0D25F9FA00618676 /* GUIWindowVideoFiles.cpp */; };
                F5A1C9F10F6B06CF00A96ABD /* GUIDialogVideoInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E183F0D25F9FA00618676 /* GUIDialogVideoInfo.cpp */; };
                F5A1C9F20F6B06CF00A96ABD /* GUIWindowVideoNav.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18410D25F9FA00618676 /* GUIWindowVideoNav.cpp */; };
                F5A1C9F30F6B06CF00A96ABD /* GUIDialogVideoOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E18430D25F9FA00618676 /* GUIDialogVideoOverlay.cpp */; };
                E38E183A0D25F9FA00618676 /* GUIWindowSystemInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowSystemInfo.h; sourceTree = "<group>"; };
                E38E183B0D25F9FA00618676 /* GUIWindowVideoBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowVideoBase.cpp; sourceTree = "<group>"; };
                E38E183C0D25F9FA00618676 /* GUIWindowVideoBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowVideoBase.h; sourceTree = "<group>"; };
-               E38E183D0D25F9FA00618676 /* GUIWindowVideoFiles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowVideoFiles.cpp; sourceTree = "<group>"; };
-               E38E183E0D25F9FA00618676 /* GUIWindowVideoFiles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowVideoFiles.h; sourceTree = "<group>"; };
                E38E183F0D25F9FA00618676 /* GUIDialogVideoInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogVideoInfo.cpp; sourceTree = "<group>"; };
                E38E18400D25F9FA00618676 /* GUIDialogVideoInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogVideoInfo.h; sourceTree = "<group>"; };
                E38E18410D25F9FA00618676 /* GUIWindowVideoNav.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowVideoNav.cpp; sourceTree = "<group>"; };
                                E38E18060D25F9FA00618676 /* GUIWindowFullScreen.h */,
                                E38E183B0D25F9FA00618676 /* GUIWindowVideoBase.cpp */,
                                E38E183C0D25F9FA00618676 /* GUIWindowVideoBase.h */,
-                               E38E183D0D25F9FA00618676 /* GUIWindowVideoFiles.cpp */,
-                               E38E183E0D25F9FA00618676 /* GUIWindowVideoFiles.h */,
                                E38E18410D25F9FA00618676 /* GUIWindowVideoNav.cpp */,
                                E38E18420D25F9FA00618676 /* GUIWindowVideoNav.h */,
                                E38E18450D25F9FA00618676 /* GUIWindowVideoPlaylist.cpp */,
                                E38E20C80D25F9FD00618676 /* GUIWindowStartup.cpp in Sources */,
                                E38E20C90D25F9FD00618676 /* GUIWindowSystemInfo.cpp in Sources */,
                                E38E20CA0D25F9FD00618676 /* GUIWindowVideoBase.cpp in Sources */,
-                               E38E20CB0D25F9FD00618676 /* GUIWindowVideoFiles.cpp in Sources */,
                                E38E20CC0D25F9FD00618676 /* GUIDialogVideoInfo.cpp in Sources */,
                                E38E20CD0D25F9FD00618676 /* GUIWindowVideoNav.cpp in Sources */,
                                E38E20CE0D25F9FD00618676 /* GUIDialogVideoOverlay.cpp in Sources */,
                                F5A1C9ED0F6B06CF00A96ABD /* GUIWindowStartup.cpp in Sources */,
                                F5A1C9EE0F6B06CF00A96ABD /* GUIWindowSystemInfo.cpp in Sources */,
                                F5A1C9EF0F6B06CF00A96ABD /* GUIWindowVideoBase.cpp in Sources */,
-                               F5A1C9F00F6B06CF00A96ABD /* GUIWindowVideoFiles.cpp in Sources */,
                                F5A1C9F10F6B06CF00A96ABD /* GUIDialogVideoInfo.cpp in Sources */,
                                F5A1C9F20F6B06CF00A96ABD /* GUIWindowVideoNav.cpp in Sources */,
                                F5A1C9F30F6B06CF00A96ABD /* GUIDialogVideoOverlay.cpp in Sources */,
index f408b5d..48b1535 100644 (file)
     <ClCompile Include="..\..\xbmc\video\VideoReferenceClock.cpp" />
     <ClCompile Include="..\..\xbmc\video\windows\GUIWindowFullScreen.cpp" />
     <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoBase.cpp" />
-    <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoFiles.cpp" />
     <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoNav.cpp" />
     <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoPlaylist.cpp" />
     <ClCompile Include="..\..\xbmc\ViewDatabase.cpp" />
     <ClInclude Include="..\..\xbmc\video\VideoReferenceClock.h" />
     <ClInclude Include="..\..\xbmc\video\windows\GUIWindowFullScreen.h" />
     <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoBase.h" />
-    <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoFiles.h" />
     <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoNav.h" />
     <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoPlaylist.h" />
     <ClInclude Include="..\..\xbmc\ViewDatabase.h" />
index a1a174f..aa1d5cd 100644 (file)
     <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoBase.cpp">
       <Filter>video\windows</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoFiles.cpp">
-      <Filter>video\windows</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\xbmc\video\windows\GUIWindowVideoNav.cpp">
       <Filter>video\windows</Filter>
     </ClCompile>
     <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoBase.h">
       <Filter>video\windows</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoFiles.h">
-      <Filter>video\windows</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\xbmc\video\windows\GUIWindowVideoNav.h">
       <Filter>video\windows</Filter>
     </ClInclude>
index 48880ac..3cb18ef 100644 (file)
 #include "video/windows/GUIWindowVideoPlaylist.h"
 #include "music/dialogs/GUIDialogMusicInfo.h"
 #include "video/dialogs/GUIDialogVideoInfo.h"
-#include "video/windows/GUIWindowVideoFiles.h"
 #include "video/windows/GUIWindowVideoNav.h"
 #include "settings/GUIWindowSettingsProfile.h"
 #ifdef HAS_GL
@@ -1012,7 +1011,6 @@ bool CApplication::Initialize()
   g_windowManager.Add(new CGUIWindowPrograms);                 // window id = 1
   g_windowManager.Add(new CGUIWindowPictures);                 // window id = 2
   g_windowManager.Add(new CGUIWindowFileManager);      // window id = 3
-  g_windowManager.Add(new CGUIWindowVideoFiles);          // window id = 6
   g_windowManager.Add(new CGUIWindowSettings);                 // window id = 4
   g_windowManager.Add(new CGUIWindowSystemInfo);               // window id = 7
 #ifdef HAS_GL
index 11b0644..7694380 100644 (file)
@@ -26,7 +26,6 @@
 #include "GUIDialogGamepad.h"
 #include "GUIDialogFileBrowser.h"
 #include "GUIUserMessages.h"
-#include "video/windows/GUIWindowVideoFiles.h"
 #include "Autorun.h"
 #include "GUIPassword.h"
 #include "Util.h"
index 332e249..4ddcf07 100644 (file)
@@ -26,8 +26,7 @@
 #include "guilib/GUIImage.h"
 #include "utils/StringUtils.h"
 #include "utils/URIUtils.h"
-#include "video/windows/GUIWindowVideoBase.h"
-#include "video/windows/GUIWindowVideoFiles.h"
+#include "video/windows/GUIWindowVideoNav.h"
 #include "dialogs/GUIDialogFileBrowser.h"
 #include "video/VideoInfoScanner.h"
 #include "Application.h"
@@ -369,8 +368,7 @@ void CGUIDialogVideoInfo::Update()
   }
 
   // Check for resumability
-  CGUIWindowVideoFiles *window = (CGUIWindowVideoFiles *)g_windowManager.GetWindow(WINDOW_VIDEO_FILES);
-  if (window && window->GetResumeItemOffset(m_movieItem.get()) > 0)
+  if (CGUIWindowVideoBase::GetResumeItemOffset(m_movieItem.get()) > 0)
     CONTROL_ENABLE(CONTROL_BTN_RESUME);
   else
     CONTROL_DISABLE(CONTROL_BTN_RESUME);
@@ -605,7 +603,7 @@ void CGUIDialogVideoInfo::Play(bool resume)
   CFileItem movie(*m_movieItem->GetVideoInfoTag());
   if (m_movieItem->GetVideoInfoTag()->m_strFileNameAndPath.IsEmpty())
     movie.m_strPath = m_movieItem->m_strPath;
-  CGUIWindowVideoFiles* pWindow = (CGUIWindowVideoFiles*)g_windowManager.GetWindow(WINDOW_VIDEO_FILES);
+  CGUIWindowVideoNav* pWindow = (CGUIWindowVideoNav*)g_windowManager.GetWindow(WINDOW_VIDEO_NAV);
   if (pWindow)
   {
     // close our dialog
index 8838cec..8ad1fed 100644 (file)
@@ -23,8 +23,6 @@
 
 #include "guilib/GUIDialog.h"
 #include "guilib/GUIListItem.h"
-#include "video/windows/GUIWindowVideoBase.h"
-#include "video/windows/GUIWindowVideoFiles.h"
 #include "ThumbLoader.h"
 
 class CFileItem;
index 19159ab..d9502fc 100644 (file)
@@ -825,7 +825,8 @@ int  CGUIWindowVideoBase::GetResumeItemOffset(const CFileItem *item)
   if (item->IsLiveTV())
     return 0;
 
-  m_database.Open();
+  CVideoDatabase db;
+  db.Open();
   long startoffset = 0;
 
   if (item->IsStack() && (!g_guiSettings.GetBool("myvideos.treatstackasfile") ||
@@ -839,7 +840,7 @@ int  CGUIWindowVideoBase::GetResumeItemOffset(const CFileItem *item)
     for (unsigned i = 0; i<movies.size();i++)
     {
       CBookmark bookmark;
-      if (m_database.GetResumeBookMark(movies[i], bookmark))
+      if (db.GetResumeBookMark(movies[i], bookmark))
       {
         startoffset = (long)(bookmark.timeInSeconds*75);
         startoffset += 0x10000000 * (i+1); /* store file number in here */
@@ -854,10 +855,10 @@ int  CGUIWindowVideoBase::GetResumeItemOffset(const CFileItem *item)
     if (item->IsVideoDb() && item->HasVideoInfoTag())
       strPath = item->GetVideoInfoTag()->m_strFileNameAndPath;
 
-    if (m_database.GetResumeBookMark(strPath, bookmark))
+    if (db.GetResumeBookMark(strPath, bookmark))
       startoffset = (long)(bookmark.timeInSeconds*75);
   }
-  m_database.Close();
+  db.Close();
 
   return startoffset;
 }
index 5ea8c28..3972541 100644 (file)
@@ -35,7 +35,7 @@ public:
   virtual bool OnAction(const CAction &action);
 
   void PlayMovie(const CFileItem *item);
-  int  GetResumeItemOffset(const CFileItem *item);
+  static int GetResumeItemOffset(const CFileItem *item);
 
   void AddToDatabase(int iItem);
   virtual void OnInfo(CFileItem* pItem, const ADDON::ScraperPtr& scraper);
@@ -107,7 +107,7 @@ protected:
   bool ShowIMDB(CFileItem *item, const ADDON::ScraperPtr& content);
 
   void AddItemToPlayList(const CFileItemPtr &pItem, CFileItemList &queuedItems);
-  void GetStackedFiles(const CStdString &strFileName, std::vector<CStdString> &movies);
+  static void GetStackedFiles(const CStdString &strFileName, std::vector<CStdString> &movies);
 
   void OnSearch();
   void OnSearchItemFound(const CFileItem* pSelItem);
diff --git a/xbmc/video/windows/GUIWindowVideoFiles.cpp b/xbmc/video/windows/GUIWindowVideoFiles.cpp
deleted file mode 100644 (file)
index 3f474cd..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- *      Copyright (C) 2005-2008 Team XBMC
- *      http://www.xbmc.org
- *
- *  This Program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  This Program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with XBMC; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *  http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "system.h"
-#include "GUIWindowVideoFiles.h"
-#include "Util.h"
-#include "playlists/PlayListFactory.h"
-#include "Application.h"
-#include "NfoFile.h"
-#include "PlayListPlayer.h"
-#include "GUIPassword.h"
-#include "dialogs/GUIDialogMediaSource.h"
-#include "settings/GUIDialogContentSettings.h"
-#include "video/dialogs/GUIDialogVideoScan.h"
-#include "filesystem/MultiPathDirectory.h"
-#include "utils/RegExp.h"
-#include "guilib/GUIWindowManager.h"
-#include "dialogs/GUIDialogOK.h"
-#include "dialogs/GUIDialogYesNo.h"
-#include "filesystem/File.h"
-#include "playlists/PlayList.h"
-#include "settings/Settings.h"
-#include "settings/GUISettings.h"
-#include "utils/log.h"
-#include "utils/URIUtils.h"
-
-using namespace std;
-using namespace XFILE;
-using namespace PLAYLIST;
-using namespace VIDEO;
-
-#define CONTROL_PLAY_DVD           6
-#define CONTROL_STACK              7
-#define CONTROL_BTNSCAN            8
-#define CONTROL_BTNPLAYLISTS      13
-
-CGUIWindowVideoFiles::CGUIWindowVideoFiles()
-: CGUIWindowVideoBase(WINDOW_VIDEO_FILES, "MyVideo.xml")
-{
-}
-
-CGUIWindowVideoFiles::~CGUIWindowVideoFiles()
-{
-}
-
-bool CGUIWindowVideoFiles::OnMessage(CGUIMessage& message)
-{
-  switch ( message.GetMessage() )
-  {
-  case GUI_MSG_WINDOW_INIT:
-    {
-      return CGUIWindowVideoBase::OnMessage(message);
-    }
-    break;
-
-  case GUI_MSG_CLICKED:
-    {
-      int iControl = message.GetSenderId();
-      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())
-        {
-#ifdef HAS_DVD_DRIVE
-          if (pItem->IsDVD())
-            return MEDIA_DETECT::CAutorun::PlayDisc();
-#endif
-
-          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);
-}
-
-bool CGUIWindowVideoFiles::OnAction(const CAction &action)
-{
-  if (action.GetID() == ACTION_TOGGLE_WATCHED)
-  {
-    CFileItemPtr pItem = m_vecItems->Get(m_viewControl.GetSelectedItem());
-    if (pItem->IsParentFolder())
-      return false;
-
-    if (pItem && pItem->GetOverlayImage().Equals("OverlayWatched.png"))
-      return OnContextButton(m_viewControl.GetSelectedItem(),CONTEXT_BUTTON_MARK_UNWATCHED);
-    else
-      return OnContextButton(m_viewControl.GetSelectedItem(),CONTEXT_BUTTON_MARK_WATCHED);
-  }
-  return CGUIWindowVideoBase::OnAction(action);
-}
-
-bool CGUIWindowVideoFiles::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
-{
-  if (!CGUIWindowVideoBase::GetDirectory(strDirectory, items))
-    return false;
-
-  ADDON::ScraperPtr info2 = m_database.GetScraperForPath(strDirectory);
-  if (info2 && info2->Content() != CONTENT_NONE)
-    items.SetContent(ADDON::TranslateContent(info2->Content()));
-  else if (items.GetContent().IsEmpty())
-    items.SetContent("files");
-
-  items.SetThumbnailImage("");
-  items.SetVideoThumb();
-
-  return true;
-}
-
-bool CGUIWindowVideoFiles::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::PlayDisc();
-#endif
-
-  if (pItem->m_bIsShareOrDrive)
-    return false;
-
-  AddFileToDatabase(pItem.get());
-
-  return CGUIWindowVideoBase::OnPlayMedia(iItem);
-}
-
-void CGUIWindowVideoFiles::AddFileToDatabase(const CFileItem* pItem)
-{
-  if (!pItem->IsVideo()) return ;
-  if ( pItem->IsNFO()) return ;
-  if ( pItem->IsPlayList()) return ;
-
-  /* subtitles are assumed not to exist here, if we need it  */
-  /* player should update this when it figures out if it has */
-  m_database.AddFile(pItem->m_strPath);
-
-  if (pItem->IsStack())
-  { // get stacked items
-    // TODO: This should be removed as soon as we no longer need the individual
-    // files for saving settings etc.
-    vector<CStdString> movies;
-    GetStackedFiles(pItem->m_strPath, movies);
-    for (unsigned int i = 0; i < movies.size(); i++)
-    {
-      CFileItem item(movies[i], false);
-      m_database.AddFile(item.m_strPath);
-    }
-  }
-}
-
-
-void CGUIWindowVideoFiles::GetStackedDirectory(const CStdString &strPath, CFileItemList &items)
-{
-  items.Clear();
-  m_rootDir.GetDirectory(strPath, items);
-  items.Stack();
-}
-
-void CGUIWindowVideoFiles::LoadPlayList(const CStdString& strPlayList)
-{
-  // load a playlist like .m3u, .pls
-  // first get correct factory to load playlist
-  auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList));
-  if ( NULL != pPlayList.get())
-  {
-    // load it
-    if (!pPlayList->Load(strPlayList))
-    {
-      CGUIDialogOK::ShowAndGetInput(6, 0, 477, 0);
-      return ; //hmmm unable to load playlist?
-    }
-  }
-
-  int iSize = pPlayList->size();
-  if (g_application.ProcessAndStartPlaylist(strPlayList, *pPlayList, PLAYLIST_VIDEO))
-  {
-    if (m_guiState.get())
-      m_guiState->SetPlaylistDirectory("playlistvideo://");
-    // activate the playlist window if its not activated yet
-    if (GetID() == g_windowManager.GetActiveWindow() && iSize > 1)
-    {
-      g_windowManager.ActivateWindow(WINDOW_VIDEO_PLAYLIST);
-    }
-  }
-}
-
-void CGUIWindowVideoFiles::GetContextButtons(int itemNumber, CContextButtons &buttons)
-{
-  CFileItemPtr item;
-  if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
-    item = m_vecItems->Get(itemNumber);
-
-  CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN);
-  if (item && !item->m_strPath.IsEmpty())
-  {
-    // 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 (!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);
-
-        CGUIDialogVideoScan *pScanDlg = (CGUIDialogVideoScan *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_SCAN);
-        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
-    {
-      CGUIWindowVideoBase::GetContextButtons(itemNumber, buttons);
-      if (!item->GetPropertyBOOL("pluginreplacecontextitems") && !item->IsParentFolder())
-      {
-        // Movie Info button
-        if (pScanDlg && pScanDlg->IsScanning())
-          buttons.Add(CONTEXT_BUTTON_STOP_SCANNING, 13353);
-        if (g_settings.GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser)
-        {
-          ADDON::ScraperPtr info;
-          VIDEO::SScanSettings settings;
-          GetScraperForItem(item.get(), info, settings);
-
-          int infoString = 13346;
-
-          if (info && info->Content() == CONTENT_TVSHOWS)
-            infoString = item->m_bIsFolder ? 20351 : 20352;
-          if (info && info->Content() == CONTENT_MUSICVIDEOS)
-            infoString = 20393;
-          if(item->IsLiveTV())
-            infoString = 20352;
-
-          if (item->m_bIsFolder)
-          {
-            if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning()))
-            {
-              if (!item->IsPlayList() && !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)
-            { // scraper not set - allow movie information or set content
-              CStdString strPath(item->m_strPath);
-              URIUtils::AddSlashAtEnd(strPath);
-              if (m_database.HasMovieInfo(strPath) || 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->Content() != CONTENT_MUSICVIDEOS)
-                buttons.Add(CONTEXT_BUTTON_INFO, infoString);
-              if (info->Content() != CONTENT_NONE)
-                if (!pScanDlg || (pScanDlg && !pScanDlg->IsScanning()))
-                  buttons.Add(CONTEXT_BUTTON_SCAN, 13349);
-            }
-          }
-          else
-          {
-            // single file
-            buttons.Add(CONTEXT_BUTTON_INFO, infoString);
-
-            if (!item->IsLiveTV())
-            {
-              if (!m_database.HasMovieInfo(item->m_strPath) 
-              &&  !m_database.HasEpisodeInfo(item->m_strPath))
-                buttons.Add(CONTEXT_BUTTON_ADD_TO_LIBRARY, 527); // Add to Database
-              else  
-                buttons.Add(CONTEXT_BUTTON_DELETE, 646); // Remove from Database
-            }
-          }
-        }
-      }
-      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
-
-      if (!item->IsPlugin() && !item->IsLiveTV() && !item->IsAddonsPath())
-      {
-        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 (item->IsPlugin() || item->m_strPath.Left(9).Equals("script://") || m_vecItems->IsPlugin())
-        buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045);
-    }
-  }
-  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::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
-{
-  CFileItemPtr item;
-  if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
-    item = m_vecItems->Get(itemNumber);
-  if ( m_vecItems->IsVirtualDirectoryRoot() && item)
-  {
-    if (CGUIDialogContextMenu::OnContextButton("video", item, button))
-    {
-      //TODO should we search DB for entries from plugins?
-      if (button == CONTEXT_BUTTON_REMOVE_SOURCE && !item->IsPlugin()
-          && !item->IsLiveTV() &&!item->IsRSS())
-      {
-        OnUnAssignContent(item->m_strPath,20375,20340,20341);
-      }
-      Update("");
-      return true;
-    }
-  }
-
-  switch (button)
-  {
-  case CONTEXT_BUTTON_SWITCH_MEDIA:
-    CGUIDialogContextMenu::SwitchMedia("video", m_vecItems->m_strPath);
-    return true;
-
-  case CONTEXT_BUTTON_ADD_TO_LIBRARY:
-    AddToDatabase(itemNumber);
-    return true;
-
-  default:
-    break;
-  }
-  return CGUIWindowVideoBase::OnContextButton(itemNumber, button);
-}
-
-CStdString CGUIWindowVideoFiles::GetStartFolder(const CStdString &dir)
-{
-  SetupShares();
-  VECSOURCES shares;
-  m_rootDir.GetSources(shares);
-  bool bIsSourceName = false;
-  int iIndex = CUtil::GetMatchingSource(dir, shares, bIsSourceName);
-  if (iIndex > -1)
-  {
-    if (iIndex < (int)shares.size() && shares[iIndex].m_iHasLock == 2)
-    {
-      CFileItem item(shares[iIndex]);
-      if (!g_passwordManager.IsItemUnlocked(&item,"video"))
-        return "";
-    }
-    // set current directory to matching share
-    if (bIsSourceName)
-      return shares[iIndex].strPath;
-    return dir;
-  }
-  return CGUIWindowVideoBase::GetStartFolder(dir);
-}
diff --git a/xbmc/video/windows/GUIWindowVideoFiles.h b/xbmc/video/windows/GUIWindowVideoFiles.h
deleted file mode 100644 (file)
index fe39479..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-/*
- *      Copyright (C) 2005-2008 Team XBMC
- *      http://www.xbmc.org
- *
- *  This Program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  This Program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with XBMC; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *  http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "GUIWindowVideoBase.h"
-
-namespace VIDEO
-{
-  class CVideoInfoScanner;
-}
-
-class CGUIWindowVideoFiles : public CGUIWindowVideoBase
-{
-public:
-  CGUIWindowVideoFiles(void);
-  virtual ~CGUIWindowVideoFiles(void);
-  virtual bool OnMessage(CGUIMessage& message);
-  virtual bool OnAction(const CAction &action);
-
-  void GetStackedDirectory(const CStdString &strPath, CFileItemList &items);
-
-protected:
-  virtual bool GetDirectory(const CStdString &strDirectory, CFileItemList &items);
-  virtual bool OnPlayMedia(int iItem);
-  virtual void AddFileToDatabase(const CFileItem* pItem);
-  virtual void GetContextButtons(int itemNumber, CContextButtons &buttons);
-  virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
-  virtual CStdString GetStartFolder(const CStdString &dir);
-
-  virtual void LoadPlayList(const CStdString& strFileName);
-  void PlayFolder(const CFileItem* pItem);
-};
index 915591e..cc74d35 100644 (file)
@@ -1,6 +1,5 @@
 SRCS=GUIWindowFullScreen.cpp \
      GUIWindowVideoBase.cpp \
-     GUIWindowVideoFiles.cpp \
      GUIWindowVideoNav.cpp \
      GUIWindowVideoPlaylist.cpp \