Skip to content

Commit

Permalink
fixed the possibility to recursively open stylemgr and symbol selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunmozhi committed Dec 26, 2012
1 parent c41cf2e commit 3bb33b8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Expand Up @@ -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 )
{
Expand Down
7 changes: 7 additions & 0 deletions src/gui/symbology-ng/qgssymbolslistwidget.cpp
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgssymbolslistwidget.h
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
Expand Up @@ -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() ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgssymbolv2selectordialog.h
Expand Up @@ -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();
Expand Down

0 comments on commit 3bb33b8

Please sign in to comment.