Skip to content
Permalink
Browse files

Enable rule-based dialog instead of widget all time

  • Loading branch information
DelazJ committed Jan 27, 2018
1 parent 71bdda5 commit 171b9ee7e5b1bda7a5a50eb60d71e469604f4a6c
Showing with 19 additions and 5 deletions.
  1. +19 −5 src/gui/symbology/qgsrulebasedrendererwidget.cpp
@@ -181,12 +181,25 @@ void QgsRuleBasedRendererWidget::editRule( const QModelIndex &index )
return;

QgsRuleBasedRenderer::Rule *rule = mModel->ruleForIndex( index );
QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this );

if ( panel && panel->dockMode() )
{
QgsRendererRulePropsWidget *widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mContext );//panel?
widget->setPanelTitle( tr( "Edit Rule" ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::ruleWidgetPanelAccepted );
connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsRuleBasedRendererWidget::liveUpdateRuleFromPanel );
openPanel( widget );
return;
}

QgsRendererRulePropsWidget *widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mContext );
widget->setPanelTitle( tr( "Edit Rule" ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::ruleWidgetPanelAccepted );
connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsRuleBasedRendererWidget::liveUpdateRuleFromPanel );
openPanel( widget );
QgsRendererRulePropsDialog dlg( rule, mLayer, mStyle, this, mContext );
if ( dlg.exec() )
{
mModel->updateRule( index.parent(), index.row() );
mModel->clearFeatureCounts();
emit widgetChanged();
}
}

void QgsRuleBasedRendererWidget::removeRule()
@@ -680,6 +693,7 @@ QgsRendererRulePropsDialog::QgsRendererRulePropsDialog( QgsRuleBasedRenderer::Ru

this->layout()->addWidget( mPropsWidget );
this->layout()->addWidget( buttonBox );
this->setWindowTitle( "Edit Rule" );

connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsRendererRulePropsDialog::accept );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );

0 comments on commit 171b9ee

Please sign in to comment.
You can’t perform that action at this time.