]> git.lyx.org Git - lyx.git/commitdiff
Remove GuiRef::nameAllowed, as the DocBook support no more uses it
authorThibaut Cuvelier <cuvelier.thibaut@gmail.com>
Sun, 5 Jul 2020 00:24:57 +0000 (02:24 +0200)
committerPavel Sanda <sanda@lyx.org>
Wed, 8 Jul 2020 07:55:59 +0000 (09:55 +0200)
src/frontends/qt/GuiRef.cpp
src/frontends/qt/GuiRef.h
src/frontends/qt/ui/RefUi.ui
src/insets/InsetRef.cpp

index d819e45ff8e2a3b978a921652f2f78eb735d3c03..a727700005a8f829efb76a7bbf5872dd23a14434 100644 (file)
@@ -96,8 +96,6 @@ GuiRef::GuiRef(GuiView & lv)
                this, SLOT(resetFilter()));
        connect(csFindCB, SIGNAL(clicked()),
                this, SLOT(filterLabels()));
-       connect(nameED, SIGNAL(textChanged(QString)),
-               this, SLOT(changed_adaptor()));
        connect(refsTW, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
                this, SLOT(refHighlighted(QTreeWidgetItem *)));
        connect(refsTW, SIGNAL(itemSelectionChanged()),
@@ -213,8 +211,6 @@ void GuiRef::refHighlighted(QTreeWidgetItem * sel)
        gotoPB->setEnabled(true);
        if (!isBufferReadonly())
                typeCO->setEnabled(true);
-       nameED->setHidden(!nameAllowed());
-       nameL->setHidden(!nameAllowed());
 }
 
 
@@ -318,7 +314,6 @@ void GuiRef::updateContents()
                typeCO->itemData(typeCO->currentIndex()).toString();
 
        referenceED->clear();
-       nameED->clear();
        typeCO->clear();
 
        // FIXME Bring InsetMathRef on par with InsetRef
@@ -336,9 +331,6 @@ void GuiRef::updateContents()
                typeCO->addItem(qt_("Formatted reference"), "prettyref");
 
        referenceED->setText(toqstr(params_["reference"]));
-       nameED->setText(toqstr(params_["name"]));
-       nameED->setHidden(!nameAllowed());
-       nameL->setHidden(!nameAllowed());
 
        // restore type settings for new insets
        bool const new_inset = params_["reference"].empty();
@@ -392,7 +384,6 @@ void GuiRef::applyView()
 
        params_.setCmdName(fromqstr(typeCO->itemData(typeCO->currentIndex()).toString()));
        params_["reference"] = qstring_to_ucs4(last_reference_);
-       params_["name"] = qstring_to_ucs4(nameED->text());
        params_["plural"] = pluralCB->isChecked() ?
              from_ascii("true") : from_ascii("false");
        params_["caps"] = capsCB->isChecked() ?
@@ -403,13 +394,6 @@ void GuiRef::applyView()
 }
 
 
-bool GuiRef::nameAllowed()
-{
-       KernelDocType const doc_type = docType();
-       return doc_type != LATEX && doc_type != LITERATE;
-}
-
-
 void GuiRef::setGoBack()
 {
        gotoPB->setText(qt_("&Go Back"));
index 335ff020769265e391e6d919fd3b6f9c9891cf96..d46bbad0a346ac8acdc282d12880b2b760fe02d8 100644 (file)
@@ -73,8 +73,6 @@ private:
        ///
        void enableBoxes();
 
-       /// is name allowed for this ?
-       bool nameAllowed();
        /// go to current reference
        void gotoRef();
        /// set go back button
index 53d637b094202cd4caac955a07cc9b2b6dc03978..0f4a7d351ae5b70f4f59f97ac74358b11bb2311e 100644 (file)
     </widget>
    </item>
    <item row="7" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout_4">
-     <item>
-      <widget class="QLabel" name="nameL">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>&amp;Name:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>nameED</cstring>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLineEdit" name="nameED">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
+    <layout class="QHBoxLayout" name="horizontalLayout_4"/>
    </item>
    <item row="0" column="0">
     <layout class="QGridLayout" name="gridLayout">
   <tabstop>groupCB</tabstop>
   <tabstop>referenceED</tabstop>
   <tabstop>typeCO</tabstop>
-  <tabstop>nameED</tabstop>
  </tabstops>
  <includes>
   <include location="local">qt_i18n.h</include>
index e9b26953976a729bb4e2a2967859600f1d6fd865..d41f0a1165a72ffbcec34e2c40c1f7a69716b048 100644 (file)
@@ -287,8 +287,6 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const
                }
        }
        else {
-               // We don't want to output p_["name"], since that is only used
-               // in docbook. So we construct new params, without it, and use that.
                InsetCommandParams p(REF_CODE, cmd);
                docstring const ref = getParam("reference");
                p["reference"] = ref;