commit 879aa03a3ee1640a004483fbe940a1ce61d8b0f7
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Feb 15 11:22:19 2023 +0100
Add some tooltips wrt document backup
---
src/frontends/qt/GuiPrefs.cpp | 15 +++
src/frontends/qt/ui/PrefPathsUi.ui | 197 ++++++++++++++++++-----------------
2 files changed, 116 insertions(+), 96 deletions(-)
diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp
index 46baffd..7e67440 100644
--- a/src/frontends/qt/GuiPrefs.cpp
+++ b/src/frontends/qt/GuiPrefs.cpp
@@ -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));
+ }
}
diff --git a/src/frontends/qt/ui/PrefPathsUi.ui
b/src/frontends/qt/ui/PrefPathsUi.ui
index 4db304a..28f0673 100644
--- a/src/frontends/qt/ui/PrefPathsUi.ui
+++ b/src/frontends/qt/ui/PrefPathsUi.ui
@@ -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
"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>
</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>&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>
@@ -63,186 +64,190 @@
</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&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>&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&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 & Feel > 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>&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>&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>&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>&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&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>
@@ -270,7 +275,7 @@
<tabstop>texinputsPrefixED</tabstop>
</tabstops>
<includes>
- <include location="local" >qt_i18n.h</include>
+ <include location="local">qt_i18n.h</include>
</includes>
<resources/>
<connections/>
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs