Ticket #1629: autoexpire-actions.2.diff

File autoexpire-actions.2.diff, 3.5 KB (added by justifiably@…, 18 years ago)

(oops --- the previous version had a space leak, corrected here)

  • programs/mythbackend/autoexpire.cpp

     
    740740               "       progend,         filesize,    recgroup "
    741741               "FROM recorded "
    742742               "LEFT JOIN channel ON recorded.chanid = channel.chanid "
    743                "WHERE %1 "
     743               "WHERE %1 AND deletepending=0 "
    744744               "ORDER BY autoexpire DESC, %2").arg(where).arg(orderby);
    745745
    746746    query.prepare(querystr);
  • programs/mythfrontend/statusbox.h

     
    66#include "mythdialogs.h"
    77#include "uitypes.h"
    88#include "xmlparse.h"
     9#include "programinfo.h"
    910
    1011typedef QMap<QString, unsigned int> recprof2bps_t;
    1112
     
    6465    QMap<int, QString> contentData;
    6566    recprof2bps_t      recordingProfilesBPS;
    6667
     68    vector<ProgramInfo *> expList;
     69
    6770    MythMainWindow *my_parent;
    6871
    6972    bool isBackend;
  • programs/mythfrontend/statusbox.cpp

     
    2424#include "mythdbcon.h"
    2525#include "cardutil.h"
    2626
     27#define REC_CAN_BE_DELETED(rec) \
     28    ((((rec)->programflags & FL_INUSEPLAYING) == 0) && \
     29     ((((rec)->programflags & FL_INUSERECORDING) == 0) || \
     30      ((rec)->recgroup != "LiveTV")))
     31
     32
    2733/** \class StatusBox
    2834 *  \brief Reports on various status items.
    2935 *
     
    611617                }
    612618            }
    613619        }
     620        else if (currentItem == QObject::tr("AutoExpire List"))
     621        {
     622            ProgramInfo* rec;
    614623
    615         return;
     624            rec = expList[contentPos];
     625
     626            if (rec)
     627            {
     628              QStringList msgs;
     629              int retval;
     630
     631              msgs << QObject::tr("Delete Now");
     632              msgs << QObject::tr("Disable AutoExpire");
     633              msgs << QObject::tr("No Change");
     634             
     635              retval = MythPopupBox::showButtonPopup(my_parent,
     636                                                     QString("AutoExpirePopup"),
     637                                                     QObject::tr("AutoExpire Actions:"),
     638                                                     msgs, 2);
     639
     640              if (retval == 0 && REC_CAN_BE_DELETED(rec))
     641              {
     642                RemoteDeleteRecording(rec, false, false);
     643              }
     644              else if (retval == 1)
     645              {
     646                  rec->SetAutoExpire(0);
     647                  if ((rec)->recgroup == "LiveTV")
     648                    rec->ApplyRecordRecGroupChange("Default");
     649              }
     650
     651              // Update list, prevent selected item going off bottom
     652              doAutoExpireList();
     653              if (contentPos >= (int)expList.size()) 
     654                  contentPos = max((int)expList.size()-1,0);
     655            }
     656        }
     657        return;
    616658    }
    617659   
    618660    // Clear all visible content elements here
     
    12861328void StatusBox::doAutoExpireList()
    12871329{
    12881330    int                   count(0);
    1289     vector<ProgramInfo *> expList;
    12901331    ProgramInfo*          pginfo;
    12911332    QString               contentLine;
    12921333    QString               detailInfo;
     
    13001341    contentFont.clear();
    13011342    doScroll = true;
    13021343
     1344    vector<ProgramInfo *>::iterator it;
     1345    for (it = expList.begin(); it != expList.end(); it++)
     1346        delete *it;
     1347    expList.clear();
     1348
    13031349    RemoteGetAllExpiringRecordings(expList);
    13041350
    1305     vector<ProgramInfo *>::iterator it;
    13061351    for (it = expList.begin(); it != expList.end(); it++)
    13071352    {
    13081353        pginfo = *it;