Exemplo n.º 1
0
void InspectorFillWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<FillCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<FillCommand*>(event.getCommand());

        const DeviceModel model = DatabaseManager::getInstance().getDeviceByName(this->model->getDeviceName());
        if (!model.getName().isEmpty())
        {
            const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(model.getName()).getChannelFormats().split(",");
            const FormatModel& formatModel = DatabaseManager::getInstance().getFormat(channelFormats.at(this->command->getChannel() - 1));

            this->resolutionWidth = formatModel.getWidth();
            this->resolutionHeight = formatModel.getHeight();

            setScaleAndPositionValues();
        }

        this->spinBoxTransitionDuration->setValue(this->command->getTransitionDuration());
        this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
        this->checkBoxDefer->setChecked(this->command->getDefer());
        this->checkBoxUseMipmap->setChecked(this->command->getUseMipmap());
    }

    blockAllSignals(false);
}
Exemplo n.º 2
0
QgsAnnotationWidget::QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * parent, Qt::WindowFlags f ): QWidget( parent, f ), mItem( item ), mMarkerSymbol( 0 )
{
  setupUi( this );

  if ( mItem )
  {
    blockAllSignals( true );

    if ( mItem->mapPositionFixed() )
    {
      mMapPositionFixedCheckBox->setCheckState( Qt::Checked );
    }
    else
    {
      mMapPositionFixedCheckBox->setCheckState( Qt::Unchecked );
    }
    mFrameWidthSpinBox->setValue( mItem->frameBorderWidth() );
    mFrameColorButton->setColor( mItem->frameColor() );

    const QgsMarkerSymbolV2* symbol = mItem->markerSymbol();
    if ( symbol )
    {
      mMarkerSymbol = dynamic_cast<QgsMarkerSymbolV2*>( symbol->clone() );
      updateCenterIcon();
    }

    blockAllSignals( false );
  }
}
Exemplo n.º 3
0
void InspectorFillWidget::channelChanged(const ChannelChangedEvent& event)
{
    blockAllSignals(true);

    if (this->model != NULL && this->command != NULL)
    {
        const DeviceModel model = DatabaseManager::getInstance().getDeviceByName(this->model->getDeviceName());
        if (!model.getName().isEmpty())
        {
            const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(model.getName()).getChannelFormats().split(",");
            if (event.getChannel() <= channelFormats.count())
            {
                const FormatModel& formatModel = DatabaseManager::getInstance().getFormat(channelFormats.at(event.getChannel() - 1));

                this->resolutionWidth = formatModel.getWidth();
                this->resolutionHeight = formatModel.getHeight();

                setScaleAndPositionValues();
            }
        }

        this->spinBoxTransitionDuration->setValue(this->command->getTransitionDuration());
        this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
        this->checkBoxDefer->setChecked(this->command->getDefer());
        this->checkBoxUseMipmap->setChecked(this->command->getUseMipmap());
    }

    blockAllSignals(false);
}
void InspectorCustomCommandWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<CustomCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<CustomCommand*>(event.getCommand());

        this->lineEditStop->setText(this->command->getStopCommand());
        this->lineEditPlay->setText(this->command->getPlayCommand());
        this->lineEditLoad->setText(this->command->getLoadCommand());
        this->lineEditPause->setText(this->command->getPauseCommand());
        this->lineEditNext->setText(this->command->getNextCommand());
        this->lineEditUpdate->setText(this->command->getUpdateCommand());
        this->lineEditInvoke->setText(this->command->getInvokeCommand());
        this->lineEditPreview->setText(this->command->getPreviewCommand());
        this->lineEditClear->setText(this->command->getClearCommand());
        this->lineEditClearVideolayer->setText(this->command->getClearVideolayerCommand());
        this->lineEditClearChannel->setText(this->command->getClearChannelCommand());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
