|
@@ -52,6 +52,7 @@ MainWindow::MainWindow ()
|
|
|
suffix = NULL;
|
|
|
filenames = NULL;
|
|
|
autoLoad = true;
|
|
|
+ autoSave = false;
|
|
|
|
|
|
setWindowTitle (tr ("DSL - Draw Strength Line"));
|
|
|
|
|
@@ -143,7 +144,12 @@ QMessageBox::StandardButton
|
|
|
MainWindow::checkModificationinProgress()
|
|
|
{
|
|
|
if(wa->getModificationInProgress())
|
|
|
- return QMessageBox::question(this, "Modification in progress", "Do you really want to change the image ? Modifications in progress will be lost.");
|
|
|
+ {
|
|
|
+ if(autoSave)
|
|
|
+ this->save();
|
|
|
+ else
|
|
|
+ return QMessageBox::question(this, "Modification in progress", "Do you really want to change the image ? Modifications in progress will be lost.");
|
|
|
+ }
|
|
|
return QMessageBox::Yes;
|
|
|
}
|
|
|
|
|
@@ -198,6 +204,13 @@ MainWindow::automaticLoading ()
|
|
|
automaticLoadingAct->setChecked(!autoLoad);
|
|
|
}
|
|
|
|
|
|
+void
|
|
|
+MainWindow::automaticSaving ()
|
|
|
+{
|
|
|
+ autoSave = !autoSave;
|
|
|
+ automaticSavingAct->setChecked(!autoSave);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
void
|
|
|
MainWindow::readOnly ()
|
|
@@ -243,6 +256,12 @@ MainWindow::createActions ()
|
|
|
automaticLoadingAct->setChecked(true);
|
|
|
connect (automaticLoadingAct, &QAction::triggered, this, &MainWindow::automaticLoading);
|
|
|
|
|
|
+ automaticSavingAct = new QAction (tr ("&Automatic saving lines in json file"), this);
|
|
|
+ automaticSavingAct->setShortcut (QKeySequence(Qt::CTRL | Qt::Key_A));
|
|
|
+ automaticSavingAct->setCheckable(true);
|
|
|
+ automaticSavingAct->setChecked(false);
|
|
|
+ connect (automaticSavingAct, &QAction::triggered, this, &MainWindow::automaticSaving);
|
|
|
+
|
|
|
readOnlyAct = new QAction (tr ("&Read Only"), this);
|
|
|
readOnlyAct->setShortcut (QKeySequence(Qt::CTRL | Qt::Key_R));
|
|
|
connect (readOnlyAct, &QAction::triggered, this, &MainWindow::readOnly);
|
|
@@ -281,6 +300,7 @@ MainWindow::createMenus ()
|
|
|
|
|
|
editMenu = menuBar()->addMenu(tr("&Edit"));
|
|
|
editMenu->addAction (automaticLoadingAct);
|
|
|
+ editMenu->addAction (automaticSavingAct);
|
|
|
editMenu->addAction (readOnlyAct);
|
|
|
|
|
|
imageMenu = menuBar ()->addMenu (tr ("&Image"));
|