Ticket #2838: mythwelcome-wakeupcmd.diff

File mythwelcome-wakeupcmd.diff, 2.0 KB (added by devel@…, 20 years ago)

Mythwelcome config page changes

  • programs/mythwelcome/welcomesettings.cpp

     
    110110//  mythshutdown script settings
    111111///////////////////////////////////////////////////////////////////
    112112
    113 static HostLineEdit *MythShutdownNvramCmd()
     113static HostComboBox *MythShutdownNvramCmd()
    114114{
    115     HostLineEdit *gc = new HostLineEdit("MythShutdownNvramCmd");
    116     gc->setLabel(QObject::tr("nvram-wakeup Command"));
    117     gc->setValue("/usr/bin/nvram-wakeup");
     115    HostComboBox *gc = new HostComboBox("MythShutdownNvramCmd", true);
     116    gc->setLabel(QObject::tr("Command to Set Wakeup Time"));
     117    gc->addSelection("/usr/bin/nvram-wakeup --settime $time");
    118118    gc->setHelpText(QObject::tr("Command to set the wakeup time in the BIOS. "
    119119                    "See the README file for more examples."));
    120120    return gc;
    121121};
    122122
     123static HostComboBox *WakeupTimeFormat()
     124{
     125    HostComboBox *gc = new HostComboBox("WakeupTimeFormat", true);
     126    gc->setLabel(QObject::tr("Wakeup time format"));
     127    gc->addSelection("time_t");
     128    gc->addSelection("yyyy-MM-dd hh:mm:ss");
     129    gc->setHelpText(QObject::tr("The format of the time string passed to the "
     130                    "\'Set Wakeup Time Command\' as $time. See "
     131                    "QT::QDateTime.toString() for details. Set to 'time_t' for "
     132                    "seconds since epoch (use time_t for nvram_wakeup)."));
     133    return gc;
     134};
     135
    123136static HostLineEdit *MythShutdownNvramRestartCmd()
    124137{
    125138    HostLineEdit *gc = new HostLineEdit("MythShutdownNvramRestartCmd");
     
    178191   
    179192    vcg->setLabel(QObject::tr("MythShutdown/MythWelcome Settings"));
    180193    vcg->addChild(MythShutdownNvramCmd());
     194    vcg->addChild(WakeupTimeFormat());
    181195    vcg->addChild(MythShutdownNvramRestartCmd());
    182196    vcg->addChild(MythShutdownReboot());
    183197    vcg->addChild(MythShutdownPowerOff());