Skip to content

Commit

Permalink
Don't open non-modal dialog from a modal symbol selector dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 14, 2018
1 parent 3b64c34 commit 8288deb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsappwindowmanager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
qgswindowmanagerinterface.cpp
-----------------------------
qgsappwindowmanager.cpp
-----------------------
Date : September 2018
Copyright : (C) 2018 Nyall Dawson
Email : nyall dot dawson at gmail dot com
Expand Down Expand Up @@ -59,8 +59,8 @@ QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::Applic
}
mLayoutManagerDialog->show();
mLayoutManagerDialog->activate();
return mLayoutManagerDialog;
}
return nullptr;
}
return nullptr;
}
4 changes: 2 additions & 2 deletions src/app/qgsappwindowmanager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
qgswindowmanagerinterface.h
---------------------------
qgsappwindowmanager.h
---------------------
Date : September 2018
Copyright : (C) 2018 Nyall Dawson
Email : nyall dot dawson at gmail dot com
Expand Down
10 changes: 8 additions & 2 deletions src/gui/symbology/qgssymbolslistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,14 @@ void QgsSymbolsListWidget::updateModelFilters()
void QgsSymbolsListWidget::openStyleManager()
{
// prefer to use global window manager to open the style manager, if possible!
// this allows reuse of an existing non-modal window instead of opening a new modal window
if ( !QgsGui::windowManager() || !QgsGui::windowManager()->openStandardDialog( QgsWindowManagerInterface::DialogStyleManager ) )
// this allows reuse of an existing non-modal window instead of opening a new modal window.
// Note that we only use the non-modal dialog if we're open in the panel -- if we're already
// open as part of a modal dialog, then we MUST use another modal dialog or the result will
// not be focusable!
QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this );
if ( !panel || !panel->dockMode()
|| !QgsGui::windowManager()
|| !QgsGui::windowManager()->openStandardDialog( QgsWindowManagerInterface::DialogStyleManager ) )
{
// fallback to modal dialog
QgsStyleManagerDialog dlg( mStyle, this );
Expand Down

0 comments on commit 8288deb

Please sign in to comment.