Skip to content
Permalink
Browse files

Also update layout designer title bar to reflect unsaved changes

indicator
  • Loading branch information
nyalldawson committed Mar 5, 2018
1 parent d4a3520 commit d73c7758a1601209456cd95262231af5922f9a3e
Showing with 13 additions and 3 deletions.
  1. +10 −2 src/app/layout/qgslayoutdesignerdialog.cpp
  2. +3 −1 src/app/layout/qgslayoutdesignerdialog.h
@@ -750,6 +750,8 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla

//listen out to status bar updates from the view
connect( mView, &QgsLayoutView::statusMessage, this, &QgsLayoutDesignerDialog::statusMessageReceived );

connect( QgsProject::instance(), &QgsProject::projectDirty, this, &QgsLayoutDesignerDialog::updateWindowTitle );
}

QgsAppLayoutDesignerInterface *QgsLayoutDesignerDialog::iface()
@@ -4130,10 +4132,16 @@ void QgsLayoutDesignerDialog::updateActionNames( QgsMasterLayoutInterface::Type

void QgsLayoutDesignerDialog::updateWindowTitle()
{
QString title;
if ( mSectionTitle.isEmpty() )
setWindowTitle( mTitle );
title = mTitle;
else
setWindowTitle( QStringLiteral( "%1 - %2" ).arg( mTitle, mSectionTitle ) );
title = QStringLiteral( "%1 - %2" ).arg( mTitle, mSectionTitle );

if ( QgsProject::instance()->isDirty() )
title.prepend( '*' );

setWindowTitle( title );
}

void QgsLayoutDesignerDialog::selectItems( const QList<QgsLayoutItem *> items )
@@ -348,6 +348,8 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
//! Populate layouts menu from main app's
void populateLayoutsMenu();

void updateWindowTitle();

private:

static bool sInitializedRegistry;
@@ -499,7 +501,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
QPrinter *printer();
QString reportTypeString();
void updateActionNames( QgsMasterLayoutInterface::Type type );
void updateWindowTitle();

};

#endif // QGSLAYOUTDESIGNERDIALOG_H

0 comments on commit d73c775

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