示例#1
0
/**
 * Helper function. Deletes all child widgets of the given layout @a item.
 */
void RGBMatrixEditor::resetProperties(QLayoutItem *item)
{
    if (item->layout()) {
        // Process all child items recursively.
        for (int i = item->layout()->count() - 1; i >= 0; i--)
            resetProperties(item->layout()->itemAt(i));
    }
    delete item->widget();
}
示例#2
0
void TraceAnalyzer::processTrace()
{
	resetProperties();
	/*
	 * We do the processing from the main thread, since otherwise
	 * we would have to wait for it
	 */
	threadProcess();
	colorizeTasks();
}
/*!
    class Constructor
 */
BtDeviceDialogQueryWidget::BtDeviceDialogQueryWidget(
        HbMessageBox::MessageBoxType type, const QVariantMap &parameters)
{
    TRACE_ENTRY
    // set properties
    mLastError = NoError;
    mShowEventReceived = false;
    mMessageBox = new HbMessageBox(type);
    resetProperties();
    constructQueryDialog(parameters);
    TRACE_EXIT
}
/*!
    class Constructor
 */
BtDeviceDialogInputWidget::BtDeviceDialogInputWidget(
        const QVariantMap &parameters)
{
    TRACE_ENTRY
    // set properties
    mLastError = NoError;
    mShowEventReceived = false;
    mInputDialog = new HbInputDialog();
    
    resetProperties();
    constructInputDialog(parameters);
    TRACE_EXIT
}
// Constructor
HbDeviceNotificationDialogWidget::HbDeviceNotificationDialogWidget(const QVariantMap &parameters)
: HbNotificationDialog()
{
    TRACE_ENTRY
    mLastError = NoError;
    mShowEventReceived = false;
    resetProperties();
    constructDialog(parameters);

#ifdef HB_EFFECTS
    HbEffectInternal::add(this, "devicenotificationdialog_appear", "appear");
    HbEffectInternal::add(this, "devicenotificationdialog_disappear", "disappear");
#endif

    TRACE_EXIT
}
// Constructor
HbDeviceProgressDialogWidget::HbDeviceProgressDialogWidget(HbProgressDialog::ProgressDialogType progressDialogType,
    const QVariantMap &parameters) : HbProgressDialog(progressDialogType)
{
    TRACE_ENTRY
    mLastError = NoError;
    mProgressDialogType = progressDialogType;
    mShowEventReceived = false;
    mAction = 0;
    resetProperties();
    constructDialog(parameters);
    if (!mAction) {
        // If HbProgressDialog default button is used, connect into its triggered signal.
        QAction *act = action(Cancel);
        if (act) {
            connect(act, SIGNAL(triggered()), SLOT(cancelTriggered()));
        }
    }
    setBackgroundFaded(true);
    TRACE_EXIT
}
示例#7
0
void RGBMatrixEditor::updateExtraOptions()
{

    resetProperties(m_propertiesLayout->layout());
    m_propertiesGroup->hide();

    if (m_matrix->algorithm() == NULL ||
        m_matrix->algorithm()->type() == RGBAlgorithm::Script ||
        m_matrix->algorithm()->type() == RGBAlgorithm::Audio)
    {
        m_textGroup->hide();
        m_imageGroup->hide();
        m_offsetGroup->hide();

        if (m_matrix->algorithm() != NULL && m_matrix->algorithm()->type() == RGBAlgorithm::Script)
        {
            RGBScript *script = static_cast<RGBScript*> (m_matrix->algorithm());
            displayProperties(script);
        }
    }
    else if (m_matrix->algorithm()->type() == RGBAlgorithm::Plain)
    {
        m_textGroup->hide();
        m_imageGroup->hide();
        m_offsetGroup->hide();
    }
    else if (m_matrix->algorithm()->type() == RGBAlgorithm::Image)
    {
        m_textGroup->hide();
        m_imageGroup->show();
        m_offsetGroup->show();

        RGBImage* image = static_cast<RGBImage*> (m_matrix->algorithm());
        Q_ASSERT(image != NULL);
        m_imageEdit->setText(image->filename());

        int index = m_imageAnimationCombo->findText(RGBImage::animationStyleToString(image->animationStyle()));
        if (index != -1)
            m_imageAnimationCombo->setCurrentIndex(index);

        m_xOffsetSpin->setValue(image->xOffset());
        m_yOffsetSpin->setValue(image->yOffset());

    }
    else if (m_matrix->algorithm()->type() == RGBAlgorithm::Text)
    {
        m_textGroup->show();
        m_offsetGroup->show();
        m_imageGroup->hide();

        RGBText* text = static_cast<RGBText*> (m_matrix->algorithm());
        Q_ASSERT(text != NULL);
        m_textEdit->setText(text->text());

        int index = m_animationCombo->findText(RGBText::animationStyleToString(text->animationStyle()));
        if (index != -1)
            m_animationCombo->setCurrentIndex(index);

        m_xOffsetSpin->setValue(text->xOffset());
        m_yOffsetSpin->setValue(text->yOffset());
    }

    if (m_matrix->algorithm() != NULL)
    {
        int accColors = m_matrix->algorithm()->acceptColors();
        if (accColors == 0)
        {
            m_startColorButton->hide();
            m_endColorButton->hide();
            m_resetEndColorButton->hide();
            m_blendModeLabel->hide();
            m_blendModeCombo->hide();
        }
        else
        {
            m_startColorButton->show();
            if (accColors == 1 || m_blendModeCombo->currentIndex() != 0)
            {
                m_endColorButton->hide();
                m_resetEndColorButton->hide();
            }
            else
            {
                m_endColorButton->show();
                m_resetEndColorButton->show();
            }
            m_blendModeLabel->show();
            m_blendModeCombo->show();
        }
    }
}
void VCMatrixPresetSelection::slotUpdatePresetProperties()
{
    resetProperties(m_propertiesLayout->layout());
    RGBScript selScript = m_doc->rgbScriptsCache()->script(m_presetCombo->currentText());
    displayProperties(&selScript);
}