Exemplo n.º 5
0
QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape ): QgsComposerItemBaseWidget( 0, composerShape ), mComposerShape( composerShape )
{
  setupUi( this );

  //add widget for general composer item properties
  QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerShape );

  //shapes don't use background or frame, since the symbol style is set through a QgsSymbolV2SelectorDialog
  itemPropertiesWidget->showBackgroundGroup( false );
  itemPropertiesWidget->showFrameGroup( false );

  mainLayout->addWidget( itemPropertiesWidget );

  blockAllSignals( true );

  //shape types
  mShapeComboBox->addItem( tr( "Ellipse" ) );
  mShapeComboBox->addItem( tr( "Rectangle" ) );
  mShapeComboBox->addItem( tr( "Triangle" ) );

  setGuiElementValues();

  blockAllSignals( false );

  if ( mComposerShape )
  {
    connect( mComposerShape, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
  }
}
Exemplo n.º 6
0
void QgsComposerArrowWidget::setGuiElementValues()
{
  if ( !mArrow )
  {
    return;
  }

  blockAllSignals( true );
  mArrowColorButton->setColor( mArrow->arrowColor() );
  mArrowColorButton->setColorDialogTitle( tr( "Select arrow color" ) );
  mArrowColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
  mOutlineWidthSpinBox->setValue( mArrow->outlineWidth() );
  mArrowHeadWidthSpinBox->setValue( mArrow->arrowHeadWidth() );

  QgsComposerArrow::MarkerMode mode = mArrow->markerMode();
  if ( mode == QgsComposerArrow::DefaultMarker )
  {
    mDefaultMarkerRadioButton->setChecked( true );
  }
  else if ( mode == QgsComposerArrow::NoMarker )
  {
    mNoMarkerRadioButton->setChecked( true );
  }
  else //svg marker
  {
    mSvgMarkerRadioButton->setChecked( true );
    enableSvgInputElements( true );
  }
  mStartMarkerLineEdit->setText( mArrow->startMarker() );
  mEndMarkerLineEdit->setText( mArrow->endMarker() );
  blockAllSignals( false );
}
Exemplo n.º 7
0
void TextTools::styleChanged(int comboIdx)
      {
      blockAllSignals(true);
      int styleIdx = textStyles->itemData(comboIdx).toInt();
      if (styleIdx < 0)
            styleIdx = TEXT_STYLE_UNSTYLED;
      bool unstyled = (styleIdx == TEXT_STYLE_UNSTYLED);

      if (unstyled)
            _textElement->setUnstyled();
      else
            _textElement->setTextStyleType(styleIdx);
      typefaceSize->setEnabled(unstyled);
      typefaceFamily->setEnabled(unstyled);
      typefaceBold->setEnabled(unstyled);
      typefaceItalic->setEnabled(unstyled);
      typefaceUnderline->setEnabled(unstyled);
      typefaceSubscript->setEnabled(unstyled);
      typefaceSuperscript->setEnabled(unstyled);
      typefaceFamily->setEnabled(unstyled);
      leftAlign->setEnabled(unstyled);
      rightAlign->setEnabled(unstyled);
      hcenterAlign->setEnabled(unstyled);
      topAlign->setEnabled(unstyled);
      bottomAlign->setEnabled(unstyled);
      baselineAlign->setEnabled(unstyled);
      vcenterAlign->setEnabled(unstyled);
      blockAllSignals(false);
      updateText();
      }
