Ticket #6318: recGroup-ui-v4.patch
File recGroup-ui-v4.patch, 3.0 KB (added by , 14 years ago) |
---|
-
programs/mythfrontend/playbackbox.cpp
474 474 if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this)) 475 475 return false; 476 476 477 m_recgroupList = dynamic_cast<MythUIButtonList *> (GetChild("recgroups")); 477 478 m_groupList = dynamic_cast<MythUIButtonList *> (GetChild("groups")); 478 479 m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings")); 479 480 … … 491 492 return false; 492 493 } 493 494 495 if (m_recgroupList) 496 m_recgroupList->SetCanTakeFocus(false); 497 494 498 connect(m_groupList, SIGNAL(itemSelected(MythUIButtonListItem*)), 495 499 SLOT(updateRecList(MythUIButtonListItem*))); 496 500 connect(m_groupList, SIGNAL(itemClicked(MythUIButtonListItem*)), … … 993 997 } 994 998 } 995 999 1000 /* 1001 * \fn PlaybackBox::updateUIRecGroupList(void) 1002 * \brief called when the list of recording groups may have changed 1003 */ 1004 void PlaybackBox::UpdateUIRecGroupList(void) 1005 { 1006 if (m_recGroupIdx < 0 || !m_recgroupList || m_recGroups.size() < 2) 1007 return; 1008 1009 m_recgroupList->Reset(); 1010 1011 QStringList::iterator it; 1012 int idx; 1013 MythUIButtonListItem *item = NULL; 1014 QString name; 1015 QString state; 1016 1017 for (it = m_recGroups.begin(), idx = 0; 1018 it != m_recGroups.end(); ++it, ++idx) 1019 { 1020 name = (*it).simplified(); 1021 if (name == "All Programs") 1022 name = "All"; 1023 1024 item = new MythUIButtonListItem(m_recgroupList, "", 1025 qVariantFromValue(name.toLower())); 1026 1027 if (idx == m_recGroupIdx) 1028 m_recgroupList->SetItemCurrent(item); 1029 1030 item->SetText(name); 1031 } 1032 } 1033 996 1034 void PlaybackBox::UpdateUIGroupList(const QStringList &groupPreferences) 997 1035 { 998 1036 m_groupList->Reset(); … … 1235 1273 m_progLists.clear(); 1236 1274 m_recordingList->Reset(); 1237 1275 m_groupList->Reset(); 1276 if (m_recgroupList) 1277 m_recgroupList->Reset(); 1238 1278 // Clear autoDelete for the "all" list since it will share the 1239 1279 // objects with the title lists. 1240 1280 m_progLists[""] = ProgramList(false); … … 1678 1718 } 1679 1719 } 1680 1720 1721 UpdateUIRecGroupList(); 1681 1722 UpdateUIGroupList(groupSelPref); 1682 1723 UpdateUsageUI(); 1683 1724 -
programs/mythfrontend/playbackbox.h
259 259 private: 260 260 bool UpdateUILists(void); 261 261 void UpdateUIGroupList(const QStringList &groupPreferences); 262 void UpdateUIRecGroupList(void); 262 263 263 264 void UpdateProgressBar(void); 264 265 … … 323 324 QString CreateProgramInfoString(const ProgramInfo &program) const; 324 325 325 326 private: 327 MythUIButtonList *m_recgroupList; 326 328 MythUIButtonList *m_groupList; 327 329 MythUIButtonList *m_recordingList; 328 330