Skip to content

Commit 3bb33b8

Browse files
author
Arunmozhi
committedDec 26, 2012
fixed the possibility to recursively open stylemgr and symbol selector
1 parent c41cf2e commit 3bb33b8

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed
 

‎src/gui/symbology-ng/qgsstylev2managerdialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ bool QgsStyleV2ManagerDialog::addSymbol()
350350
}
351351

352352
// get symbol design
353+
// NOTE : Set the parent widget as "this" to notify the Symbol selector
354+
// that, it is being called by Style Manager, so recursive calling
355+
// of style manger and symbol slector can be arrested
356+
// Look Also: editSymbol()
353357
QgsSymbolV2SelectorDialog dlg( symbol, mStyle, NULL, this );
354358
if ( dlg.exec() == 0 )
355359
{

‎src/gui/symbology-ng/qgssymbolslistwidget.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty
6262
viewSymbols->setModel( model );
6363
connect( viewSymbols->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( setSymbolFromStyle( const QModelIndex & ) ) );
6464

65+
if ( parent )
66+
{
67+
if ( dynamic_cast<QgsStyleV2ManagerDialog*>( parent->parentWidget() ) )
68+
{
69+
btnStyle->setVisible( false );
70+
}
71+
}
6572
// Set the Style Menu under btnStyle
6673
QMenu *styleMenu = new QMenu( btnStyle );
6774
QAction *styleMgrAction = new QAction( "Style Manager", styleMenu );

‎src/gui/symbology-ng/qgssymbolslistwidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListW
3030
Q_OBJECT
3131

3232
public:
33-
QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent = NULL );
33+
QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent );
3434

3535
public slots:
3636
void setSymbolFromStyle( const QModelIndex & index );

‎src/gui/symbology-ng/qgssymbolv2selectordialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void QgsSymbolV2SelectorDialog::layerChanged()
332332
{
333333
// then it must be a symbol
334334
// Now populate symbols of that type using the symbols list widget:
335-
QWidget *symbolsList = new QgsSymbolsListWidget( currentItem->symbol(), mStyle, mAdvancedMenu );
335+
QWidget *symbolsList = new QgsSymbolsListWidget( currentItem->symbol(), mStyle, mAdvancedMenu, this );
336336
setWidget( symbolsList );
337337
connect( symbolsList, SIGNAL( changed() ), this, SLOT( symbolChanged() ) );
338338
}

‎src/gui/symbology-ng/qgssymbolv2selectordialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class GUI_EXPORT QgsSymbolV2SelectorDialog : public QDialog, private Ui::QgsSymb
3737
Q_OBJECT
3838

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.