]> git.lyx.org Git - lyx.git/commitdiff
Add user name and email to Insert > Fields
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 7 Aug 2018 12:57:44 +0000 (14:57 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 7 Aug 2018 12:57:44 +0000 (14:57 +0200)
This is a low hanging fruit, since it's already available (although
quite hidden)

Generally, output "not set" i a pref is not set rather than an empty
string.

lib/ui/stdmenus.inc
src/insets/InsetInfo.cpp

index 6f6f097b909865cfed29c161cfaf60e9a01cbae1..d0e408707064b586589e42955ec5adb807c2d466 100644 (file)
@@ -431,6 +431,8 @@ Menuset
                Item "Time (Fix)|x" "info-insert fixtime"
                Separator
                Item "File Name (Excl. Extension)|N" "info-insert buffer name-noext"
+               Item "User Name|U" "info-insert lyxrc user_name"
+               Item "User Email|E" "info-insert lyxrc user_email"
                Separator
                Item "Other...|O" "info-insert"
        End
index dac80c4a09add557a750a360376ef0003303ee80..f197cee029bbd62fb564e1d71dc7068c75dbe816 100644 (file)
@@ -786,6 +786,9 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
                // remove \n and ""
                result = rtrim(result, "\n");
                result = trim(result, "\"");
+               gui = _("not set");
+               if (result.empty())
+                       result = "not set";
                setText(from_utf8(result), params_.lang);
                break;
        }