Ticket #6318: recGroup-ui.patch
File recGroup-ui.patch, 3.3 KB (added by , 15 years ago) |
---|
-
programs/mythfrontend/playbackbox.cpp
old new bool PlaybackBox::Create() 400 400 if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this)) 401 401 return false; 402 402 403 m_recgroupList = dynamic_cast<MythUIButtonList *> (GetChild("recgroups")); 403 404 m_groupList = dynamic_cast<MythUIButtonList *> (GetChild("groups")); 404 405 m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings")); 405 406 … … bool PlaybackBox::Create() 422 423 connect(m_recordingList, SIGNAL(itemClicked(MythUIButtonListItem*)), 423 424 SLOT(playSelected(MythUIButtonListItem*))); 424 425 426 if (m_recgroupList) 427 m_recgroupList->SetCanTakeFocus(false); 428 425 429 if (!m_player && !m_recGroupPassword.isEmpty()) 426 430 displayRecGroup(m_recGroup); 427 431 else if (gContext->GetNumSetting("QueryInitialFilter", 0) == 1) … … void PlaybackBox::updateUsage() 752 756 } 753 757 } 754 758 759 /* 760 * \fn PlaybackBox::updateRecGroupList(void) 761 * \brief called when the list of recording groups may have changed 762 */ 763 void PlaybackBox::updateRecGroupList(void) 764 { 765 if (m_recGroupIdx < 0 || !m_recgroupList) 766 return; 767 768 m_recgroupList->Reset(); 769 770 QStringList::iterator it; 771 int idx; 772 MythUIButtonListItem *item = NULL; 773 QString name; 774 QString state; 775 776 for (it = m_recGroups.begin(), idx = 0; 777 it != m_recGroups.end(); ++it, ++idx) 778 { 779 name = (*it).simplified(); 780 if (name == "All Programs") 781 name = "All"; 782 783 item = new MythUIButtonListItem(m_recgroupList, "", 784 qVariantFromValue(name.toLower())); 785 if (idx == m_recGroupIdx) 786 { 787 state = "selected"; 788 m_recgroupList->SetItemCurrent(item); 789 } 790 else 791 state = "active"; 792 793 item->SetText(name, "buttonitem", state); 794 } 795 } 796 755 797 void PlaybackBox::updateGroupList() 756 798 { 757 799 m_groupList->Reset(); … … bool PlaybackBox::FillList(bool useCache 1003 1045 m_progLists.clear(); 1004 1046 m_recordingList->Reset(); 1005 1047 m_groupList->Reset(); 1048 if (m_recgroupList) 1049 m_recgroupList->Reset(); 1006 1050 // Clear autoDelete for the "all" list since it will share the 1007 1051 // objects with the title lists. 1008 1052 m_progLists[""] = ProgramList(false); … … bool PlaybackBox::FillList(bool useCache 1465 1509 } 1466 1510 } 1467 1511 1512 updateRecGroupList(); 1468 1513 updateGroupList(); 1469 1514 updateUsage(); 1470 1515 -
programs/mythfrontend/playbackbox.h
old new class PlaybackBox : public MythScreenTyp 293 293 QString getRecGroupPassword(const QString &recGroup); 294 294 void fillRecGroupPasswordCache(void); 295 295 296 void updateRecGroupList(); 296 297 void updateGroupList(); 297 298 void updateIcons(const ProgramInfo *pginfo = NULL); 298 299 void updateUsage(); … … class PlaybackBox : public MythScreenTyp 304 305 305 306 void HandlePreviewEvent(const ProgramInfo &evinfo); 306 307 308 MythUIButtonList *m_recgroupList; 307 309 MythUIButtonList *m_groupList; 308 310 MythUIButtonList *m_recordingList; 309 311