#include "qt_helpers.h"
#include "FuncRequest.h"
+#include "insets/InsetCommand.h"
+
#include <QLineEdit>
#include <QPushButton>
GuiBibitem::GuiBibitem(GuiView & lv)
- : GuiCommand(lv, "bibitem", qt_("Bibliography Entry Settings"))
+ : GuiDialog(lv, "bibitem", qt_("Bibliography Entry Settings")),
+ params_(insetCode("bibitem"))
{
setupUi(this);
}
+bool GuiBibitem::initialiseParams(std::string const & data)
+{
+ // The name passed with LFUN_INSET_APPLY is also the name
+ // used to identify the mailer.
+ InsetCommand::string2params("bibitem", data, params_);
+ return true;
+}
+
+
+void GuiBibitem::dispatchParams()
+{
+ std::string const lfun = InsetCommand::params2string("bibitem", params_);
+ dispatch(FuncRequest(getLfun(), lfun));
+}
+
+
Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
namespace lyx {
namespace frontend {
-class GuiBibitem : public GuiCommand, public Ui::BibitemUi
+class GuiBibitem : public GuiDialog, public Ui::BibitemUi
{
Q_OBJECT
public:
+ /// Constructor
GuiBibitem(GuiView & lv);
private Q_SLOTS:
void applyView();
/// update
void updateContents();
+ ///
+ bool initialiseParams(std::string const & data);
+ /// clean-up on hide.
+ void clearParams() { params_.clear(); }
+ /// clean-up on hide.
+ void dispatchParams();
+ ///
+ bool isBufferDependent() const { return true; }
+
+private:
+ ///
+ InsetCommandParams params_;
};
} // namespace frontend
#ifndef GUIBIBTEX_H
#define GUIBIBTEX_H
-#include "GuiDialog.h"
+#include "GuiCommand.h"
#include "ButtonController.h"
#include "ui_BibtexUi.h"
#include "ui_BibtexAddUi.h"
#ifndef GUICITATION_H
#define GUICITATION_H
-#include "GuiDialog.h"
+#include "GuiCommand.h"
#include "GuiSelectionManager.h"
#include "ui_CitationUi.h"
-#include "support/docstring.h"
#include "BiblioInfo.h"
-#include <QKeyEvent>
#include <QStringList>
#include <QStringListModel>
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file GuiCommand.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef GUICOMMAND_H
+#define GUICOMMAND_H
+
+#include "GuiDialog.h"
+
+#include "insets/InsetCommandParams.h"
+
+
+namespace lyx {
+namespace frontend {
+
+class GuiCommand : public GuiDialog
+{
+public:
+ /// We need to know with what sort of inset we're associated.
+ // FIXME This should probably be an InsetCode
+ GuiCommand(GuiView &, QString const & name, QString const & title);
+ ///
+ bool initialiseParams(std::string const & data);
+ /// clean-up on hide.
+ void clearParams() { params_.clear(); }
+ /// clean-up on hide.
+ void dispatchParams();
+ ///
+ bool isBufferDependent() const { return true; }
+
+protected:
+ ///
+ InsetCommandParams params_;
+ //FIXME It should be possible to eliminate lfun_name_
+ //now and recover that information from params().insetType().
+ //But let's not do that quite yet.
+ /// Flags what action is taken by Kernel::dispatch()
+ std::string const lfun_name_;
+};
+
+} // namespace frontend
+} // namespace lyx
+
+#endif // GUIDIALOG_H
#include <config.h>
#include "GuiDialog.h"
+#include "GuiCommand.h"
+
#include "GuiView.h"
#include "qt_helpers.h"
#include "FuncRequest.h"
#include "support/debug.h"
#include <QCloseEvent>
-#include <QMainWindow>
-#include <QSettings>
-#include <QShowEvent>
using namespace std;
#include "Dialog.h"
#include "ButtonController.h"
-#include "insets/InsetCommandParams.h"
-
#include <QDialog>
-class QCloseEvent;
-class QShowEvent;
namespace lyx {
namespace frontend {
};
-class GuiCommand : public GuiDialog
-{
-public:
- /// We need to know with what sort of inset we're associated.
- // FIXME This should probably be an InsetCode
- GuiCommand(GuiView &, QString const & name, QString const & title);
- ///
- bool initialiseParams(std::string const & data);
- /// clean-up on hide.
- void clearParams() { params_.clear(); }
- /// clean-up on hide.
- void dispatchParams();
- ///
- bool isBufferDependent() const { return true; }
-
-protected:
- ///
- InsetCommandParams params_;
- //FIXME It should be possible to eliminate lfun_name_
- //now and recover that information from params().insetType().
- //But let's not do that quite yet.
- /// Flags what action is taken by Kernel::dispatch()
- std::string const lfun_name_;
-};
-
} // namespace frontend
} // namespace lyx
#ifndef GUIHYPERLINK_H
#define GUIHYPERLINK_H
-#include "GuiDialog.h"
+#include "GuiCommand.h"
#include "ui_HyperlinkUi.h"
-#include "insets/InsetCommandParams.h"
namespace lyx {
namespace frontend {
Q_OBJECT
public:
+ /// Constructor
GuiHyperlink(GuiView & lv);
public Q_SLOTS:
#define GUIINCLUDE_H
#include "GuiDialog.h"
+#include "GuiCommand.h"
#include "ui_IncludeUi.h"
-#include "insets/InsetCommandParams.h"
-
-#include "support/docstring.h"
-
namespace lyx {
namespace frontend {
#ifndef GUILABEL_H
#define GUILABEL_H
-#include "GuiDialog.h"
+#include "GuiCommand.h"
#include "ui_LabelUi.h"
namespace lyx {
void updateContents();
};
-
} // namespace frontend
} // namespace lyx
-#endif // GUIINDEX_H
+#endif // GUILABEL_H
#include "FontEnums.h"
#include <map>
+#include <string>
namespace lyx {
// -*- C++ -*-
/**
- * \file GuiNomencl.h
+ * \file GuiNomenclature.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* Full author contact details are available in file CREDITS.
*/
-#ifndef GUINOMENCL_H
-#define GUINOMENCL_H
+#ifndef GUINOMENCLATURE_H
+#define GUINOMENCLATURE_H
-#include "GuiDialog.h"
+#include "GuiCommand.h"
#include "ui_NomenclUi.h"
namespace lyx {
} // namespace frontend
} // namespace lyx
-#endif // GUINOMENCL_H
+#endif // GUINOMENCLATURE_H
#ifndef GUIREF_H
#define GUIREF_H
-#include "GuiDialog.h"
-#include "Dialog.h"
+#include "GuiCommand.h"
#include "ui_RefUi.h"
-#include "insets/InsetCommandParams.h"
#include <vector>
DialogView.h \
DockView.h \
FileDialog.h \
+ GuiCommand.h \
GuiFontExample.h \
GuiFontLoader.h \
GuiFontMetrics.h \
find_if(info_.begin(), info_.end(),
not1(mem_fun_ref(&ParamInfo::ParamData::isOptional)));
if (it == info_.end())
- LASSERT(false, /**/);
+ LASSERT(false, return docstring());
return (*this)[it->name()];
}
docstring const & InsetCommandParams::operator[](string const & name) const
{
static const docstring dummy; //so we don't return a ref to temporary
- LASSERT(info_.hasParam(name), /**/);
+ LASSERT(info_.hasParam(name), return dummy);
ParamMap::const_iterator data = params_.find(name);
if (data == params_.end() || data->second.empty())
return dummy;