06/07/2013 04:31, Pavel Sanda:
Jean-Marc Lasgouttes wrote:
This make sense. Here is a proposed patch. Since I am not a master/child
Correction of doxy comment is needed.
Pavel
Like this? What am I supposed to do with this patch now?
BTW, I am not very happy with the current bindings. I would think that
it is better to view/update master by default and has a special binding
for child only. This way a same key binding C-r would always view the
full document.
However, I am not a child/master user myself, so my intuition of what is
the most common may be biased, There may even be no good answer.
JMarc
>From 5c9a1a1e92f78ab483930308934ef0ce764499ec Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Fri, 5 Jul 2013 13:49:20 +0200
Subject: [PATCH] Allow master view/update when current buffer is the master
---
src/LyXAction.cpp | 8 ++++----
src/frontends/qt4/GuiView.cpp | 4 +++-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 2fa5ccf..d0a67ed 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -3252,8 +3252,8 @@ void LyXAction::init()
{ LFUN_BUFFER_PREVIOUS, "buffer-previous", ReadOnly, Buffer },
/*!
* \var lyx::FuncCode lyx::LFUN_MASTER_BUFFER_UPDATE
- * \li Action: When run from a child document, this updates (exports) document built
- from the master buffer, if available.
+ * \li Action: Update (export) the document built from the master buffer,
+ if the current buffer is part of a master/child document.
* \li Syntax: master-buffer-update [<FORMAT>]
* \li Params: <FORMAT>: The format to display, where this is one of the
formats defined (in the current GUI) in the
@@ -3266,8 +3266,8 @@ void LyXAction::init()
{ LFUN_MASTER_BUFFER_UPDATE, "master-buffer-update", ReadOnly, Buffer },
/*!
* \var lyx::FuncCode lyx::LFUN_MASTER_BUFFER_VIEW
- * \li Action: When run from a child document, this command shows a preview built
- from the master buffer, if available.
+ * \li Action: Show a preview built from the master buffer, if available.
+ if the current buffer is part of a master/child document.
* \li Syntax: master-buffer-view [<FORMAT>]
* \li Params: <FORMAT>: The format to display, where this is one of the
formats defined (in the current GUI) in the
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 993e830..76f0cd1 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1611,7 +1611,9 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
case LFUN_MASTER_BUFFER_UPDATE:
case LFUN_MASTER_BUFFER_VIEW:
- enable = doc_buffer && doc_buffer->parent() != 0
+ enable = doc_buffer
+ && (doc_buffer->parent() != 0
+ || doc_buffer->hasChildren())
&& !d.processing_thread_watcher_.isRunning();
break;
--
1.7.0.4