Skip to content
Permalink
Browse files
fixed the possibility to recursively open stylemgr and symbol selector
  • Loading branch information
tecoholic committed Dec 26, 2012
1 parent c41cf2e commit 3bb33b827e304873cf82f5e2e481f9965519e901
@@ -350,6 +350,10 @@ bool QgsStyleV2ManagerDialog::addSymbol()
}

// get symbol design
// NOTE : Set the parent widget as "this" to notify the Symbol selector
// that, it is being called by Style Manager, so recursive calling
// of style manger and symbol slector can be arrested
// Look Also: editSymbol()
QgsSymbolV2SelectorDialog dlg( symbol, mStyle, NULL, this );
if ( dlg.exec() == 0 )
{
@@ -62,6 +62,13 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty
viewSymbols->setModel( model );
connect( viewSymbols->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( setSymbolFromStyle( const QModelIndex & ) ) );

if ( parent )
{
if ( dynamic_cast<QgsStyleV2ManagerDialog*>( parent->parentWidget() ) )
{
btnStyle->setVisible( false );
}
}
// Set the Style Menu under btnStyle
QMenu *styleMenu = new QMenu( btnStyle );
QAction *styleMgrAction = new QAction( "Style Manager", styleMenu );
@@ -30,7 +30,7 @@ class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListW
Q_OBJECT

public:
QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent = NULL );
QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent );

public slots:
void setSymbolFromStyle( const QModelIndex & index );
@@ -332,7 +332,7 @@ void QgsSymbolV2SelectorDialog::layerChanged()
{
// then it must be a symbol
// Now populate symbols of that type using the symbols list widget:
QWidget *symbolsList = new QgsSymbolsListWidget( currentItem->symbol(), mStyle, mAdvancedMenu );
QWidget *symbolsList = new QgsSymbolsListWidget( currentItem->symbol(), mStyle, mAdvancedMenu, this );
setWidget( symbolsList );
connect( symbolsList, SIGNAL( changed() ), this, SLOT( symbolChanged() ) );
}
@@ -37,7 +37,7 @@ class GUI_EXPORT QgsSymbolV2SelectorDialog : public QDialog, private Ui::QgsSymb
Q_OBJECT

public:
QgsSymbolV2SelectorDialog( QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent = NULL, bool embedded = false );
QgsSymbolV2SelectorDialog( QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent = 0, bool embedded = false );

//! return menu for "advanced" button - create it if doesn't exist and show the advanced button
QMenu* advancedMenu();

0 comments on commit 3bb33b8

Please sign in to comment.