void QgsComposerShapeWidget::setGuiElementValues()
{
    if ( !mComposerShape )
    {
        return;
    }

    blockAllSignals( true );
    mOutlineWidthSpinBox->setValue( mComposerShape->lineWidth() );
    mRotationSpinBox->setValue( mComposerShape->rotation() );
    if ( mComposerShape->shapeType() == QgsComposerShape::Ellipse )
    {
        mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Ellipse" ) ) );
    }
    else if ( mComposerShape->shapeType() == QgsComposerShape::Rectangle )
    {
        mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Rectangle" ) ) );
    }
    else if ( mComposerShape->shapeType() == QgsComposerShape::Triangle )
    {
        mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Triangle" ) ) );
    }

    if ( mComposerShape->transparentFill() )
    {
        mTransparentCheckBox->setCheckState( Qt::Checked );
        mFillColorButton->setEnabled( false );
    }
    else
    {
        mTransparentCheckBox->setCheckState( Qt::Unchecked );
        mFillColorButton->setEnabled( true );
    }
    blockAllSignals( false );
}
Exemplo n.º 9
0
void TextTools::styleChanged(int idx)
      {
      blockAllSignals(true);
      bool styled = idx != 0;

      if (styled)
            _textElement->setTextStyleType(idx - 1);
      else
            _textElement->setUnstyled();
      bool unstyled = !styled;
      typefaceSize->setEnabled(unstyled);
      typefaceFamily->setEnabled(unstyled);
      typefaceBold->setEnabled(unstyled);
      typefaceItalic->setEnabled(unstyled);
      typefaceUnderline->setEnabled(unstyled);
      typefaceSubscript->setEnabled(unstyled);
      typefaceSuperscript->setEnabled(unstyled);
      typefaceFamily->setEnabled(unstyled);
      leftAlign->setEnabled(unstyled);
      rightAlign->setEnabled(unstyled);
      centerAlign->setEnabled(unstyled);
      topAlign->setEnabled(unstyled);
      bottomAlign->setEnabled(unstyled);
      vcenterAlign->setEnabled(unstyled);

      blockAllSignals(false);
      }
