Ticket #6066: patch.diff

File patch.diff, 3.9 KB (added by ralfd, 14 years ago)

patch to fix the shutdown issue

  • mythtv-0-23/mythtv/programs/mythbackend/scheduler.cpp

     
    20542054                        for ( ; idleIter != reclist.end(); idleIter++)
    20552055                            if ((*idleIter)->recstatus == rsWillRecord)
    20562056                                break;
    2057 
     2057   
    20582058                        if (idleIter != reclist.end())
    20592059                        {
    20602060                            if (curtime.secsTo((*idleIter)->recstartts) -
    2061                                 prerollseconds > idleWaitForRecordingTime * 60)
     2061                                prerollseconds >                     
     2062                                (idleWaitForRecordingTime * 60) +
     2063                                idleTimeoutSecs)
    20622064                            {
    20632065                                idleSince = curtime;
    20642066                            }
     
    20962098                        {
    20972099                            int itime = idleSince.secsTo(curtime);
    20982100                            QString msg;
     2101                           
    20992102                            if (itime == 1)
    21002103                            {
    21012104                                msg = QString("I\'m idle now... shutdown will "
  • mythtv-0-23/mythtv/programs/mythwelcome/welcomedialog.h

     
    7272    QDateTime      m_nextRecordingStart;
    7373    int            m_preRollSeconds;
    7474    int            m_idleWaitForRecordingTime;
     75    int            m_idleTimeoutSecs;
    7576    uint           m_screenTunerNo;
    7677    uint           m_screenScheduledNo;
    7778    uint           m_statusListNo;
  • mythtv-0-23/mythtv/programs/mythwelcome/welcomedialog.cpp

     
    3737    m_secondsToShutdown(-1),   m_preRollSeconds(0),    m_idleWaitForRecordingTime(0),
    3838    m_screenTunerNo(0),        m_screenScheduledNo(0), m_statusListNo(0),
    3939    m_frontendIsRunning(false),m_pendingRecListUpdate(false),
    40     m_pendingSchedUpdate(false)
     40    m_pendingSchedUpdate(false),                       m_idleTimeoutSecs(0)
    4141{
    4242    gContext->addListener(this);
    4343
     
    5252
    5353    // if idleTimeoutSecs is 0, the user disabled the auto-shutdown feature
    5454    m_bWillShutdown = (gContext->GetNumSetting("idleTimeoutSecs", 0) != 0);
     55   
     56    m_idleTimeoutSecs = gContext->GetNumSetting("idleTimeoutSecs", 0);
    5557
    5658    connect(m_updateStatusTimer, SIGNAL(timeout()),
    5759            this, SLOT(updateStatus()));
     
    517519    QDateTime curtime = QDateTime::currentDateTime();
    518520
    519521    if (!m_isRecording && !m_nextRecordingStart.isNull() &&
    520             curtime.secsTo(m_nextRecordingStart) -
    521             m_preRollSeconds < m_idleWaitForRecordingTime * 60)
     522        curtime.secsTo(m_nextRecordingStart) - m_preRollSeconds <
     523        (m_idleWaitForRecordingTime * 60) + m_idleTimeoutSecs)
    522524    {
    523525         m_statusList.append(tr("MythTV is about to start recording."));
    524526    }
     
    664666
    665667    // don't shutdown if we are about to start recording
    666668    if (!m_nextRecordingStart.isNull() &&
    667             curtime.secsTo(m_nextRecordingStart) -
    668             m_preRollSeconds < m_idleWaitForRecordingTime * 60)
     669        curtime.secsTo(m_nextRecordingStart) - m_preRollSeconds <
     670        (m_idleWaitForRecordingTime * 60) + m_idleTimeoutSecs)
    669671    {
    670672        MythPopupBox::showOkPopup(gContext->GetMainWindow(), "Cannot shutdown",
    671673                tr("Cannot shutdown because MythTV is about to start recording"));