mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Use KAutoSaveFile for the backup system, instead of home made function.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5788 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QStandardPaths>
|
||||
#include <KAutoSaveFile>
|
||||
|
||||
#include "elementscollectionmodel.h"
|
||||
|
||||
@@ -863,7 +864,7 @@ void QETDiagramEditor::saveAs() {
|
||||
*/
|
||||
bool QETDiagramEditor::newProject() {
|
||||
// create new project without diagram
|
||||
QETProject *new_project = new QETProject(0);
|
||||
QETProject *new_project = new QETProject(this);
|
||||
|
||||
// Set default properties for new diagram
|
||||
new_project -> setDefaultBorderProperties (BorderProperties:: defaultProperties());
|
||||
@@ -1714,6 +1715,34 @@ bool QETDiagramEditor::drawGrid() const {
|
||||
return m_draw_grid->isChecked();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETDiagramEditor::openBackupFiles
|
||||
* @param backup_files
|
||||
*/
|
||||
void QETDiagramEditor::openBackupFiles(QList<KAutoSaveFile *> backup_files)
|
||||
{
|
||||
for (KAutoSaveFile *file : backup_files)
|
||||
{
|
||||
//Create the project
|
||||
DialogWaiting::instance(this);
|
||||
|
||||
QETProject *project = new QETProject(file, this);
|
||||
if (project->state() != QETProject::Ok)
|
||||
{
|
||||
if (project -> state() != QETProject::FileOpenDiscard)
|
||||
{
|
||||
QET::QetMessageBox::warning(this, tr("Échec de l'ouverture du projet", "message box title"),
|
||||
QString(tr("Une erreur est survenue lors de l'ouverture du fichier %1.",
|
||||
"message box content")).arg(file->managedFile().fileName()));
|
||||
}
|
||||
delete project;
|
||||
DialogWaiting::dropInstance();
|
||||
}
|
||||
addProject(project);
|
||||
DialogWaiting::dropInstance();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
met a jour le menu "Fenetres"
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user