Exemplo n.º 10
0
void Core::updateControls(int cardId)
{
	settingsStr_->clear(MIXERS);
	settingsStr_->clearSwitches();
	const int soundCardId = (alsaWork_->cardExists(cardId)) ? cardId : alsaWork_->getFirstCardWithMixers();
	alsaWork_->setCurrentCard(soundCardId);
	settingsStr_->setCardId(soundCardId);
	settingsStr_->setList(MIXERS, alsaWork_->getVolumeMixers());
	settingsStr_->addMixerSwitch(alsaWork_->getSwitchList());
	const std::string newName = alsaWork_->getMixerName(settingsStr_->mixerId());
	if (mixerName_ != newName) {
		mixerName_ = newName;
		alsaWork_->setCurrentMixer(mixerName_);
	}
	if (!isPulse_) {
		volumeValue_ = alsaWork_->getAlsaVolume();
	}
#ifdef HAVE_PULSE
	else if (pulse_) {
		volumeValue_ = pulse_->getVolume();
	}
#endif
	m_signal_volume_changed(volumeValue_);
	updateTrayIcon(volumeValue_);
	m_signal_mixer_muted(getMuted());
	if(settingsDialog_) {
		blockAllSignals(true);
		settingsDialog_->updateMixers(settingsStr_->mixerList());
		settingsDialog_->updateSwitches(settingsStr_->switchList());
		blockAllSignals(false);
	}
}
Exemplo n.º 11
0
bool InspectorAudioWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<AudioCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->command = dynamic_cast<AudioCommand*>(rundownItemSelectedEvent->getCommand());

            this->comboBoxTransition->setCurrentIndex(this->comboBoxTransition->findText(this->command->getTransition()));
            this->spinBoxDuration->setValue(this->command->getDuration());
            this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
            this->comboBoxDirection->setCurrentIndex(this->comboBoxDirection->findText(this->command->getDirection()));
            this->checkBoxLoop->setChecked(this->command->getLoop());
            this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
            this->checkBoxUseAuto->setChecked(this->command->getUseAuto());
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
Exemplo n.º 12
0
void QgsComposerLegendWidget::setGuiElements()
{
  if ( !mLegend )
  {
    return;
  }

  blockAllSignals( true );
  mTitleLineEdit->setText( mLegend->title() );
  mColumnCountSpinBox->setValue( mLegend->columnCount() );
  mSymbolWidthSpinBox->setValue( mLegend->symbolWidth() );
  mSymbolHeightSpinBox->setValue( mLegend->symbolHeight() );
  mGroupSpaceSpinBox->setValue( mLegend->groupSpace() );
  mLayerSpaceSpinBox->setValue( mLegend->layerSpace() );
  mSymbolSpaceSpinBox->setValue( mLegend->symbolSpace() );
  mIconLabelSpaceSpinBox->setValue( mLegend->iconLabelSpace() );
  mBoxSpaceSpinBox->setValue( mLegend->boxSpace() );
  if ( mLegend->model() )
  {
    mCheckBoxAutoUpdate->setChecked( mLegend->model()->autoUpdate() );
  }
  refreshMapComboBox();

  const QgsComposerMap* map = mLegend->composerMap();
  if ( map )
  {
    mMapComboBox->setCurrentIndex( mMapComboBox->findData( map->id() ) );
  }
  else
  {
    mMapComboBox->setCurrentIndex( mMapComboBox->findData( -1 ) );
  }
  blockAllSignals( false );
}
Exemplo n.º 13
0
void QgsComposerArrowWidget::setGuiElementValues()
{
  if ( !mArrow )
  {
    return;
  }

  blockAllSignals( true );
  mArrowHeadFillColorButton->setColor( mArrow->arrowHeadFillColor() );
  mArrowHeadStrokeColorButton->setColor( mArrow->arrowHeadStrokeColor() );
  mStrokeWidthSpinBox->setValue( mArrow->arrowHeadStrokeWidth() );
  mArrowHeadWidthSpinBox->setValue( mArrow->arrowHeadWidth() );

  QgsComposerArrow::MarkerMode mode = mArrow->markerMode();
  if ( mode == QgsComposerArrow::DefaultMarker )
  {
    mDefaultMarkerRadioButton->setChecked( true );
  }
  else if ( mode == QgsComposerArrow::NoMarker )
  {
    mNoMarkerRadioButton->setChecked( true );
  }
  else //svg marker
  {
    mSvgMarkerRadioButton->setChecked( true );
    enableSvgInputElements( true );
  }
  mStartMarkerLineEdit->setText( mArrow->startMarker() );
  mEndMarkerLineEdit->setText( mArrow->endMarker() );

  updateLineSymbolMarker();

  blockAllSignals( false );
}
Exemplo n.º 14
0
void QgsComposerShapeWidget::setGuiElementValues()
{
  if ( !mComposerShape )
  {
    return;
  }

  blockAllSignals( true );

  updateShapeStyle();

  mCornerRadiusSpinBox->setValue( mComposerShape->cornerRadius() );
  if ( mComposerShape->shapeType() == QgsComposerShape::Ellipse )
  {
    mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Ellipse" ) ) );
    mCornerRadiusSpinBox->setEnabled( false );
  }
  else if ( mComposerShape->shapeType() == QgsComposerShape::Rectangle )
  {
    mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Rectangle" ) ) );
    mCornerRadiusSpinBox->setEnabled( true );
  }
  else if ( mComposerShape->shapeType() == QgsComposerShape::Triangle )
  {
    mShapeComboBox->setCurrentIndex( mShapeComboBox->findText( tr( "Triangle" ) ) );
    mCornerRadiusSpinBox->setEnabled( false );
  }

  blockAllSignals( false );
}
Exemplo n.º 15
0
void DeviceFilterWidget::deviceRemoved()
{
    blockAllSignals(true);

    this->lineEditDeviceFilter->clear();
    this->comboBoxDeviceFilter->clear();

    blockAllSignals(false);

    this->comboBoxDeviceFilter->addItem("All");
    QObject::connect(this->comboBoxDeviceFilter->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(dataChanged(const QModelIndex&, const QModelIndex&)));
    dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(0, 0)->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(0, 0)->setData(Qt::Checked, Qt::CheckStateRole);

    blockAllSignals(true);

    foreach (const DeviceModel& model, DeviceManager::getInstance().getDeviceModels())
    {
        this->comboBoxDeviceFilter->addItem(QString("%1").arg(model.getName()));

        dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(this->comboBoxDeviceFilter->count() - 1, 0)->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
        dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(this->comboBoxDeviceFilter->count() - 1, 0)->setData(Qt::Unchecked, Qt::CheckStateRole);
    }

    blockAllSignals(false);
}
Exemplo n.º 16
0
bool InspectorContrastWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Event::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->command = dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand());

            this->sliderContrast->setValue(QString("%1").arg(this->command->getContrast() * 100).toFloat());
            this->spinBoxContrast->setValue(QString("%1").arg(this->command->getContrast() * 100).toFloat());

            this->spinBoxDuration->setValue(this->command->getDuration());
            this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
            this->checkBoxDefer->setChecked(this->command->getDefer());
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
Exemplo n.º 17
0
void HeatmapGui::updateSize()
{
  blockAllSignals( true );
  mRowsSpinBox->setValue( mRows );
  mColumnsSpinBox->setValue( mColumns );
  mCellXLineEdit->setText( QString::number( mXcellsize ) );
  mCellYLineEdit->setText( QString::number( mYcellsize ) );
  blockAllSignals( false );
}
Exemplo n.º 18
0
void InspectorOutputWidget::atemDeviceRemoved()
{
    blockAllSignals(true);

    this->comboBoxAtemDevice->clear();
    foreach (const AtemDeviceModel& model, AtemDeviceManager::getInstance().getDeviceModels())
        this->comboBoxAtemDevice->addItem(model.getName());

    blockAllSignals(false);
}
Exemplo n.º 19
0
void InspectorOutputWidget::templateChanged(const TemplateChangedEvent& event)
{
    if (this->model == NULL)
        return;

    blockAllSignals(true);

    fillTargetCombo(this->model->getType());

    blockAllSignals(false);
}
Exemplo n.º 20
0
void QgsTextAnnotationDialog::setCurrentFontPropertiesToGui()
{
  blockAllSignals( true );
  QFont currentFont = mTextEdit->currentFont();
  mFontComboBox->setCurrentFont( currentFont );
  mFontSizeSpinBox->setValue( currentFont.pointSize() );
  mBoldPushButton->setChecked( currentFont.bold() );
  mItalicsPushButton->setChecked( currentFont.italic() );
  mFontColorButton->setColor( mTextEdit->textColor() );
  blockAllSignals( false );
}
Exemplo n.º 21
0
void QgsComposerMapGridWidget::updateGuiElements()
{
  if ( !mComposerMapGrid || !mComposerMap )
  {
    return;
  }

  blockAllSignals( true );
  populateDataDefinedButtons();
  setGridItems();
  blockAllSignals( false );
}
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidget(), mComposerMap( composerMap )
{
  setupUi( this );

  //add widget for general composer item properties
  QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap );
  toolBox->addItem( itemPropertiesWidget, tr( "General options" ) );

  mWidthLineEdit->setValidator( new QDoubleValidator( mWidthLineEdit ) );
  mHeightLineEdit->setValidator( new QDoubleValidator( mHeightLineEdit ) );
  mScaleLineEdit->setValidator( new QDoubleValidator( mScaleLineEdit ) );

  mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) );
  mXMaxLineEdit->setValidator( new QDoubleValidator( mXMaxLineEdit ) );
  mYMinLineEdit->setValidator( new QDoubleValidator( mYMinLineEdit ) );
  mYMaxLineEdit->setValidator( new QDoubleValidator( mYMaxLineEdit ) );

  blockAllSignals( true );
  mPreviewModeComboBox->insertItem( 0, tr( "Cache" ) );
  mPreviewModeComboBox->insertItem( 1, tr( "Render" ) );
  mPreviewModeComboBox->insertItem( 2, tr( "Rectangle" ) );

  mGridTypeComboBox->insertItem( 0, tr( "Solid" ) );
  mGridTypeComboBox->insertItem( 1, tr( "Cross" ) );

  mAnnotationFormatComboBox->insertItem( 0, tr( "Decimal" ) );
  mAnnotationFormatComboBox->insertItem( 1, tr( "DegreeMinute" ) );
  mAnnotationFormatComboBox->insertItem( 2, tr( "DegreeMinuteSecond" ) );

  insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
  insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
  insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
  insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );

  insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
  insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
  insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
  insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );

  mFrameStyleComboBox->insertItem( 0, tr( "No frame" ) );
  mFrameStyleComboBox->insertItem( 1, tr( "Zebra" ) );

  if ( composerMap )
  {
    connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
  }

  updateOverviewSymbolMarker();

  updateGuiElements();
  blockAllSignals( false );
}
Exemplo n.º 23
0
void QgsComposerLabelWidget::setGuiElementValues()
{
  blockAllSignals( true );
  mTextEdit->setText( mComposerLabel->text() );
  mMarginDoubleSpinBox->setValue( mComposerLabel->margin() );
  mTopRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignTop );
  mMiddleRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignVCenter );
  mBottomRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignBottom );
  mLeftRadioButton->setChecked( mComposerLabel->hAlign() == Qt::AlignLeft );
  mCenterRadioButton->setChecked( mComposerLabel->hAlign() == Qt::AlignHCenter );
  mRightRadioButton->setChecked( mComposerLabel->hAlign() == Qt::AlignRight );
  blockAllSignals( false );
}
Exemplo n.º 24
0
void DeviceFilterWidget::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
{
    blockAllSignals(true);

    // "All" item is selected, deselect others.
    if (topLeft.row() == 0 && dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(topLeft.row(), 0)->checkState() == Qt::Checked)
    {
        for (int i = 1; i < this->comboBoxDeviceFilter->count(); i++)
            dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(i, 0)->setData(Qt::Unchecked, Qt::CheckStateRole);
    }
    else
    {
        // Deselect the "All" item.
        dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(0, 0)->setData(Qt::Unchecked, Qt::CheckStateRole);
    }

    bool found = false;
    for (int i = 0; i < this->comboBoxDeviceFilter->count(); i++)
    {
        if (dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(i, 0)->checkState() == Qt::Checked)
            found = true;

        if (found)
            break;
    }

    if (!found)
        dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(0, 0)->setData(Qt::Checked, Qt::CheckStateRole);

    QString devices;
    for (int i = 0; i < this->comboBoxDeviceFilter->count(); i++)
    {
        if (dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(i, 0)->checkState() == Qt::Checked)
            devices += QString("%1,").arg(dynamic_cast<QStandardItemModel*>(this->comboBoxDeviceFilter->model())->item(i, 0)->text().trimmed());
    }

    if (devices.endsWith(','))
        devices.remove(devices.length() - 1, 1);

    this->lineEditDeviceFilter->setText(devices);

    if (this->sendEvents)
    {
        EventManager::getInstance().fireMediaChangedEvent();
        EventManager::getInstance().fireTemplateChangedEvent();
        EventManager::getInstance().fireDataChangedEvent();
        EventManager::getInstance().firePresetChangedEvent();
    }

    blockAllSignals(false);
}
Exemplo n.º 25
0
void QgsComposerLabelWidget::setGuiElementValues()
{
  blockAllSignals( true );
  mTextEdit->setPlainText( mComposerLabel->text() );
  mTextEdit->moveCursor( QTextCursor::End, QTextCursor::MoveAnchor );
  mMarginDoubleSpinBox->setValue( mComposerLabel->margin() );
  mHtmlCheckBox->setChecked( mComposerLabel->htmlState() );
  mTopRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignTop );
  mMiddleRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignVCenter );
  mBottomRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignBottom );
  mLeftRadioButton->setChecked( mComposerLabel->hAlign() == Qt::AlignLeft );
  mCenterRadioButton->setChecked( mComposerLabel->hAlign() == Qt::AlignHCenter );
  mRightRadioButton->setChecked( mComposerLabel->hAlign() == Qt::AlignRight );
  blockAllSignals( false );
}
Exemplo n.º 26
0
HeatmapGui::HeatmapGui( QWidget* parent, Qt::WindowFlags fl, QMap<QString, QVariant>* temporarySettings )
    : QDialog( parent, fl ),
    mRows( 500 )
{
  setupUi( this );

  QgsDebugMsg( QString( "Creating Heatmap Dialog" ) );

  blockAllSignals( true );

  mHeatmapSessionSettings = temporarySettings;

  // Adding point layers to the inputLayerCombo
  QString defaultLayer = mHeatmapSessionSettings->value( QString( "lastInputLayer" ) ).toString();
  int defaultLayerIndex = 0;
  bool usingLastInputLayer = false;
  int currentIndex = -1;
  foreach ( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
  {
    QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( l );
    if ( !vl || vl->geometryType() != QGis::Point )
      continue;

    currentIndex++;
    inputLayerCombo->addItem( vl->name(), vl->id() );
    if ( vl->id() == defaultLayer )
    {
      // if this layer is the same layer as a heatmap was last generated using,
      // then default to this layer
      usingLastInputLayer = true;
      defaultLayerIndex = currentIndex;
    }
  }
Exemplo n.º 27
0
void InspectorKeyerWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<KeyerCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<KeyerCommand*>(event.getCommand());

        this->checkBoxDefer->setChecked(this->command->getDefer());
    }

    blockAllSignals(false);
}
void InspectorPlayoutCommandWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<PlayoutCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<PlayoutCommand*>(event.getCommand());

        this->comboBoxPlayoutCommand->setCurrentIndex(this->comboBoxPlayoutCommand->findText(this->command->getPlayoutCommand()));
    }

    blockAllSignals(false);
}
Exemplo n.º 29
0
void InspectorClearOutputWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<ClearOutputCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<ClearOutputCommand*>(event.getCommand());

        this->checkBoxClearChannel->setChecked(this->command->getClearChannel());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
