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.
This commit is contained in:
Juergen Spitzmueller 2018-08-07 14:57:44 +02:00
parent 2315bdad41
commit c6d8efba6c
2 changed files with 5 additions and 0 deletions

View 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

View 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;
}