add auto-saving of modified editors

Task-number: QTCREATORBUG-2847
This commit is contained in:
Oswald Buddenhagen
2011-05-10 20:43:03 +02:00
parent a14955d0fb
commit 9ac137fb06
48 changed files with 398 additions and 89 deletions

View File

@@ -53,8 +53,9 @@ public:
explicit FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent = 0);
// IFile
virtual bool save(QString *errorString, const QString &fileName = QString());
virtual bool save(QString *errorString, const QString &fileName, bool autoSave);
virtual QString fileName() const;
virtual bool shouldAutoSave() const;
virtual bool isModified() const;
virtual bool isReadOnly() const;
virtual bool isSaveAsAllowed() const;
@@ -79,6 +80,7 @@ signals:
public slots:
void setFileName(const QString &);
void setShouldAutoSave(bool sad = true) { m_shouldAutoSave = sad; }
private slots:
void slotFormWindowRemoved(QDesignerFormWindowInterface *w);
@@ -88,6 +90,7 @@ private:
QString m_fileName;
QString m_suggestedName;
bool m_shouldAutoSave;
// Might actually go out of scope before the IEditor due
// to deleting the WidgetHost which owns it.
QPointer<QDesignerFormWindowInterface> m_formWindow;