From 4ecc0c4d2ad897d258a7b49a29eed91546947e47 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 7 Apr 2009 05:29:11 +0100 Subject: [PATCH 1/2] Automatically hide photo descriptions after 10 seconds. --- xbmc/GUIWindowSlideShow.cpp | 28 ++++++++++++++++++++++++++++ xbmc/GUIWindowSlideShow.h | 4 ++++ xbmc/utils/GUIInfoManager.cpp | 1 + 3 files changed, 33 insertions(+) diff --git a/xbmc/GUIWindowSlideShow.cpp b/xbmc/GUIWindowSlideShow.cpp index a4dc54826b75a..7e04cd7c154e8 100644 --- a/xbmc/GUIWindowSlideShow.cpp +++ b/xbmc/GUIWindowSlideShow.cpp @@ -38,6 +38,7 @@ using namespace DIRECTORY; #define MAX_ZOOM_FACTOR 10 #define MAX_PICTURE_SIZE 2048*2048 +#define DESCRIPTION_DISPLAY_TIME 10 #define IMMEDIATE_TRANSISTION_TIME 20 @@ -229,6 +230,7 @@ void CGUIWindowSlideShow::Select(const CStdString& strPicture) m_iNextSlide = m_iCurrentSlide + 1; if (m_iNextSlide >= m_slides->Size()) m_iNextSlide = 0; + UpdateDescription(); return ; } } @@ -259,6 +261,15 @@ void CGUIWindowSlideShow::StartSlideShow(bool screensaver) void CGUIWindowSlideShow::Render() { + if (stopwatch.IsRunning()) + { + if ((int)stopwatch.GetElapsedSeconds() == DESCRIPTION_DISPLAY_TIME) + { + stopwatch.Stop(); + if (g_infoManager.GetSlideshowShowDescription() == true) + g_infoManager.SetSlideshowShowDescription(false); + } + } // reset the screensaver if we're in a slideshow if (m_bSlideShow) g_application.ResetScreenSaver(); int iSlides = m_slides->Size(); @@ -421,6 +432,7 @@ void CGUIWindowSlideShow::Render() if (m_Image[1 - m_iCurrentPic].IsLoaded()) m_iCurrentPic = 1 - m_iCurrentPic; m_iCurrentSlide = m_iNextSlide; + UpdateDescription(); if (bSlideShow) { m_iNextSlide++; @@ -466,7 +478,11 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action) // If the item has a description, allow toggling CFileItemPtr fileItem = m_slides->Get(m_iCurrentSlide); if (fileItem->GetProperty("description") != "") + { g_infoManager.SetSlideshowShowDescription(!g_infoManager.GetSlideshowShowDescription()); + if (stopwatch.IsRunning()) + stopwatch.Stop(); + } } break; case ACTION_PREVIOUS_MENU: @@ -836,6 +852,18 @@ void CGUIWindowSlideShow::GetCheckedSize(float width, float height, int &maxWidt #endif } +void CGUIWindowSlideShow::UpdateDescription() +{ + if (stopwatch.IsRunning()) + stopwatch.Stop(); + CFileItemPtr fileItem = m_slides->Get(m_iCurrentSlide); + if (fileItem->GetProperty("description") != "") + { + stopwatch.StartZero(); + g_infoManager.SetSlideshowShowDescription(true); + } +} + CFileItemPtr CGUIWindowSlideShow::GetCurrentListItem(int offset) { if (m_slides->Size() == 0 || m_iCurrentSlide < 0) diff --git a/xbmc/GUIWindowSlideShow.h b/xbmc/GUIWindowSlideShow.h index 19bc4a19a541e..036f390a83a83 100644 --- a/xbmc/GUIWindowSlideShow.h +++ b/xbmc/GUIWindowSlideShow.h @@ -25,6 +25,7 @@ #include "utils/Thread.h" #include "SlideShowPicture.h" #include "DllImageLib.h" +#include "Stopwatch.h" class CFileItemList; @@ -95,6 +96,7 @@ class CGUIWindowSlideShow : public CGUIWindow void Zoom(int iZoom); void Move(float fX, float fY); void GetCheckedSize(float width, float height, int &maxWidth, int &maxHeight); + void UpdateDescription(); int m_iCurrentSlide; int m_iNextSlide; @@ -118,4 +120,6 @@ class CGUIWindowSlideShow : public CGUIWindow bool m_bReloadImage; DllImageLib m_ImageLib; RESOLUTION m_Resolution; + + CStopWatch stopwatch; }; diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp index 4963398503695..cbf9007afbd09 100644 --- a/xbmc/utils/GUIInfoManager.cpp +++ b/xbmc/utils/GUIInfoManager.cpp @@ -113,6 +113,7 @@ CGUIInfoManager::CGUIInfoManager(void) m_frameCounter = 0; m_frameClumpTime = 0; m_fps = 0.0; + m_slideshowShowDescription = false; } CGUIInfoManager::~CGUIInfoManager(void) From 3f6947bd64d8db838b5ba00ad513ca6472431bdb Mon Sep 17 00:00:00 2001 From: james Date: Tue, 7 Apr 2009 06:51:57 +0100 Subject: [PATCH 2/2] Don't show Remove or Edit buttons in the context menu for auto-added PMS sources. --- xbmc/Util.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp index 52f3375e60d09..061c931247316 100644 --- a/xbmc/Util.cpp +++ b/xbmc/Util.cpp @@ -433,6 +433,7 @@ void CUtil::AutodetectPlexSources(CStdString strPlexPath, VECSOURCES& dstSources share.strName = item->GetLabel(); share.strPath = item->m_strPath; share.m_strFanartUrl = item->GetQuickFanart(); + share.m_ignore = true; // Download thumbnail if needed. CStdString cachedThumb(item->GetCachedProgramThumb());