コード例 #1
0
ファイル: example.cpp プロジェクト: adicarlo/mythtv
void AirPlayPictureScreen::Init(void)
{
    if (m_airplayImage)
    {
        if (!m_imageFilename.isEmpty())
        {
            m_airplayImage->SetFilename(m_imageFilename); // Absolute path, http or SG url
            m_airplayImage->Load(); // By default the image is loaded in a background thread, use LoadNow() to load in foreground
        }
        else
        {
            // Will default to displaying whatever placeholder image is defined
            // in the xml by the themer, means we can show _something_ rather than
            // a big empty hole. Generally you always want to call Reset() in
            // these circumstances
            m_airplayImage->Reset();
        }
    }

    if (m_airplayText)
    {
        if (!m_imageDescription.isEmpty())
        {
            m_airplayText->SetText(m_imageDescription);
        }
        else
        {
            // Same as above, calling Reset() allows for a sane, themer defined
            //default to be displayed
            m_airplayText->Reset();
        }
    }
}
コード例 #2
0
ファイル: mythscreentype.cpp プロジェクト: Olti/mythtv
bool MythScreenType::SetFocusWidget(MythUIType *widget)
{ 
    if (!widget || !widget->IsVisible())
    {
        QMap<int, MythUIType *>::iterator it = m_FocusWidgetList.begin();
        MythUIType *current;

        while (it != m_FocusWidgetList.end())
        {
            current = *it;

            if (current->CanTakeFocus() && current->IsVisible())
            {
                widget = current;
                break;
            }
            ++it;
        }
    }

    if (!widget)
        return false;

    if (m_CurrentFocusWidget == widget)
        return true;
    
    MythUIText *helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
    if (helpText)
        helpText->Reset();

    if (m_CurrentFocusWidget)
        m_CurrentFocusWidget->LoseFocus();
    m_CurrentFocusWidget = widget;
    m_CurrentFocusWidget->TakeFocus();

    if (helpText && !widget->GetHelpText().isEmpty())
        helpText->SetText(widget->GetHelpText());

    return true;
}
コード例 #3
0
ファイル: idlescreen.cpp プロジェクト: garybuhrmaster/mythtv
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();
        }
    }
}
コード例 #4
0
ファイル: mythscreentype.cpp プロジェクト: Olti/mythtv
static void DoResetMap(MythUIType *UItype, QHash<QString, QString> &infoMap)
{
    if (infoMap.isEmpty())
        return;

    QList<MythUIType *> *children = UItype->GetAllChildren();

    MythUIText *textType;
    QMutableListIterator<MythUIType *> i(*children);
    while (i.hasNext())
    {
        MythUIType *type = i.next();
        if (!type->IsVisible())
            continue;

        textType = dynamic_cast<MythUIText *> (type);
        if (textType && infoMap.contains(textType->objectName()))
            textType->Reset();

        MythUIGroup *group = dynamic_cast<MythUIGroup *> (type);
        if (group)
            DoResetMap(type, infoMap);
    }
}