Ticket #3446: mythtv-quitmenu1.diff
File mythtv-quitmenu1.diff, 2.2 KB (added by , 17 years ago) |
---|
-
main.cpp
old new 451 451 // first of all find out, if this is a frontend only host... 452 452 bool frontendOnly = gContext->IsFrontendOnly(); 453 453 454 // how do you want to quit today? 455 int exitMenuStyle = gContext->GetNumSetting("OverrideExitMenu", 0); 456 454 457 QString title = QObject::tr("Do you really want to exit MythTV?"); 455 458 456 459 DialogBox diag(gContext->GetMainWindow(), title); 457 460 diag.AddButton(QObject::tr("No")); 458 diag.AddButton(QObject::tr("Yes, Exit now")); 459 if (frontendOnly) 461 if (exitMenuStyle < 3) 462 diag.AddButton(QObject::tr("Yes, Exit now")); 463 if ((exitMenuStyle == 0 && frontendOnly) || 464 (exitMenuStyle > 1 && exitMenuStyle < 4)) 460 465 diag.AddButton(QObject::tr("Yes, Exit and Shutdown")); 461 466 462 467 int result = diag.exec(); 468 if ((exitMenuStyle == 3) && (result == 2)) 469 result = 3; 463 470 switch (result) 464 471 { 465 472 case 1: return NO_EXIT; -
globalsettings.cpp
old new 1337 1337 return gc; 1338 1338 } 1339 1339 1340 static HostComboBox *OverrideExitMenu() 1341 { 1342 HostComboBox *gc = new HostComboBox("OverrideExitMenu"); 1343 gc->setLabel(QObject::tr("Exit menu style")); 1344 gc->addSelection(QObject::tr("Autodetect"), "0"); 1345 gc->addSelection(QObject::tr("Show quit"), "1"); 1346 gc->addSelection(QObject::tr("Show quit and shutdown"), "2"); 1347 gc->addSelection(QObject::tr("Show shutdown"), "3"); 1348 gc->setHelpText(QObject::tr("MythTV automatically determines which " 1349 "options to show in the exit menu. If you wish, you may " 1350 "force specific options to display, to suit your " 1351 "configuration.")); 1352 return gc; 1353 } 1354 1340 1355 static HostCheckBox *NoPromptOnExit() 1341 1356 { 1342 1357 HostCheckBox *gc = new HostCheckBox("NoPromptOnExit"); … … 3374 3389 general->addChild(AllowQuitShutdown()); 3375 3390 general->addChild(NoPromptOnExit()); 3376 3391 general->addChild(HaltCommand()); 3392 general->addChild(OverrideExitMenu()); 3377 3393 general->addChild(LircKeyPressedApp()); 3378 3394 general->addChild(UseArrowAccels()); 3379 3395 general->addChild(NetworkControlEnabled());