From 879aa03a3ee1640a004483fbe940a1ce61d8b0f7 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 15 Feb 2023 11:22:19 +0100 Subject: [PATCH] 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 46baffdcfe..7e6744053a 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 4db304aa9b..28f0673df2 100644 --- a/src/frontends/qt/ui/PrefPathsUi.ui +++ b/src/frontends/qt/ui/PrefPathsUi.ui @@ -1,45 +1,46 @@ - + + PrefPathsUi - - + + 0 0 347 - 311 + 467 - + - - + + 9 - + 6 - + - 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. + 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. true - - - + + + &PATH prefix: - + pathPrefixED - + Specify those directories which should be prepended to the PATH environment variable. Use the OS native format. @@ -63,186 +64,190 @@ - - - + + + Browse... - + false - - - + + + T&hesaurus dictionaries: - + thesaurusDirED - - + + - - - + + + Browse... - + false - - + + - - - + + + &Temporary directory: - + tempDirED - - - + + + Browse... - + false - - + + - - - + + + Ly&XServer pipe: - + lyxserverDirED - - - + + + Browse... - + false - - + + + + 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. + + - - - + + + &Backup directory: - + backupDirED - - - + + + Browse... - + false - - + + - - - + + + &Example files: - + exampleDirED - - - + + + Browse... - + false - - + + - - - + + + &Document templates: - + templateDirED - - - + + + Browse... - + false - - + + - - - + + + &Working directory: - + workingDirED - - - + + + H&unspell dictionaries: - + hunspellDirED - - + + - - - + + + Browse... - + false @@ -270,7 +275,7 @@ texinputsPrefixED - qt_i18n.h + qt_i18n.h -- 2.39.5