Ticket #2978: prompt_livetv_exit_r12644-with-new-fns.diff
File prompt_livetv_exit_r12644-with-new-fns.diff, 7.2 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/tv_play.h
131 131 void PromptStopWatchingRecording(void); 132 132 void PromptDeleteRecording(QString title); 133 133 bool PromptRecGroupPassword(void); 134 134 bool BookmarkAllowed(void); 135 bool DeleteAllowed(void); 135 136 136 137 // Boolean queries 137 138 -
libs/libmythtv/tv_play.cpp
2362 2362 { 2363 2363 int result = GetOSD()->GetDialogResponse(dialogname); 2364 2364 2365 if (result > 1) 2366 { 2367 if (!BookmarkAllowed()) 2368 result++; 2369 if (result > 2 && !DeleteAllowed()) 2370 result++; 2371 } 2372 2365 2373 switch (result) 2366 2374 { 2367 case 0: case 3:2375 case 0: case 4: 2368 2376 DoPause(); 2369 2377 break; 2370 case 1:2378 case 2: 2371 2379 nvp->SetBookmark(); 2372 2380 exitPlayer = true; 2373 2381 wantsToQuit = true; 2374 2382 break; 2375 case 4:2383 case 3: 2376 2384 dialogname = ""; 2377 2385 DoPause(); 2378 2386 PromptDeleteRecording( … … 2384 2392 break; 2385 2393 } 2386 2394 } 2387 else if (dialogname == "videoexitplayoptions")2388 {2389 int result = GetOSD()->GetDialogResponse(dialogname);2390 2391 switch (result)2392 {2393 case 0: case 1:2394 DoPause();2395 break;2396 default:2397 exitPlayer = true;2398 wantsToQuit = true;2399 break;2400 }2401 }2402 2395 else if (dialogname == "askdeleterecording") 2403 2396 { 2404 2397 int result = GetOSD()->GetDialogResponse(dialogname); … … 2780 2773 2781 2774 if (StateIsLiveTV(GetState())) 2782 2775 { 2783 if (nvp && gContext->GetNumSetting("PlaybackExitPrompt") == 2) 2784 nvp->SetBookmark(); 2785 if (nvp && gContext->GetNumSetting("AutomaticSetWatched", 0)) 2786 nvp->SetWatched(); 2787 exitPlayer = true; 2788 wantsToQuit = true; 2776 if (nvp && 12 & gContext->GetNumSetting("PlaybackExitPrompt")) 2777 PromptStopWatchingRecording(); 2778 else 2779 { 2780 exitPlayer = true; 2781 wantsToQuit = true; 2782 } 2789 2783 } 2790 2784 else 2791 2785 { 2792 if (nvp && gContext->GetNumSetting("PlaybackExitPrompt") == 1&&2786 if (nvp && 5 & gContext->GetNumSetting("PlaybackExitPrompt") && 2793 2787 !underNetworkControl && !prbuffer->InDVDMenuOrStillFrame()) 2794 2788 { 2795 2789 PromptStopWatchingRecording(); … … 7457 7451 } 7458 7452 } 7459 7453 7454 /* \fn TV::BookmarkAllowed(void) 7455 * \brief Returns true if bookmarks are allowed for the current player. 7456 */ 7457 bool TV::BookmarkAllowed(void) 7458 { 7459 if ((prbuffer->isDVD() && (!gContext->GetNumSetting("EnableDVDBookmark", 0) 7460 || prbuffer->DVD()->GetTotalTimeOfTitle() < 120)) || 7461 StateIsLiveTV(GetState()) || 7462 (playbackinfo->isVideo && !prbuffer->isDVD())) 7463 return false; 7460 7464 7465 return true; 7466 } 7467 7468 /* \fn TV::DeleteAllowed(void) 7469 * \brief Returns true if the delete menu option should be offered. 7470 */ 7471 bool TV::DeleteAllowed(void) 7472 { 7473 if (prbuffer->isDVD() || StateIsLiveTV(GetState())) 7474 return false; 7475 return true; 7476 } 7477 7461 7478 void 7462 7479 TV::PromptStopWatchingRecording(void) 7463 7480 { … … 7468 7485 7469 7486 dialogboxTimer.restart(); 7470 7487 QString message; 7488 QString videotype; 7471 7489 QStringList options; 7472 bool allowbookmark = true; 7473 bool allowdvdbookmark = gContext->GetNumSetting("EnableDVDBookmark", 0); 7474 if (prbuffer->isDVD()) 7475 { 7476 if (!allowdvdbookmark || 7477 prbuffer->DVD()->GetTotalTimeOfTitle() < 120) 7478 { 7479 allowbookmark = false; 7480 } 7481 } 7490 7491 if (StateIsLiveTV(GetState())) 7492 videotype = "Live TV"; 7493 else if (prbuffer->isDVD()) 7494 videotype = "this DVD"; 7482 7495 else if (playbackinfo->isVideo) 7483 allowbookmark = false; 7496 videotype = "this video"; 7497 else 7498 videotype = "this recording"; 7499 7500 message = tr("You are exiting %1").arg(videotype); 7484 7501 7485 if (playbackinfo && allowbookmark) 7502 options += tr("Exit to the menu"); 7503 7504 if (playbackinfo && BookmarkAllowed()) 7486 7505 { 7487 QString videotype = (prbuffer->isDVD()) ? "DVD":"recording"; 7488 message = tr("You are exiting this %1").arg(videotype); 7489 7490 options += tr("Save this position and go to the menu"); 7491 options += tr("Do not save, just exit to the menu"); 7492 options += tr("Keep watching"); 7493 if (!prbuffer->isDVD()) 7506 if(BookmarkAllowed()) 7507 options += tr("Save this position and go to the menu"); 7508 if(DeleteAllowed()) 7494 7509 options += tr("Delete this recording"); 7495 7496 dialogname = "exitplayoptions";7497 7510 } 7498 else7499 {7500 7511 7501 message = tr("You are exiting this Video/DVD"); 7502 7503 options += tr("Keep Watching"); 7504 options += tr("Exit Video"); 7505 7506 dialogname = "videoexitplayoptions"; 7507 } 7512 options += tr("Keep watching"); 7513 dialogname = "exitplayoptions"; 7508 7514 7509 7515 if (GetOSD()) 7510 7516 GetOSD()->NewDialogBox(dialogname, message, options, 0); … … 7561 7567 return false; 7562 7568 7563 7569 return (dialogname == "askdeleterecording" || 7564 dialogname == "exitplayoptions" || 7565 dialogname == "videoexitplayoptions"); 7570 dialogname == "exitplayoptions"); 7566 7571 } 7567 7572 7568 7573 void TV::setLastProgram(ProgramInfo *rcinfo) -
programs/mythfrontend/globalsettings.cpp
1241 1241 gc->setLabel(QObject::tr("Action on playback exit")); 1242 1242 gc->addSelection(QObject::tr("Just exit"), "0"); 1243 1243 gc->addSelection(QObject::tr("Save position and exit"), "2"); 1244 gc->addSelection(QObject::tr("Always prompt"), "1"); 1244 gc->addSelection(QObject::tr("Always prompt (excluding Live TV)"), "1"); 1245 gc->addSelection(QObject::tr("Always prompt (including Live TV)"), "4"); 1246 gc->addSelection(QObject::tr("Prompt for Live TV only"), "8"); 1245 1247 gc->setHelpText(QObject::tr("If set to prompt, a menu will be displayed " 1246 1248 "when you exit playback mode. The options available will " 1247 1249 "allow you to save your position, delete the "