Ticket #13234: 20180409_1244_rec_grp_arrows.patch

File 20180409_1244_rec_grp_arrows.patch, 8.5 KB (added by Peter Bennett, 3 years ago)

Playback Support change recording group with arrow keys

  • mythtv/programs/mythfrontend/globalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
    index b1518bb..2523fd1 100644
    a b static HostCheckBoxSetting *RememberRecGroup() 
    171171    return gc;
    172172}
    173173
     174static HostCheckBoxSetting *RecGroupMod()
     175{
     176    HostCheckBoxSetting *gc = new HostCheckBoxSetting("RecGroupsFocusable");
     177
     178    gc->setLabel(PlaybackSettings::tr("Change Recording Group using the arrow "
     179                                      "keys"));
     180
     181    gc->setValue(false);
     182
     183    gc->setHelpText(PlaybackSettings::tr("If enabled, change recording group "
     184                                         "directly using the arrow keys "
     185                                         "instead of having to use < and >. "
     186                                         "Requires theme support for this "
     187                                         "feature."));
     188    return gc;
     189}
     190
     191
    174192static HostCheckBoxSetting *PBBStartInTitle()
    175193{
    176194    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackBoxStartInTitle");
    void PlaybackSettings::Load(void) 
    39713989    pbox2->addChild(DisplayRecGroup());
    39723990    pbox2->addChild(QueryInitialFilter());
    39733991    pbox2->addChild(RememberRecGroup());
     3992    pbox2->addChild(RecGroupMod());
    39743993
    39753994    pbox->addChild(pbox2);
    39763995
  • mythtv/programs/mythfrontend/playbackbox.cpp

    diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
    index c1de86b..8545cba 100644
    a b bool PlaybackBox::Create() 
    556556    }
    557557
    558558    if (m_recgroupList)
    559         m_recgroupList->SetCanTakeFocus(false);
     559    {
     560        if (gCoreContext->GetNumSetting("RecGroupsFocusable", 0))
     561        connect(m_recgroupList, SIGNAL(itemSelected(MythUIButtonListItem*)),
     562            SLOT(updateRecGroup(MythUIButtonListItem*)));
     563        else
     564            m_recgroupList->SetCanTakeFocus(false);
     565    }
    560566
    561567    connect(m_groupList, SIGNAL(itemSelected(MythUIButtonListItem*)),
    562568            SLOT(updateRecList(MythUIButtonListItem*)));
    void PlaybackBox::UpdateUIRecGroupList(void) 
    13371343    if (m_recGroupIdx < 0 || !m_recgroupList || m_recGroups.size() < 2)
    13381344        return;
    13391345
     1346    QSignalBlocker blocker(m_recgroupList);
     1347
    13401348    m_recgroupList->Reset();
    13411349
    13421350    int idx = 0;
    void PlaybackBox::UpdateUIGroupList(const QStringList &groupPreferences) 
    14111419    }
    14121420}
    14131421
     1422void PlaybackBox::updateRecGroup(MythUIButtonListItem *sel_item)
     1423{
     1424    QString newRecGroup = sel_item->GetData().toString();
     1425    displayRecGroup(newRecGroup);
     1426}
     1427
    14141428void PlaybackBox::updateRecList(MythUIButtonListItem *sel_item)
    14151429{
    14161430    if (!sel_item)
  • mythtv/programs/mythfrontend/playbackbox.h

    diff --git a/mythtv/programs/mythfrontend/playbackbox.h b/mythtv/programs/mythfrontend/playbackbox.h
    index 8ea5c0d..cafcd1b 100644
    a b class PlaybackBox : public ScheduleCommon 
    141141    void ItemVisible(MythUIButtonListItem *item);
    142142    void ItemLoaded(MythUIButtonListItem *item);
    143143    void selected(MythUIButtonListItem *item);
     144    void updateRecGroup(MythUIButtonListItem *sel_item);
    144145    void PlayFromBookmarkOrProgStart(MythUIButtonListItem *item = NULL);
    145146    void PlayFromBookmark(MythUIButtonListItem *item = NULL);
    146147    void PlayFromBeginning(MythUIButtonListItem *item = NULL);
  • mythtv/themes/MythCenter-wide/recordings-ui.xml

    diff --git a/mythtv/themes/MythCenter-wide/recordings-ui.xml b/mythtv/themes/MythCenter-wide/recordings-ui.xml
    index f5729a6..3bb79cb 100644
    a b  
    3838            <arrange>stack</arrange>
    3939            <align>top,hcenter</align>
    4040            <spacing>0</spacing>
     41            <focusorder>2</focusorder>
    4142            <scrollstyle>free</scrollstyle>
    4243            <wrapstyle>items</wrapstyle>
    4344            <layout>horizontal</layout>
     
    7879                    </group>
    7980                </state>
    8081
    81                 <state name="selectedactive" from="selectedinactive" />
     82                <state name="selectedactive" from="selectedinactive">
     83                    <group name="areagroup">
     84                        <shape name="recGroupShape">
     85                            <line color="#ffff00" width="3" alpha="255" />
     86                        </shape>
     87                    </group>
     88                </state>
    8289
    8390                <state name="inactive" from="selectedinactive">
    8491                    <area>0,0,100%,100%</area>
     
    96103                    </group>
    97104                </state>
    98105
    99                 <state name="active" from="inactive" />
     106                <state name="active" from="selectedinactive">
     107                    <group name="areagroup">
     108                        <shape name="recGroupShape">
     109                            <line color="#ffff00" width="3" alpha="100" />
     110                        </shape>
     111                    </group>
     112                </state>
    100113
    101114            </statetype>
    102115
     
    127140            <spacing>0</spacing>
    128141            <wrapstyle>captive</wrapstyle>
    129142            <searchposition>-1,390</searchposition>
    130             <triggerevent context="Global" action="ESCAPE">LEFT</triggerevent>
     143            <!-- <triggerevent context="Global" action="ESCAPE">LEFT</triggerevent> -->
    131144            <statetype name="buttonitem">
    132145                <state name="active" >
    133146                    <area>5,0,310,30</area>
  • mythtv/themes/MythCenter/recordings-ui.xml

    diff --git a/mythtv/themes/MythCenter/recordings-ui.xml b/mythtv/themes/MythCenter/recordings-ui.xml
    index 5500fd7..e9020bc 100644
    a b  
    3838            <arrange>stack</arrange>
    3939            <align>top,hcenter</align>
    4040            <spacing>0</spacing>
     41            <focusorder>2</focusorder>
    4142            <scrollstyle>free</scrollstyle>
    4243            <wrapstyle>items</wrapstyle>
    4344            <layout>horizontal</layout>
     
    7879                    </group>
    7980                </state>
    8081
    81                 <state name="selectedactive" from="selectedinactive" />
     82                <state name="selectedactive" from="selectedinactive">
     83                    <group name="areagroup">
     84                        <shape name="recGroupShape">
     85                            <line color="#ffff00" width="3" alpha="255" />
     86                        </shape>
     87                    </group>
     88                </state>
    8289
    8390                <state name="inactive" from="selectedinactive">
    8491                    <area>0,0,100%,100%</area>
     
    96103                    </group>
    97104                </state>
    98105
    99                 <state name="active" from="inactive" />
     106                <state name="active" from="selectedinactive">
     107                    <group name="areagroup">
     108                        <shape name="recGroupShape">
     109                            <line color="#ffff00" width="3" alpha="100" />
     110                        </shape>
     111                    </group>
     112                </state>
    100113
    101114            </statetype>
    102115
     
    127140            <spacing>0</spacing>
    128141            <wrapstyle>selection</wrapstyle>
    129142            <searchposition>-1,390</searchposition>
    130             <triggerevent context="Global" action="ESCAPE">LEFT</triggerevent>
     143            <!-- <triggerevent context="Global" action="ESCAPE">LEFT</triggerevent> -->
    131144            <statetype name="buttonitem">
    132145                <state name="active" >
    133146                    <area>0,0,220,30</area>
  • mythtv/themes/default-wide/recordings-ui.xml

    diff --git a/mythtv/themes/default-wide/recordings-ui.xml b/mythtv/themes/default-wide/recordings-ui.xml
    index 083f2f5..42c7389 100644
    a b  
    2121            <align>center</align>
    2222            <!-- only allow one button to fix -->
    2323            <spacing>880</spacing>
     24            <focusorder>2</focusorder>
    2425            <scrollstyle>center</scrollstyle>
    2526            <wrapstyle>items</wrapstyle>
    2627            <layout>horizontal</layout>
  • mythtv/themes/default/recordings-ui.xml

    diff --git a/mythtv/themes/default/recordings-ui.xml b/mythtv/themes/default/recordings-ui.xml
    index 7401397..13eeff8 100644
    a b  
    2121            <align>center</align>
    2222            <!-- only allow one button to fix -->
    2323            <spacing>500</spacing>
     24            <focusorder>2</focusorder>
    2425            <scrollstyle>center</scrollstyle>
    2526            <wrapstyle>items</wrapstyle>
    2627            <layout>horizontal</layout>