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<QWidget const *>(sender());
const_cast<QWidget *>(widget)->hide();
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());
}
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);
}
downPB->setEnabled(history_pos_ != history_.end());
FuncRequest func = lyxaction.lookupFunc(str);
func.origin = FuncRequest::COMMANDBUFFER;
- theLyXFunc().setLyXView(view_);
lyx::dispatch(func);
}