X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCommandBuffer.cpp;h=b66860439b69ad3681032c9ad48519da7c663063;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=5f48010d761c7884257f3bb402a10694048ab981;hpb=cdfc9575a99cdebf03845ae85ca9b42e6152ca34;p=lyx.git diff --git a/src/frontends/qt4/GuiCommandBuffer.cpp b/src/frontends/qt4/GuiCommandBuffer.cpp index 5f48010d76..b66860439b 100644 --- a/src/frontends/qt4/GuiCommandBuffer.cpp +++ b/src/frontends/qt4/GuiCommandBuffer.cpp @@ -14,6 +14,7 @@ #include "GuiCommandBuffer.h" +#include "GuiApplication.h" #include "GuiCommandEdit.h" #include "GuiView.h" #include "qt_helpers.h" @@ -87,8 +88,8 @@ GuiCommandBuffer::GuiCommandBuffer(GuiView * view) transform(lyxaction.func_begin(), lyxaction.func_end(), back_inserter(commands_), firster()); - QPixmap qpup(":/images/up.png"); - QPixmap qpdown(":/images/down.png"); + QPixmap qpup = getPixmap("images/", "up", "png"); + QPixmap qpdown = getPixmap("images/", "down", "png"); QVBoxLayout * top = new QVBoxLayout(this); QHBoxLayout * layout = new QHBoxLayout(0); @@ -207,16 +208,16 @@ void GuiCommandBuffer::showList(vector const & list, listBox->move(pos.x(), y); connect(listBox, SIGNAL(itemClicked(QListWidgetItem *)), - this, SLOT(item_selected(QListWidgetItem *))); + this, SLOT(itemSelected(QListWidgetItem *))); connect(listBox, SIGNAL(itemActivated(QListWidgetItem *)), - this, SLOT(item_selected(QListWidgetItem *))); + this, SLOT(itemSelected(QListWidgetItem *))); listBox->show(); listBox->setFocus(); } -void GuiCommandBuffer::item_selected(QListWidgetItem * item) +void GuiCommandBuffer::itemSelected(QListWidgetItem * item) { QWidget const * widget = static_cast(sender()); const_cast(widget)->hide(); @@ -247,7 +248,8 @@ void GuiCommandBuffer::down() if (!h.empty()) edit_->setText(toqstr(h)); - downPB->setEnabled(history_pos_ != history_.end()-1); + downPB->setEnabled(!history_.empty() + && history_pos_ != history_.end() - 1); upPB->setEnabled(history_pos_ != history_.begin()); } @@ -295,14 +297,13 @@ string const GuiCommandBuffer::historyDown() docstring const GuiCommandBuffer::getCurrentState() const { - return view_->view()->cursor().currentState(); + return view_->currentBufferView()->cursor().currentState(); } void GuiCommandBuffer::hide() const { FuncRequest cmd(LFUN_COMMAND_EXECUTE, "off"); - theLyXFunc().setLyXView(view_); lyx::dispatch(cmd); } @@ -357,7 +358,6 @@ void GuiCommandBuffer::dispatch(string const & str) downPB->setEnabled(history_pos_ != history_.end()); FuncRequest func = lyxaction.lookupFunc(str); func.origin = FuncRequest::COMMANDBUFFER; - theLyXFunc().setLyXView(view_); lyx::dispatch(func); }