#include "insets/InsetRef.h"
-#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
+#include "support/FileName.h"
+#include "support/filetools.h" // makeAbsPath, makeDisplayPath
#include <QLineEdit>
#include <QCheckBox>
#include <QToolTip>
#include <QCloseEvent>
-using std::vector;
-using std::string;
+using namespace std;
+using namespace lyx::support;
namespace lyx {
namespace frontend {
-using support::makeAbsPath;
-using support::makeDisplayPath;
-
GuiRef::GuiRef(GuiView & lv)
- : GuiCommand(lv, "ref")
+ : GuiDialog(lv, "ref", qt_("Cross-reference")),
+ params_(insetCode("ref"))
{
setupUi(this);
- setViewTitle(_("Cross-reference"));
sort_ = false;
at_ref_ = false;
{
slotClose();
reset_dialog();
- GuiDialog::closeEvent(e);
+ e->accept();
}
vector<string> buffers = theBufferList().getFileNames();
for (vector<string>::iterator it = buffers.begin();
it != buffers.end(); ++it) {
- bufferCO->addItem(toqstr(lyx::to_utf8(makeDisplayPath(*it))));
+ bufferCO->addItem(toqstr(makeDisplayPath(*it)));
}
// restore the buffer combo setting for new insets
// the first item inserted
QString const oldSelection(referenceED->text());
- for (std::vector<docstring>::const_iterator iter = refs_.begin();
+ for (vector<docstring>::const_iterator iter = refs_.begin();
iter != refs_.end(); ++iter) {
refsLW->addItem(toqstr(*iter));
}
{
refs_.clear();
string const name = theBufferList().getFileNames()[bufferCO->currentIndex()];
- Buffer const * buf = theBufferList().getBuffer(makeAbsPath(name).absFilename());
+ Buffer const * buf = theBufferList().getBuffer(
+ support::makeAbsPath(name).absFilename());
buf->getLabelList(refs_);
sortCB->setEnabled(!refs_.empty());
refsLW->setEnabled(!refs_.empty());
}
+bool GuiRef::initialiseParams(std::string const & data)
+{
+ InsetCommand::string2params("ref", data, params_);
+ return true;
+}
+
+
+void GuiRef::dispatchParams()
+{
+ std::string const lfun = InsetCommand::params2string("ref", params_);
+ dispatch(FuncRequest(getLfun(), lfun));
+}
+
+
+
Dialog * createGuiRef(GuiView & lv) { return new GuiRef(lv); }