Ticket #6318: recGroup-cycle-v1.1.patch

File recGroup-cycle-v1.1.patch, 2.9 KB (added by jppoet@…, 15 years ago)

new version with recGroupType getting set properly

  • programs/mythfrontend/playbackbox.cpp

     
    345345    }
    346346
    347347    // recording group stuff
     348    m_recGroupIdx = -1;
    348349    m_recGroupType.clear();
    349350    m_recGroupType[m_recGroup] = (displayCat) ? "category" : "recgroup";
    350351    if (m_groupnameAsAllProg)
     
    14221423        m_titleList << tr("LiveTV");
    14231424    m_titleList << sortedList.values();
    14241425
     1426    // Populate list of recording groups
     1427    if (m_progCache)
     1428    {
     1429        QString name;
     1430
     1431        m_recGroups.clear();
     1432        m_recGroupIdx = -1;
     1433
     1434        m_recGroups.append("All Programs");
     1435
     1436        MSqlQuery query(MSqlQuery::InitCon());
     1437
     1438        query.prepare("SELECT distinct recgroup from recorded WHERE "
     1439                      "deletepending = 0 ORDER BY recgroup");
     1440        if (query.exec())
     1441        {
     1442            while (query.next())
     1443            {
     1444                name = query.value(0).toString();
     1445                if (name != "Deleted" && name != "LiveTV")
     1446                {
     1447                    m_recGroups.append(name);
     1448                    m_recGroupType[name] = "recgroup";
     1449                }
     1450            }
     1451
     1452            m_recGroupIdx = m_recGroups.indexOf(m_recGroup);
     1453            if (m_recGroupIdx < 0)
     1454                m_recGroupIdx = 0;
     1455        }
     1456    }
     1457
    14251458    updateGroupList();
    14261459    updateUsage();
    14271460
     
    31473180            m_viewMask = m_viewMaskToggle(m_viewMask, VIEW_TITLES);
    31483181            m_connected = FillList(true);
    31493182        }
     3183        else if (action == "PAGERIGHT")
     3184        {
     3185            if (m_recGroupIdx >= 0 && !m_recGroups.empty())
     3186            {
     3187                if (++m_recGroupIdx >= m_recGroups.size())
     3188                    m_recGroupIdx = 0;
     3189                displayRecGroup(m_recGroups[m_recGroupIdx]);
     3190            }
     3191        }
     3192        else if (action == "PAGELEFT")
     3193        {
     3194            if (m_recGroupIdx >= 0 && !m_recGroups.empty())
     3195            {
     3196                if (--m_recGroupIdx < 0)
     3197                    m_recGroupIdx = m_recGroups.size() - 1;
     3198                displayRecGroup(m_recGroups[m_recGroupIdx]);
     3199            }
     3200        }
    31503201        else if (action == "CHANGERECGROUP")
    31513202            showGroupFilter();
    31523203        else if (action == "CHANGEGROUPVIEW")
  • programs/mythfrontend/playbackbox.h

     
    373373    int                 m_progsInDB;  ///< total number of recordings in DB
    374374    bool                m_isFilling;
    375375
     376    QStringList         m_recGroups;
     377    int                 m_recGroupIdx;
     378
    376379    // Other state
    377380    /// Program currently selected for deletion
    378381    ProgramInfo *m_delItem;