Skip to content
Permalink
Browse files

Fix undo/redo for rule-based renderer/labeling in styling dock

  • Loading branch information
wonder-sk committed Jul 6, 2016
1 parent 156e7e0 commit d37518d301e7cbbc74d27cfd36583f8da49ce888
Showing with 6 additions and 8 deletions.
  1. +4 −5 src/app/qgsrulebasedlabelingwidget.cpp
  2. +2 −3 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
@@ -69,6 +69,10 @@ QgsRuleBasedLabelingWidget::QgsRuleBasedLabelingWidget( QgsVectorLayer* layer, Q

mModel = new QgsRuleBasedLabelingModel( mRootRule );
viewRules->setModel( mModel );

connect( mModel, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SIGNAL( widgetChanged() ) );
connect( mModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SIGNAL( widgetChanged() ) );
connect( mModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SIGNAL( widgetChanged() ) );
}

QgsRuleBasedLabelingWidget::~QgsRuleBasedLabelingWidget()
@@ -116,8 +120,6 @@ void QgsRuleBasedLabelingWidget::ruleWidgetPanelAccepted( QgsPanelWidget* panel

QModelIndex index = viewRules->selectionModel()->currentIndex();
mModel->updateRule( index.parent(), index.row() );

emit widgetChanged();
}

void QgsRuleBasedLabelingWidget::liveUpdateRuleFromPanel()
@@ -158,7 +160,6 @@ void QgsRuleBasedLabelingWidget::removeRule()
}
// make sure that the selection is gone
viewRules->selectionModel()->clear();
emit widgetChanged();
}

void QgsRuleBasedLabelingWidget::copy()
@@ -171,7 +172,6 @@ void QgsRuleBasedLabelingWidget::copy()

QMimeData* mime = mModel->mimeData( indexlist );
QApplication::clipboard()->setMimeData( mime );
emit widgetChanged();
}

void QgsRuleBasedLabelingWidget::paste()
@@ -184,7 +184,6 @@ void QgsRuleBasedLabelingWidget::paste()
else
index = indexlist.first();
mModel->dropMimeData( mime, Qt::CopyAction, index.row(), index.column(), index.parent() );
emit widgetChanged();
}

QgsRuleBasedLabeling::Rule* QgsRuleBasedLabelingWidget::currentRule()
@@ -107,6 +107,8 @@ QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* laye
connect( btnRenderingOrder, SIGNAL( clicked() ), this, SLOT( setRenderingOrder() ) );

connect( mModel, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), this, SIGNAL( widgetChanged() ) );
connect( mModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SIGNAL( widgetChanged() ) );
connect( mModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SIGNAL( widgetChanged() ) );

currentRuleChanged();
selectedRulesChanged();
@@ -462,7 +464,6 @@ void QgsRuleBasedRendererV2Widget::refineRuleCategoriesAccepted( QgsPanelWidget
QgsRuleBasedRendererV2::refineRuleCategories( initialRule, r );
}
mModel->finishedAddingRules();
emit widgetChanged();
}

void QgsRuleBasedRendererV2Widget::refineRuleRangesAccepted( QgsPanelWidget *panel )
@@ -478,7 +479,6 @@ void QgsRuleBasedRendererV2Widget::refineRuleRangesAccepted( QgsPanelWidget *pan
QgsRuleBasedRendererV2::refineRuleRanges( initialRule, r );
}
mModel->finishedAddingRules();
emit widgetChanged();
}

void QgsRuleBasedRendererV2Widget::ruleWidgetPanelAccepted( QgsPanelWidget *panel )
@@ -490,7 +490,6 @@ void QgsRuleBasedRendererV2Widget::ruleWidgetPanelAccepted( QgsPanelWidget *pane
QModelIndex index = viewRules->selectionModel()->currentIndex();
mModel->updateRule( index.parent(), index.row() );
mModel->clearFeatureCounts();
emit widgetChanged();
}

void QgsRuleBasedRendererV2Widget::liveUpdateRuleFromPanel()

0 comments on commit d37518d

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