]> git.lyx.org Git - features.git/commitdiff
Make showState be view_state_changed, and rename setState to something
authorJohn Levon <levon@movementarian.org>
Wed, 17 Jul 2002 04:13:41 +0000 (04:13 +0000)
committerJohn Levon <levon@movementarian.org>
Wed, 17 Jul 2002 04:13:41 +0000 (04:13 +0000)
more descriptive

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4671 a592a061-630c-0410-9148-cb99ea01b6c8

22 files changed:
src/BufferView.C
src/BufferView.h
src/BufferView2.C
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/ChangeLog
src/frontends/ChangeLog
src/frontends/LyXView.C
src/frontends/LyXView.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlCharacter.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/QMiniBuffer.h
src/frontends/qt2/QtView.C
src/frontends/qt2/QtView.h
src/frontends/qt2/lyx_gui.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/XFormsView.C
src/frontends/xforms/XFormsView.h
src/insets/ChangeLog
src/insets/insettext.C
src/lyxfunc.C

index befa417b6604fd42096492f8fd30430e038bae90..f3a5279285c50d6c051025d7be266f5bd388789b 100644 (file)
@@ -163,9 +163,9 @@ void BufferView::update(LyXText * text, UpdateCodes f)
 }
 
 
-void BufferView::setState()
+void BufferView::switchKeyMap()
 {
-       pimpl_->setState();
+       pimpl_->switchKeyMap();
 }
 
 
index 0c91f1c3808f2c21d70619f96105dc22d86186d7..d8a0912f761d3141201db0b06ca858f001d5163f 100644 (file)
@@ -185,7 +185,7 @@ public:
        void scrollDocView(int);
 
        ///
-       void setState();
+       void switchKeyMap();
 
        ///
        bool ChangeInsets(Inset::Code code, string const & from,
index 5624b2b324c762619b9cea3f04e736728c86067a..d299b9f0f67f44ffb639ce340ac7a17286fd8b5d 100644 (file)
@@ -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();
        }
 }
 
index f4dd3b06506a214e52458dba68d94c73f783f1cc..da02d8a2fb63daff8f32517f02f077fcaa3d6be5 100644 (file)
@@ -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;
index 05a390b28fed8b7aa3e659f5fe6e0e9e753b2c4a..1f7a52b0ac48081f214cbbf31d81e076c936ff1a 100644 (file)
@@ -107,7 +107,7 @@ struct BufferView::Pimpl : public boost::signals::trackable {
        ///
        bool isSavedPosition(unsigned int i);
        ///
-       void setState();
+       void switchKeyMap();
        ///
        void insetUnlock();
        ///
index eaba748c4d71de745b3166bb196cc4cbf426d20b..19391d755c69dc644ee9c6a787aed0d869303896 100644 (file)
@@ -1,3 +1,12 @@
+2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
+
+       * 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  <lasgouttes@freesurf.fr>
 
        * MenuBackend.C (expand): add numeric shortcuts to document menu
index 5a7fc2b5264a2fb5a823dc5a3510377bdd9683d7..b56ac0861ba4287d79700a0bd600da92a7b0a26c 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
+
+       * LyXView.h:
+       * LyXView.C: change showState to view_state_changed signal
 2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyx_gui.h: add set_read_callback()
index 9724419d4d01712a139c3e2b1514f0b4f693bc98..37092cc3962e0794f71b6beedddcb240db0c92c5 100644 (file)
@@ -227,9 +227,3 @@ void LyXView::updateWindowTitle()
                last_title = title;
        }
 }
-
-
-void LyXView::showState()
-{
-       message(currentState(view()));
-}
index f9916efbab51318ebb7da11624f20dc094c3071c..bdd39a2d37e5bcde531916c261dbb2e3db9e82c9 100644 (file)
@@ -22,6 +22,7 @@
 #include <boost/utility.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/signals/trackable.hpp>
+#include <boost/signals/signal0.hpp>
 
 class Buffer;
 class Toolbar;
@@ -107,14 +108,15 @@ public:
        /// update the menubar
        void updateMenubar();
 
+       /// view state string changed
+       boost::signal0<void> 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();
index 4f49ba5e43aa44350756ad390227f0d0e3288966..985c6246e3c39a688c12dd2821c86806e2df6d6d 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
+
+       * ControlCharacter.C: use view_state_changed not setState
 2002-07-15  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * biblio.C (parseBibTeX): use ascii_lowercase instead of lowercase
index a12534fe85591aa656db87231b5469ef2bb5bce1..497e746b5068d4d11fc98cb1035ef08bec5f0ed7 100644 (file)
@@ -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"));
 }
index 62a82e7386ba49a03fcee1ea83ca36322d9201e2..b7ebfc77d398f268f60e2cf230786fef812afb50 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
+
+       * QtView.C: basic statusbar show
 2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
 
        * QLImage.C: add using std
index d3f9b201078f62d697d672970576e965c62a01fd..b4a0fe2bb8a8ad9bd73a5d56a7feac17ea412cfb 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "LString.h"
 
-#include "MiniBuffer.h"
+#include "frontends/MiniBuffer.h"
 
 #ifdef __GNUG__
 #pragma interface
index 3073605bbc659ee4716d693e7103f2e421a439e9..f53c2cf19341c19ac043c5740e67b167fe2a5d18 100644 (file)
@@ -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 <qmenubar.h>
 #include <qstatusbar.h>
  
+#include <boost/bind.hpp>
 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);
index a781af1cf8872aef2267f56ae43e1db43a140f13..247bed896a2960d9117721bd63d33a0750ade8e4 100644 (file)
@@ -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
index 9a0eec71f295a9db57437e71f8334d2c5d9da30b..5d2151533dda24ae53b25f68abadc43b29531d13 100644 (file)
@@ -111,6 +111,7 @@ void lyx_gui::start(string const & batch, vector<string> files)
                view.getLyXFunc()->verboseDispatch(batch, false);
        }
 
+       // FIXME: something somewhere is EATING CPU
        while (!finished) {
                qApp->processEvents();
        }
index fdaec7da48d63f30997debed0ca618199b900a66..d5fe41eace8964122ce74fd624d333f173c9e587 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
+
+       * XFormsView.h:
+       * XFormsView.C: hook up view_state_changed
 2002-07-16  Angus Leeming  <leeming@lyx.org>
 
        * XPainter.C: add some #ifdef ugliness to enable the home grown image
index a8f7a5e5ee2051d8ce6dfd558407c4e1d952a1c8..5e90fe3a2a55edcba2b88d439b968c32fed96e20 100644 (file)
@@ -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
index 32242db532081f0eb92f6247645d4c91cfb6ddda..8d35bcef54de7d4eb7b29cc1f5971ca61b8f53cb 100644 (file)
@@ -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.
index 1daeec89f7118ebd84fc4b4370e725d53e7da71a..818baa2e5ac1bef38c0485099678bddf72f611a3 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
+
+       * insettext.C: use view_state_changed, switchKeyMap
 2002-07-17  Herbert Voss  <voss@perce.de>
 
        * insetgraphics.C (prepareFile): keep the extension when
index 21d24736d625f2674d326cf8cf62a0232bb6a985..bd6e032f7bcd97b7047eaf0e6c57ff1cbd852fed 100644 (file)
@@ -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);
index 19bfb7dba377d1d9682eceea5895ec61e1497999..441693f8035f54ad73983742f0908a97da00f38b 100644 (file)
@@ -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()