]> git.lyx.org Git - features.git/commitdiff
Add some tooltips wrt document backup
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 15 Feb 2023 10:22:19 +0000 (11:22 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 15 Feb 2023 10:22:19 +0000 (11:22 +0100)
src/frontends/qt/GuiPrefs.cpp
src/frontends/qt/ui/PrefPathsUi.ui

index 46baffdcfec811a3cab9956f3c5fcb724d299754..7e6744053a20e8ebeaa30bdc8e60b26fd666ddc5 100644 (file)
@@ -2769,6 +2769,21 @@ void PrefDocHandling::updateRC(LyXRC const & rc)
                closeLastViewCO->setCurrentIndex(1);
        else if (rc.close_buffer_with_last_view == "ask")
                closeLastViewCO->setCurrentIndex(2);
+       if (rc.backupdir_path.empty())
+               backupCB->setToolTip(qt_("If this is checked, a backup of the document is created "
+                                        "in the current working directory. "
+                                        "The backup file has the same name but the suffix '.lyx~'. "
+                                        "Note that these files are hidden by default by some file managers. "
+                                        "A dedicated backup directory can be set in the 'Paths' section."));
+       else {
+               docstring const tip = bformat(_("If this is checked, a backup of the document is created "
+                                               "in the backup directory (%1$s). "
+                                               "The backup file has the full original path and name as file name "
+                                               "and the suffix '.lyx~' (e.g., mydir!filename.lyx~). "
+                                               "Note that these files are hidden by default by some file managers."),
+                                             FileName(rc.backupdir_path).absoluteFilePath());
+               backupCB->setToolTip(toqstr(tip));
+       }
 }
 
 
index 4db304aa9b54672ace64f05266be8d4febd1c85e..28f0673df27d38e57aec8be18dbdc1e5faa5f99b 100644 (file)
@@ -1,45 +1,46 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>PrefPathsUi</class>
- <widget class="QWidget" name="PrefPathsUi" >
-  <property name="geometry" >
+ <widget class="QWidget" name="PrefPathsUi">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>347</width>
-    <height>311</height>
+    <height>467</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string/>
   </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
+  <layout class="QGridLayout">
+   <property name="margin" stdset="0">
     <number>9</number>
    </property>
-   <property name="spacing" >
+   <property name="spacing">
     <number>6</number>
    </property>
-   <item row="12" column="0" colspan="3" >
+   <item row="12" column="0" colspan="3">
     <widget class="QLabel" name="label">
      <property name="text">
-      <string>Relative and absolute paths are allowed. Relative paths will be expanded with respect to the working directory (WD). For all paths except the "TEXINPUTS prefix" the WD is the directory from which you start LyX, and thus could change for each LyX session. For the "TEXINPUTS prefix" path the WD is the directory containing the document. The path "." (without quotes) is a common example of a relative path and refers to the WD.</string>
+      <string>Relative and absolute paths are allowed. Relative paths will be expanded with respect to the working directory (WD). For all paths except the &quot;TEXINPUTS prefix&quot; the WD is the directory from which you start LyX, and thus could change for each LyX session. For the &quot;TEXINPUTS prefix&quot; path the WD is the directory containing the document. The path &quot;.&quot; (without quotes) is a common example of a relative path and refers to the WD.</string>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="10" column="0" >
-    <widget class="QLabel" name="pathPrefixLA" >
-     <property name="text" >
+   <item row="10" column="0">
+    <widget class="QLabel" name="pathPrefixLA">
+     <property name="text">
       <string>&amp;PATH prefix:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>pathPrefixED</cstring>
      </property>
     </widget>
    </item>
-   <item row="10" column="1" colspan="2" >
+   <item row="10" column="1" colspan="2">
     <widget class="QLineEdit" name="pathPrefixED">
      <property name="toolTip">
       <string>Specify those directories which should be prepended to the PATH environment variable. Use the OS native format.</string>
      </property>
     </widget>
    </item>
-   <item row="6" column="2" >
-    <widget class="QPushButton" name="thesaurusDirPB" >
-     <property name="text" >
+   <item row="6" column="2">
+    <widget class="QPushButton" name="thesaurusDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="6" column="0" >
-    <widget class="QLabel" name="thesaurusDirLA" >
-     <property name="text" >
+   <item row="6" column="0">
+    <widget class="QLabel" name="thesaurusDirLA">
+     <property name="text">
       <string>T&amp;hesaurus dictionaries:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>thesaurusDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="6" column="1" >
-    <widget class="QLineEdit" name="thesaurusDirED" />
+   <item row="6" column="1">
+    <widget class="QLineEdit" name="thesaurusDirED"/>
    </item>
-   <item row="5" column="2" >
-    <widget class="QPushButton" name="tempDirPB" >
-     <property name="text" >
+   <item row="5" column="2">
+    <widget class="QPushButton" name="tempDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="5" column="1" >
-    <widget class="QLineEdit" name="tempDirED" />
+   <item row="5" column="1">
+    <widget class="QLineEdit" name="tempDirED"/>
    </item>
