Skip to content

Commit 22debea

Browse files
committed
Remove WA_DeleteOnClose attribute from QgsBusyIndicatorDialog
- Add default title
1 parent 25f067c commit 22debea

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
lines changed

python/gui/qgsbusyindicatordialog.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class QgsBusyIndicatorDialog : QDialog
1010
%End
1111
public:
1212
/** Constructor
13-
* Modal busy indicator dialog with no buttons that deletes on close.
13+
* Modal busy indicator dialog with no buttons.
1414
* @param message Text to show above busy progress indicator.
1515
* @note added in 1.9
1616
*/

src/app/composer/qgscomposer.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,9 @@ void QgsComposer::on_mActionDuplicateComposer_triggered()
14011401

14021402
QgsComposer* newComposer = mQgis->duplicateComposer( this, newTitle );
14031403

1404-
if ( dlg ) // user may have already closed busy indicator
1405-
{
1406-
dlg->close();
1407-
}
1404+
dlg->close();
1405+
delete dlg;
1406+
dlg = 0;
14081407

14091408
if ( !newComposer )
14101409
{
@@ -1527,10 +1526,9 @@ void QgsComposer::loadTemplate( bool newCompser )
15271526
comp->loadFromTemplate( templateDoc, 0, false );
15281527
c->activate();
15291528

1530-
if ( dlg ) // user may have already closed busy indicator
1531-
{
1532-
dlg->close();
1533-
}
1529+
dlg->close();
1530+
delete dlg;
1531+
dlg = 0;
15341532
}
15351533
}
15361534
}

src/app/composer/qgscomposermanager.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,14 @@ void QgsComposerManager::on_mAddButton_clicked()
189189
QDialog* dlg = new QgsBusyIndicatorDialog( tr( "Loading template into composer..." ) );
190190
dlg->setStyleSheet( QgisApp::instance()->styleSheet() );
191191
dlg->show();
192+
192193
newComposer->hide();
193194
loadedOK = newComposer->composition()->loadFromTemplate( templateDoc, 0, false );
194195
newComposer->activate();
195196

196-
if ( dlg ) // user may have already closed busy indicator
197-
{
198-
dlg->close();
199-
}
197+
dlg->close();
198+
delete dlg;
199+
dlg = 0;
200200
}
201201
}
202202

@@ -396,10 +396,9 @@ void QgsComposerManager::duplicate_clicked()
396396

397397
QgsComposer* newComposer = QgisApp::instance()->duplicateComposer( currentComposer, newTitle );
398398

399-
if ( dlg ) // user may have already closed busy indicator
400-
{
401-
dlg->close();
402-
}
399+
dlg->close();
400+
delete dlg;
401+
dlg = 0;
403402

404403
if ( newComposer )
405404
{

src/gui/qgsbusyindicatordialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
QgsBusyIndicatorDialog::QgsBusyIndicatorDialog( const QString& message, QWidget* parent, Qt::WFlags fl )
2626
: QDialog( parent, fl ), mMessage( QString( message ) ), mMsgLabel( 0 )
2727
{
28+
setWindowTitle( tr( "QGIS" ) );
2829
setLayout( new QVBoxLayout() );
2930
setWindowModality( Qt::WindowModal );
30-
setAttribute( Qt::WA_DeleteOnClose );
3131
setMinimumWidth( 250 );
3232
mMsgLabel = new QLabel( mMessage );
3333
layout()->addWidget( mMsgLabel );

src/gui/qgsbusyindicatordialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class GUI_EXPORT QgsBusyIndicatorDialog : public QDialog
3333
Q_OBJECT
3434
public:
3535
/** Constructor
36-
* Modal busy indicator dialog with no buttons that deletes on close.
36+
* Modal busy indicator dialog with no buttons.
3737
* @param message Text to show above busy progress indicator.
3838
* @note added in 1.9
3939
*/

0 commit comments

Comments
 (0)