forked from qt-creator/qt-creator
Designer: Fix displaying of 'modified' state after saving.
Emit an IEditor::changed() after saving to force an update of the OpenEditorsModel.
This commit is contained in:
@@ -81,6 +81,8 @@ FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
|
|||||||
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
|
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||||
// Revert to saved/load externally modified files
|
// Revert to saved/load externally modified files
|
||||||
connect(&(d->m_file), SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
|
connect(&(d->m_file), SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
|
||||||
|
// Force update of open editors model.
|
||||||
|
connect(&(d->m_file), SIGNAL(saved()), this, SIGNAL(changed()));
|
||||||
}
|
}
|
||||||
|
|
||||||
FormWindowEditor::~FormWindowEditor()
|
FormWindowEditor::~FormWindowEditor()
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ bool FormWindowFile::save(const QString &name /*= QString()*/)
|
|||||||
emit setDisplayName(fi.fileName());
|
emit setDisplayName(fi.fileName());
|
||||||
m_formWindow->setDirty(false);
|
m_formWindow->setDirty(false);
|
||||||
emit changed();
|
emit changed();
|
||||||
|
emit saved();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,14 +50,14 @@ public:
|
|||||||
explicit FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent = 0);
|
explicit FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent = 0);
|
||||||
|
|
||||||
// IFile
|
// IFile
|
||||||
bool save(const QString &fileName = QString());
|
virtual bool save(const QString &fileName = QString());
|
||||||
QString fileName() const;
|
virtual QString fileName() const;
|
||||||
bool isModified() const;
|
virtual bool isModified() const;
|
||||||
bool isReadOnly() const;
|
virtual bool isReadOnly() const;
|
||||||
bool isSaveAsAllowed() const;
|
virtual bool isSaveAsAllowed() const;
|
||||||
void modified(Core::IFile::ReloadBehavior *behavior);
|
virtual void modified(Core::IFile::ReloadBehavior *behavior);
|
||||||
QString defaultPath() const;
|
virtual QString defaultPath() const;
|
||||||
QString suggestedFileName() const;
|
virtual QString suggestedFileName() const;
|
||||||
virtual QString mimeType() const;
|
virtual QString mimeType() const;
|
||||||
|
|
||||||
// Internal
|
// Internal
|
||||||
@@ -70,6 +70,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Internal
|
// Internal
|
||||||
|
void saved();
|
||||||
void reload(const QString &);
|
void reload(const QString &);
|
||||||
void setDisplayName(const QString &);
|
void setDisplayName(const QString &);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user