Ticket #6318: recGroup-ui-v2.1.patch
| File recGroup-ui-v2.1.patch, 4.1 KB (added by , 16 years ago) |
|---|
-
programs/mythfrontend/playbackbox.cpp
old new PlaybackBox::~PlaybackBox(void) 434 434 bool PlaybackBox::Create() 435 435 { 436 436 if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this)) 437 437 return false; 438 438 439 m_recgroupList = dynamic_cast<MythUIButtonList *> (GetChild("recgroups")); 439 440 m_groupList = dynamic_cast<MythUIButtonList *> (GetChild("groups")); 440 441 m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings")); 441 442 442 443 m_noRecordingsText = dynamic_cast<MythUIText *> (GetChild("norecordings")); 443 444 … … bool PlaybackBox::Create() 450 451 { 451 452 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); 452 453 return false; 453 454 } 454 455 456 if (m_recgroupList) 457 m_recgroupList->SetCanTakeFocus(false); 458 455 459 connect(m_groupList, SIGNAL(itemSelected(MythUIButtonListItem*)), 456 460 SLOT(updateRecList(MythUIButtonListItem*))); 457 461 connect(m_groupList, SIGNAL(itemClicked(MythUIButtonListItem*)), 458 462 SLOT(SwitchList())); 459 463 connect(m_recordingList, SIGNAL(itemSelected(MythUIButtonListItem*)), … … void PlaybackBox::updateUsage() 897 901 usedProgress->SetTotal(m_freeSpaceTotal); 898 902 usedProgress->SetUsed(m_freeSpaceUsed); 899 903 } 900 904 } 901 905 906 /* 907 * \fn PlaybackBox::updateRecGroupList(void) 908 * \brief called when the list of recording groups may have changed 909 */ 910 void PlaybackBox::updateRecGroupList(void) 911 { 912 if (m_recGroupIdx < 0 || !m_recgroupList) 913 return; 914 915 m_recgroupList->Reset(); 916 917 QStringList::iterator it; 918 int idx; 919 MythUIButtonListItem *item = NULL; 920 QString name; 921 QString state; 922 923 for (it = m_recGroups.begin(), idx = 0; 924 it != m_recGroups.end(); ++it, ++idx) 925 { 926 name = (*it).simplified(); 927 if (name == "All Programs") 928 name = "All"; 929 930 item = new MythUIButtonListItem(m_recgroupList, "", 931 qVariantFromValue(name.toLower())); 932 933 if (idx == m_recGroupIdx) 934 m_recgroupList->SetItemCurrent(item); 935 936 item->SetText(name); 937 } 938 } 939 902 940 void PlaybackBox::updateGroupList() 903 941 { 904 942 m_groupList->Reset(); 905 943 906 944 if (!m_titleList.isEmpty()) … … bool PlaybackBox::FillList(bool useCache 1165 1203 m_progsInDB = 0; 1166 1204 m_titleList.clear(); 1167 1205 m_progLists.clear(); 1168 1206 m_recordingList->Reset(); 1169 1207 m_groupList->Reset(); 1208 if (m_recgroupList) 1209 m_recgroupList->Reset(); 1170 1210 // Clear autoDelete for the "all" list since it will share the 1171 1211 // objects with the title lists. 1172 1212 m_progLists[""] = ProgramList(false); 1173 1213 m_progLists[""].setAutoDelete(false); 1174 1214 … … bool PlaybackBox::FillList(bool useCache 1627 1667 if (m_recGroupIdx < 0) 1628 1668 m_recGroupIdx = 0; 1629 1669 } 1630 1670 } 1631 1671 1672 updateRecGroupList(); 1632 1673 updateGroupList(); 1633 1674 updateUsage(); 1634 1675 1635 1676 if (m_currentItem) 1636 1677 { -
programs/mythfrontend/playbackbox.h
old new class PlaybackBox : public ScheduleCommo 312 312 bool loadArtwork(QString artworkFile, MythUIImage *image, QTimer *timer, 313 313 int delay = 500, bool resetImage = false); 314 314 QString findArtworkFile(QString &seriesID, QString &titleIn, 315 315 QString imagetype, QString host); 316 316 317 void updateRecGroupList(); 317 318 void updateGroupList(); 318 319 void updateIcons(const ProgramInfo *pginfo = NULL); 319 320 void updateUsage(); 320 321 void updateGroupInfo(const QString &groupname, const QString &grouplabel); 321 322 void UpdateProgramInfo(MythUIButtonListItem *item, bool is_sel, … … class PlaybackBox : public ScheduleCommo 325 326 326 327 void HandlePreviewEvent(const ProgramInfo &evinfo); 327 328 328 329 void ShowMenu(void); 329 330 331 MythUIButtonList *m_recgroupList; 330 332 MythUIButtonList *m_groupList; 331 333 MythUIButtonList *m_recordingList; 332 334 333 335 MythUIText *m_noRecordingsText; 334 336
