]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiRef.cpp
Compil fix.
[lyx.git] / src / frontends / qt4 / GuiRef.cpp
index df032c00a32bd3cf11fb778903cbbe6f405159f5..c7770453d67d6f0899e008d7707ed9255e01e459 100644 (file)
@@ -22,7 +22,7 @@
 #include "insets/InsetRef.h"
 
 #include "support/FileName.h"
-#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
+#include "support/filetools.h" // makeAbsPath, makeDisplayPath
 
 #include <QLineEdit>
 #include <QCheckBox>
@@ -39,7 +39,8 @@ namespace lyx {
 namespace frontend {
 
 GuiRef::GuiRef(GuiView & lv)
-       : GuiCommand(lv, "ref", qt_("Cross-reference"))
+       : GuiDialog(lv, "ref", qt_("Cross-reference")),
+         params_(insetCode("ref"))
 {
        setupUi(this);
 
@@ -180,7 +181,7 @@ void GuiRef::closeEvent(QCloseEvent * e)
 {
        slotClose();
        reset_dialog();
-       GuiDialog::closeEvent(e);
+       e->accept();
 }
 
 
@@ -209,7 +210,7 @@ void GuiRef::updateContents()
        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
@@ -339,7 +340,8 @@ void GuiRef::updateRefs()
 {
        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());
@@ -367,6 +369,21 @@ void GuiRef::gotoBookmark()
 }
 
 
+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); }