Ticket #2978: ticket_2748_final.diff
File ticket_2748_final.diff, 7.2 KB (added by , 14 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
2419 2419 { 2420 2420 int result = GetOSD()->GetDialogResponse(dialogname); 2421 2421 2422 if (result > 0) 2423 { 2424 if (!BookmarkAllowed()) 2425 result++; 2426 if (result > 2 && !DeleteAllowed()) 2427 result++; 2428 } 2429 2422 2430 switch (result) 2423 2431 { 2424 case 0: case 3:2432 case 0: case 4: 2425 2433 DoPause(); 2426 2434 break; 2427 2435 case 1: … … 2429 2437 exitPlayer = true; 2430 2438 wantsToQuit = true; 2431 2439 break; 2432 case 4:2440 case 3: 2433 2441 dialogname = ""; 2434 2442 DoPause(); 2435 2443 PromptDeleteRecording( … … 2441 2449 break; 2442 2450 } 2443 2451 } 2444 else if (dialogname == "videoexitplayoptions")2445 {2446 int result = GetOSD()->GetDialogResponse(dialogname);2447 2448 switch (result)2449 {2450 case 0: case 1:2451 DoPause();2452 break;2453 default:2454 exitPlayer = true;2455 wantsToQuit = true;2456 break;2457 }2458 }2459 2452 else if (dialogname == "askdeleterecording") 2460 2453 { 2461 2454 int result = GetOSD()->GetDialogResponse(dialogname); … … 2859 2852 2860 2853 if (StateIsLiveTV(GetState())) 2861 2854 { 2862 if (nvp && gContext->GetNumSetting("PlaybackExitPrompt") == 2) 2863 nvp->SetBookmark(); 2864 if (nvp && gContext->GetNumSetting("AutomaticSetWatched", 0)) 2865 nvp->SetWatched(); 2866 exitPlayer = true; 2867 wantsToQuit = true; 2855 if (nvp && 12 & gContext->GetNumSetting("PlaybackExitPrompt")) 2856 PromptStopWatchingRecording(); 2857 else 2858 { 2859 exitPlayer = true; 2860 wantsToQuit = true; 2861 } 2868 2862 } 2869 2863 else 2870 2864 { 2871 if (nvp && gContext->GetNumSetting("PlaybackExitPrompt") == 1&&2865 if (nvp && 5 & gContext->GetNumSetting("PlaybackExitPrompt") && 2872 2866 !underNetworkControl && !prbuffer->InDVDMenuOrStillFrame()) 2873 2867 { 2874 2868 PromptStopWatchingRecording(); … … 7539 7533 } 7540 7534 } 7541 7535 7536 /* \fn TV::BookmarkAllowed(void) 7537 * \brief Returns true if bookmarks are allowed for the current player. 7538 */ 7539 bool TV::BookmarkAllowed(void) 7540 { 7541 if ((prbuffer->isDVD() && (!gContext->GetNumSetting("EnableDVDBookmark", 0) 7542 || prbuffer->DVD()->GetTotalTimeOfTitle() < 120)) || 7543 StateIsLiveTV(GetState()) || 7544 (playbackinfo->isVideo && !prbuffer->isDVD())) 7545 return false; 7542 7546 7547 return true; 7548 } 7549 7550 /* \fn TV::DeleteAllowed(void) 7551 * \brief Returns true if the delete menu option should be offered. 7552 */ 7553 bool TV::DeleteAllowed(void) 7554 { 7555 if (prbuffer->isDVD() || StateIsLiveTV(GetState())) 7556 return false; 7557 return true; 7558 } 7559 7543 7560 void 7544 7561 TV::PromptStopWatchingRecording(void) 7545 7562 { … … 7550 7567 7551 7568 dialogboxTimer.restart(); 7552 7569 QString message; 7570 QString videotype; 7553 7571 QStringList options; 7554 bool allowbookmark = true; 7555 bool allowdvdbookmark = gContext->GetNumSetting("EnableDVDBookmark", 0); 7556 if (prbuffer->isDVD()) 7557 { 7558 if (!allowdvdbookmark || 7559 prbuffer->DVD()->GetTotalTimeOfTitle() < 120) 7560 { 7561 allowbookmark = false; 7562 } 7563 } 7572 7573 if (StateIsLiveTV(GetState())) 7574 videotype = "Live TV"; 7575 else if (prbuffer->isDVD()) 7576 videotype = "this DVD"; 7564 7577 else if (playbackinfo->isVideo) 7565 allowbookmark = false; 7578 videotype = "this Video"; 7579 else 7580 videotype = "this recording"; 7581 7582 message = tr("You are exiting %1").arg(videotype); 7566 7583 7567 if (playbackinfo && allowbookmark)7584 if (playbackinfo && BookmarkAllowed()) 7568 7585 { 7569 QString videotype = (prbuffer->isDVD()) ? "DVD":"recording";7570 message = tr("You are exiting this %1").arg(videotype);7571 7572 7586 options += tr("Save this position and go to the menu"); 7573 7587 options += tr("Do not save, just exit to the menu"); 7574 options += tr("Keep watching");7575 if (!prbuffer->isDVD())7576 options += tr("Delete this recording");7577 7578 dialogname = "exitplayoptions";7579 7588 } 7580 7589 else 7581 {7590 options += tr("Exit %1").arg(videotype); 7582 7591 7583 message = tr("You are exiting this Video/DVD"); 7584 7585 options += tr("Keep Watching"); 7586 options += tr("Exit Video"); 7587 7588 dialogname = "videoexitplayoptions"; 7589 } 7592 if (playbackinfo && DeleteAllowed()) 7593 options += tr("Delete this recording"); 7590 7594 7595 options += tr("Keep watching"); 7596 dialogname = "exitplayoptions"; 7597 7591 7598 if (GetOSD()) 7592 7599 GetOSD()->NewDialogBox(dialogname, message, options, 0); 7593 7600 } … … 7643 7650 return false; 7644 7651 7645 7652 return (dialogname == "askdeleterecording" || 7646 dialogname == "exitplayoptions" || 7647 dialogname == "videoexitplayoptions"); 7653 dialogname == "exitplayoptions"); 7648 7654 } 7649 7655 7650 7656 void TV::setLastProgram(ProgramInfo *rcinfo) -
programs/mythfrontend/globalsettings.cpp
1243 1243 gc->setLabel(QObject::tr("Action on playback exit")); 1244 1244 gc->addSelection(QObject::tr("Just exit"), "0"); 1245 1245 gc->addSelection(QObject::tr("Save position and exit"), "2"); 1246 gc->addSelection(QObject::tr("Always prompt"), "1"); 1246 gc->addSelection(QObject::tr("Always prompt (excluding Live TV)"), "1"); 1247 gc->addSelection(QObject::tr("Always prompt (including Live TV)"), "4"); 1248 gc->addSelection(QObject::tr("Prompt for Live TV only"), "8"); 1247 1249 gc->setHelpText(QObject::tr("If set to prompt, a menu will be displayed " 1248 1250 "when you exit playback mode. The options available will " 1249 1251 "allow you to save your position, delete the "