Skip to content

Commit

Permalink
Flip panel connects to new style
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 17, 2017
1 parent ecc4925 commit 7aff3e7
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposerarrowwidget.cpp
Expand Up @@ -340,7 +340,7 @@ void QgsComposerArrowWidget::on_mLineStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateLineStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpLineStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerArrowWidget::cleanUpLineStyleSelector );
openPanel( d );
mArrow->beginCommand( tr( "Arrow line style changed" ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposermapgridwidget.cpp
Expand Up @@ -641,8 +641,8 @@ void QgsComposerMapGridWidget::on_mGridLineStyleButton_clicked()
symbolContext.setExpressionContext( &context );
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateGridLineStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpGridLineStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerMapGridWidget::updateGridLineStyleFromWidget );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapGridWidget::cleanUpGridLineStyleSelector );
openPanel( d );
mComposerMap->beginCommand( tr( "Grid line style changed" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -1652,7 +1652,7 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateOverviewFrameStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpOverviewFrameStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapWidget::cleanUpOverviewFrameStyleSelector );
openPanel( d );
mComposerMap->beginCommand( tr( "Overview frame style changed" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposerpolygonwidget.cpp
Expand Up @@ -68,7 +68,7 @@ void QgsComposerPolygonWidget::on_mPolygonStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerPolygonWidget::cleanUpStyleSelector );
openPanel( d );
mComposerPolygon->beginCommand( tr( "Polygon style changed" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposerpolylinewidget.cpp
Expand Up @@ -63,7 +63,7 @@ void QgsComposerPolylineWidget::on_mLineStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerPolylineWidget::cleanUpStyleSelector );
openPanel( d );
mComposerPolyline->beginCommand( tr( "Polyline style changed" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposershapewidget.cpp
Expand Up @@ -117,7 +117,7 @@ void QgsComposerShapeWidget::on_mShapeStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerShapeWidget::cleanUpSymbolSelector );
openPanel( d );
mComposerShape->beginCommand( tr( "Shape style changed" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscompositionwidget.cpp
Expand Up @@ -548,7 +548,7 @@ void QgsCompositionWidget::on_mPageStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsCompositionWidget::cleanUpStyleSelector );
openPanel( d );
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgslabelingwidget.cpp
Expand Up @@ -156,8 +156,8 @@ void QgsLabelingWidget::labelModeChanged( int index )

QgsRuleBasedLabelingWidget *ruleWidget = new QgsRuleBasedLabelingWidget( mLayer, mCanvas, this );
ruleWidget->setDockMode( dockMode() );
connect( ruleWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( ruleWidget, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( ruleWidget, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );
connect( ruleWidget, &QgsRuleBasedLabelingWidget::widgetChanged, this, &QgsLabelingWidget::widgetChanged );
mWidget = ruleWidget;
mStackedWidget->addWidget( mWidget );
mStackedWidget->setCurrentWidget( mWidget );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgslayerstylingwidget.cpp
Expand Up @@ -356,7 +356,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
connect( styleWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) );
QgsPanelWidgetWrapper *wrapper = new QgsPanelWidgetWrapper( styleWidget, mStackedWidget );
wrapper->setDockMode( true );
connect( styleWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), wrapper, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( styleWidget, &QgsRendererPropertiesDialog::showPanel, wrapper, &QgsPanelWidget::openPanel );
mWidgetStack->setMainPanel( wrapper );
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsrulebasedlabelingwidget.cpp
Expand Up @@ -167,7 +167,7 @@ void QgsRuleBasedLabelingWidget::editRule( const QModelIndex &index )

QgsLabelingRulePropsWidget *widget = new QgsLabelingRulePropsWidget( rule, mLayer, this, mCanvas );
widget->setPanelTitle( tr( "Edit rule" ) );
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( ruleWidgetPanelAccepted( QgsPanelWidget * ) ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedLabelingWidget::ruleWidgetPanelAccepted );
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( liveUpdateRuleFromPanel() ) );
openPanel( widget );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -1264,7 +1264,7 @@ void QgsVectorLayerProperties::updateSymbologyPage()
mRendererDialog = new QgsRendererPropertiesDialog( mLayer, QgsStyle::defaultStyle(), true, this );
mRendererDialog->setDockMode( false );
mRendererDialog->setMapCanvas( QgisApp::instance()->mapCanvas() );
connect( mRendererDialog, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mRendererDialog, &QgsRendererPropertiesDialog::showPanel, this, &QgsVectorLayerProperties::openPanel );
connect( mRendererDialog, SIGNAL( layerVariablesChanged() ), this, SLOT( updateVariableEditor() ) );

// display the menu to choose the output format (fix #5136)
Expand Down
2 changes: 1 addition & 1 deletion src/gui/effects/qgseffectstackpropertieswidget.cpp
Expand Up @@ -467,7 +467,7 @@ void QgsEffectStackCompactWidget::showDialog()
widget->setPreviewPicture( *mPreviewPicture );
}
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( updateEffectLive() ) );
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( updateAcceptWidget( QgsPanelWidget * ) ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsEffectStackCompactWidget::updateAcceptWidget );
openPanel( widget );
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgspanelwidget.cpp
Expand Up @@ -38,8 +38,8 @@ void QgsPanelWidget::connectChildPanels( const QList<QgsPanelWidget *> &panels )

void QgsPanelWidget::connectChildPanel( QgsPanelWidget *panel )
{
connect( panel, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( panel, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( panel, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );
connect( panel, &QgsPanelWidget::widgetChanged, this, &QgsPanelWidget::widgetChanged );
}

void QgsPanelWidget::setDockMode( bool dockMode )
Expand Down
8 changes: 4 additions & 4 deletions src/gui/qgspanelwidgetstack.cpp
Expand Up @@ -29,13 +29,13 @@ QgsPanelWidgetStack::QgsPanelWidgetStack( QWidget *parent )
setupUi( this );
clear();

connect( mBackButton, SIGNAL( pressed() ), this, SLOT( acceptCurrentPanel() ) );
connect( mBackButton, &QAbstractButton::pressed, this, &QgsPanelWidgetStack::acceptCurrentPanel );
}

void QgsPanelWidgetStack::setMainPanel( QgsPanelWidget *panel )
{
// TODO Don't allow adding another main widget or else that would be strange for the user.
connect( panel, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( showPanel( QgsPanelWidget * ) ),
connect( panel, &QgsPanelWidget::showPanel, this, &QgsPanelWidgetStack::showPanel,
// using unique connection because addMainPanel() may be called multiple times
// for a panel, so showPanel() slot could be invoked more times from one signal
Qt::UniqueConnection );
Expand Down Expand Up @@ -118,8 +118,8 @@ void QgsPanelWidgetStack::showPanel( QgsPanelWidget *panel )
{
mTitles.push( panel->panelTitle() );

connect( panel, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( closePanel( QgsPanelWidget * ) ) );
connect( panel, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( showPanel( QgsPanelWidget * ) ) );
connect( panel, &QgsPanelWidget::panelAccepted, this, &QgsPanelWidgetStack::closePanel );
connect( panel, &QgsPanelWidget::showPanel, this, &QgsPanelWidgetStack::showPanel );

int index = mStackedWidget->addWidget( panel );
mStackedWidget->setCurrentIndex( index );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology-ng/qgscategorizedsymbolrendererwidget.cpp
Expand Up @@ -544,7 +544,7 @@ void QgsCategorizedSymbolRendererWidget::changeCategorizedSymbol()
dlg->setContext( mContext );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

Expand Down Expand Up @@ -587,7 +587,7 @@ void QgsCategorizedSymbolRendererWidget::changeCategorySymbol()
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( symbol, mStyle, mLayer, nullptr );
dlg->setContext( mContext );
connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgspointclusterrendererwidget.cpp
Expand Up @@ -202,7 +202,7 @@ void QgsPointClusterRendererWidget::on_mCenterSymbolPushButton_clicked()
dlg->setContext( context );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateCenterSymbolFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsPointClusterRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

Expand Down
Expand Up @@ -376,7 +376,7 @@ void QgsPointDisplacementRendererWidget::on_mCenterSymbolPushButton_clicked()
dlg->setContext( context );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateCenterSymbolFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsPointDisplacementRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology-ng/qgsrendererpropertiesdialog.cpp
Expand Up @@ -134,7 +134,7 @@ QgsRendererPropertiesDialog::QgsRendererPropertiesDialog( QgsVectorLayer *layer,
<< mEffectWidget;

connectValueChanged( widgets, SIGNAL( widgetChanged() ) );
connect( mEffectWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mEffectWidget, &QgsPanelWidget::showPanel, this, &QgsRendererPropertiesDialog::openPanel );
}

void QgsRendererPropertiesDialog::connectValueChanged( const QList<QWidget *> &widgets, const char *slot )
Expand Down Expand Up @@ -260,7 +260,7 @@ void QgsRendererPropertiesDialog::rendererChanged()
connect( mActiveWidget, SIGNAL( layerVariablesChanged() ), this, SIGNAL( layerVariablesChanged() ) );
}
connect( mActiveWidget, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( mActiveWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mActiveWidget, &QgsPanelWidget::showPanel, this, &QgsRendererPropertiesDialog::openPanel );
w->setDockMode( mDockMode );
}
else
Expand Down
8 changes: 4 additions & 4 deletions src/gui/symbology-ng/qgsrulebasedrendererwidget.cpp
Expand Up @@ -183,7 +183,7 @@ void QgsRuleBasedRendererWidget::editRule( const QModelIndex &index )

QgsRendererRulePropsWidget *widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mContext );
widget->setPanelTitle( tr( "Edit rule" ) );
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( ruleWidgetPanelAccepted( QgsPanelWidget * ) ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::ruleWidgetPanelAccepted );
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( liveUpdateRuleFromPanel() ) );
openPanel( widget );
}
Expand Down Expand Up @@ -260,7 +260,7 @@ void QgsRuleBasedRendererWidget::refineRuleCategoriesGui()
{
QgsCategorizedSymbolRendererWidget *w = new QgsCategorizedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add categories to rules" ) );
connect( w, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( refineRuleCategoriesAccepted( QgsPanelWidget * ) ) );
connect( w, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::refineRuleCategoriesAccepted );
w->setContext( mContext );
openPanel( w );
}
Expand All @@ -269,7 +269,7 @@ void QgsRuleBasedRendererWidget::refineRuleRangesGui()
{
QgsGraduatedSymbolRendererWidget *w = new QgsGraduatedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add ranges to rules" ) );
connect( w, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( refineRuleRangesAccepted( QgsPanelWidget * ) ) );
connect( w, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::refineRuleRangesAccepted );
w->setContext( mContext );
openPanel( w );
}
Expand Down Expand Up @@ -642,7 +642,7 @@ QgsRendererRulePropsWidget::QgsRendererRulePropsWidget( QgsRuleBasedRenderer::Ru
mSymbolSelector = new QgsSymbolSelectorWidget( mSymbol, style, mLayer, this );
mSymbolSelector->setContext( mContext );
connect( mSymbolSelector, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( mSymbolSelector, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mSymbolSelector, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );

QVBoxLayout *l = new QVBoxLayout;
l->addWidget( mSymbolSelector );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgssinglesymbolrendererwidget.cpp
Expand Up @@ -53,7 +53,7 @@ QgsSingleSymbolRendererWidget::QgsSingleSymbolRendererWidget( QgsVectorLayer *la
// setup ui
mSelector = new QgsSymbolSelectorWidget( mSingleSymbol, mStyle, mLayer, nullptr );
connect( mSelector, SIGNAL( symbolModified() ), this, SLOT( changeSingleSymbol() ) );
connect( mSelector, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mSelector, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );

QVBoxLayout *layout = new QVBoxLayout( this );
layout->setContentsMargins( 0, 0, 0, 0 );
Expand Down

0 comments on commit 7aff3e7

Please sign in to comment.