#include "insets/InsetRef.h"
-#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
-
-#include <boost/filesystem/operations.hpp>
+#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;
-
-/// Flags what action is taken by Kernel::dispatch()
-/// Needed because we're not inheriting from GuiCommand
-static std::string const lfun_ref_ = "ref";
-
-GuiRef::GuiRef(LyXView & lv)
- : GuiDialog(lv, "ref"), params_(REF_CODE)
+GuiRef::GuiRef(GuiView & lv)
+ : 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(string const & data)
+bool GuiRef::initialiseParams(std::string const & data)
{
- // The name passed with LFUN_INSET_APPLY is also the name
- // used to identify the mailer.
- InsetCommandMailer::string2params(lfun_ref_, data, params_);
+ InsetCommand::string2params("ref", data, params_);
return true;
}
-void GuiRef::clearParams()
-{
- params_.clear();
-}
-
-
void GuiRef::dispatchParams()
{
- string const lfun = InsetCommandMailer::params2string(lfun_ref_, params_);
+ std::string const lfun = InsetCommand::params2string("ref", params_);
dispatch(FuncRequest(getLfun(), lfun));
}
-Dialog * createGuiRef(LyXView & lv) { return new GuiRef(lv); }
+
+Dialog * createGuiRef(GuiView & lv) { return new GuiRef(lv); }
} // namespace frontend