diff options
author | chriszero <zerov83@gmail.com> | 2015-05-23 20:24:17 +0200 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-05-23 20:24:17 +0200 |
commit | 3bb1c162515089e5f20300029095edef2c1a2387 (patch) | |
tree | ff673d332049757784ed31f8cb6d36c9c94a7475 | |
parent | 0ca20c1d4ff9816ccf27ccdcce5a860af729e1c1 (diff) | |
download | vdr-plugin-plex-3bb1c162515089e5f20300029095edef2c1a2387.tar.gz vdr-plugin-plex-3bb1c162515089e5f20300029095edef2c1a2387.tar.bz2 |
More error handling if plexserver is gone or not availiable.
-rw-r--r-- | browserGrid.cpp | 2 | ||||
-rw-r--r-- | plexSdOsd.cpp | 16 | ||||
-rw-r--r-- | viewGridNavigator.cpp | 8 |
3 files changed, 22 insertions, 4 deletions
diff --git a/browserGrid.cpp b/browserGrid.cpp index 7d4c8fb..9422eec 100644 --- a/browserGrid.cpp +++ b/browserGrid.cpp @@ -202,6 +202,7 @@ void cBrowserGrid::ProcessData() eOSState cBrowserGrid::NavigateSelect() { + if(m_setIterator) return eOSState::osContinue;; plexclient::Directory* dir = dynamic_cast<plexclient::Directory*>(SelectedObject()); if(dir) { m_pContainer = m_pService->GetSection(dir->m_sKey); @@ -222,6 +223,7 @@ eOSState cBrowserGrid::NavigateSelect() eOSState cBrowserGrid::NavigateBack() { + if(m_setIterator) return eOSState::osContinue;; std::shared_ptr<plexclient::MediaContainer> pCont = NULL; if(m_pService) { pCont = m_pService->GetLastSection(); diff --git a/plexSdOsd.cpp b/plexSdOsd.cpp index ac0c26a..1c25fed 100644 --- a/plexSdOsd.cpp +++ b/plexSdOsd.cpp @@ -69,6 +69,22 @@ eOSState cPlexSdOsd::ProcessKey(eKeys Key) if (m_pBrowserGrid->DrawTime()) m_pBrowserGrid->Flush(); + //check if some plexservers are online + if(plexclient::plexgdm::GetInstance().GetFirstServer() == NULL || + (plexclient::plexgdm::GetInstance().GetFirstServer() && plexclient::plexgdm::GetInstance().GetFirstServer()->Offline) + ) { + DrawMessage(std::string(tr("No Plex Media Server found."))); + + switch (Key & ~k_Repeat) { + case kOk: + case kBack: + return eOSState::osEnd; + break; + default: + return eOSState::osContinue; + } + } + if(m_messageDisplayed) { vid = dynamic_cast<plexclient::Video*>(m_pBrowserGrid->SelectedObject()); switch (Key & ~k_Repeat) { diff --git a/viewGridNavigator.cpp b/viewGridNavigator.cpp index f8d71c9..83c86e3 100644 --- a/viewGridNavigator.cpp +++ b/viewGridNavigator.cpp @@ -152,7 +152,7 @@ void cViewGridNavigator::SetGridDimensions(int rows, int columns) bool cViewGridNavigator::NavigateDown() { - if (m_activeElementIter == m_vElements.end() - 1) return false; + if (m_setIterator || m_activeElementIter == m_vElements.end() - 1) return false; auto next = m_activeElementIter + m_columns; if(next >= m_vElements.end()) next = m_vElements.end()-1; @@ -169,7 +169,7 @@ bool cViewGridNavigator::NavigateDown() bool cViewGridNavigator::NavigateUp() { - if (m_activeElementIter == m_vElements.begin()) return false; + if (m_setIterator || m_activeElementIter == m_vElements.begin()) return false; auto next = m_activeElementIter - m_columns; if(next < m_vElements.begin()) next = m_vElements.begin(); @@ -186,7 +186,7 @@ bool cViewGridNavigator::NavigateUp() bool cViewGridNavigator::NavigateLeft() { - if (m_activeElementIter == m_vElements.begin()) return false; + if (m_setIterator || m_activeElementIter == m_vElements.begin()) return false; auto next = m_activeElementIter - 1; if(next < m_vElements.begin()) next = m_vElements.begin(); @@ -204,7 +204,7 @@ bool cViewGridNavigator::NavigateLeft() bool cViewGridNavigator::NavigateRight() { - if (m_activeElementIter == m_vElements.end() - 1) return false; + if (m_setIterator || m_activeElementIter == m_vElements.end() - 1) return false; auto next = m_activeElementIter + 1; if(next >= m_vElements.end()) next = m_vElements.end()-1; |