From e8da1771f2c6e2fdc7a2db21fbaee290a61dbb9b Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 20 Sep 2007 05:00:23 +0000 Subject: [PATCH] Introduce LFUN_MASTER_BUFFER_VIEW and UPDATE. Code by Tommaso Cucinotta. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20366 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/bind/cua.bind | 4 ++++ src/LyXAction.cpp | 2 ++ src/LyXFunc.cpp | 12 ++++++++++++ src/lfuns.h | 5 ++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind index 9f1b65c879..71d501d77c 100644 --- a/lib/bind/cua.bind +++ b/lib/bind/cua.bind @@ -43,8 +43,12 @@ \bind "C-p" "dialog-show print" \bind "C-d" "buffer-view dvi" # 'd' for dvi \bind "C-t" "buffer-view ps" +\bind "C-M-t" "master-buffer-view ps" +\bind "C-M-d" "master-buffer-view dvi" \bind "C-S-D" "buffer-update dvi" # 'd' for dvi \bind "C-S-T" "buffer-update ps" +\bind "C-M-S-t" "master-buffer-update ps" +\bind "C-M-S-d" "master-buffer-update dvi" \bind "C-q" "lyx-quit" \bind "C-Next" "buffer-next" \bind "C-Tab" "buffer-next" diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index d26b4dffeb..6dad0b688c 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -128,6 +128,8 @@ void LyXAction::init() { LFUN_BUFFER_TOGGLE_READ_ONLY, "buffer-toggle-read-only", ReadOnly }, { LFUN_BUFFER_UPDATE, "buffer-update", ReadOnly }, { LFUN_BUFFER_VIEW, "buffer-view", ReadOnly }, + { LFUN_MASTER_BUFFER_UPDATE, "master-buffer-update", ReadOnly }, + { LFUN_MASTER_BUFFER_VIEW, "master-buffer-view", ReadOnly }, { LFUN_BUFFER_WRITE, "buffer-write", ReadOnly }, { LFUN_BUFFER_WRITE_AS, "buffer-write-as", ReadOnly }, { LFUN_BUFFER_WRITE_ALL, "buffer-write-all", ReadOnly }, diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 8bdc6216f0..07238163b7 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -696,6 +696,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const case LFUN_BUFFER_WRITE_AS: case LFUN_BUFFER_UPDATE: case LFUN_BUFFER_VIEW: + case LFUN_MASTER_BUFFER_UPDATE: + case LFUN_MASTER_BUFFER_VIEW: case LFUN_BUFFER_IMPORT: case LFUN_BUFFER_AUTO_SAVE: case LFUN_RECONFIGURE: @@ -1000,6 +1002,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd) Exporter::preview(lyx_view_->buffer(), argument); break; + case LFUN_MASTER_BUFFER_UPDATE: + BOOST_ASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->getMasterBuffer()); + Exporter::Export(lyx_view_->buffer()->getMasterBuffer(), argument, true); + break; + + case LFUN_MASTER_BUFFER_VIEW: + BOOST_ASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->getMasterBuffer()); + Exporter::preview(lyx_view_->buffer()->getMasterBuffer(), argument); + break; + case LFUN_BUILD_PROGRAM: BOOST_ASSERT(lyx_view_ && lyx_view_->buffer()); Exporter::Export(lyx_view_->buffer(), "program", true); diff --git a/src/lfuns.h b/src/lfuns.h index 299166c6a2..3a27cf338a 100644 --- a/src/lfuns.h +++ b/src/lfuns.h @@ -398,11 +398,14 @@ enum kb_action { LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502 LFUN_TOOLBAR_TOGGLE, // Edwin 20070521 LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX - //290 + // 290 LFUN_PARAGRAPH_PARAMS, // rgh, 200708XX LFUN_LAYOUT_MODULES_CLEAR, // rgh, 20070825 LFUN_LAYOUT_MODULE_ADD, // rgh, 20070825 LFUN_LAYOUT_RELOAD, // rgh, 20070903 + LFUN_MASTER_BUFFER_VIEW, // Tommaso + // 295 + LFUN_MASTER_BUFFER_UPDATE, // Tommaso LFUN_LASTACTION // end of the table };