forked from qt-creator/qt-creator
DocumentManager: Refactor saveModified methods
Introduce methods to save a document/list of documents/all documents, both silently and with a dialog to the DocumentManager. All of these return a bool that signifies whether the save was successful or not. Detailed information on which files failed to load or whether the save was canceled by the user are still available as optional in/out parameters. Change-Id: Id17798302f2a8ba6b85a07c1f0b91f03b20da03f Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -99,12 +99,27 @@ public:
|
||||
static QString getSaveAsFileName(const IDocument *document, const QString &filter = QString(),
|
||||
QString *selectedFilter = 0);
|
||||
|
||||
static QList<IDocument *> saveModifiedDocumentsSilently(const QList<IDocument *> &documents, bool *cancelled = 0);
|
||||
static QList<IDocument *> saveModifiedDocuments(const QList<IDocument *> &documents,
|
||||
bool *cancelled = 0,
|
||||
const QString &message = QString(),
|
||||
static bool saveAllModifiedDocumentsSilently(bool *canceled = 0,
|
||||
QList<IDocument *> *failedToClose = 0);
|
||||
static bool saveModifiedDocumentsSilently(const QList<IDocument *> &documents, bool *canceled = 0,
|
||||
QList<IDocument *> *failedToClose = 0);
|
||||
static bool saveModifiedDocumentSilently(IDocument *document, bool *canceled = 0,
|
||||
QList<IDocument *> *failedToClose = 0);
|
||||
|
||||
static bool saveAllModifiedDocuments(const QString &message = QString(), bool *canceled = 0,
|
||||
const QString &alwaysSaveMessage = QString(),
|
||||
bool *alwaysSave = 0,
|
||||
QList<IDocument *> *failedToClose = 0);
|
||||
static bool saveModifiedDocuments(const QList<IDocument *> &documents,
|
||||
const QString &message = QString(), bool *canceled = 0,
|
||||
const QString &alwaysSaveMessage = QString(),
|
||||
bool *alwaysSave = 0,
|
||||
QList<IDocument *> *failedToClose = 0);
|
||||
static bool saveModifiedDocument(IDocument *document,
|
||||
const QString &message = QString(), bool *canceled = 0,
|
||||
const QString &alwaysSaveMessage = QString(),
|
||||
bool *alwaysSave = 0);
|
||||
bool *alwaysSave = 0,
|
||||
QList<IDocument *> *failedToClose = 0);
|
||||
|
||||
static QString fileDialogLastVisitedDirectory();
|
||||
static void setFileDialogLastVisitedDirectory(const QString &);
|
||||
|
||||
Reference in New Issue
Block a user