X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView2.C;h=7263f0ac85f115fc9af2d98fa42e8f94e4522b9b;hb=664eb7ff45dbb4fabc22ec0b56798031a82335b1;hp=9c26846fb469c97e47d636532f000f2361c22a8c;hpb=8cb2e519b3975cc643f2c93706137cf2e6a4f4d8;p=lyx.git diff --git a/src/BufferView2.C b/src/BufferView2.C index 9c26846fb4..7263f0ac85 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -22,7 +22,6 @@ #include "insets/insetinfo.h" #include "insets/insetspecialchar.h" #include "LyXView.h" -#include "minibuffer.h" #include "bufferlist.h" #include "support/FileInfo.h" #include "lyxscreen.h" @@ -32,6 +31,9 @@ #include "BufferView_pimpl.h" #include "insets/insetcommand.h" //ChangeRefs #include "support/lyxfunctional.h" //equal_1st_in_pair +#include "language.h" +#include "gettext.h" +#include "lyxfunc.h" extern BufferList bufferlist; @@ -423,7 +425,8 @@ void BufferView::insertNote() void BufferView::openStuff() { if (available()) { - owner()->getMiniBuffer()->Set(_("Open/Close...")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("Open/Close...")); hideCursor(); beforeChange(text); update(text, BufferView::SELECT|BufferView::FITCUR); @@ -437,7 +440,8 @@ void BufferView::openStuff() void BufferView::toggleFloat() { if (available()) { - owner()->getMiniBuffer()->Set(_("Open/Close...")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("Open/Close...")); hideCursor(); beforeChange(text); update(text, BufferView::SELECT|BufferView::FITCUR); @@ -451,12 +455,13 @@ void BufferView::toggleFloat() void BufferView::menuUndo() { if (available()) { - owner()->getMiniBuffer()->Set(_("Undo")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Undo")); hideCursor(); beforeChange(text); update(text, BufferView::SELECT|BufferView::FITCUR); if (!text->TextUndo(this)) - owner()->getMiniBuffer()->Set(_("No further undo information")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("No forther undo information")); else update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); setState(); @@ -467,17 +472,20 @@ void BufferView::menuUndo() void BufferView::menuRedo() { if (theLockingInset()) { - owner()->getMiniBuffer()->Set(_("Redo not yet supported in math mode")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("Redo not yet supported in math mode")); return; } if (available()) { - owner()->getMiniBuffer()->Set(_("Redo")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("Redo")); hideCursor(); beforeChange(text); update(text, BufferView::SELECT|BufferView::FITCUR); if (!text->TextRedo(this)) - owner()->getMiniBuffer()->Set(_("No further redo information")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("No further redo information")); else update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); setState(); @@ -569,6 +577,7 @@ void BufferView::hfill() } } + void BufferView::copyEnvironment() { if (available()) { @@ -577,7 +586,8 @@ void BufferView::copyEnvironment() toggleSelection(); text->ClearSelection(this); update(text, BufferView::SELECT|BufferView::FITCUR); - owner()->getMiniBuffer()->Set(_("Paragraph environment type copied")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("Paragraph environment type copied")); } } @@ -586,7 +596,8 @@ void BufferView::pasteEnvironment() { if (available()) { text->pasteEnvironmentType(this); - owner()->getMiniBuffer()->Set(_("Paragraph environment type set")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, + _("Paragraph environment type set")); update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); } } @@ -600,7 +611,7 @@ void BufferView::copy() toggleSelection(); text->ClearSelection(this); update(text, BufferView::SELECT|BufferView::FITCUR); - owner()->getMiniBuffer()->Set(_("Copy")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Copy")); } } @@ -611,7 +622,7 @@ void BufferView::cut() update(text, BufferView::SELECT|BufferView::FITCUR); text->CutSelection(this); update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - owner()->getMiniBuffer()->Set(_("Cut")); + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Cut")); } } @@ -619,8 +630,9 @@ void BufferView::cut() void BufferView::paste() { if (!available()) return; - - owner()->getMiniBuffer()->Set(_("Paste")); + + owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Paste")); + hideCursor(); // clear the selection toggleSelection(); @@ -665,10 +677,14 @@ void BufferView::gotoInset(std::vector const & codes, text->cursor.pos(0); if (!text->GotoNextInset(this, codes, contents)) { text->cursor = tmp; - owner()->getMiniBuffer()->Set(_("No more insets")); + owner()->getLyXFunc() + ->Dispatch(LFUN_MESSAGE, + _("No more insets")); } } else { - owner()->getMiniBuffer()->Set(_("No more insets")); + owner()->getLyXFunc() + ->Dispatch(LFUN_MESSAGE, + _("No more insets")); } } update(text, BufferView::SELECT|BufferView::FITCUR); @@ -863,9 +879,6 @@ void BufferView::updateInset(Inset * inset, bool mark_dirty) if (text->UpdateInset(this, inset)) { update(); if (mark_dirty) { - if (buffer()->isLyxClean()) - owner()->getMiniBuffer()-> - setTimer(4); buffer()->markDirty(); } updateScrollbar(); @@ -875,9 +888,6 @@ void BufferView::updateInset(Inset * inset, bool mark_dirty) if (text->UpdateInset(this, theLockingInset())) { update(); if (mark_dirty){ - if (buffer()->isLyxClean()) - owner()->getMiniBuffer()-> - setTimer(4); buffer()->markDirty(); } updateScrollbar(); @@ -901,7 +911,8 @@ void BufferView::updateInset(Inset * inset, bool mark_dirty) } -bool BufferView::ChangeInsets(Inset::Code code, string const & from, string const & to) +bool BufferView::ChangeInsets(Inset::Code code, + string const & from, string const & to) { bool flag = false; LyXParagraph * par = buffer()->paragraph; @@ -1020,6 +1031,7 @@ LyXText * BufferView::getParentText(Inset * inset) const return text; } + Language const * BufferView::getParentLanguage(Inset * inset) const { LyXText * text = getParentText(inset);