From c6d8efba6c83f93ba3b2dea8fb95f0e09dffe788 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 7 Aug 2018 14:57:44 +0200 Subject: [PATCH] Add user name and email to Insert > Fields 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 | 2 ++ src/insets/InsetInfo.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 6f6f097b90..d0e4087070 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -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 diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index dac80c4a09..f197cee029 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -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; } -- 2.39.2