Exemplo n.º 30
0
QgsAnnotationWidget::QgsAnnotationWidget( QgsMapCanvasAnnotationItem *item, QWidget *parent, Qt::WindowFlags f )
  : QWidget( parent, f )
  , mItem( item )
{
  setupUi( this );
  mLayerComboBox->setAllowEmptyLayer( true );

  mMapMarkerButton->setSymbolType( QgsSymbol::Marker );
  mFrameStyleButton->setSymbolType( QgsSymbol::Fill );

  if ( mItem && mItem->annotation() )
  {
    QgsAnnotation *annotation = mItem->annotation();
    blockAllSignals( true );

    if ( annotation->hasFixedMapPosition() )
    {
      mMapPositionFixedCheckBox->setCheckState( Qt::Checked );
    }
    else
    {
      mMapPositionFixedCheckBox->setCheckState( Qt::Unchecked );
    }

    whileBlocking( mSpinTopMargin )->setValue( annotation->contentsMargin().top() );
    whileBlocking( mSpinLeftMargin )->setValue( annotation->contentsMargin().left() );
    whileBlocking( mSpinRightMargin )->setValue( annotation->contentsMargin().right() );
    whileBlocking( mSpinBottomMargin )->setValue( annotation->contentsMargin().bottom() );

    mLayerComboBox->setLayer( annotation->mapLayer() );

    const QgsMarkerSymbol *symbol = annotation->markerSymbol();
    if ( symbol )
    {
      mMapMarkerButton->setSymbol( symbol->clone() );
    }
    const QgsFillSymbol *fill = annotation->fillSymbol();
    if ( fill )
    {
      mFrameStyleButton->setSymbol( fill->clone() );
    }

    blockAllSignals( false );
  }
  mMapMarkerButton->setMapCanvas( QgisApp::instance()->mapCanvas() );
  mFrameStyleButton->setMapCanvas( QgisApp::instance()->mapCanvas() );
}