The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit c9f9107a7fd481ed8c1f4e9ada54976184254b4e
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sat Sep 29 16:12:31 2012 +0200

    Fix issues with xref dialog in read-only documents (#8177)

diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index 5082daa..c79dcb9 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -48,14 +48,6 @@ GuiRef::GuiRef(GuiView & lv)
 
        at_ref_ = false;
 
-       // Enabling is set in updateRefs. Disable for now in case no
-       // call to updateContents follows (e.g. read-only documents).
-       sortCB->setEnabled(false);
-       caseSensitiveCB->setEnabled(false);
-       caseSensitiveCB->setChecked(false);
-       refsTW->setEnabled(false);
-       gotoPB->setEnabled(false);
-
        refsTW->setColumnCount(1);
        refsTW->header()->setVisible(false);
 
@@ -98,19 +90,22 @@ GuiRef::GuiRef(GuiView & lv)
        bc().setOK(okPB);
        bc().setApply(applyPB);
        bc().setCancel(closePB);
-       bc().addReadOnly(refsTW);
-       bc().addReadOnly(sortCB);
-       bc().addReadOnly(caseSensitiveCB);
-       bc().addReadOnly(nameED);
-       bc().addReadOnly(referenceED);
        bc().addReadOnly(typeCO);
-       bc().addReadOnly(bufferCO);
 
        restored_buffer_ = -1;
        active_buffer_ = -1;
 }
 
 
+void GuiRef::enableView(bool enable)
+{
+       if (!enable)
+               // In the opposite case, updateContents() will be called anyway.
+               updateContents();
+       GuiDialog::enableView(enable);
+}
+
+
 void GuiRef::changed_adaptor()
 {
        changed();
@@ -139,9 +134,6 @@ void GuiRef::selectionChanged()
 
 void GuiRef::refHighlighted(QTreeWidgetItem * sel)
 {
-       if (isBufferReadonly())
-               return;
-
        if (sel->childCount() > 0) {
                sel->setExpanded(true);
                return;
@@ -158,7 +150,7 @@ void GuiRef::refHighlighted(QTreeWidgetItem * sel)
        if (at_ref_)
                gotoRef();
        gotoPB->setEnabled(true);
-       if (typeAllowed())
+       if (typeAllowed() && !isBufferReadonly())
                typeCO->setEnabled(true);
        nameED->setHidden(!nameAllowed());
        nameL->setHidden(!nameAllowed());
@@ -235,11 +227,13 @@ void GuiRef::updateContents()
 {
        int orig_type = typeCO->currentIndex();
 
-       referenceED->setText(toqstr(params_["reference"]));
+       referenceED->clear();
+       nameED->clear();
 
+       referenceED->setText(toqstr(params_["reference"]));
        nameED->setText(toqstr(params_["name"]));
-       nameED->setHidden(!nameAllowed() && !isBufferReadonly());
-       nameL->setHidden(!nameAllowed() && !isBufferReadonly());
+       nameED->setHidden(!nameAllowed());
+       nameL->setHidden(!nameAllowed());
 
        // restore type settings for new insets
        if (params_["reference"].empty())
@@ -449,7 +443,7 @@ void GuiRef::updateRefs()
                FileName const & name = theBufferList().fileNames()[the_buffer];
                Buffer const * buf = theBufferList().getBuffer(name);
                buf->getLabelList(refs_);
-       }       
+       }
        sortCB->setEnabled(!refs_.empty());
        caseSensitiveCB->setEnabled(sortCB->isEnabled() && sortCB->isChecked());
        refsTW->setEnabled(!refs_.empty());
diff --git a/src/frontends/qt4/GuiRef.h b/src/frontends/qt4/GuiRef.h
index e240d0e..250d407 100644
--- a/src/frontends/qt4/GuiRef.h
+++ b/src/frontends/qt4/GuiRef.h
@@ -30,6 +30,10 @@ class GuiRef : public GuiDialog, public Ui::RefUi
 
 public:
        GuiRef(GuiView & lv);
+       /// Dialog inherited methods
+       //@{
+       void enableView(bool enable);
+       //@}
 
 private Q_SLOTS:
        void changed_adaptor();

commit 0b2c308a68d24015494c8705f24871f73983315d
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sat Sep 29 16:11:09 2012 +0200

    sort table

diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index b7dd225..0d4c919 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -73,6 +73,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\bind_file", LyXRC::RC_BINDFILE },
        { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
        { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
+       { "\\close_buffer_with_last_view", 
LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
        { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
        { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
        { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
@@ -210,7 +211,6 @@ LexerKeyword lyxrcTags[] = {
        { "\\viewer", LyXRC::RC_VIEWER},
        { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
        { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
-       { "\\close_buffer_with_last_view", 
LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
        { "format", LyXRC::RC_LYXRCFORMAT }
 };
 

-----------------------------------------------------------------------

Summary of changes:
 src/LyXRC.cpp                |    2 +-
 src/frontends/qt4/GuiRef.cpp |   38 ++++++++++++++++----------------------
 src/frontends/qt4/GuiRef.h   |    4 ++++
 3 files changed, 21 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to