Пример #1
0
void WelcomeDialog::showMenu(void)
{
    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

    m_menuPopup = new MythDialogBox("Menu", popupStack, "actionmenu");

    if (m_menuPopup->Create())
        popupStack->AddScreen(m_menuPopup);

    m_menuPopup->SetReturnEvent(this, "action");

    QString mythshutdown_status = m_installDir + "/bin/mythshutdown --status 0";
    QByteArray tmpcmd = mythshutdown_status.toAscii();
    int statusCode = system(tmpcmd.constData());
    if (WIFEXITED(statusCode))
        statusCode = WEXITSTATUS(statusCode);

    if (statusCode & 16)
        m_menuPopup->AddButton(tr("Unlock Shutdown"), SLOT(unlockShutdown()));
    else
        m_menuPopup->AddButton(tr("Lock Shutdown"), SLOT(lockShutdown()));

    m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber()));
    m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow()));
    m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog()));
    m_menuPopup->AddButton(tr("Cancel"));
}
Пример #2
0
void WelcomeDialog::showMenu(void)
{
    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

    m_menuPopup = new MythDialogBox("Menu", popupStack, "actionmenu");

    if (m_menuPopup->Create())
        popupStack->AddScreen(m_menuPopup);

    m_menuPopup->SetReturnEvent(this, "action");

    QString mythshutdown_status = m_installDir + "/bin/mythshutdown --status 0";
    uint statusCode = myth_system(mythshutdown_status + logPropagateArgs);

    if (!(statusCode & 0xFF00) && statusCode & 16)
        m_menuPopup->AddButton(tr("Unlock Shutdown"), SLOT(unlockShutdown()));
    else
        m_menuPopup->AddButton(tr("Lock Shutdown"), SLOT(lockShutdown()));

    m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber()));
    m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow()));
    m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog()));
    m_menuPopup->AddButton(tr("Cancel"));
}