]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCommandBuffer.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiCommandBuffer.cpp
index 2a1ca377b41824756f419e51be3b4262b1baf4b4..6958e45469e3f161d971edcd626d27398965555b 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <QHBoxLayout>
 #include <QKeyEvent>
-#include <QLayout>
 #include <QListWidget>
 #include <QMouseEvent>
 #include <QPixmap>
 #include <QToolTip>
 #include <QVBoxLayout>
 
-using std::back_inserter;
-using std::transform;
-using std::string;
-using std::vector;
-
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace frontend {
 
-using support::prefixIs;
-
-
 namespace {
 
 class QTempListBox : public QListWidget {
@@ -135,10 +128,11 @@ void GuiCommandBuffer::cancel()
 
 void GuiCommandBuffer::dispatch()
 {
-       dispatch(fromqstr(edit_->text()));
+       QString cmd = edit_->text();
        view_->setFocus();
        edit_->setText(QString());
        edit_->clearFocus();
+       dispatch(fromqstr(cmd));
 }
 
 
@@ -173,7 +167,7 @@ void GuiCommandBuffer::complete()
        list->resize(list->sizeHint());
        QPoint const pos = edit_->mapToGlobal(QPoint(0, 0));
 
-       int const y = std::max(0, pos.y() - list->height());
+       int const y = max(0, pos.y() - list->height());
 
        list->move(pos.x(), y);
 
@@ -272,7 +266,9 @@ docstring const GuiCommandBuffer::getCurrentState() const
 
 void GuiCommandBuffer::hide() const
 {
-       view_->showMiniBuffer(false);
+       FuncRequest cmd(LFUN_COMMAND_EXECUTE, "off");
+       theLyXFunc().setLyXView(view_);
+       lyx::dispatch(cmd);
 }
 
 
@@ -324,7 +320,8 @@ void GuiCommandBuffer::dispatch(string const & str)
        history_pos_ = history_.end();
        FuncRequest func = lyxaction.lookupFunc(str);
        func.origin = FuncRequest::COMMANDBUFFER;
-       view_->dispatch(func);
+       theLyXFunc().setLyXView(view_);
+       lyx::dispatch(func);
 }
 
 } // namespace frontend