Ticket #2930: livetv.patch

File livetv.patch, 2.9 KB (added by Robin Neatherway <robthebob+myth@…>, 16 years ago)
  • libs/libmythtv/tv_play.cpp

     
    126126            int numrecordings = reclist->size();
    127127            if (numrecordings > 0)
    128128            {
    129                 if (numrecordings == 1)
     129                ProgramInfo *p = NULL;
     130                QStringList recTitles;
     131                QString buttonTitle;
     132                vector<ProgramInfo *>::iterator it = reclist->begin();
     133                recTitles.append(tr("Exit"));
     134                while (it != reclist->end())
    130135                {
    131                     curProgram = new ProgramInfo(*reclist->at(0));
     136                    p = *it;
     137                    buttonTitle = tr("Chan %1: %2")
     138                        .arg(p->chanstr).arg(p->title);
     139                    recTitles.append(buttonTitle);
     140                    it++;
    132141                }
     142                DialogCode ret = MythPopupBox::ShowButtonPopup(
     143                    gContext->GetMainWindow(),
     144                    "",
     145                    tr("All Tuners are Busy.\n"
     146                       "Select a Current Recording"),
     147                    recTitles, kDialogCodeButton1);
     148
     149                int idx = MythDialog::CalcItemIndex(ret) - 1;
     150                if ((0 <= idx) && (idx < (int)reclist->size()))
     151                {
     152                    p = reclist->at(idx);
     153                    curProgram = new ProgramInfo(*p);
     154                }
    133155                else
    134156                {
    135                     ProgramInfo *p = NULL;
    136                     QStringList recTitles;
    137                     QString buttonTitle;
    138                     vector<ProgramInfo *>::iterator it = reclist->begin();
    139                     recTitles.append(tr("Exit"));
    140                     while (it != reclist->end())
    141                     {
    142                         p = *it;
    143                         buttonTitle = tr("Chan %1: %2")
    144                             .arg(p->chanstr).arg(p->title);
    145                         recTitles.append(buttonTitle);
    146                         it++;
    147                     }
    148                     DialogCode ret = MythPopupBox::ShowButtonPopup(
    149                         gContext->GetMainWindow(),
    150                         "",
    151                         tr("All Tuners are Busy.\n"
    152                            "Select a Current Recording"),
    153                         recTitles, kDialogCodeButton1);
    154 
    155                     int idx = MythDialog::CalcItemIndex(ret) - 1;
    156                     if ((0 <= idx) && (idx < (int)reclist->size()))
    157                     {
    158                         p = reclist->at(idx);
    159                         curProgram = new ProgramInfo(*p);
    160                     }
    161                     else
    162                     {
    163                         quitAll = true;
    164                     }
     157                    quitAll = true;
    165158                }
    166159            }
    167160