From 9faae1284bf6ab5e4deed980b56b4507594de2dd Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 19 Mar 2019 06:59:24 +0100 Subject: [PATCH] Add new dialog for templates and examples This lists all respective files from user, build and system directory in a structured way and thus allows for easier access to them. Fixes: #2396, #6861 --- lib/ui/stdmenus.inc | 3 +- src/LyXAction.cpp | 7 +- src/frontends/qt4/GuiApplication.cpp | 14 +- src/frontends/qt4/GuiLyXFiles.cpp | 405 +++++++++++++++++++++++++++ src/frontends/qt4/GuiLyXFiles.h | 76 +++++ src/frontends/qt4/GuiView.cpp | 13 +- src/frontends/qt4/GuiView.h | 3 +- src/frontends/qt4/Makefile.am | 3 + src/frontends/qt4/ui/LyXFilesUi.ui | 150 ++++++++++ 9 files changed, 661 insertions(+), 13 deletions(-) create mode 100644 src/frontends/qt4/GuiLyXFiles.cpp create mode 100644 src/frontends/qt4/GuiLyXFiles.h create mode 100644 src/frontends/qt4/ui/LyXFilesUi.ui diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index b9f16b0404..a0c3bf2631 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -43,9 +43,10 @@ Menuset Menu "file" Item "New|N" "buffer-new" - Item "New from Template...|m" "buffer-new-template" + Item "New from Template...|m" "dialog-show lyxfiles templates" Item "Open...|O" "file-open" Submenu "Open Recent|t" "file_lastfiles" + Item "Open Example File...|p" "dialog-show lyxfiles examples" Separator Item "Close|C" "buffer-close" Item "Close All" "buffer-close-all" diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index d6c821e55a..082d6080d4 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -714,8 +714,11 @@ void LyXAction::init() * \li Action: Creates a new buffer (that is, document) from a template. * \li Notion: Path for new files and templates can be set in Preferences dialog. Template will be asked for via Open-dialog. - * \li Syntax: buffer-new-template [] - * \li Params: : filename of created file with absolute path. + * \li Syntax: buffer-new-template [] [