Ticket #3446: mythtv-quitmenu1.diff

File mythtv-quitmenu1.diff, 2.2 KB (added by directhex@…, 17 years ago)

Exit menu patch

  • main.cpp

    old new  
    451451    // first of all find out, if this is a frontend only host...
    452452    bool frontendOnly = gContext->IsFrontendOnly();
    453453
     454    // how do you want to quit today?
     455    int  exitMenuStyle = gContext->GetNumSetting("OverrideExitMenu", 0);
     456
    454457    QString title = QObject::tr("Do you really want to exit MythTV?");
    455458
    456459    DialogBox diag(gContext->GetMainWindow(), title);
    457460    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))
    460465        diag.AddButton(QObject::tr("Yes, Exit and Shutdown"));
    461466
    462467    int result = diag.exec();
     468    if ((exitMenuStyle == 3) && (result == 2))
     469        result = 3;
    463470    switch (result)
    464471    {
    465472        case 1: return NO_EXIT;
  • globalsettings.cpp

    old new  
    13371337    return gc;
    13381338}
    13391339
     1340static 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
    13401355static HostCheckBox *NoPromptOnExit()
    13411356{
    13421357    HostCheckBox *gc = new HostCheckBox("NoPromptOnExit");
     
    33743389    general->addChild(AllowQuitShutdown());
    33753390    general->addChild(NoPromptOnExit());
    33763391    general->addChild(HaltCommand());
     3392    general->addChild(OverrideExitMenu());
    33773393    general->addChild(LircKeyPressedApp());
    33783394    general->addChild(UseArrowAccels());
    33793395    general->addChild(NetworkControlEnabled());