From f7d9331e9fbebeb218619e00bd86be5bd85ad93f Mon Sep 17 00:00:00 2001
From: Pasha Golovko <mythtv@golovko.org>
Date: Wed, 20 Jan 2010 14:31:11 -0800
Subject: [PATCH] Fixes #7425. Update tree position remmeber functionality for post-MythUI changes.
---
mythplugins/mythvideo/mythvideo/videodlg.cpp | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/mythplugins/mythvideo/mythvideo/videodlg.cpp b/mythplugins/mythvideo/mythvideo/videodlg.cpp
index 24a6c1a..066cf85 100644
|
a
|
b
|
class VideoDialogPrivate |
| 1432 | 1432 | |
| 1433 | 1433 | if (m_rememberPosition && m_lastTreeNodePath.length()) |
| 1434 | 1434 | { |
| | 1435 | VERBOSE(VB_GENERAL, QString("Saving tree position: %1").arg(m_lastTreeNodePath)); |
| 1435 | 1436 | gContext->SaveSetting("mythvideo.VideoTreeLastActive", |
| 1436 | 1437 | m_lastTreeNodePath); |
| 1437 | 1438 | } |
| … |
… |
void VideoDialog::loadData() |
| 1797 | 1798 | |
| 1798 | 1799 | if (m_d->m_rememberPosition) |
| 1799 | 1800 | { |
| 1800 | | QStringList route = |
| 1801 | | gContext->GetSetting("mythvideo.VideoTreeLastActive", |
| 1802 | | "").split("\n"); |
| | 1801 | /* |
| | 1802 | * We need to remove first element of the route since it is the name of the |
| | 1803 | * root 'Video Home' element |
| | 1804 | */ |
| | 1805 | m_d->m_lastTreeNodePath = gContext->GetSetting("mythvideo.VideoTreeLastActive", ""); |
| | 1806 | QStringList route = m_d->m_lastTreeNodePath.split("\n"); |
| | 1807 | route.removeFirst(); |
| | 1808 | VERBOSE(VB_GENERAL, QString("Setting tree position: %1").arg(route.join("->"))); |
| 1803 | 1809 | m_videoButtonTree->SetNodeByString(route); |
| 1804 | 1810 | } |
| 1805 | 1811 | } |
| … |
… |
void VideoDialog::UpdateText(MythUIButtonListItem *item) |
| 2916 | 2922 | |
| 2917 | 2923 | if (m_d->m_currentNode) |
| 2918 | 2924 | CheckedSet(m_crumbText, m_d->m_currentNode->getRouteByString().join(" > ")); |
| | 2925 | m_d->m_lastTreeNodePath = m_d->m_currentNode->getRouteByString().join("\n"); |
| 2919 | 2926 | |
| 2920 | 2927 | if (node && node->getInt() == kSubFolder) |
| 2921 | 2928 | CheckedSet(this, "childcount", |