Commit c3f7fd52 authored by Fabio D'Urso's avatar Fabio D'Urso

Don't reuse KConfigDialogs

Because a cached dialog stays parented to the initial part, which might
not be the one used to open it.
This is especially visible now that we support more than one window per
okular process.

For example:
 - User initially opens a dialog from window A
      -> This dialog gets cached as child of A's PageView. This implies that
         clicking on the dialog also brings window A to foreground.
 - User re-opens the dialog from a different window B
      -> The dialog is still a child of A's PageView, therefore clicking on the
         dialog's frame brings A to the foreground, and B to the background.
parent 84d7eae0
......@@ -1030,13 +1030,9 @@ void Part::setWindowTitleFromDocument()
void Part::slotGeneratorPreferences( )
{
// an instance the dialog could be already created and could be cached,
// in which case you want to display the cached dialog
if ( KConfigDialog::showDialog( "generator_prefs" ) )
return;
// we didn't find an instance of this dialog, so lets create it
// Create dialog
KConfigDialog * dialog = new KConfigDialog( m_pageView, "generator_prefs", Okular::Settings::self() );
dialog->setAttribute( Qt::WA_DeleteOnClose );
if( m_embedMode == ViewerWidgetMode )
{
......@@ -1049,6 +1045,7 @@ void Part::slotGeneratorPreferences( )
m_document->fillConfigDialog( dialog );
// Show it
dialog->setWindowModality( Qt::ApplicationModal );
dialog->show();
}
......@@ -2164,13 +2161,11 @@ void Part::slotGetNewStuff()
void Part::slotPreferences()
{
// an instance the dialog could be already created and could be cached,
// in which case you want to display the cached dialog
if ( PreferencesDialog::showDialog( "preferences" ) )
return;
// we didn't find an instance of this dialog, so lets create it
// Create dialog
PreferencesDialog * dialog = new PreferencesDialog( m_pageView, Okular::Settings::self(), m_embedMode );
dialog->setAttribute( Qt::WA_DeleteOnClose );
// Show it
dialog->show();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment