diff --git a/lib/images/buffer-toggle-output-sync.png b/lib/images/buffer-toggle-output-sync.png new file mode 100644 index 0000000000..ac005e8472 Binary files /dev/null and b/lib/images/buffer-toggle-output-sync.png differ diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index 794f050528..534674f36b 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -100,6 +100,7 @@ ToolbarSet Item "Update" "buffer-update" Item "View master document" "master-buffer-view" Item "Update master document" "master-buffer-update" + Item "Toggle Resources for Forward/Reverse Search" "buffer-toggle-output-sync" Separator StickyPopupMenu "view-others" "View other formats" StickyPopupMenu "update-others" "Update other formats" diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 9d7af3bbad..5c49a8145a 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1078,7 +1078,12 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag) flag.setOnOff(buffer_.params().compressed); break; } - + + case LFUN_BUFFER_TOGGLE_OUTPUT_SYNC: { + flag.setOnOff(buffer_.params().output_sync); + break; + } + case LFUN_SCREEN_UP: case LFUN_SCREEN_DOWN: case LFUN_SCROLL: @@ -1588,6 +1593,10 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) buffer_.params().compressed = !buffer_.params().compressed; break; + case LFUN_BUFFER_TOGGLE_OUTPUT_SYNC: + buffer_.params().output_sync = !buffer_.params().output_sync; + break; + case LFUN_SCREEN_UP: case LFUN_SCREEN_DOWN: { Point p = getPos(cur); diff --git a/src/FuncCode.h b/src/FuncCode.h index 6137f2a3db..573a441812 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -447,6 +447,7 @@ enum FuncCode LFUN_PREVIEW_INSERT, // vfr, 20100328 LFUN_FORWARD_SEARCH, LFUN_INSET_COPY_AS, // vfr, 20100419 + LFUN_BUFFER_TOGGLE_OUTPUT_SYNC, LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 32bb731b0e..6d5c1a5908 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -2843,7 +2843,6 @@ void LyXAction::init() * \endvar */ { LFUN_FORWARD_SEARCH, "forward-search", ReadOnly, System }, - /*! * \var lyx::FuncCode lyx::LFUN_SERVER_NOTIFY * \li Action: Sends notify message about the last key-sequence to client. @@ -2920,6 +2919,16 @@ void LyXAction::init() * \endvar */ { LFUN_BUFFER_TOGGLE_COMPRESSION, "buffer-toggle-compression", Noop, Buffer }, +/*! + * \var lyx::FuncCode lyx::LFUN_BUFFER_TOGGLE_OUTPUT_SYNC + * \li Action: Toggles including of resources for forward/reverse search of the given document. + * \li Notion: When toggled on, SyncTeX is invoked for PDF, while srcltx package + is used for DVI. Custom LaTeX macro can be defined in preferences. + * \li Syntax: buffer-toggle-output-sync + * \li Origin: sanda, 25 May 2010 + * \endvar + */ + { LFUN_BUFFER_TOGGLE_OUTPUT_SYNC, "buffer-toggle-output-sync", Noop, System }, /*! * \var lyx::FuncCode lyx::LFUN_BUFFER_CLOSE * \li Action: Closes the current buffer.