Ticket #3014: mythvideo_remember.patch
File mythvideo_remember.patch, 1.9 KB (added by , 17 years ago) |
---|
-
globalsettings.cpp
162 162 return hsb; 163 163 } 164 164 165 HostCheckBox *VideoTreeRemeber() 166 { 167 HostCheckBox *gc = new HostCheckBox("VideoTreeRemember"); 168 gc->setLabel(QObject::tr("Video Tree remembers last selected position")); 169 gc->setValue(false); 170 gc->setHelpText(QObject::tr("If set then last position in the Video Tree" 171 "is remembered and item is selected when entering MythVideo")); 172 return gc; 173 } 174 165 175 HostLineEdit *SearchListingsCommand() 166 176 { 167 177 HostLineEdit *gc = new HostLineEdit("MovieListCommandLine"); … … 550 560 general2->addChild(VideoNewBrowsable()); 551 561 general2->addChild(VideoSortIgnoresCase()); 552 562 general2->addChild(VideoDBFolderView()); 563 general2->addChild(VideoTreeRemeber()); 553 564 general2->addChild(VideoImageCacheSize()); 554 565 addChild(general2); 555 566 -
videotree.cpp
233 233 m_video_list->setCurrentVideoFilter(video_filter); 234 234 235 235 buildVideoList(); 236 237 bool remember = gContext->GetNumSetting("VideoTreeRemember", 0); 238 239 if (remember) 240 { 241 QString routePath = gContext->GetSetting("VideoTreeLastActive", ""); 242 QStringList route = QStringList::split("\n", routePath); 243 m_imp->video_tree_list->tryToSetCurrent(route); 244 m_imp->video_tree_list->enter(); 245 } 246 236 247 } 237 248 238 249 VideoTree::~VideoTree() 239 250 { 251 bool remember = gContext->GetNumSetting("VideoTreeRemember", 0); 252 253 if (remember) 254 { 255 QStringList path = m_imp->video_tree_list->getRouteToCurrent(); 256 QString routePath = path.join("\n"); 257 gContext->SaveSetting("VideoTreeLastActive", routePath); 258 } 240 259 } 241 260 242 261 void VideoTree::keyPressEvent(QKeyEvent *e)