[krita] libs/ui: Make all aspects of autosaving and backup files configurable

Boudewijn Rempt null at kde.org
Tue Feb 19 10:02:50 GMT 2019


Git commit e0f5af950cbb5e765a3777329d46b30b8878c00c by Boudewijn Rempt.
Committed on 19/02/2019 at 08:30.
Pushed by rempt into branch 'master'.

Make all aspects of autosaving and backup files configurable

Autosaves of unnamed files can now be made visible (the dot
is omitted).

The number of backups kept can be set, the default is 1 again.
The location of backups can be chosen: same folder as the file,
$HOME or the tempdir.
The suffix used for the backup file can be chosen. There is
a validator to weed out potentially hazardous characters.

CCMAIL:kimageshop at kde.org
BUG:404395
Differential Revision: https://phabricator.kde.org/D19115

M  +10   -6    libs/ui/KisApplication.cpp
M  +71   -41   libs/ui/KisDocument.cpp
M  +53   -9    libs/ui/dialogs/kis_dlg_preferences.cc
M  +228  -149  libs/ui/forms/wdggeneralsettings.ui

https://commits.kde.org/krita/e0f5af950cbb5e765a3777329d46b30b8878c00c

diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp
index f57dfbc6a6f..818b563eb86 100644
--- a/libs/ui/KisApplication.cpp
+++ b/libs/ui/KisApplication.cpp
@@ -665,21 +665,25 @@ void KisApplication::checkAutosaveFiles()
 {
     if (d->batchRun) return;
 
-    // Check for autosave files from a previous run. There can be several, and
-    // we want to offer a restore for every one. Including a nice thumbnail!
-
-    QStringList filters;
-    filters << QString(".krita-*-*-autosave.kra");
-
 #ifdef Q_OS_WIN
     QDir dir = QDir::temp();
 #else
     QDir dir = QDir::home();
 #endif
 
+    // Check for autosave files from a previous run. There can be several, and
+    // we want to offer a restore for every one. Including a nice thumbnail!
+
+    // Hidden autosave files
+    QStringList filters = QStringList() << QString(".krita-*-*-autosave.kra");
+
     // all autosave files for our application
     QStringList autosaveFiles = dir.entryList(filters, QDir::Files | QDir::Hidden);
 
+    // Visibile autosave files
+    filters = QStringList() << QString("krita-*-*-autosave.kra");
+    autosaveFiles += dir.entryList(filters, QDir::Files);
+
     // Allow the user to make their selection
     if (autosaveFiles.size() > 0) {
         if (d->splashScreen) {
diff --git a/libs/ui/KisDocument.cpp b/libs/ui/KisDocument.cpp
index d24933e79bc..03e3c2bf9d3 100644
--- a/libs/ui/KisDocument.cpp
+++ b/libs/ui/KisDocument.cpp
@@ -394,11 +394,11 @@ public:
     }
 
     ~StrippedSafeSavingLocker() {
-         if (m_locked) {
-             m_imageLock.unlock();
-             m_savingLock.unlock();
-         }
-     }
+        if (m_locked) {
+            m_imageLock.unlock();
+            m_savingLock.unlock();
+        }
+    }
 
     bool successfullyLocked() const {
         return m_locked;
@@ -423,9 +423,9 @@ KisDocument::KisDocument()
     KisResourceServerProvider::instance();
 
     d->shapeController = new KisShapeController(this, d->nserver),
-    d->koShapeController = new KoShapeController(0, d->shapeController),
+            d->koShapeController = new KoShapeController(0, d->shapeController),
 
-    slotConfigChanged();
+            slotConfigChanged();
 }
 
 KisDocument::KisDocument(const KisDocument &rhs)
@@ -438,9 +438,9 @@ KisDocument::KisDocument(const KisDocument &rhs)
     setObjectName(rhs.objectName());
 
     d->shapeController = new KisShapeController(this, d->nserver),
-    d->koShapeController = new KoShapeController(0, d->shapeController),
+            d->koShapeController = new KoShapeController(0, d->shapeController),
 
-    slotConfigChanged();
+            slotConfigChanged();
 
     // clone the image with keeping the GUIDs of the layers intact
     // NOTE: we expect the image to be locked!
@@ -534,20 +534,43 @@ bool KisDocument::exportDocumentImpl(const KritaUtils::ExportFileJob &job, KisPr
 
     KisConfig cfg(true);
     if (cfg.backupFile() && filePathInfo.exists()) {
-        KBackup::numberedBackupFile(job.filePath);
+
+        QString backupDir;
+
+        switch(cfg.readEntry<int>("backupfilelocation", 0)) {
+        case 1:
+            backupDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
+            break;
+        case 2:
+            backupDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
+            break;
+        default:
+            // Do nothing: the empty string is user file location
+            break;
+        }
+
+        int numOfBackupsKept = cfg.readEntry<int>("numberofbackupfiles", 1);
+        QString suffix = cfg.readEntry<QString>("backupfilesuffix", "~");
+
+        if (numOfBackupsKept == 1) {
+            KBackup::simpleBackupFile(job.filePath, backupDir, suffix);
+        }
+        else if (numOfBackupsKept > 2) {
+            KBackup::numberedBackupFile(job.filePath, backupDir, suffix, numOfBackupsKept);
+        }
     }
 
     KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(!job.mimeType.isEmpty(), false);
 
     const QString actionName =
-        job.flags & KritaUtils::SaveIsExporting ?
-        i18n("Exporting Document...") :
-        i18n("Saving Document...");
+            job.flags & KritaUtils::SaveIsExporting ?
+                i18n("Exporting Document...") :
+                i18n("Saving Document...");
 
     bool started =
-        initiateSavingInBackground(actionName,
-                                   this, SLOT(slotCompleteSavingDocument(KritaUtils::ExportFileJob,KisImportExportFilter::ConversionStatus,QString)),
-                                   job, exportConfiguration);
+            initiateSavingInBackground(actionName,
+                                       this, SLOT(slotCompleteSavingDocument(KritaUtils::ExportFileJob,KisImportExportFilter::ConversionStatus,QString)),
+                                       job, exportConfiguration);
 
     if (!started) {
         emit canceled(QString());
@@ -738,7 +761,7 @@ bool KisDocument::exportDocumentSync(const QUrl &url, const QByteArray &mimeType
     const QString fileName = url.toLocalFile();
 
     KisImportExportFilter::ConversionStatus status =
-        d->importExportManager->
+            d->importExportManager->
             exportDocument(fileName, fileName, mimeType, false, exportConfiguration);
 
     d->savingImage = 0;
@@ -796,12 +819,12 @@ bool KisDocument::initiateSavingInBackground(const QString actionName,
             receiverObject, receiverMethod, Qt::UniqueConnection);
 
     bool started =
-        d->backgroundSaveDocument->startExportInBackground(actionName,
-                                                           job.filePath,
-                                                           job.filePath,
-                                                           job.mimeType,
-                                                           job.flags & KritaUtils::SaveShowWarnings,
-                                                           exportConfiguration);
+            d->backgroundSaveDocument->startExportInBackground(actionName,
+                                                               job.filePath,
+                                                               job.filePath,
+                                                               job.mimeType,
+                                                               job.flags & KritaUtils::SaveShowWarnings,
+                                                               exportConfiguration);
 
     if (!started) {
         // the state should have been deinitialized in slotChildCompletedSavingInBackground()
@@ -939,12 +962,12 @@ bool KisDocument::startExportInBackground(const QString &actionName,
 
     KisImportExportFilter::ConversionStatus initializationStatus;
     d->childSavingFuture =
-        d->importExportManager->exportDocumentAsyc(location,
-                                                   realLocation,
-                                                   mimeType,
-                                                   initializationStatus,
-                                                   showWarnings,
-                                                   exportConfiguration);
+            d->importExportManager->exportDocumentAsyc(location,
+                                                       realLocation,
+                                                       mimeType,
+                                                       initializationStatus,
+                                                       showWarnings,
+                                                       exportConfiguration);
 
     if (initializationStatus != KisImportExportFilter::ConversionStatus::OK) {
         if (d->savingUpdater) {
@@ -973,7 +996,7 @@ void KisDocument::finishExportInBackground()
     }
 
     KisImportExportFilter::ConversionStatus status =
-        d->childSavingFuture.result();
+            d->childSavingFuture.result();
     const QString errorMessage = this->errorMessage();
 
     d->savingImage.clear();
@@ -1062,23 +1085,25 @@ QString KisDocument::generateAutoSaveFileName(const QString & path) const
 
     // Using the extension allows to avoid relying on the mime magic when opening
     const QString extension (".kra");
-    QRegularExpression autosavePattern("^\\..+-autosave.kra$");
+    QString prefix = KisConfig(true).readEntry<bool>("autosavefileshidden") ? QString(".") : QString();
+    QRegularExpression autosavePattern1("^\\..+-autosave.kra$");
+    QRegularExpression autosavePattern2("^.+-autosave.kra$");
 
     QFileInfo fi(path);
     QString dir = fi.absolutePath();
     QString filename = fi.fileName();
 
-    if (path.isEmpty() || autosavePattern.match(filename).hasMatch()) {
+    if (path.isEmpty() || autosavePattern1.match(filename).hasMatch() || autosavePattern2.match(filename).hasMatch()) {
         // Never saved?
 #ifdef Q_OS_WIN
         // On Windows, use the temp location (https://bugs.kde.org/show_bug.cgi?id=314921)
-        retval = QString("%1%2.%3-%4-%5-autosave%6").arg(QDir::tempPath()).arg(QDir::separator()).arg("krita").arg(qApp->applicationPid()).arg(objectName()).arg(extension);
+        retval = QString("%1%2%7%3-%4-%5-autosave%6").arg(QDir::tempPath()).arg(QDir::separator()).arg("krita").arg(qApp->applicationPid()).arg(objectName()).arg(extension).arg(prefix);
 #else
         // On Linux, use a temp file in $HOME then. Mark it with the pid so two instances don't overwrite each other's autosave file
-        retval = QString("%1%2.%3-%4-%5-autosave%6").arg(QDir::homePath()).arg(QDir::separator()).arg("krita").arg(qApp->applicationPid()).arg(objectName()).arg(extension);
+        retval = QString("%1%2%7%3-%4-%5-autosave%6").arg(QDir::homePath()).arg(QDir::separator()).arg("krita").arg(qApp->applicationPid()).arg(objectName()).arg(extension).arg(prefix);
 #endif
     } else {
-        retval = QString("%1%2.%3-autosave%4").arg(dir).arg(QDir::separator()).arg(filename).arg(extension);
+        retval = QString("%1%2%5%3-autosave%4").arg(dir).arg(QDir::separator()).arg(filename).arg(extension).arg(prefix);
     }
 
     //qDebug() << "generateAutoSaveFileName() for path" << path << ":" << retval;
@@ -1454,14 +1479,19 @@ void KisDocument::removeAutoSaveFiles(const QString &autosaveBaseName, bool wasR
         QFile::remove(asf);
     }
 
-    QRegularExpression autosavePattern("^\\..+-autosave.kra$");
+    QList<QRegularExpression> expressions;
 
-    if (wasRecovered &&
-        !autosaveBaseName.isEmpty() &&
-        autosavePattern.match(QFileInfo(autosaveBaseName).fileName()).hasMatch() &&
-        QFile::exists(autosaveBaseName)) {
+    expressions << QRegularExpression("^\\..+-autosave.kra$")
+                << QRegularExpression("^.+-autosave.kra$");
 
-        QFile::remove(autosaveBaseName);
+    Q_FOREACH(const QRegularExpression &rex, expressions) {
+        if (wasRecovered &&
+                !autosaveBaseName.isEmpty() &&
+                rex.match(QFileInfo(autosaveBaseName).fileName()).hasMatch() &&
+                QFile::exists(autosaveBaseName)) {
+
+            QFile::remove(autosaveBaseName);
+        }
     }
 }
 
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index 88b66293956..33055bc9210 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -90,6 +90,29 @@
 #  include <kis_tablet_support_win8.h>
 #endif
 
+struct BackupSuffixValidator : public QValidator {
+    BackupSuffixValidator(QObject *parent)
+        : QValidator(parent)
+        , invalidCharacters(QStringList()
+                            << "0" << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9"
+                            << "/" << "\\" << ":" << ";" << " ")
+    {}
+
+    ~BackupSuffixValidator() override {}
+
+    const QStringList invalidCharacters;
+
+    State validate(QString &line, int &/*pos*/) const override
+    {
+        Q_FOREACH(const QString invalidChar, invalidCharacters) {
+            if (line.contains(invalidChar)) {
+                return Invalid;
+            }
+        }
+        return Acceptable;
+    }
+};
+
 
 GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
     : WdgGeneralSettings(_parent, _name)
@@ -169,26 +192,34 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
     m_kineticScrollingSensitivitySlider->setValue(cfg.kineticScrollingSensitivity());
     m_chkKineticScrollingHideScrollbars->setChecked(cfg.kineticScrollingHiddenScrollbars());
 
-
     //
-    // Miscellaneous
+    // File handling
     //
-    cmbStartupSession->addItem(i18n("Open default window"));
-    cmbStartupSession->addItem(i18n("Load previous session"));
-    cmbStartupSession->addItem(i18n("Show session manager"));
-    cmbStartupSession->setCurrentIndex(cfg.sessionOnStartup());
-
-    chkSaveSessionOnQuit->setChecked(cfg.saveSessionOnQuit(false));
-
     int autosaveInterval = cfg.autoSaveInterval();
     //convert to minutes
     m_autosaveSpinBox->setValue(autosaveInterval / 60);
     m_autosaveCheckBox->setChecked(autosaveInterval > 0);
+    chkHideAutosaveFiles->setChecked(cfg.readEntry<bool>("autosavefileshidden", true));
 
     m_chkCompressKra->setChecked(cfg.compressKra());
     chkZip64->setChecked(cfg.useZip64());
 
     m_backupFileCheckBox->setChecked(cfg.backupFile());
+    cmbBackupFileLocation->setCurrentIndex(cfg.readEntry<int>("backupfilelocation", 0));
+    txtBackupFileSuffix->setText(cfg.readEntry<QString>("backupfilesuffix", "~"));
+    QValidator *validator = new BackupSuffixValidator(txtBackupFileSuffix);
+    txtBackupFileSuffix->setValidator(validator);
+    intNumBackupFiles->setValue(cfg.readEntry<int>("numberofbackupfiles", 1));
+
+    //
+    // Miscellaneous
+    //
+    cmbStartupSession->addItem(i18n("Open default window"));
+    cmbStartupSession->addItem(i18n("Load previous session"));
+    cmbStartupSession->addItem(i18n("Show session manager"));
+    cmbStartupSession->setCurrentIndex(cfg.sessionOnStartup());
+
+    chkSaveSessionOnQuit->setChecked(cfg.saveSessionOnQuit(false));
 
     m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport());
 
@@ -223,8 +254,15 @@ void GeneralTab::setDefault()
     m_autosaveCheckBox->setChecked(cfg.autoSaveInterval(true) > 0);
     //convert to minutes
     m_autosaveSpinBox->setValue(cfg.autoSaveInterval(true) / 60);
+    chkHideAutosaveFiles->setChecked(true);
+
     m_undoStackSize->setValue(cfg.undoStackLimit(true));
+
     m_backupFileCheckBox->setChecked(cfg.backupFile(true));
+    cmbBackupFileLocation->setCurrentIndex(0);
+    txtBackupFileSuffix->setText("~");
+    intNumBackupFiles->setValue(1);
+
     m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting(true));
     m_changeBrushOutline->setChecked(!cfg.forceAlwaysFullSizedOutline(true));
 
@@ -1344,7 +1382,13 @@ bool KisDlgPreferences::editPreferences()
         cfg.setMDIBackgroundColor(dialog->m_general->m_mdiColor->color().toQColor());
         cfg.setMDIBackgroundImage(dialog->m_general->m_backgroundimage->text());
         cfg.setAutoSaveInterval(dialog->m_general->autoSaveInterval());
+        cfg.writeEntry("autosavefileshidden", dialog->m_general->chkHideAutosaveFiles->isChecked());
+
         cfg.setBackupFile(dialog->m_general->m_backupFileCheckBox->isChecked());
+        cfg.writeEntry("backupfilelocation", dialog->m_general->cmbBackupFileLocation->currentIndex());
+        cfg.writeEntry("backupfilesuffix", dialog->m_general->txtBackupFileSuffix->text());
+        cfg.writeEntry("numberofbackupfiles", dialog->m_general->intNumBackupFiles->value());
+
         cfg.setShowCanvasMessages(dialog->m_general->showCanvasMessages());
         cfg.setCompressKra(dialog->m_general->compressKra());
         cfg.setUseZip64(dialog->m_general->useZip64());
diff --git a/libs/ui/forms/wdggeneralsettings.ui b/libs/ui/forms/wdggeneralsettings.ui
index 00abf30b182..c7505addaa4 100644
--- a/libs/ui/forms/wdggeneralsettings.ui
+++ b/libs/ui/forms/wdggeneralsettings.ui
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>759</width>
+    <width>552</width>
     <height>468</height>
    </rect>
   </property>
@@ -495,6 +495,187 @@
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>File Handling</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <widget class="QGroupBox" name="m_autosaveCheckBox">
+         <property name="title">
+          <string>Enable Autosaving</string>
+         </property>
+         <property name="checkable">
+          <bool>true</bool>
+         </property>
+         <layout class="QFormLayout" name="formLayout_6">
+          <item row="0" column="0">
+           <widget class="QLabel" name="label_6">
+            <property name="text">
+             <string>Autosave Interval:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="KisIntParseSpinBox" name="m_autosaveSpinBox">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>75</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="suffix">
+             <string comment="Suffix: “Every x min”"> min</string>
+            </property>
+            <property name="prefix">
+             <string comment="Prefix: “Every x min”">Every </string>
+            </property>
+            <property name="minimum">
+             <number>1</number>
+            </property>
+            <property name="maximum">
+             <number>1440</number>
+            </property>
+            <property name="singleStep">
+             <number>5</number>
+            </property>
+            <property name="value">
+             <number>15</number>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QCheckBox" name="chkHideAutosaveFiles">
+            <property name="text">
+             <string>Unnamed autosave files are hidden by default</string>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="m_backupFileCheckBox">
+         <property name="title">
+          <string>Create a Backup File on Saving</string>
+         </property>
+         <property name="checkable">
+          <bool>true</bool>
+         </property>
+         <layout class="QFormLayout" name="formLayout_5">
+          <item row="0" column="0">
+           <widget class="QLabel" name="label_13">
+            <property name="text">
+             <string>Backup File Location</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="QComboBox" name="cmbBackupFileLocation">
+            <item>
+             <property name="text">
+              <string>Same Folder as Original File</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>User Folder</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Temporary File Location</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="label_8">
+            <property name="text">
+             <string>Backup File Suffix:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QLineEdit" name="txtBackupFileSuffix">
+            <property name="text">
+             <string>~</string>
+            </property>
+            <property name="maxLength">
+             <number>10</number>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="0">
+           <widget class="QLabel" name="label_7">
+            <property name="text">
+             <string>Number of Backup Files Kept:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="1">
+           <widget class="QSpinBox" name="intNumBackupFiles">
+            <property name="minimum">
+             <number>1</number>
+            </property>
+            <property name="value">
+             <number>1</number>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="groupBox_2">
+         <property name="title">
+          <string>Kra File Compression</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_3">
+          <item row="0" column="0">
+           <widget class="QCheckBox" name="m_chkCompressKra">
+            <property name="text">
+             <string>Compress .kra files more (slows loading/saving)</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QCheckBox" name="chkZip64">
+            <property name="toolTip">
+             <string><html><head/><body><p>Only use this option for <span style=" font-weight:600;">very</span> large files: larger than 4 GiB on disk.</p></body></html></string>
+            </property>
+            <property name="text">
+             <string>Use Zip64 (for very large files: cannot be opened in versions of Krita older than 4.2.0)</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_6">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
      <widget class="QWidget" name="Miscellaneous">
       <attribute name="title">
        <string>Miscellaneous</string>
@@ -509,7 +690,7 @@
           </sizepolicy>
          </property>
          <property name="text">
-          <string>When Krita starts</string>
+          <string>When Krita starts:</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -526,96 +707,14 @@
          </property>
         </widget>
        </item>
-       <item row="1" column="1">
-        <widget class="QCheckBox" name="chkSaveSessionOnQuit">
-         <property name="text">
-          <string>Save session when Krita closes</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0">
-        <widget class="QLabel" name="lbl_autosave">
-         <property name="text">
-          <string>Autosave:</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="1">
-        <layout class="QHBoxLayout" name="horizontalLayout_3">
-         <item>
-          <widget class="QCheckBox" name="m_autosaveCheckBox">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="text">
-            <string comment="Checkbox after “Autosave:”">Enabled</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="KisIntParseSpinBox" name="m_autosaveSpinBox">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>75</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="suffix">
-            <string comment="Suffix: “Every x min”"> min</string>
-           </property>
-           <property name="prefix">
-            <string comment="Prefix: “Every x min”">Every </string>
-           </property>
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>1440</number>
-           </property>
-           <property name="singleStep">
-            <number>5</number>
-           </property>
-           <property name="value">
-            <number>15</number>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
        <item row="3" column="1">
-        <widget class="QCheckBox" name="m_chkCompressKra">
-         <property name="text">
-          <string>Compress .kra files more (slows loading/saving)</string>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="1">
-        <widget class="QCheckBox" name="m_backupFileCheckBox">
-         <property name="text">
-          <string>Create backup file </string>
-         </property>
-        </widget>
-       </item>
-       <item row="8" column="1">
         <widget class="QCheckBox" name="m_chkConvertOnImport">
          <property name="text">
           <string>On importing images as layers, convert to the image colorspace</string>
          </property>
         </widget>
        </item>
-       <item row="10" column="0">
+       <item row="5" column="0">
         <widget class="QLabel" name="label">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@@ -631,7 +730,7 @@
          </property>
         </widget>
        </item>
-       <item row="10" column="1">
+       <item row="5" column="1">
         <widget class="KisIntParseSpinBox" name="m_undoStackSize">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -659,7 +758,7 @@
          </property>
         </widget>
        </item>
-       <item row="11" column="0">
+       <item row="6" column="0">
         <widget class="QLabel" name="label_3">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@@ -668,21 +767,53 @@
           </sizepolicy>
          </property>
          <property name="text">
-          <string>Number of Palette Presets</string>
+          <string>Number of Palette Presets:</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
          </property>
         </widget>
        </item>
-       <item row="13" column="1">
+       <item row="6" column="1">
+        <widget class="KisIntParseSpinBox" name="m_favoritePresetsSpinBox">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>75</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="minimum">
+          <number>10</number>
+         </property>
+         <property name="maximum">
+          <number>30</number>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="1">
         <widget class="QCheckBox" name="chkShowRootLayer">
          <property name="text">
           <string>Show root layer</string>
          </property>
         </widget>
        </item>
-       <item row="15" column="1">
+       <item row="9" column="1">
+        <widget class="QCheckBox" name="chkUsageLogging">
+         <property name="text">
+          <string>Enable Logging for bug reports</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="1">
         <widget class="QCheckBox" name="m_chkNativeFileDialog">
          <property name="toolTip">
           <string>Warning: if you enable this setting and the file dialogs do weird stuff, do not report a bug.</string>
@@ -692,14 +823,14 @@
          </property>
         </widget>
        </item>
-       <item row="17" column="0">
+       <item row="12" column="0">
         <widget class="QLabel" name="label_9">
          <property name="text">
           <string>Maximum brush size:</string>
          </property>
         </widget>
        </item>
-       <item row="17" column="1">
+       <item row="12" column="1">
         <layout class="QHBoxLayout" name="horizontalLayout_2">
          <item>
           <widget class="QSpinBox" name="intMaxBrushSize">
@@ -735,7 +866,7 @@
          </item>
         </layout>
        </item>
-       <item row="18" column="1">
+       <item row="13" column="1">
         <spacer name="verticalSpacer_4">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -748,45 +879,10 @@
          </property>
         </spacer>
        </item>
-       <item row="11" column="1">
-        <widget class="KisIntParseSpinBox" name="m_favoritePresetsSpinBox">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>75</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="minimum">
-          <number>10</number>
-         </property>
-         <property name="maximum">
-          <number>30</number>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="1">
-        <widget class="QCheckBox" name="chkZip64">
-         <property name="toolTip">
-          <string><html><head/><body><p>Only use this option for <span style=" font-weight:600;">very</span> large files: larger than 4 GiB on disk.</p></body></html></string>
-         </property>
-         <property name="text">
-          <string>Use Zip64 (for very large files: cannot be opened in versions of Krita older than 4.2.0)</string>
-         </property>
-        </widget>
-       </item>
-       <item row="14" column="1">
-        <widget class="QCheckBox" name="chkUsageLogging">
+       <item row="2" column="1">
+        <widget class="QCheckBox" name="chkSaveSessionOnQuit">
          <property name="text">
-          <string>Enable Logging for bug reports</string>
-         </property>
-         <property name="checked">
-          <bool>true</bool>
+          <string>Save session when Krita closes</string>
          </property>
         </widget>
        </item>
@@ -815,22 +911,5 @@
   </customwidget>
  </customwidgets>
  <resources/>
- <connections>
-  <connection>
-   <sender>m_autosaveCheckBox</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>m_autosaveSpinBox</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>20</x>
-     <y>20</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>



More information about the kimageshop mailing list