+++ /dev/null
-/**
- * \file GuiIndex.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "GuiIndex.h"
-
-#include "support/debug.h"
-#include "qt_helpers.h"
-
-#include <QLabel>
-#include <QPushButton>
-#include <QLineEdit>
-#include <QCloseEvent>
-
-using namespace std;
-
-namespace lyx {
-namespace frontend {
-
-/////////////////////////////////////////////////////////////////
-//
-// Base implementation
-//
-/////////////////////////////////////////////////////////////////
-
-GuiIndexDialogBase::GuiIndexDialogBase(GuiView & lv,
- QString const & title, QString const & label, string const & name)
- : GuiCommand(lv, name, title)
-{
- label_ = label;
- setupUi(this);
-
- connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
- connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
- connect(keywordED, SIGNAL(textChanged(const QString &)),
- this, SLOT(change_adaptor()));
-
- setFocusProxy(keywordED);
-
- keywordLA->setText(label_);
-
- keywordED->setWhatsThis( qt_(
- "The format of the entry in the index.\n"
- "\n"
- "An entry can be specified as a sub-entry of\n"
- "another with \"!\":\n"
- "\n"
- "cars!mileage\n"
- "\n"
- "You can cross-refer to another entry like so:\n"
- "\n"
- "cars!mileage|see{economy}\n"
- "\n"
- "For further details refer to the local LaTeX\n"
- "documentation.\n")
- );
-
- bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
- bc().setOK(okPB);
- bc().setCancel(closePB);
- bc().addReadOnly(keywordED);
-}
-
-
-void GuiIndexDialogBase::change_adaptor()
-{
- changed();
-}
-
-
-void GuiIndexDialogBase::reject()
-{
- slotClose();
-}
-
-
-void GuiIndexDialogBase::closeEvent(QCloseEvent * e)
-{
- slotClose();
- e->accept();
-}
-
-
-void GuiIndexDialogBase::updateContents()
-{
- docstring const contents = params_["name"];
- keywordED->setText(toqstr(contents));
- bc().setValid(!contents.empty());
-}
-
-
-void GuiIndexDialogBase::applyView()
-{
- params_["name"] = qstring_to_ucs4(keywordED->text());
-}
-
-
-bool GuiIndexDialogBase::isValid()
-{
- return !keywordED->text().isEmpty();
-}
-
-
-/////////////////////////////////////////////////////////////////
-//
-// Index Dialog
-//
-/////////////////////////////////////////////////////////////////
-
-
-GuiIndex::GuiIndex(GuiView & lv)
- : GuiIndexDialogBase(lv, qt_("Index Entry"), qt_("&Keyword:"), "index")
-{
- keywordED->setWhatsThis( qt_(
- "The format of the entry in the index.\n"
- "\n"
- "An entry can be specified as a sub-entry of\n"
- "another with \"!\":\n"
- "\n"
- "cars!mileage\n"
- "\n"
- "You can cross-refer to another entry like so:\n"
- "\n"
- "cars!mileage|see{economy}\n"
- "\n"
- "For further details refer to the local LaTeX\n"
- "documentation.\n")
- );
-}
-
-
-Dialog * createGuiIndex(GuiView & lv) { return new GuiIndex(lv); }
-
-
-/////////////////////////////////////////////////////////////////
-//
-// Label Dialog
-//
-/////////////////////////////////////////////////////////////////
-
-GuiLabel::GuiLabel(GuiView & lv)
- : GuiIndexDialogBase(lv, qt_("Label"), qt_("&Label:"), "label")
-{}
-
-
-Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); }
-
-
-} // namespace frontend
-} // namespace lyx
-
-#include "GuiIndex_moc.cpp"
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file GuiIndex.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- * \author Kalle Dalheimer
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef GUIINDEX_H
-#define GUIINDEX_H
-
-#include "GuiDialog.h"
-#include "ui_IndexUi.h"
-
-namespace lyx {
-namespace frontend {
-
-class GuiIndexDialogBase : public GuiCommand, public Ui::IndexUi
-{
- Q_OBJECT
-
-public:
- GuiIndexDialogBase(GuiView & lv, QString const & title,
- QString const & label, std::string const & name);
-
-private Q_SLOTS:
- void change_adaptor();
- void reject();
-
-private:
- ///
- void closeEvent(QCloseEvent * e);
- ///
- bool isValid();
- /// Apply changes
- void applyView();
- /// update
- void updateContents();
-
- ///
- QString label_;
-};
-
-
-class GuiIndex : public GuiIndexDialogBase
-{
-public:
- GuiIndex(GuiView & lv);
-};
-
-
-class GuiLabel : public GuiIndexDialogBase
-{
-public:
- GuiLabel(GuiView & lv);
-};
-
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // GUIINDEX_H
--- /dev/null
+/**
+ * \file GuiLabel.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "GuiLabel.h"
+
+#include "support/debug.h"
+#include "qt_helpers.h"
+
+#include <QLabel>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QCloseEvent>
+
+using namespace std;
+
+namespace lyx {
+namespace frontend {
+
+/////////////////////////////////////////////////////////////////
+//
+// Base implementation
+//
+/////////////////////////////////////////////////////////////////
+
+GuiLabel::GuiLabel(GuiView & lv)
+ : GuiCommand(lv, "label", qt_("Label"))
+{
+ setupUi(this);
+
+ connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
+ connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
+ connect(keywordED, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+
+ setFocusProxy(keywordED);
+
+ bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
+ bc().setOK(okPB);
+ bc().setCancel(closePB);
+ bc().addReadOnly(keywordED);
+}
+
+
+void GuiLabel::change_adaptor()
+{
+ changed();
+}
+
+
+void GuiLabel::reject()
+{
+ slotClose();
+}
+
+
+void GuiLabel::closeEvent(QCloseEvent * e)
+{
+ slotClose();
+ e->accept();
+}
+
+
+void GuiLabel::updateContents()
+{
+ docstring const contents = params_["name"];
+ keywordED->setText(toqstr(contents));
+ bc().setValid(!contents.empty());
+}
+
+
+void GuiLabel::applyView()
+{
+ params_["name"] = qstring_to_ucs4(keywordED->text());
+}
+
+
+bool GuiLabel::isValid()
+{
+ return !keywordED->text().isEmpty();
+}
+
+
+Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); }
+
+
+} // namespace frontend
+} // namespace lyx
+
+#include "GuiLabel_moc.cpp"
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file GuiLabel.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author John Levon
+ * \author Kalle Dalheimer
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef GUILABEL_H
+#define GUILABEL_H
+
+#include "GuiDialog.h"
+#include "ui_LabelUi.h"
+
+namespace lyx {
+namespace frontend {
+
+class GuiLabel : public GuiCommand, public Ui::LabelUi
+{
+ Q_OBJECT
+
+public:
+ GuiLabel(GuiView & lv);
+
+private Q_SLOTS:
+ void change_adaptor();
+ void reject();
+
+private:
+ ///
+ void closeEvent(QCloseEvent * e);
+ ///
+ bool isValid();
+ /// Apply changes
+ void applyView();
+ /// update
+ void updateContents();
+};
+
+
+} // namespace frontend
+} // namespace lyx
+
+#endif // GUIINDEX_H
Dialog * createGuiFloat(GuiView & lv);
Dialog * createGuiGraphics(GuiView & lv);
Dialog * createGuiInclude(GuiView & lv);
-Dialog * createGuiIndex(GuiView & lv);
Dialog * createGuiLabel(GuiView & lv);
Dialog * createGuiListings(GuiView & lv);
Dialog * createGuiLog(GuiView & lv);
return createGuiGraphics(*this);
if (name == "include")
return createGuiInclude(*this);
- if (name == "index")
- return createGuiIndex(*this);
if (name == "nomenclature")
return createGuiNomenclature(*this);
if (name == "label")
GuiIdListModel.cpp \
GuiImage.cpp \
GuiInclude.cpp \
- GuiIndex.cpp \
GuiKeySymbol.cpp \
+ GuiLabel.cpp \
GuiListings.cpp \
GuiLog.cpp \
GuiMath.cpp \
GuiGraphics.h \
GuiHyperlink.h \
GuiInclude.h \
- GuiIndex.h \
+ GuiLabel.h \
GuiListings.h \
GuiLog.h \
GuiMathMatrix.h \
GraphicsUi.ui \
HyperlinkUi.ui \
IncludeUi.ui \
- IndexUi.ui \
+ LabelUi.ui \
LanguageUi.ui \
LaTeXUi.ui \
ListingsUi.ui \
+++ /dev/null
-<ui version="4.0" >
- <class>IndexUi</class>
- <widget class="QDialog" name="IndexUi" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>203</width>
- <height>82</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string/>
- </property>
- <property name="sizeGripEnabled" >
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="keywordLA" >
- <property name="toolTip" >
- <string/>
- </property>
- <property name="text" >
- <string/>
- </property>
- <property name="buddy" >
- <cstring>keywordED</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="keywordED" >
- <property name="toolTip" >
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="okPB" >
- <property name="text" >
- <string>&OK</string>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="closePB" >
- <property name="text" >
- <string>Cancel</string>
- </property>
- <property name="autoDefault" >
- <bool>false</bool>
- </property>
- <property name="default" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <includes>
- <include location="local" >qt_helpers.h</include>
- </includes>
- <resources/>
- <connections/>
-</ui>
--- /dev/null
+<ui version="4.0" >
+ <class>LabelUi</class>
+ <widget class="QDialog" name="LabelUi" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>300</width>
+ <height>82</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string/>
+ </property>
+ <property name="sizeGripEnabled" >
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>11</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="keywordLA" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>&Label:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>keywordED</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="keywordED" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okPB" >
+ <property name="text" >
+ <string>&OK</string>
+ </property>
+ <property name="default" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="closePB" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ <property name="autoDefault" >
+ <bool>false</bool>
+ </property>
+ <property name="default" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <includes>
+ <include location="local" >qt_helpers.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>