case GUI_MSG_WINDOW_DEINIT:
{
g_PVRManager.SetPlayingGroup(m_group);
+ SetLastSelectedItem(m_group->GroupID());
Clear();
}
break;
CPVRChannelGroupPtr group = GetPlayingGroup();
CPVRChannelGroupPtr nextGroup = iAction == ACTION_MOVE_RIGHT ? group->GetNextGroup() : group->GetPreviousGroup();
g_PVRManager.SetPlayingGroup(nextGroup);
+ SetLastSelectedItem(group->GroupID());
Update();
if (!IsObserving(g_infoManager))
g_infoManager.RegisterObserver(this);
- int iSelectedItem = m_viewControl.GetSelectedItem();
m_viewControl.SetCurrentView(DEFAULT_VIEW_LIST);
// empty the list ready for population
{
group->GetMembers(*m_vecItems);
m_viewControl.SetItems(*m_vecItems);
-
- if (selectPlayingChannel)
- iSelectedItem = group->GetIndex(*channel);
- if (iSelectedItem < 0)
- iSelectedItem = 0;
- else if (iSelectedItem > m_vecItems->Size())
- iSelectedItem = m_vecItems->Size() - 1;
- m_viewControl.SetSelectedItem(iSelectedItem);
+ m_viewControl.SetSelectedItem(selectPlayingChannel ? group->GetIndex(*channel) : GetLastSelectedItem(group->GroupID()));
}
g_graphicsContext.Unlock();
g_graphicsContext.Unlock();
}
}
+
+void CGUIDialogPVRChannelsOSD::SetLastSelectedItem(int iGroupID)
+{
+ m_groupSelectedItems[iGroupID] = m_viewControl.GetSelectedItem();
+}
+
+int CGUIDialogPVRChannelsOSD::GetLastSelectedItem(int iGroupID) const
+{
+ map<int,int>::const_iterator it = m_groupSelectedItems.find(iGroupID);
+ if(it != m_groupSelectedItems.end())
+ return it->second;
+ return 0;
+}
#include "GUIViewControl.h"
#include "utils/Observer.h"
#include "pvr/channels/PVRChannelGroupsContainer.h"
+#include <map>
class CFileItemList;
private:
CPVRChannelGroupPtr m_group;
+ std::map<int,int> m_groupSelectedItems;
+ void SetLastSelectedItem(int iGroupID);
+ int GetLastSelectedItem(int iGroupID) const;
};
}