The branch, master, has been updated.

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

commit b75ecdfaf032d210a6cd5391aacdf5704d5b483f
Author: Scott Kostyshak <[email protected]>
Date:   Fri Apr 19 22:39:17 2013 -0400

    GuiRef: only enable "Group" CB if non-empty refs

diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index d3f68d5..141c67b 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -462,6 +462,7 @@ void GuiRef::updateRefs()
        sortCB->setEnabled(!refs_.empty());
        caseSensitiveCB->setEnabled(sortCB->isEnabled() && sortCB->isChecked());
        refsTW->setEnabled(!refs_.empty());
+       groupCB->setEnabled(!refs_.empty());
        // refsTW should only be the focus proxy when it is enabled
        setFocusProxy(refs_.empty() ? 0 : refsTW);
        gotoPB->setEnabled(!refs_.empty());

commit 21d1f97cad7efb5b76ebd515a4987d696900fb8a
Author: Scott Kostyshak <[email protected]>
Date:   Fri Apr 19 22:24:16 2013 -0400

    GuiRef: do not insert a category as a ref
    
    Before, if a user had "Group" checked in GuiRef and double-clicked
    on a category, that category would be inserted as a (broken)
    reference. Now, when a category is double-clicked, nothing happens.

diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index 15e6583..d3f68d5 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -162,6 +162,11 @@ void GuiRef::refSelected(QTreeWidgetItem * sel)
        if (isBufferReadonly())
                return;
 
+       if (sel->childCount()) {
+               sel->setExpanded(false);
+               return;
+       }
+
 /*     int const cur_item = refsTW->currentRow();
        bool const cur_item_selected = cur_item >= 0 ?
                refsLB->isSelected(cur_item) : false;*/

commit 647ae51a462fdb8d5256fde65596695e7611e2ff
Author: Scott Kostyshak <[email protected]>
Date:   Fri Apr 19 07:48:15 2013 -0400

    GuiRef: do not hide labels that start with ':'
    
    If a label starts with ':' and 'Group' is checked,
    the label is now shown under "<No prefix>" instead of
    not shown.
    
    Note that labels starting with ':' can be valid in LaTeX.

diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index 9e64750..15e6583 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -392,11 +392,11 @@ void GuiRef::redoRefs()
                                QString const ref = refsStrings.at(i);
                                if ((ref.startsWith(cat + QString(":")))
                                    || (cat == qt_("<No prefix>")
-                                       && !ref.contains(":"))) {
-                                       QTreeWidgetItem * child =
-                                               new QTreeWidgetItem(item);
-                                       child->setText(0, ref);
-                                       item->addChild(child);
+                                      && (!ref.mid(1).contains(":") || 
ref.left(1).contains(":")))) {
+                                               QTreeWidgetItem * child =
+                                                       new 
QTreeWidgetItem(item);
+                                               child->setText(0, ref);
+                                               item->addChild(child);
                                }
                        }
                        refsCats.append(item);

commit 9887dd48ca52914b79763b8d689cbe5f335938b9
Author: Scott Kostyshak <[email protected]>
Date:   Fri Apr 19 07:48:26 2013 -0400

    GuiRef: only show "<No prefix>" if non-empty
    
    If "Group" is checked, "<No prefix>" is shown only if there exists a
    label with no prefix. Before, it was shown even when it was empty and
    even when there were no labels at all.

diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index c79dcb9..9e64750 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -350,19 +350,29 @@ void GuiRef::redoRefs()
        QStringList refsStrings;
        QStringList refsCategories;
        vector<docstring>::const_iterator iter;
+       bool noprefix = false;
        for (iter = refs_.begin(); iter != refs_.end(); ++iter) {
                QString const lab = toqstr(*iter);
                refsStrings.append(lab);
-               if (groupCB->isChecked() && lab.contains(":")) {
-                       QString const pref = lab.split(':')[0];
-                       if (!pref.isEmpty() && !refsCategories.contains(pref))
-                                 refsCategories.append(pref);
+               if (groupCB->isChecked()) {
+                       if (lab.contains(":")) {
+                               QString const pref = lab.split(':')[0];
+                               if (!refsCategories.contains(pref)) {
+                                       if (!pref.isEmpty())
+                                               refsCategories.append(pref);
+                                       else
+                                               noprefix = true;
+                               }
+                       }
+                       else
+                               noprefix = true;
                }
        }
        // sort categories case-intensively
        qSort(refsCategories.begin(), refsCategories.end(),
              caseInsensitiveLessThan /*defined above*/);
-       refsCategories.insert(0, qt_("<No prefix>"));
+       if (noprefix)
+               refsCategories.insert(0, qt_("<No prefix>"));
 
        if (sortCB->isEnabled() && sortCB->isChecked()) {
                if(caseSensitiveCB->isEnabled() && caseSensitiveCB->isChecked())

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

Summary of changes:
 src/frontends/qt4/GuiRef.cpp |   36 ++++++++++++++++++++++++++----------
 1 files changed, 26 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to