Ticket #2503: playbackbox_storage_popup_11349.diff

File playbackbox_storage_popup_11349.diff, 6.1 KB (added by perveilerj@…, 18 years ago)

Aggh! Attached wrong patch. This is the correct one (also against trunk r11204)

  • programs/mythfrontend/playbackbox.cpp

     
    206206      recGroupLineEdit(NULL),           recGroupLineEdit1(NULL),
    207207      recGroupOldPassword(NULL),        recGroupNewPassword(NULL),
    208208      recGroupOkButton(NULL),
     209      // Storage popup support
     210      storageAutoExpireButton(NULL),    storagePreserveEpisodeButton(NULL),
    209211      // Main Recording List support
    210212      fillListTimer(new QTimer(this)),  connected(false),
    211213      titleIndex(0),                    progIndex(0),
     
    27802782    popup->addButton(tr("Change Playback Group"), this,
    27812783                     SLOT(showPlayGroupChanger()));
    27822784
     2785    QString buttonLabel;
    27832786    if (delitem && delitem->GetAutoExpireFromRecorded())
    2784         popup->addButton(tr("Disable Auto Expire"), this, SLOT(noAutoExpire()));
     2787        buttonLabel = "Disable Auto Expire";
    27852788    else
    2786         popup->addButton(tr("Enable Auto Expire"), this, SLOT(doAutoExpire()));
     2789        buttonLabel = "Enable Auto Expire";
     2790    storageAutoExpireButton = new MythPushButton(tr(buttonLabel), popup);
     2791    connect(storageAutoExpireButton, SIGNAL(pressed()), this, SLOT(autoExpireToggle()));
     2792    popup->addWidget(storageAutoExpireButton, false);
    27872793
    27882794    if (delitem && delitem->UsesMaxEpisodes())
    27892795    {
    2790         if (delitem && delitem->GetPreserveEpisodeFromRecorded())
    2791             popup->addButton(tr("Do not preserve this episode"), this, SLOT(noPreserveEpisode()));
     2796        if (delitem->GetPreserveEpisodeFromRecorded())
     2797            buttonLabel = "Do not preserve this episode";
    27922798        else
    2793             popup->addButton(tr("Preserve this episode"), this, SLOT(doPreserveEpisode()));
     2799            buttonLabel = "Preserve this episode";
     2800
     2801        storagePreserveEpisodeButton = new MythPushButton(tr(buttonLabel), popup);
     2802        connect(storagePreserveEpisodeButton, SIGNAL(pressed()), this, SLOT(preserveEpisodeToggle()));
     2803        popup->addWidget(storagePreserveEpisodeButton, false);
    27942804    }
    27952805
    2796     popup->ShowPopup(this, SLOT(doCancel()));
     2806    popup->ShowPopup(this, SLOT(storageDoCancel()));
    27972807    storageButton->setFocus();
    27982808
    27992809    expectingPopup = true;
     
    31283138    playSelectedPlaylist(true);
    31293139}
    31303140
    3131 void PlaybackBox::doPreserveEpisode(void)
    3132 {
    3133     if (!expectingPopup)
    3134         return;
    3135 
    3136     cancelPopup();
    3137 
    3138     if (delitem->availableStatus != asAvailable)
    3139         showAvailablePopup(delitem);
    3140     else
    3141         delitem->SetPreserveEpisode(true);
    3142 }
    3143 
    3144 void PlaybackBox::noPreserveEpisode(void)
    3145 {
    3146     if (!expectingPopup)
    3147         return;
    3148 
    3149     cancelPopup();
    3150 
    3151     if (delitem->availableStatus != asAvailable)
    3152         showAvailablePopup(delitem);
    3153     else
    3154         delitem->SetPreserveEpisode(false);
    3155 }
    3156 
    31573141void PlaybackBox::askStop(void)
    31583142{
    31593143    if (!expectingPopup)
     
    35483532    update(drawListBounds);
    35493533}
    35503534
    3551 void PlaybackBox::noAutoExpire(void)
     3535
     3536void PlaybackBox::autoExpireToggle()
    35523537{
    35533538    if (!expectingPopup && delitem)
    35543539        return;
    35553540
    3556     cancelPopup();
     3541    ProgramInfo *tmpItem = findMatchingProg(delitem);
     3542    if (delitem->GetAutoExpireFromRecorded())
     3543    {
     3544        delitem->SetAutoExpire(0);
    35573545
    3558     delitem->SetAutoExpire(0);
     3546        if (tmpItem)
     3547            tmpItem->programflags &= ~FL_AUTOEXP;
    35593548
    3560     ProgramInfo *tmpItem = findMatchingProg(delitem);
    3561     if (tmpItem)
    3562         tmpItem->programflags &= ~FL_AUTOEXP;
     3549        storageAutoExpireButton->setText(tr("Enable Auto Expire"));
     3550    }
     3551    else
     3552    {
     3553        delitem->SetAutoExpire(1);
    35633554
    3564     delete delitem;
    3565     delitem = NULL;
     3555        if (tmpItem)
     3556            tmpItem->programflags |= FL_AUTOEXP;
    35663557
    3567     previewVideoState = kChanging;
     3558        storageAutoExpireButton->setText(tr("Disable Auto Expire"));
     3559    }
     3560}
    35683561
    3569     update(drawListBounds);
     3562void PlaybackBox::preserveEpisodeToggle()
     3563{   
     3564    if (!expectingPopup)
     3565        return;
     3566
     3567    if (delitem->availableStatus != asAvailable)
     3568        showAvailablePopup(delitem);
     3569    else
     3570    {
     3571        if (delitem->GetPreserveEpisodeFromRecorded())
     3572        {
     3573            delitem->SetPreserveEpisode(false);
     3574            storagePreserveEpisodeButton->setText(tr("Preserve this episode"));
     3575        }
     3576        else
     3577        {
     3578            delitem->SetPreserveEpisode(true);
     3579            storagePreserveEpisodeButton->setText(tr("Do not preserve this episode"));
     3580        }
     3581    }
    35703582}
    35713583
    3572 void PlaybackBox::doAutoExpire(void)
     3584void PlaybackBox::doCancel(void)
    35733585{
    35743586    if (!expectingPopup)
    35753587        return;
    35763588
    35773589    cancelPopup();
    35783590
    3579     delitem->SetAutoExpire(1);
    3580 
    3581     ProgramInfo *tmpItem = findMatchingProg(delitem);
    3582     if (tmpItem)
    3583         tmpItem->programflags |= FL_AUTOEXP;
    3584 
    3585     delete delitem;
    3586     delitem = NULL;
    3587 
    35883591    previewVideoState = kChanging;
    3589 
    3590     update(drawListBounds);
    35913592}
    35923593
    3593 void PlaybackBox::doCancel(void)
     3594void PlaybackBox::storageDoCancel(void)
    35943595{
    35953596    if (!expectingPopup)
    35963597        return;
    35973598
    3598     cancelPopup();
    3599 
    3600     previewVideoState = kChanging;
     3599    storageAutoExpireButton = NULL;
     3600    storagePreserveEpisodeButton = NULL;
     3601    doCancel();
    36013602}
    36023603
    36033604void PlaybackBox::toggleTitleView(void)
  • programs/mythfrontend/playbackbox.h

     
    163163    void setWatched();
    164164    void setUnwatched();
    165165
    166     void doAutoExpire();
    167     void noAutoExpire();
    168     void doPreserveEpisode();
    169     void noPreserveEpisode();
    170 
     166    void autoExpireToggle();
     167    void preserveEpisodeToggle();
     168   
    171169    void doCancel();
     170    void storageDoCancel();
    172171    void toggleTitleView();
    173172
    174173    void exitWin();
     
    372371    MythLineEdit       *recGroupNewPassword;
    373372    MythPushButton     *recGroupOkButton;
    374373
     374    // Storage popup support
     375    MythPushButton     *storageAutoExpireButton;
     376    MythPushButton     *storagePreserveEpisodeButton;
     377
    375378    // State Variables ////////////////////////////////////////////////////////
    376379    // Main Recording List support
    377380    QTimer             *fillListTimer;