Ticket #3952: linkage_frontend_menu.diff

File linkage_frontend_menu.diff, 6.4 KB (added by Wolfgang <mythtv@…>, 13 years ago)

alternative method, the linkage has its own menu accessed by "F1" key as default

  • themes/defaultosd/osd.xml

     
    345345    </textarea>
    346346  </container>
    347347
     348  <container name="linkmenu">
     349    <listtreemenu name="menu">
     350      <area>20,250,620,300</area>
     351      <listsize>0,0,600,200</listsize>
     352      <leveloffset>10</leveloffset>
     353      <gradient type="unselected" start="#505050" end="#000000" alpha="150">
     354      </gradient>
     355      <gradient type="selected" start="#52CA38" end="#349838" alpha="255">
     356      </gradient>
     357      <fcnfont name="infofont" function="active"></fcnfont>
     358      <fcnfont name="infofontgray" function="inactive"></fcnfont>
     359    </listtreemenu>
     360  </container>
     361
    348362</mythosdtheme>
  • themes/blueosd/osd.xml

     
    349349      <fcnfont name="infofontgray" function="inactive"></fcnfont>
    350350    </listtreemenu>
    351351  </container>
     352
     353  <container name="linkmenu">
     354    <listtreemenu name="menu">
     355      <area>20,250,620,300</area>
     356      <listsize>0,0,600,200</listsize>
     357      <leveloffset>10</leveloffset>
     358      <gradient type="unselected" start="#505050" end="#000000" alpha="100">
     359      </gradient>
     360      <gradient type="selected" start="#52CA38" end="#349838" alpha="255">
     361      </gradient>
     362      <fcnfont name="infofont" function="active"></fcnfont>
     363      <fcnfont name="infofontgray" function="inactive"></fcnfont>
     364    </listtreemenu>
     365  </container>
    352366   
    353 
    354367</mythosdtheme>
  • libs/libmythtv/tv_play.h

     
    360360    void BuildOSDTreeMenu(void);
    361361    void ShowOSDTreeMenu(void);
    362362
     363    void ShowOSDLinkMenu(void);
     364    bool FillLinkMenu(OSDGenericTree *linkMenu);
     365
    363366    void UpdateLCD(void);
    364367    void ShowLCDChannelInfo(void);
    365368    void ShowLCDDVDInfo(void);
     
    575578    // OSD info
    576579    QString         dialogname; ///< Name of current OSD dialog
    577580    OSDGenericTree *treeMenu;   ///< OSD menu, 'm' using default keybindings
     581    OSDGenericTree *linkMenu;   ///< OSD link menu, 'F1' using default keybindings
    578582    MythTimer  dialogboxTimer;  ///< How long a dialog box is on the screen
    579583
    580584    /// UDPNotify instance which shows messages sent
  • libs/libmythtv/tv_play.cpp

     
    383383    REG_KEY("TV Playback", "PLAY", "Play", "Ctrl+P");
    384384    REG_KEY("TV Playback", "JUMPPREV", "Jump to previously played recording", "");
    385385    REG_KEY("TV Playback", "JUMPREC", "Display menu of recorded programs to jump to", "");
     386    REG_KEY("TV Playback", "LINKMENU", "Display linked channels", "F1");
    386387    REG_KEY("TV Playback", "SIGNALMON", "Monitor Signal Quality", "F7");
    387388    REG_KEY("TV Playback", "JUMPTODVDROOTMENU", "Jump to the DVD Root Menu", "");
    388389    REG_KEY("TV Playback", "EXITSHOWNOPROMPTS","Exit Show without any prompts", "");
     
    540541      // RingBuffers
    541542      prbuffer(NULL), piprbuffer(NULL), activerbuffer(NULL),
    542543      // OSD info
    543       dialogname(""), treeMenu(NULL), udpnotify(NULL), osdlock(true),
     544      dialogname(""), treeMenu(NULL), linkMenu(NULL),
     545      udpnotify(NULL), osdlock(true),
    544546      // LCD Info
    545547      lcdTitle(""), lcdSubtitle(""), lcdCallsign(""),
    546548      // Window info (GUI is optional, transcoding, preview img, etc)
     
    734736    if (treeMenu)
    735737        delete treeMenu;
    736738
     739    if (linkMenu)
     740        delete linkMenu;
     741
    737742    if (playbackinfo)
    738743        delete playbackinfo;
    739744
     
    31063111                else
    31073112                    ChangeChannel(CHANNEL_DIRECTION_DOWN);
    31083113            }
     3114            else if (action == "LINKMENU")
     3115                ShowOSDLinkMenu();
    31093116            else if (action == "TOGGLEEDIT")
    31103117                StartChannelEditMode();
    31113118            else
     
    66286635         else if (RunPlaybackBoxPtr)
    66296636            EditSchedule(kPlaybackBox);
    66306637    }
     6638    else if (action.left(8) == "JUMPLINK")
     6639    {
     6640        ChangeChannel(action.section(" ",1,1).toInt(),"");
     6641    }
    66316642    else if (StateIsLiveTV(GetState()))
    66326643    {
    66336644        if (action == "TOGGLEPIPMODE")
     
    67196730    }
    67206731}
    67216732
     6733void TV::ShowOSDLinkMenu(void)
     6734{
     6735    if (linkMenu)
     6736        delete linkMenu;
     6737
     6738    linkMenu = new OSDGenericTree(NULL, "linkMenu");
     6739
     6740    if (GetOSD() && FillLinkMenu(linkMenu))
     6741    {
     6742        ClearOSD();
     6743
     6744        OSDListTreeType *tree = GetOSD()->ShowTreeMenu("linkmenu", linkMenu);
     6745        if (tree)
     6746        {
     6747            connect(tree, SIGNAL(itemSelected(OSDListTreeType *,OSDGenericTree *)),
     6748                    this, SLOT(TreeMenuSelected(OSDListTreeType *, OSDGenericTree *)));
     6749
     6750            connect(tree, SIGNAL(itemEntered(OSDListTreeType *, OSDGenericTree *)),
     6751                    this, SLOT(TreeMenuEntered(OSDListTreeType *, OSDGenericTree *)));
     6752        }
     6753    }
     6754}
     6755
    67226756void TV::BuildOSDTreeMenu(void)
    67236757{
    67246758    if (treeMenu)
     
    78407874    } 
    78417875}
    78427876
     7877bool TV::FillLinkMenu(OSDGenericTree *linkMenu)
     7878{
     7879    uint chanid = 0;
     7880    QString selStr = "JUMPLINK_";
     7881
     7882    chanid = playbackinfo->chanid.toUInt();
     7883    MSqlQuery query(MSqlQuery::InitCon());
     7884    query.prepare("SELECT linkage2.chanid,linkage2.subevent,program.title "
     7885                      "FROM linkage AS linkage1,linkage AS linkage2,program "
     7886                      "WHERE linkage1.chanid=:CHANID "
     7887                      "AND   linkage1.portal_chanid=linkage2.portal_chanid "
     7888                      "AND   linkage2.chanid = program.chanid "
     7889                      "AND   program.starttime<now() "
     7890                      "AND   program.endtime>now() "
     7891                      "ORDER BY program.starttime,linkage2.serviceid");
     7892
     7893    query.bindValue(":CHANID", chanid);
     7894
     7895    if (!query.exec() || !query.isActive())
     7896    {
     7897        MythContext::DBError("GetLinkage", query);
     7898        return false;
     7899    }
     7900
     7901    if (query.size() == 0)
     7902        return false;
     7903
     7904    while (query.next()) {
     7905        new OSDGenericTree(
     7906            linkMenu, QString::fromUtf8(query.value(1).toString()+":"+query.value(2).toString()), QString("JUMPLINK %1").arg(query.value(0).toString()));
     7907    }
     7908
     7909    return true;
     7910}
     7911
    78437912/* vim: set expandtab tabstop=4 shiftwidth=4: */