Ticket #1480: mythtv-file_not_found_action_dialog.patch

File mythtv-file_not_found_action_dialog.patch, 3.2 KB (added by sphery <mtdean@…>, 14 years ago)
  • programs/mythfrontend/playbackbox.h

     
    237237    void promptEndOfRecording(ProgramInfo *);
    238238    void showDeletePopup(ProgramInfo *, deletePopupType);
    239239    void showActionPopup(ProgramInfo *program);
     240    void showFileNotFoundActionPopup(ProgramInfo *program);
    240241    void initPopup(MythPopupBox *popup, ProgramInfo *program,
    241242                   QString message, QString message2);
    242243    void cancelPopup();
  • programs/mythfrontend/playbackbox.cpp

     
    12471247        paintSkipUpdate = false;
    12481248        update(drawTotalBounds);
    12491249    }
     1250    else if (arrowAccel)
     1251        showActionsSelected();
    12501252    else if (curitem && curitem->availableStatus != asAvailable)
    12511253        showAvailablePopup(curitem);
    1252     else if (arrowAccel)
    1253         showActionsSelected();   
    12541254}
    12551255
    12561256void PlaybackBox::cursorDown(bool page, bool newview)
     
    18631863    if (inTitle && haveGroupInfoSet)
    18641864        return;
    18651865
    1866     if (curitem->availableStatus != asAvailable)
     1866    if ((curitem->availableStatus != asAvailable) &&
     1867        (curitem->availableStatus != asFileNotFound))
    18671868        showAvailablePopup(curitem);
    18681869    else
    18691870        showActions(curitem);
     
    20492050
    20502051    delitem = new ProgramInfo(*toExp);
    20512052
    2052     if (delitem->availableStatus != asAvailable)
     2053    if (fileExists(delitem) == false)
     2054    {
     2055        QString msg =
     2056            QString("PlaybackBox::showActions(): Error, %1 file not found")
     2057            .arg(delitem->pathname);
     2058        VERBOSE(VB_IMPORTANT, msg);
     2059
     2060        ProgramInfo *tmpItem = findMatchingProg(delitem);
     2061        if (tmpItem)
     2062        {
     2063            tmpItem->availableStatus = asFileNotFound;
     2064            showFileNotFoundActionPopup(delitem);
     2065        }
     2066
     2067    }
     2068    else if (delitem->availableStatus != asAvailable)
    20532069        showAvailablePopup(delitem);
    20542070    else
    20552071        showActionPopup(delitem);
     
    26282644    expectingPopup = true;
    26292645}
    26302646
     2647void PlaybackBox::showFileNotFoundActionPopup(ProgramInfo *program)
     2648{
     2649    if (!curitem || !program)
     2650        return;
     2651
     2652    popup = new MythPopupBox(gContext->GetMainWindow(), drawPopupSolid,
     2653                             drawPopupFgColor, drawPopupBgColor,
     2654                             drawPopupSelColor, "action popup");
     2655
     2656    QString msg = QObject::tr("Recording Unavailable") + "\n";
     2657    msg += QObject::tr("The file for this recording can "
     2658                       "not be found") + "\n";
     2659
     2660    initPopup(popup, program, "", msg);
     2661
     2662    QButton *detailsButton;
     2663    detailsButton = popup->addButton(tr("Show Program Details"), this,
     2664                                     SLOT(showProgramDetails()));
     2665
     2666    popup->addButton(tr("Delete"), this, SLOT(askDelete()));
     2667
     2668    popup->ShowPopup(this, SLOT(doCancel()));
     2669
     2670    detailsButton->setFocus();
     2671
     2672    expectingPopup = true;
     2673}
     2674
    26312675void PlaybackBox::initPopup(MythPopupBox *popup, ProgramInfo *program,
    26322676                            QString message, QString message2)
    26332677{