示例#1
0
void StartPrompter::backendRunningPrompt(void)
{
    bool backendIsRecording = false;
    // Get recording status
    if (!gCoreContext->IsConnectedToMaster() &&
        gCoreContext->ConnectToMasterServer(false))
    {
        backendIsRecording = RemoteGetRecordingStatus(NULL, false);
    }
    
    QString warning = tr("WARNING: The backend is currently running.")+"\n\n"+
                      tr("Changing existing card inputs, deleting anything, "
                     "or scanning for channels may not work.")+"\n\n";
    if (backendIsRecording)
    {
        warning += tr("Recording Status: RECORDING.")+"\n"+
                   tr("If you stop the backend now these recordings will be stopped!");
    }
    else
    {
        warning += tr("Recording Status: None.");
    }

    MythDialogBox *dia = new MythDialogBox(warning, m_d->stk, "actionmenu");

    if (!dia->Create())
    {
        LOG(VB_GENERAL, LOG_ERR, "Can't create Prompt dialog?");
        delete dia;
        quit();
    }

    // This is a hack so that the button clicks target the correct slot:
    dia->SetReturnEvent(this, QString());

    m_d->stk->AddScreen(dia);

    QString commandString = gCoreContext->GetSetting("BackendStopCommand");
    if (!commandString.isEmpty())
    {
        // Only show option to stop backend if command is defined.
        dia->AddButton(tr("Stop Backend and Continue"), SLOT(stopBackend()));
    }
    dia->AddButton(tr("Continue"), SLOT(leaveBackendRunning()));
    dia->AddButton(tr("Exit"), SLOT(quit()));
}
示例#2
0
bool WelcomeDialog::updateRecordingList()
{
    {
        // clear pending flag early in case something happens while
        // we're updating
        QMutexLocker lock(&m_RecListUpdateMuxtex);
        setPendingRecListUpdate(false);
    }

    m_tunerList.clear();
    m_isRecording = false;
    m_screenTunerNo = 0;

    if (!gCoreContext->IsConnectedToMaster())
        return false;

    m_isRecording = RemoteGetRecordingStatus(&m_tunerList, true);

    return true;
}
示例#3
0
void IdleScreen::UpdateStatus(void)
{
    QString state = "idle";

    if (CheckConnectionToServer())
    {
        if (m_secondsToShutdown >= 0)
            state = "shuttingdown";
        else if (RemoteGetRecordingStatus())
            state = "recording";
    }
    else
    {
        state = "offline";
    }

    m_statusState->DisplayState(state);

    MythUIType* shuttingdown = m_statusState->GetState("shuttingdown");

    if (shuttingdown)
    {
        MythUIText *statusText = dynamic_cast<MythUIText *>(shuttingdown->GetChild("status"));

        if (statusText)
        {
            if (m_secondsToShutdown >= 0)
            {
                QString status = tr("Backend will shutdown in %n "
                                    "second(s).", "", m_secondsToShutdown);

                statusText->SetText(status);
            }
            else
                statusText->Reset();
        }
    }
}