Ticket #4743: playlistexpirystuff.patch

File playlistexpirystuff.patch, 5.4 KB (added by Justin Hornsby, 13 years ago)
  • programs/mythfrontend/playbackbox.cpp

     
    26132613
    26142614    if (playList.count())
    26152615    {
    2616         popup->addButton(tr("Playlist options"), this,
     2616        popup->addButton(tr("Playlist Actions"), this,
     2617                         SLOT(showPlaylistActionPopup()));
     2618        popup->addButton(tr("Playlist Operations"), this,
    26172619                         SLOT(showPlaylistPopup()));
    26182620    }
    26192621    else if (!m_player)
     
    29482950                             drawPopupFgColor, drawPopupBgColor,
    29492951                             drawPopupSelColor, "playlist popup");
    29502952
     2953    QLabel *toplabel = popup->addLabel(tr("Playlist Operations"),
     2954                                  MythPopupBox::Large, false);
     2955    toplabel->setAlignment(Qt::AlignCenter);
     2956
    29512957    QLabel *tlabel = NULL;
    29522958    if (playList.count() > 1)
    29532959    {
     2960        tlabel = popup->addLabel(tr("There are %1 items in the playlist. These "
     2961                                    "actions affect all items in the playlist")
     2962                                       .arg(playList.count()));
     2963    } else {
     2964        tlabel = popup->addLabel(tr("There is %1 item in the playlist. These "
     2965                                    "actions affect all items in the playlist")
     2966                                       .arg(playList.count()));
     2967    }
     2968    tlabel->setAlignment(Qt::AlignCenter | Qt::WordBreak);
     2969
     2970    QButton * changeRecgroupButton = popup->addButton(tr("Change Recording Group"), this,
     2971                     SLOT(doPlaylistChangeRecGroup()));
     2972    popup->addButton(tr("Change Playback Group"), this,
     2973                     SLOT(doPlaylistChangePlayGroup()));
     2974    popup->addButton(tr("Job Options"), this,
     2975                     SLOT(showPlaylistJobPopup()));
     2976    popup->addButton(tr("Delete"), this, SLOT(doPlaylistDelete()));
     2977    popup->addButton(tr("Delete, and allow re-record"), this,
     2978                     SLOT(doPlaylistDeleteForgetHistory()));
     2979    popup->addButton(tr("Disable Autoexpire"), this, SLOT(doPlaylistExpireSetOff()));
     2980    popup->addButton(tr("Enable Autoexpire"), this, SLOT(doPlaylistExpireSetOn()));
     2981
     2982    changeRecgroupButton->setFocus();
     2983
     2984    popup->ShowPopup(this, SLOT(PopupDone(int)));
     2985
     2986    expectingPopup = true;
     2987}
     2988
     2989void PlaybackBox::showPlaylistActionPopup()
     2990{
     2991    if (expectingPopup)
     2992       cancelPopup();
     2993
     2994    popup = new MythPopupBox(gContext->GetMainWindow(), drawPopupSolid,
     2995                             drawPopupFgColor, drawPopupBgColor,
     2996                             drawPopupSelColor, "playlist popup");
     2997
     2998    QLabel *toplabel2 = popup->addLabel(tr("Playlist Actions"),
     2999                                  MythPopupBox::Large, false);
     3000    toplabel2->setAlignment(Qt::AlignCenter);
     3001    QLabel *tlabel = NULL;
     3002    if (playList.count() > 1)
     3003    {
    29543004        tlabel = popup->addLabel(tr("There are %1 items in the playlist.")
    29553005                                       .arg(playList.count()));
    29563006    } else {
     
    29793029                         SLOT(togglePlayListItem()));
    29803030    }
    29813031
    2982     QLabel *label = popup->addLabel(
    2983                         tr("These actions affect all items in the playlist"));
    2984     label->setAlignment(Qt::AlignCenter | Qt::WordBreak);
    2985 
    2986     popup->addButton(tr("Change Recording Group"), this,
    2987                      SLOT(doPlaylistChangeRecGroup()));
    2988     popup->addButton(tr("Change Playback Group"), this,
    2989                      SLOT(doPlaylistChangePlayGroup()));
    2990     popup->addButton(tr("Job Options"), this,
    2991                      SLOT(showPlaylistJobPopup()));
    2992     popup->addButton(tr("Delete"), this, SLOT(doPlaylistDelete()));
    2993     popup->addButton(tr("Delete, and allow re-record"), this,
    2994                      SLOT(doPlaylistDeleteForgetHistory()));
    2995 
    29963032    playButton->setFocus();
    29973033
    29983034    popup->ShowPopup(this, SLOT(PopupDone(int)));
     
    37673803    previewVideoRefreshTimer->start(500);
    37683804}
    37693805
     3806void PlaybackBox::doPlaylistExpireSetOn()
     3807{
     3808    doPlaylistExpireSetting(true);
     3809}
     3810
     3811void PlaybackBox::doPlaylistExpireSetOff()
     3812{
     3813    doPlaylistExpireSetting(false);
     3814}
     3815
     3816void PlaybackBox::doPlaylistExpireSetting(bool turnOn)
     3817{
     3818    if (!expectingPopup)
     3819        return;
     3820
     3821    cancelPopup();
     3822
     3823    ProgramInfo *tmpItem;
     3824    QStringList::Iterator it;
     3825
     3826    for (it = playList.begin(); it != playList.end(); ++it )
     3827    {
     3828        tmpItem = findMatchingProg(*it);
     3829        tmpItem->SetAutoExpire(turnOn, true);
     3830    }
     3831
     3832    connected = FillList();
     3833    playList.clear();
     3834}
     3835
    37703836void PlaybackBox::doPlaylistDelete(void)
    37713837{
    37723838    playlistDelete(false);
  • programs/mythfrontend/playbackbox.h

     
    170170    void changeProfileAndTranscodeLow()
    171171             { changeProfileAndTranscode("Low Quality"); }
    172172    void showStoragePopup();
     173    void showPlaylistActionPopup();
    173174    void showPlaylistPopup();
    174175    void showPlaylistJobPopup();
    175176    void showProgramDetails();
     
    198199
    199200    void toggleAutoExpire(bool turnOn);
    200201    void togglePreserveEpisode(bool turnOn);
     202    void doPlaylistExpireSetting(bool turnOn);
     203    void doPlaylistExpireSetOff();
     204    void doPlaylistExpireSetOn();
    201205
    202206    void PopupDone(int r);
    203207    void toggleView(ViewMask itemMask, bool setOn);