Beispiel #1
0
/**
 *  \brief Set the image filename, does not load the image. See Load()
 */
void MythUIImage::SetFilename(const QString &filename)
{
    QWriteLocker updateLocker(&d->m_UpdateLock);
    m_imageProperties.isThemeImage = false;
    m_imageProperties.filename = filename;
    if (filename == m_OrigFilename)
        emit DependChanged(true);
    else
        emit DependChanged(false);
}
Beispiel #2
0
void MythUICheckBox::SetCheckState(MythUIStateType::StateType state)
{
    m_currentCheckState = state;
    if (m_CheckState)
        m_CheckState->DisplayState(state);

    if (state == MythUIStateType::Off)
        emit DependChanged(true);
    else
        emit DependChanged(false);
    emit valueChanged();
}
Beispiel #3
0
/**
 *  \brief Set the image filename pattern and integer range for an animated
 *         image, does not load the image. See Load()
 */
void MythUIImage::SetFilepattern(const QString &filepattern, int low,
                                 int high)
{
    QWriteLocker updateLocker(&d->m_UpdateLock);
    m_imageProperties.isThemeImage = false;
    m_imageProperties.filename = filepattern;
    m_LowNum = low;
    m_HighNum = high;
    if (filepattern == m_OrigFilename)
        emit DependChanged(true);
    else
        emit DependChanged(false);
}
void MythUIProgressBar::Reset()
{
    m_total = m_start = m_current = 0;
    CalculatePosition();
    emit DependChanged(false);
    MythUIType::Reset();
}
Beispiel #5
0
/**
 *  \brief Reset the image back to the default defined in the theme
 */
void MythUIImage::Reset(void)
{
    d->m_UpdateLock.lockForWrite();

    SetMinArea(MythRect());

    if (m_imageProperties.filename != m_OrigFilename)
    {
        m_imageProperties.isThemeImage = true;
        m_imageProperties.filename = m_OrigFilename;

        if (m_animatedImage)
        {
            m_LowNum = 0;
            m_HighNum = 0;
            m_animatedImage = false;
        }
        emit DependChanged(true);

        d->m_UpdateLock.unlock();
        Load();
    }
    else
        d->m_UpdateLock.unlock();

    MythUIType::Reset();
}
Beispiel #6
0
MythUIStateType::MythUIStateType(MythUIType *parent, const QString &name)
    : MythUIComposite(parent, name)
{
    m_CurrentState = NULL;
    m_ShowEmpty = true;
    emit DependChanged(false);
}
void MythUIProgressBar::SetVisible(bool visible)
{
    if (m_firstdepend || visible != m_Visible)
    {
        emit DependChanged(!visible);
        m_firstdepend = false;
    }
    MythUIType::SetVisible(visible);
}
Beispiel #8
0
void MythUIStateType::AdjustDependence(void)
{
    if (m_CurrentState == NULL || !m_CurrentState->IsVisible())
    {
        emit DependChanged(true);
        return;
    }
    QList<MythUIType *> *children = m_CurrentState->GetAllChildren();
    QList<MythUIType *>::iterator it = children->begin();

    for (; it != children->end(); ++it)
    {
        if ((*it)->IsVisible())
        {
            emit DependChanged(false);
            return;
        }
    }
    emit DependChanged(true);
}
Beispiel #9
0
void MythUIText::Reset()
{
    if (m_Message != m_DefaultMessage)
    {
        SetText(m_DefaultMessage);
        SetRedraw();
        emit DependChanged(true);
    }

    SetFontState("default");

    MythUIType::Reset();
}
Beispiel #10
0
void MythUIText::SetText(const QString &text)
{
    QString newtext = text;

    if (!m_Layouts.isEmpty() && newtext == m_Message)
        return;

    if (newtext.isEmpty())
    {
        m_Message = m_DefaultMessage;
        emit DependChanged(true);
    }
    else
    {
        m_Message = newtext;
        emit DependChanged(false);
    }
    m_CutMessage.clear();
    FillCutMessage();

    SetRedraw();
}
Beispiel #11
0
MythUIImage::MythUIImage(const QString &filename, MythUIType *parent,
                         const QString &name)
    : MythUIType(parent, name)
{
    m_imageProperties.filename = filename;
    m_OrigFilename = filename;

    m_LowNum = 0;
    m_HighNum = 0;
    m_Delay = -1;
    m_EnableInitiator = true;

    d = new MythUIImagePrivate(this);
    emit DependChanged(false);
    Init();
}
Beispiel #12
0
MythUIImage::MythUIImage(const QString &filepattern,
                         int low, int high, int delayms,
                         MythUIType *parent, const QString &name)
    : MythUIType(parent, name)
{
    m_imageProperties.filename = filepattern;
    m_LowNum = low;
    m_HighNum = high;

    m_Delay = delayms;
    m_EnableInitiator = true;

    d = new MythUIImagePrivate(this);
    emit DependChanged(false);
    Init();
}
Beispiel #13
0
void MythUICheckBox::SetCheckState(bool onOff)
{
    if (onOff)
    {
        m_currentCheckState = MythUIStateType::Full;
    }
    else
    {
        m_currentCheckState = MythUIStateType::Off;
    }

    if (m_CheckState)
        m_CheckState->DisplayState(m_currentCheckState);

    emit toggled(onOff);
    emit DependChanged(!onOff);
    emit valueChanged();
}
Beispiel #14
0
void MythUICheckBox::toggleCheckState()
{
    bool onOff = false;

    if (m_currentCheckState != MythUIStateType::Full)
    {
        m_currentCheckState = MythUIStateType::Full;
        onOff = true;
    }
    else
    {
        m_currentCheckState = MythUIStateType::Off;
        onOff = false;
    }

    if (m_CheckState)
        m_CheckState->DisplayState(m_currentCheckState);

    emit DependChanged(!onOff);
    emit toggled(onOff);
    emit valueChanged();
}