if (name == "include")
return createGuiInclude(lyxview_);
if (name == "index")
- return new GuiIndexDialog(lyxview_);
+ return createGuiIndex(lyxview_);
if (name == "nomenclature")
return createGuiNomenclature(lyxview_);
if (name == "label")
- return new GuiLabelDialog(lyxview_);
+ return createGuiLabel(lyxview_);
if (name == "log")
return createGuiLog(lyxview_);
if (name == "view-source")
#include "support/lstrings.h"
#include "support/docstring.h"
+#include "insets/InsetCommand.h"
+
#include <vector>
#include <string>
GuiCitation::GuiCitation(LyXView & lv)
- : GuiDialog(lv, "citation"), ControlCommand(*this, "citation")
+ : GuiCommand(lv, "citation")
{
setupUi(this);
setViewTitle(_("Citation"));
- setController(this, false);
connect(citationStyleCO, SIGNAL(activated(int)),
this, SLOT(changed()));
citationStyleCO->setEnabled(!basic_engine && haveSelection);
citationStyleLA->setEnabled(!basic_engine && haveSelection);
- string const & command = params().getCmdName();
+ string const & command = params_.getCmdName();
// Find the style of the citekeys
vector<biblio::CiteStyle> const & styles = citeStyles_;
biblio::CitationStyle(styles[choice], full, force)
.asLatexStr();
- params().setCmdName(command);
- params()["key"] = qstring_to_ucs4(cited_keys_.join(","));
- params()["before"] = qstring_to_ucs4(before);
- params()["after"] = qstring_to_ucs4(after);
+ params_.setCmdName(command);
+ params_["key"] = qstring_to_ucs4(cited_keys_.join(","));
+ params_["before"] = qstring_to_ucs4(before);
+ params_["after"] = qstring_to_ucs4(after);
dispatchParams();
}
QString GuiCitation::textBefore()
{
- return toqstr(params()["before"]);
+ return toqstr(params_["before"]);
}
QString GuiCitation::textAfter()
{
- return toqstr(params()["after"]);
+ return toqstr(params_["after"]);
}
available_model_.setStringList(all_keys_);
// Ditto for the keys cited in this inset
- QString str = toqstr(params()["key"]);
+ QString str = toqstr(params_["key"]);
if (str.isEmpty())
cited_keys_.clear();
else
bool GuiCitation::initialiseParams(string const & data)
{
- if (!ControlCommand::initialiseParams(data))
- return false;
+ InsetCommandMailer::string2params(lfun_name_, data, params_);
biblio::CiteEngine const engine = buffer().params().getEngine();
}
-
void GuiCitation::clearParams()
{
- ControlCommand::clearParams();
+ params_.clear();
bibkeysInfo_.clear();
}
namespace lyx {
namespace frontend {
-class GuiCitation
- : public GuiDialog, public Ui::CitationUi, public ControlCommand
+class GuiCitation : public GuiCommand, public Ui::CitationUi
{
Q_OBJECT
void updateView();
private:
- ///
- ControlCommand & controller() { return *this; }
///
void closeEvent(QCloseEvent * e);
/// prepares a call to GuiCitation::searchKeys when we
///
void init();
-
/// Available keys
QStringListModel * available() { return &available_model_; }
-
/// Selected keys
QStringListModel * selected() { return &selected_model_; }
-
/// Text before cite
QString textBefore();
-
/// Text after cite
QString textAfter();
-
/// Get key description
QString getKeyInfo(QString const &);
-
/// Clear selected keys
void clearSelection();
-
/// Return a list of available fields
QStringList getFieldsAsQStringList();
-
/// Return a list of available fields
QStringList getEntriesAsQStringList();
#include "GuiIndex.h"
-#include "ControlCommand.h"
-
#include "debug.h"
#include "qt_helpers.h"
GuiIndexDialogBase::GuiIndexDialogBase(LyXView & lv,
docstring const & title, QString const & label, std::string const & name)
- : GuiDialog(lv, name)
+ : GuiCommand(lv, name)
{
label_ = label;
setupUi(this);
setViewTitle(title);
- setController(new ControlCommand(*this, name));
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
}
-ControlCommand & GuiIndexDialogBase::controller()
-{
- return static_cast<ControlCommand &>(GuiDialog::controller());
-}
-
-
void GuiIndexDialogBase::change_adaptor()
{
changed();
void GuiIndexDialogBase::updateContents()
{
- docstring const contents = controller().params()["name"];
+ docstring const contents = params_["name"];
keywordED->setText(toqstr(contents));
bc().setValid(!contents.empty());
}
void GuiIndexDialogBase::applyView()
{
- controller().params()["name"] = qstring_to_ucs4(keywordED->text());
+ params_["name"] = qstring_to_ucs4(keywordED->text());
}
/////////////////////////////////////////////////////////////////
-GuiIndexDialog::GuiIndexDialog(LyXView & lv)
+GuiIndex::GuiIndex(LyXView & lv)
: GuiIndexDialogBase(lv, _("Index Entry"), qt_("&Keyword:"), "index")
{
keywordED->setWhatsThis( qt_(
}
+Dialog * createGuiIndex(LyXView & lv) { return new GuiIndex(lv); }
+
+
/////////////////////////////////////////////////////////////////
//
// Label Dialog
//
/////////////////////////////////////////////////////////////////
-GuiLabelDialog::GuiLabelDialog(LyXView & lv)
+GuiLabel::GuiLabel(LyXView & lv)
: GuiIndexDialogBase(lv, _("Label"), qt_("&Label:"), "label")
{}
+Dialog * createGuiLabel(LyXView & lv) { return new GuiLabel(lv); }
+
+
} // namespace frontend
} // namespace lyx
#define GUIINDEX_H
#include "GuiDialog.h"
-#include "ControlCommand.h"
#include "ui_IndexUi.h"
namespace lyx {
namespace frontend {
-class GuiIndexDialogBase : public GuiDialog, public Ui::IndexUi
+class GuiIndexDialogBase : public GuiCommand, public Ui::IndexUi
{
Q_OBJECT
private:
///
void closeEvent(QCloseEvent * e);
- /// parent controller
- ControlCommand & controller();
///
bool isValid();
/// Apply changes
};
-class GuiIndexDialog : public GuiIndexDialogBase
+class GuiIndex : public GuiIndexDialogBase
{
public:
- GuiIndexDialog(LyXView & lv);
+ GuiIndex(LyXView & lv);
};
-class GuiLabelDialog : public GuiIndexDialogBase
+class GuiLabel : public GuiIndexDialogBase
{
public:
- GuiLabelDialog(LyXView & lv);
+ GuiLabel(LyXView & lv);
};