-   <item row="5" column="0" >
-    <widget class="QLabel" name="tempDirLA" >
-     <property name="text" >
+   <item row="5" column="0">
+    <widget class="QLabel" name="tempDirLA">
+     <property name="text">
       <string>&amp;Temporary directory:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>tempDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="4" column="2" >
-    <widget class="QPushButton" name="lyxserverDirPB" >
-     <property name="text" >
+   <item row="4" column="2">
+    <widget class="QPushButton" name="lyxserverDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="4" column="1" >
-    <widget class="QLineEdit" name="lyxserverDirED" />
+   <item row="4" column="1">
+    <widget class="QLineEdit" name="lyxserverDirED"/>
    </item>
-   <item row="4" column="0" >
-    <widget class="QLabel" name="lyxserverDirLA" >
-     <property name="text" >
+   <item row="4" column="0">
+    <widget class="QLabel" name="lyxserverDirLA">
+     <property name="text">
       <string>Ly&amp;XServer pipe:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>lyxserverDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="3" column="2" >
-    <widget class="QPushButton" name="backupDirPB" >
-     <property name="text" >
+   <item row="3" column="2">
+    <widget class="QPushButton" name="backupDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="3" column="1" >
-    <widget class="QLineEdit" name="backupDirED" />
+   <item row="3" column="1">
+    <widget class="QLineEdit" name="backupDirED">
+     <property name="toolTip">
+      <string>If a path is specified here, all backups of LyX files will be stored there. If no path is given, backups will be stored alongside the original document. This requires 'Backup original documents when saving' in Look &amp; Feel &gt; Document Handling to be checked.</string>
+     </property>
+    </widget>
    </item>
-   <item row="3" column="0" >
-    <widget class="QLabel" name="backupDirLA" >
-     <property name="text" >
+   <item row="3" column="0">
+    <widget class="QLabel" name="backupDirLA">
+     <property name="text">
       <string>&amp;Backup directory:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>backupDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="2" column="2" >
-    <widget class="QPushButton" name="exampleDirPB" >
-     <property name="text" >
+   <item row="2" column="2">
+    <widget class="QPushButton" name="exampleDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="2" column="1" >
-    <widget class="QLineEdit" name="exampleDirED" />
+   <item row="2" column="1">
+    <widget class="QLineEdit" name="exampleDirED"/>
    </item>
-   <item row="2" column="0" >
-    <widget class="QLabel" name="exampleDirLA" >
-     <property name="text" >
+   <item row="2" column="0">
+    <widget class="QLabel" name="exampleDirLA">
+     <property name="text">
       <string>&amp;Example files:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>exampleDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="1" column="2" >
-    <widget class="QPushButton" name="templateDirPB" >
-     <property name="text" >
+   <item row="1" column="2">
+    <widget class="QPushButton" name="templateDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="1" column="1" >
-    <widget class="QLineEdit" name="templateDirED" />
+   <item row="1" column="1">
+    <widget class="QLineEdit" name="templateDirED"/>
    </item>
-   <item row="1" column="0" >
-    <widget class="QLabel" name="templateDirLA" >
-     <property name="text" >
+   <item row="1" column="0">
+    <widget class="QLabel" name="templateDirLA">
+     <property name="text">
       <string>&amp;Document templates:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>templateDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="0" column="2" >
-    <widget class="QPushButton" name="workingDirPB" >
-     <property name="text" >
+   <item row="0" column="2">
+    <widget class="QPushButton" name="workingDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="0" column="1" >
-    <widget class="QLineEdit" name="workingDirED" />
+   <item row="0" column="1">
+    <widget class="QLineEdit" name="workingDirED"/>
    </item>
-   <item row="0" column="0" >
-    <widget class="QLabel" name="workingDirLA" >
-     <property name="text" >
+   <item row="0" column="0">
+    <widget class="QLabel" name="workingDirLA">
+     <property name="text">
       <string>&amp;Working directory:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>workingDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="8" column="0" >
-    <widget class="QLabel" name="hunspellDirLA" >
-     <property name="text" >
+   <item row="8" column="0">
+    <widget class="QLabel" name="hunspellDirLA">
+     <property name="text">
       <string>H&amp;unspell dictionaries:</string>
      </property>
-     <property name="buddy" >
+     <property name="buddy">
       <cstring>hunspellDirED</cstring>
      </property>
     </widget>
    </item>
-   <item row="8" column="1" >
-    <widget class="QLineEdit" name="hunspellDirED" />
+   <item row="8" column="1">
+    <widget class="QLineEdit" name="hunspellDirED"/>
    </item>
-   <item row="8" column="2" >
-    <widget class="QPushButton" name="hunspellDirPB" >
-     <property name="text" >
+   <item row="8" column="2">
+    <widget class="QPushButton" name="hunspellDirPB">
+     <property name="text">
       <string>Browse...</string>
      </property>
-     <property name="autoDefault" >
+     <property name="autoDefault">
       <bool>false</bool>
      </property>
     </widget>
   <tabstop>texinputsPrefixED</tabstop>
  </tabstops>
  <includes>
-  <include location="local" >qt_i18n.h</include>
+  <include location="local">qt_i18n.h</include>
  </includes>
  <resources/>
  <connections/>