Ticket #2503: playbackbox_storage_popup_11349.diff
File playbackbox_storage_popup_11349.diff, 6.1 KB (added by , 18 years ago) |
---|
-
programs/mythfrontend/playbackbox.cpp
206 206 recGroupLineEdit(NULL), recGroupLineEdit1(NULL), 207 207 recGroupOldPassword(NULL), recGroupNewPassword(NULL), 208 208 recGroupOkButton(NULL), 209 // Storage popup support 210 storageAutoExpireButton(NULL), storagePreserveEpisodeButton(NULL), 209 211 // Main Recording List support 210 212 fillListTimer(new QTimer(this)), connected(false), 211 213 titleIndex(0), progIndex(0), … … 2780 2782 popup->addButton(tr("Change Playback Group"), this, 2781 2783 SLOT(showPlayGroupChanger())); 2782 2784 2785 QString buttonLabel; 2783 2786 if (delitem && delitem->GetAutoExpireFromRecorded()) 2784 popup->addButton(tr("Disable Auto Expire"), this, SLOT(noAutoExpire()));2787 buttonLabel = "Disable Auto Expire"; 2785 2788 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); 2787 2793 2788 2794 if (delitem && delitem->UsesMaxEpisodes()) 2789 2795 { 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"; 2792 2798 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); 2794 2804 } 2795 2805 2796 popup->ShowPopup(this, SLOT( doCancel()));2806 popup->ShowPopup(this, SLOT(storageDoCancel())); 2797 2807 storageButton->setFocus(); 2798 2808 2799 2809 expectingPopup = true; … … 3128 3138 playSelectedPlaylist(true); 3129 3139 } 3130 3140 3131 void PlaybackBox::doPreserveEpisode(void)3132 {3133 if (!expectingPopup)3134 return;3135 3136 cancelPopup();3137 3138 if (delitem->availableStatus != asAvailable)3139 showAvailablePopup(delitem);3140 else3141 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 else3154 delitem->SetPreserveEpisode(false);3155 }3156 3157 3141 void PlaybackBox::askStop(void) 3158 3142 { 3159 3143 if (!expectingPopup) … … 3548 3532 update(drawListBounds); 3549 3533 } 3550 3534 3551 void PlaybackBox::noAutoExpire(void) 3535 3536 void PlaybackBox::autoExpireToggle() 3552 3537 { 3553 3538 if (!expectingPopup && delitem) 3554 3539 return; 3555 3540 3556 cancelPopup(); 3541 ProgramInfo *tmpItem = findMatchingProg(delitem); 3542 if (delitem->GetAutoExpireFromRecorded()) 3543 { 3544 delitem->SetAutoExpire(0); 3557 3545 3558 delitem->SetAutoExpire(0); 3546 if (tmpItem) 3547 tmpItem->programflags &= ~FL_AUTOEXP; 3559 3548 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); 3563 3554 3564 delete delitem;3565 delitem = NULL;3555 if (tmpItem) 3556 tmpItem->programflags |= FL_AUTOEXP; 3566 3557 3567 previewVideoState = kChanging; 3558 storageAutoExpireButton->setText(tr("Disable Auto Expire")); 3559 } 3560 } 3568 3561 3569 update(drawListBounds); 3562 void 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 } 3570 3582 } 3571 3583 3572 void PlaybackBox::do AutoExpire(void)3584 void PlaybackBox::doCancel(void) 3573 3585 { 3574 3586 if (!expectingPopup) 3575 3587 return; 3576 3588 3577 3589 cancelPopup(); 3578 3590 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 3588 3591 previewVideoState = kChanging; 3589 3590 update(drawListBounds);3591 3592 } 3592 3593 3593 void PlaybackBox:: doCancel(void)3594 void PlaybackBox::storageDoCancel(void) 3594 3595 { 3595 3596 if (!expectingPopup) 3596 3597 return; 3597 3598 3598 cancelPopup();3599 3600 previewVideoState = kChanging;3599 storageAutoExpireButton = NULL; 3600 storagePreserveEpisodeButton = NULL; 3601 doCancel(); 3601 3602 } 3602 3603 3603 3604 void PlaybackBox::toggleTitleView(void) -
programs/mythfrontend/playbackbox.h
163 163 void setWatched(); 164 164 void setUnwatched(); 165 165 166 void doAutoExpire(); 167 void noAutoExpire(); 168 void doPreserveEpisode(); 169 void noPreserveEpisode(); 170 166 void autoExpireToggle(); 167 void preserveEpisodeToggle(); 168 171 169 void doCancel(); 170 void storageDoCancel(); 172 171 void toggleTitleView(); 173 172 174 173 void exitWin(); … … 372 371 MythLineEdit *recGroupNewPassword; 373 372 MythPushButton *recGroupOkButton; 374 373 374 // Storage popup support 375 MythPushButton *storageAutoExpireButton; 376 MythPushButton *storagePreserveEpisodeButton; 377 375 378 // State Variables //////////////////////////////////////////////////////// 376 379 // Main Recording List support 377 380 QTimer *fillListTimer;