Ticket #8328: 126-StartNow.new.2.patch
File 126-StartNow.new.2.patch, 5.4 KB (added by , 14 years ago) |
---|
-
mythtv/programs/mythfrontend/schedulecommon.cpp
old new void ScheduleCommon::ShowRecordingDialog 186 186 menuPopup->SetReturnEvent(this, "schedulerecording"); 187 187 188 188 QDateTime now = QDateTime::currentDateTime(); 189 QDateTime nowp2 = now.addSecs(2 * 60 * 60); // two hours from now 189 190 190 if (recinfo.recstartts < now && recinfo.recendts > now) 191 if (recinfo.recstartts > now && recinfo.recstartts < nowp2 && recinfo.recstatus == rsWillRecord) 192 menuPopup->AddButton(tr("Start Now"), qVariantFromValue(recinfo)); 193 194 if (recinfo.recstatus == rsRecording) 191 195 { 192 if (recinfo.recstatus != rsRecording) 196 menuPopup->AddButton(tr("Stop recording"), 197 qVariantFromValue(recinfo)); 198 menuPopup->AddButton(tr("Change Ending Time"), 199 qVariantFromValue(recinfo)); 200 } 201 202 if (recinfo.recstartts <= now && recinfo.recendts > now && recinfo.recstatus != rsRecording) 193 203 menuPopup->AddButton(tr("Reactivate"), 194 204 qVariantFromValue(recinfo)); 195 else196 menuPopup->AddButton(tr("Stop recording"),197 qVariantFromValue(recinfo));198 }199 205 200 206 if (recinfo.recendts > now) 201 207 { … … void ScheduleCommon::ShowRecordingDialog 229 235 } 230 236 231 237 if (recinfo.rectype != kOverrideRecord && 232 recinfo.rectype != kDontRecord) 238 recinfo.rectype != kDontRecord && 239 recinfo.recstatus != rsRecording) 233 240 { 234 if (recinfo.recstatus == rsRecording) 235 { 236 menuPopup->AddButton(tr("Change Ending Time"), 237 qVariantFromValue(recinfo)); 238 } 239 else 241 menuPopup->AddButton(tr("Edit Options"), 242 qVariantFromValue(recinfo)); 243 244 if (recinfo.rectype != kSingleRecord && 245 recinfo.rectype != kFindOneRecord) 240 246 { 241 menuPopup->AddButton(tr(" Edit Options"),247 menuPopup->AddButton(tr("Add Override"), 242 248 qVariantFromValue(recinfo)); 243 244 if (recinfo.rectype != kSingleRecord &&245 recinfo.rectype != kFindOneRecord)246 {247 menuPopup->AddButton(tr("Add Override"),248 qVariantFromValue(recinfo));249 }250 249 } 251 250 } 252 251 253 if (recinfo.rectype == kOverrideRecord || 254 recinfo.rectype == kDontRecord) 252 if ((recinfo.rectype == kOverrideRecord || 253 recinfo.rectype == kDontRecord) && 254 (recinfo.recstatus != rsRecording)) 255 255 { 256 if (recinfo.recstatus == rsRecording) 257 { 258 menuPopup->AddButton(tr("Change Ending Time"), 259 qVariantFromValue(recinfo)); 260 } 261 else 262 { 263 menuPopup->AddButton(tr("Edit Override"), 264 qVariantFromValue(recinfo)); 265 menuPopup->AddButton(tr("Clear Override"), 266 qVariantFromValue(recinfo)); 267 } 256 menuPopup->AddButton(tr("Edit Override"), 257 qVariantFromValue(recinfo)); 258 menuPopup->AddButton(tr("Clear Override"), 259 qVariantFromValue(recinfo)); 268 260 } 269 261 } 270 262 … … void ScheduleCommon::customEvent(QEvent 522 514 { 523 515 MakeOverride(&recInfo); 524 516 } 517 else if (resulttext == tr("Start Now")) 518 { 519 RecordingRule *recrule = new RecordingRule(); 520 if (!recrule->LoadByProgram(static_cast<ProgramInfo*>(&recInfo))) 521 { 522 VERBOSE(VB_IMPORTANT, QString("Failed to load by program info")); 523 delete recrule; 524 return; 525 } 526 527 if (recInfo.rectype != kSingleRecord && 528 recInfo.rectype != kOverrideRecord && 529 recInfo.rectype != kFindOneRecord) 530 { 531 if (!recrule->MakeOverride()) 532 { 533 VERBOSE(VB_IMPORTANT, QString("Failed to make Override")); 534 delete recrule; 535 return; 536 } 537 recrule->m_type = kOverrideRecord; 538 } 539 540 QDateTime now = QDateTime::currentDateTime(); 541 int newoffset = recrule->m_startOffset; 542 newoffset += (now.secsTo(recInfo.recstartts) / 60) + 1; 543 recrule->m_startOffset = newoffset; 544 545 recrule->Save(); 546 delete recrule; 547 548 } 525 549 } 526 550 } 527 551 }