Ticket #6318: recGroup-cycle.patch
| File recGroup-cycle.patch, 3.2 KB (added by , 17 years ago) |
|---|
-
programs/mythfrontend/playbackbox.cpp
old new PlaybackBox::PlaybackBox(MythScreenStack 345 345 } 346 346 347 347 // recording group stuff 348 m_recGroupIdx = -1; 348 349 m_recGroupType.clear(); 349 350 m_recGroupType[m_recGroup] = (displayCat) ? "category" : "recgroup"; 350 351 if (m_groupnameAsAllProg) … … bool PlaybackBox::FillList(bool useCache 1428 1429 m_titleList << tr("LiveTV"); 1429 1430 m_titleList << sortedList.values(); 1430 1431 1432 // Populate list of recording groups 1433 if (m_progCache) 1434 { 1435 QString current_recGroup; 1436 QString name; 1437 1438 m_recGroups.clear(); 1439 m_recGroupIdx = -1; 1440 1441 m_recGroups.append("All Programs"); 1442 1443 MSqlQuery query(MSqlQuery::InitCon()); 1444 1445 query.prepare("SELECT distinct recgroup from recorded WHERE " 1446 "deletepending = 0 ORDER BY recgroup"); 1447 if (query.exec()) 1448 { 1449 while (query.next()) 1450 { 1451 name = query.value(0).toString(); 1452 if (name != "Deleted" && name != "LiveTV") 1453 m_recGroups.append(name); 1454 } 1455 1456 if (m_recGroups.contains(m_recGroup)) 1457 current_recGroup = m_recGroup; 1458 else if (m_recGroupIdx >= 0 && m_recGroupIdx < m_recGroups.size()) 1459 current_recGroup = m_recGroups[m_recGroupIdx]; 1460 else 1461 current_recGroup = "All Programs"; 1462 1463 if ((m_recGroupIdx = m_recGroups.indexOf(current_recGroup)) < 0) 1464 m_recGroupIdx = 0; 1465 } 1466 } 1467 1431 1468 updateGroupList(); 1432 1469 updateUsage(); 1433 1470 … … bool PlaybackBox::keyPressEvent(QKeyEven 3147 3184 m_viewMask = m_viewMaskToggle(m_viewMask, VIEW_TITLES); 3148 3185 m_connected = FillList(true); 3149 3186 } 3187 else if (action == "PAGERIGHT") 3188 { 3189 if (m_recGroupIdx >= 0 && !m_recGroups.empty()) 3190 { 3191 if (++m_recGroupIdx >= m_recGroups.size()) 3192 m_recGroupIdx = 0; 3193 displayRecGroup(m_recGroups[m_recGroupIdx]); 3194 } 3195 } 3196 else if (action == "PAGELEFT") 3197 { 3198 if (m_recGroupIdx >= 0 && !m_recGroups.empty()) 3199 { 3200 if (--m_recGroupIdx < 0) 3201 m_recGroupIdx = m_recGroups.size() - 1; 3202 displayRecGroup(m_recGroups[m_recGroupIdx]); 3203 } 3204 } 3150 3205 else if (action == "CHANGERECGROUP") 3151 3206 showGroupFilter(); 3152 3207 else if (action == "CHANGEGROUPVIEW") -
programs/mythfrontend/playbackbox.h
old new class PlaybackBox : public MythScreenTyp 373 373 int m_progsInDB; ///< total number of recordings in DB 374 374 bool m_isFilling; 375 375 376 QStringList m_recGroups; 377 int m_recGroupIdx; 378 376 379 // Other state 377 380 /// Program currently selected for deletion 378 381 ProgramInfo *m_delItem;
