From: John Levon Date: Wed, 17 Jul 2002 04:13:41 +0000 (+0000) Subject: Make showState be view_state_changed, and rename setState to something X-Git-Tag: 1.6.10~18848 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=91bcdf564a791d3d017355f9966e4fdaa4e64145;p=features.git Make showState be view_state_changed, and rename setState to something more descriptive git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4671 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView.C b/src/BufferView.C index befa417b66..f3a5279285 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -163,9 +163,9 @@ void BufferView::update(LyXText * text, UpdateCodes f) } -void BufferView::setState() +void BufferView::switchKeyMap() { - pimpl_->setState(); + pimpl_->switchKeyMap(); } diff --git a/src/BufferView.h b/src/BufferView.h index 0c91f1c380..d8a0912f76 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -185,7 +185,7 @@ public: void scrollDocView(int); /// - void setState(); + void switchKeyMap(); /// bool ChangeInsets(Inset::Code code, string const & from, diff --git a/src/BufferView2.C b/src/BufferView2.C index 5624b2b324..d299b9f0f6 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -344,7 +344,7 @@ void BufferView::menuUndo() owner()->message(_("No further undo information")); else update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - setState(); + switchKeyMap(); } } @@ -367,7 +367,7 @@ void BufferView::menuRedo() owner()->message(_("No further redo information")); else update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - setState(); + switchKeyMap(); } } diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index f4dd3b0650..da02d8a2fb 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -351,7 +351,7 @@ int BufferView::Pimpl::resizeCurrentBuffer() bv_->text->first_y = screen().topCursorVisible(bv_->text->cursor, bv_->text->first_y); - setState(); + switchKeyMap(); owner_->allowInput(); /// clear the "Formatting Document" message @@ -734,8 +734,8 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y, workarea().haveSelection(bv_->getLyXText()->selection.set()); } - setState(); - owner_->showState(); + switchKeyMap(); + owner_->view_state_changed(); owner_->updateMenubar(); owner_->updateToolbar(); @@ -1236,7 +1236,7 @@ bool BufferView::Pimpl::isSavedPosition(unsigned int i) } -void BufferView::Pimpl::setState() +void BufferView::Pimpl::switchKeyMap() { if (!lyxrc.rtl_support) return; @@ -1384,10 +1384,7 @@ void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur) if (!lt->selection.set()) workarea().haveSelection(false); - /* ---> Everytime the cursor is moved, show the current font state. */ - // should this too me moved out of this func? - //owner->showState(); - setState(); + switchKeyMap(); } @@ -1520,7 +1517,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) case LFUN_PASTE: bv_->paste(); - setState(); + switchKeyMap(); break; case LFUN_PASTESELECTION: @@ -1546,7 +1543,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) case LFUN_LAYOUT_PASTE: bv_->pasteEnvironment(); - setState(); + switchKeyMap(); break; case LFUN_GOTOERROR: @@ -1675,60 +1672,60 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); - setState(); + switchKeyMap(); } } break; case LFUN_LANGUAGE: lang(bv_, argument); - setState(); - owner_->showState(); + switchKeyMap(); + owner_->view_state_changed(); break; case LFUN_EMPH: emph(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_BOLD: bold(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_NOUN: noun(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_CODE: code(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_SANS: sans(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_ROMAN: roman(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_DEFAULT: styleReset(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_UNDERLINE: underline(bv_); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_FONT_SIZE: fontSize(bv_, argument); - owner_->showState(); + owner_->view_state_changed(); break; case LFUN_FONT_STATE: @@ -1874,7 +1871,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorRight(bv_, false); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1907,7 +1904,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1921,7 +1918,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorUp(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1935,7 +1932,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorDown(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1949,7 +1946,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorUpParagraph(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1963,7 +1960,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorDownParagraph(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1977,7 +1974,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) cursorPrevious(lt); finishUndo(); moveCursorUpdate(false, false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -1991,7 +1988,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) cursorNext(lt); finishUndo(); moveCursorUpdate(false, false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2005,7 +2002,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorHome(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2020,7 +2017,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorEnd(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2036,7 +2033,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorTab(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2053,7 +2050,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorRightOneWord(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2070,7 +2067,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorLeftOneWord(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2085,7 +2082,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorTop(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2100,7 +2097,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorBottom(bv_); finishUndo(); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2117,7 +2114,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorRight(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2133,7 +2130,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorLeft(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2146,7 +2143,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorUp(bv_, true); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2159,7 +2156,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorDown(bv_, true); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2172,7 +2169,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorUpParagraph(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2185,7 +2182,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorDownParagraph(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2197,7 +2194,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) cursorPrevious(lt); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2209,7 +2206,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) cursorNext(lt); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2221,7 +2218,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorHome(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2233,7 +2230,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorEnd(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2248,7 +2245,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorRightOneWord(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2263,7 +2260,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorLeftOneWord(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2277,7 +2274,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorTop(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2292,7 +2289,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) lt->cursorBottom(bv_); finishUndo(); moveCursorUpdate(true); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2370,8 +2367,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) bv_->cut(false); } moveCursorUpdate(false); - owner_->showState(); - setState(); + owner_->view_state_changed(); + switchKeyMap(); } break; @@ -2435,7 +2432,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) bv_->getLyXText()->deleteWordForward(bv_); update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); break; /* -------> Delete word backward. */ @@ -2450,7 +2447,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) | BufferView::FITCUR | BufferView::CHANGE); moveCursorUpdate(false); - owner_->showState(); + owner_->view_state_changed(); } break; @@ -2513,8 +2510,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) } else { bv_->cut(false); } - owner_->showState(); - setState(); + owner_->view_state_changed(); + switchKeyMap(); } break; @@ -2567,8 +2564,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) | BufferView::FITCUR | BufferView::CHANGE); lt->selection.cursor = lt->cursor; - setState(); - owner_->showState(); + switchKeyMap(); + owner_->view_state_changed(); break; } @@ -2583,8 +2580,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) | BufferView::FITCUR | BufferView::CHANGE); lt->selection.cursor = lt->cursor; - setState(); - owner_->showState(); + switchKeyMap(); + owner_->view_state_changed(); break; } @@ -2623,8 +2620,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) | BufferView::FITCUR | BufferView::CHANGE); lt->selection.cursor = cursor; - setState(); - owner_->showState(); + switchKeyMap(); + owner_->view_state_changed(); } break; @@ -2686,7 +2683,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) update(lt, BufferView::SELECT|BufferView::FITCUR); lt->toggleInset(bv_); update(lt, BufferView::SELECT|BufferView::FITCUR); - setState(); + switchKeyMap(); } break; @@ -3125,7 +3122,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) // real_current_font.number can change so we need to // update the minibuffer if (old_font != lt->real_current_font) - owner_->showState(); + owner_->view_state_changed(); //return string(); } break; diff --git a/src/BufferView_pimpl.h b/src/BufferView_pimpl.h index 05a390b28f..1f7a52b0ac 100644 --- a/src/BufferView_pimpl.h +++ b/src/BufferView_pimpl.h @@ -107,7 +107,7 @@ struct BufferView::Pimpl : public boost::signals::trackable { /// bool isSavedPosition(unsigned int i); /// - void setState(); + void switchKeyMap(); /// void insetUnlock(); /// diff --git a/src/ChangeLog b/src/ChangeLog index eaba748c4d..19391d755c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2002-07-17 John Levon + + * BufferView.h: + * BufferView.C: + * BufferView2.C: + * BufferView_pimpl.h: + * BufferView_pimpl.C: + * lyxfunc.C: s/setState/switchKeyMap/, s/showState/view_state_changed/ + 2002-07-16 Jean-Marc Lasgouttes * MenuBackend.C (expand): add numeric shortcuts to document menu diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 5a7fc2b526..b56ac0861b 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,8 @@ +2002-07-17 John Levon + + * LyXView.h: + * LyXView.C: change showState to view_state_changed signal + 2002-07-14 John Levon * lyx_gui.h: add set_read_callback() diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 9724419d4d..37092cc396 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -227,9 +227,3 @@ void LyXView::updateWindowTitle() last_title = title; } } - - -void LyXView::showState() -{ - message(currentState(view())); -} diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index f9916efbab..bdd39a2d37 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -22,6 +22,7 @@ #include #include #include +#include class Buffer; class Toolbar; @@ -107,14 +108,15 @@ public: /// update the menubar void updateMenubar(); + /// view state string changed + boost::signal0 view_state_changed; + /// display a message in the view void message(string const &); /// push a message onto the history, and show it void messagePush(string const & str); /// pop the last message pushed void messagePop(); - /// show state (font etc.) in minibuffer - void showState(); /// updates the title of the window void updateWindowTitle(); diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 4f49ba5e43..985c6246e3 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2002-07-17 John Levon + + * ControlCharacter.C: use view_state_changed not setState + 2002-07-15 Jean-Marc Lasgouttes * biblio.C (parseBibTeX): use ascii_lowercase instead of lowercase diff --git a/src/frontends/controllers/ControlCharacter.C b/src/frontends/controllers/ControlCharacter.C index a12534fe85..497e746b50 100644 --- a/src/frontends/controllers/ControlCharacter.C +++ b/src/frontends/controllers/ControlCharacter.C @@ -63,7 +63,7 @@ void ControlCharacter::apply() view().apply(); toggleAndShow(lv_.view(), *(font_.get()), toggleall_); - lv_.view()->setState(); + lv_.view_state_changed(); lv_.buffer()->markDirty(); setMinibuffer(&lv_, _("Character set")); } diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 62a82e7386..b7ebfc77d3 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-07-17 John Levon + + * QtView.C: basic statusbar show + 2002-07-17 John Levon * QLImage.C: add using std diff --git a/src/frontends/qt2/QMiniBuffer.h b/src/frontends/qt2/QMiniBuffer.h index d3f9b20107..b4a0fe2bb8 100644 --- a/src/frontends/qt2/QMiniBuffer.h +++ b/src/frontends/qt2/QMiniBuffer.h @@ -14,7 +14,7 @@ #include "LString.h" -#include "MiniBuffer.h" +#include "frontends/MiniBuffer.h" #ifdef __GNUG__ #pragma interface diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index 3073605bbc..f53c2cf193 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -21,6 +21,7 @@ #include "QMiniBuffer.h" #include "ToolbarDefaults.h" #include "lyxfunc.h" +#include "bufferview_funcs.h" #include "BufferView.h" #include "frontends/Toolbar.h" @@ -36,6 +37,8 @@ #include #include +#include + using std::endl; // FIXME: this has to go away @@ -65,6 +68,8 @@ QtView::QtView(unsigned int width, unsigned int height) bufferview_.reset(new BufferView(this, 0, 0, width, height)); ::current_view = bufferview_.get(); + view_state_changed.connect(boost::bind(&QtView::update_view_state, this)); + // FIXME: move // FIXME autosave_timeout_->timeout.connect(SigC::slot(this, &QtView::autoSave)); @@ -84,6 +89,12 @@ QtView::~QtView() } +void QtView::update_view_state() +{ + statusBar()->message(currentState(view()).c_str()); +} + + void QtView::activated(int id) { getLyXFunc()->verboseDispatch(id, true); diff --git a/src/frontends/qt2/QtView.h b/src/frontends/qt2/QtView.h index a781af1cf8..247bed896a 100644 --- a/src/frontends/qt2/QtView.h +++ b/src/frontends/qt2/QtView.h @@ -56,6 +56,9 @@ protected: virtual void closeEvent(QCloseEvent * e); private: + /// update status bar + void update_view_state(); + /** * setWindowTitle - set title of window * @param t main window title diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 9a0eec71f2..5d2151533d 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -111,6 +111,7 @@ void lyx_gui::start(string const & batch, vector files) view.getLyXFunc()->verboseDispatch(batch, false); } + // FIXME: something somewhere is EATING CPU while (!finished) { qApp->processEvents(); } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index fdaec7da48..d5fe41eace 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-07-17 John Levon + + * XFormsView.h: + * XFormsView.C: hook up view_state_changed + 2002-07-16 Angus Leeming * XPainter.C: add some #ifdef ugliness to enable the home grown image diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index a8f7a5e5ee..5e90fe3a2a 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -66,6 +66,8 @@ XFormsView::XFormsView(int width, int height) minibuffer_->inputReady.connect(boost::bind(&LyXFunc::miniDispatch, getLyXFunc(), _1)); minibuffer_->timeout.connect(boost::bind(&LyXFunc::initMiniBuffer, getLyXFunc())); + view_state_changed.connect(boost::bind(&XFormsView::update_view_state, this)); + // Make sure the buttons are disabled if needed. updateToolbar(); getDialogs()->redrawGUI.connect(boost::bind(&XFormsView::redraw, this)); @@ -198,6 +200,12 @@ void XFormsView::setWindowTitle(string const & title, string const & icon_title) } +void XFormsView::update_view_state() +{ + minibuffer_->message(currentState(view())); +} + + // How should this actually work? Should it prohibit input in all BufferViews, // or just in the current one? If "just the current one", then it should be // placed in BufferView. If "all BufferViews" then LyXGUI (I think) should diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index 32242db532..8d35bcef54 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -62,6 +62,9 @@ private: */ virtual void setWindowTitle(string const & t, string const & it); + /// update the minibuffer state message + void update_view_state(); + /// makes the main form. void create_form_form_main(Dialogs & d, int width, int height); /// the main form. diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 1daeec89f7..818baa2e5a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-07-17 John Levon + + * insettext.C: use view_state_changed, switchKeyMap + 2002-07-17 Herbert Voss * insetgraphics.C (prepareFile): keep the extension when diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 21d24736d6..bd6e032f7b 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -658,7 +658,7 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty) const if (need_update == CURSOR) need_update = NONE; - bv->owner()->showState(); + bv->owner()->view_state_changed(); bv->owner()->updateMenubar(); bv->owner()->updateToolbar(); if (old_par != cpar(bv)) { @@ -1261,7 +1261,7 @@ InsetText::localDispatch(BufferView * bv, setUndo(bv, Undo::INSERT, lt->cursor.par(), lt->cursor.par()->next()); - bv->setState(); + bv->switchKeyMap(); if (lyxrc.auto_region_delete) { if (lt->selection.set()) { lt->cutSelection(bv, false); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 19bfb7dba3..441693f803 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -145,11 +145,6 @@ LyXText * LyXFunc::TEXT(bool flag = true) const } -// I changed this func slightly. I commented out the ...FinishUndo(), -// this means that all places that used to have a moveCursorUpdate, now -// have a ...FinishUndo() as the preceeding statement. I have also added -// a moveCursorUpdate to some of the functions that updated the cursor, but -// that did not show its new position. inline void LyXFunc::moveCursorUpdate(bool flag, bool selecting) { @@ -161,9 +156,7 @@ void LyXFunc::moveCursorUpdate(bool flag, bool selecting) owner->view()->update(TEXT(flag), BufferView::SELECT|BufferView::FITCUR); owner->view()->showCursor(); - /* ---> Everytime the cursor is moved, show the current font state. */ - // should this too me moved out of this func? - owner->view()->setState(); + owner->view()->switchKeyMap(); } @@ -852,7 +845,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) } else if (result == UpdatableInset::FINISHED_RIGHT) { TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); goto exit_with_message; } else if (result == UpdatableInset::FINISHED_UP) { if (TEXT()->cursor.irow()->previous()) { @@ -866,7 +859,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) TEXT()->cursorUp(owner->view()); #endif moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); } else { owner->view()->update(TEXT(), BufferView::SELECT|BufferView::FITCUR); } @@ -887,7 +880,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) TEXT()->cursorRight(owner->view()); } moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); goto exit_with_message; } #warning I am not sure this is still right, please have a look! (Jug 20020417) @@ -898,21 +891,21 @@ string const LyXFunc::dispatch(kb_action action, string argument) case LFUN_BREAKPARAGRAPH: case LFUN_BREAKLINE: TEXT()->cursorRight(owner->view()); - owner->view()->setState(); - owner->showState(); + owner->view()->switchKeyMap(); + owner->view_state_changed(); break; case LFUN_RIGHT: if (!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) { TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); } goto exit_with_message; case LFUN_LEFT: if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) { TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); } goto exit_with_message; case LFUN_DOWN: @@ -921,7 +914,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) else TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); goto exit_with_message; default: break; @@ -945,7 +938,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) owner->view()->unlockInset(tli); TEXT()->cursorRight(owner->view()); moveCursorUpdate(true, false); - owner->showState(); + owner->view_state_changed(); } else { tli->unlockInsetInInset(owner->view(), lock, @@ -1385,8 +1378,8 @@ string const LyXFunc::dispatch(kb_action action, string argument) } // Set the cursor owner->view()->getLyXText()->setCursor(owner->view(), par, 0); - owner->view()->setState(); - owner->showState(); + owner->view()->switchKeyMap(); + owner->view_state_changed(); owner->view()->center(); // see BufferView_pimpl::center()