Skip to content
Permalink
Browse files

Don't open non-modal dialog from a modal symbol selector dialog

  • Loading branch information
nyalldawson committed Sep 14, 2018
1 parent 3b64c34 commit 8288debe555d7c333122d6361db74df41d09c97c
Showing with 13 additions and 7 deletions.
  1. +3 −3 src/app/qgsappwindowmanager.cpp
  2. +2 −2 src/app/qgsappwindowmanager.h
  3. +8 −2 src/gui/symbology/qgssymbolslistwidget.cpp
@@ -1,6 +1,6 @@
/***************************************************************************
qgswindowmanagerinterface.cpp
-----------------------------
qgsappwindowmanager.cpp
-----------------------
Date : September 2018
Copyright : (C) 2018 Nyall Dawson
Email : nyall dot dawson at gmail dot com
@@ -59,8 +59,8 @@ QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::Applic
}
mLayoutManagerDialog->show();
mLayoutManagerDialog->activate();
return mLayoutManagerDialog;
}
return nullptr;
}
return nullptr;
}
@@ -1,6 +1,6 @@
/***************************************************************************
qgswindowmanagerinterface.h
---------------------------
qgsappwindowmanager.h
---------------------
Date : September 2018
Copyright : (C) 2018 Nyall Dawson
Email : nyall dot dawson at gmail dot com
@@ -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 );

0 comments on commit 8288deb

Please sign in to comment.
You can’t perform that action at this time.