]> git.lyx.org Git - features.git/commitdiff
reset the status message on leaving an inset or clicking with the mous
authorJohn Levon <levon@movementarian.org>
Mon, 7 Apr 2003 16:57:38 +0000 (16:57 +0000)
committerJohn Levon <levon@movementarian.org>
Mon, 7 Apr 2003 16:57:38 +0000 (16:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6727 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/BufferView_pimpl.C
src/ChangeLog
src/frontends/LyXView.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QtView.C
src/frontends/qt2/QtView.h
src/frontends/xforms/XFormsView.C
src/frontends/xforms/XFormsView.h
src/insets/ChangeLog
src/insets/insettabular.C
src/insets/insettext.C
src/lyxfunc.C

index 51a1d488180968d439593ee17ecd39241ef9fa2c..cf0d3c6ad1e3d32b97b923b49a845662121bfbcb 100644 (file)
@@ -337,6 +337,9 @@ int BufferView::Pimpl::resizeCurrentBuffer()
        switchKeyMap();
        owner_->busy(false);
 
+       // reset the "Formatting..." message
+       owner_->clearMessage();
+
        updateScrollbar();
 
        return 0;
@@ -937,6 +940,11 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & ev_in)
        bv_->owner()->updateLayoutChoice();
        bv_->fitCursor();
 
+       // slight hack: this is only called currently when
+       // we clicked somewhere, so we force through the display
+       // of the new status here.
+       bv_->owner()->clearMessage();
+
        return res;
 }
 
index 2490b75fbce1f4d1dbdc7de65c4fe2068ee6ff14..fbc26e38a7e91a6fbc264fffb8aaf84e03cbb498 100644 (file)
@@ -1,3 +1,10 @@
+2003-04-07  John Levon  <levon@movementarian.org>
+
+       * BufferView_pimpl.C: clear message when doc finishes resizing,
+       and after a mouse event
+
+       * lyxfunc.C: clear message after exiting inset
+
 2003-04-07  John Levon  <levon@movementarian.org>
 
        * bufferview_funcs.C: show math status not outside
index e3318d2bb9b911f3d1ac4b485f6e786c03146b78..ea4c42d08d9e3165b2e04fc921c51a06e60e6555 100644 (file)
@@ -124,6 +124,9 @@ public:
        /// display a message in the view
        virtual void message(string const &) = 0;
 
+       /// clear any temporary message and replace with current status
+       virtual void clearMessage() = 0;
+
        /// updates the title of the window
        void updateWindowTitle();
 
index aedbd92228128a9ed0acc316b13b351ce06f6d83..30ac476542736c93186937f7dda2568f68164863 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-07  John Levon  <levon@movementarian.org>
+
+       * QtView.h:
+       * QtView.C: implement clearMessage()
+
 2003-04-07  John Levon  <levon@movementarian.org>
 
        * QtView.h:
index 63b60e32eeb05a38e0a5cd4ec0f63f972f297b26..6c432b673635245c432da274f1382767471316b0 100644 (file)
@@ -19,7 +19,6 @@
 #include "MenuBackend.h"
 #include "ToolbarBackend.h"
 #include "lyxfunc.h"
-#include "bufferview_funcs.h"
 #include "BufferView.h"
 
 #include "frontends/Toolbar.h"
@@ -41,7 +40,6 @@
 #include <qstatusbar.h>
 
 using std::endl;
-using namespace bv_funcs;
 
 namespace {
 
@@ -109,6 +107,12 @@ void QtView::message(string const & str)
 }
 
 
+void QtView::clearMessage()
+{
+       update_view_state_qt();
+}
+
+
 void QtView::focus_command_widget()
 {
        commandbuffer_->focus_command();
@@ -117,7 +121,7 @@ void QtView::focus_command_widget()
 
 void QtView::update_view_state_qt()
 {
-       statusBar()->message(toqstr(currentState(view().get())));
+       statusBar()->message(toqstr(getLyXFunc().view_status_message()));
        statusbar_timer_.stop();
 }
 
@@ -128,7 +132,7 @@ void QtView::update_view_state()
        if (statusbar_timer_.isActive())
                        return;
 
-       statusBar()->message(toqstr(currentState(view().get())));
+       statusBar()->message(toqstr(getLyXFunc().view_status_message()));
 }
 
 
index bc0f91b2dfb85865ec093cf259619d966efb5b58..f5484d00e613a899856cb37da81ef2ceda003634 100644 (file)
@@ -42,6 +42,10 @@ public:
 
        /// display a status message
        virtual void message(string const & str);
+
+       /// clear status message
+       virtual void clearMessage();
+
 public slots:
        /// menu item has been selected
        void activated(int id);
index 7971cf91ffe87e883c6b69480745732a653f0ae5..4d37ffd1753d4976e08b7f8e8f1005de618e4b3f 100644 (file)
@@ -189,6 +189,12 @@ void XFormsView::message(string const & str)
 }
 
 
+void XFormsView::clearMessage()
+{
+       message(getLyXFunc().view_status_message());
+}
+
+
 void XFormsView::show_view_state()
 {
        message(getLyXFunc().view_status_message());
index e5b6c99d831b583e5f84002f55c13e4fcf0cba98..70ba5ada9ccb69d49ade43b792bd68ae31453e84 100644 (file)
@@ -53,6 +53,9 @@ public:
        /// display a status message
        virtual void message(string const & str);
 
+       /// clear back to normal status message
+       virtual void clearMessage();
+
 private:
        /**
         * setWindowTitle - set title of window
index 1784cda2373d1e57ad9c980fc38d7dd77d920801..669b1ddba41a4fb7774cddbe752e5b828268343e 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-07  John Levon  <levon@movementarian.org>
+
+       * insettabular.C:
+       * insettext.C: clear status message on inset exit
+
 2003-04-03  John Levon  <levon@movementarian.org>
 
        * insetcommand.C: return dispatched on DIALOG_UPDATE
index 8f1939db07a00cd93898fe94d8de1efb78ba4c7e..d8964618a867b9287255a91e7d780b48aadb3375 100644 (file)
@@ -854,10 +854,17 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
                        return result;
                } else if (result == FINISHED_UP) {
                        action = LFUN_UP;
+                       // Make sure to reset status message after
+                       // exiting, e.g. math inset
+                       bv->owner()->clearMessage();
                } else if (result == FINISHED_DOWN) {
                        action = LFUN_DOWN;
+                       bv->owner()->clearMessage();
                } else if (result == FINISHED_RIGHT) {
                        action = LFUN_RIGHT;
+                       bv->owner()->clearMessage();
+               } else if (result == FINISHED) {
+                       bv->owner()->clearMessage();
                }
        }
 
index e85a5ca9250b17674a19d447c0623faafe691b18..753161a6d560ccfb48932c215f1338321c0ceb02 100644 (file)
@@ -1146,6 +1146,8 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & ev)
                        }
                        the_locking_inset = 0;
                        updateLocal(bv, CURSOR, false);
+                       // make sure status gets reset immediately
+                       bv->owner()->clearMessage();
                        return result;
                }
        }
index 71c513dd6ca96f37fb4822453dcfc168f8ce28cc..e9e3efe8af372d731603597e7a28c9c664bbf41b 100644 (file)
@@ -818,6 +818,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                                goto exit_with_message;
                                        // If UNDISPATCHED, just soldier on
                        else if (result == FINISHED) {
+                               owner->clearMessage();
                                goto exit_with_message;
                                // We do not need special RTL handling here:
                                // FINISHED means that the cursor should be
@@ -825,7 +826,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                        } else if (result == FINISHED_RIGHT) {
                                TEXT()->cursorRight(view());
                                moveCursorUpdate(true, false);
-                               owner->view_state_changed();
+                               owner->clearMessage();
                                goto exit_with_message;
                        } else if (result == FINISHED_UP) {
                                if (TEXT()->cursor.irow() != TEXT()->rows().begin()) {
@@ -839,10 +840,10 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                                        TEXT()->cursorUp(view());
 #endif
                                        moveCursorUpdate(true, false);
-                                       owner->view_state_changed();
                                } else {
                                        view()->update(TEXT(), BufferView::SELECT);
                                }
+                               owner->clearMessage();
                                goto exit_with_message;
                        } else if (result == FINISHED_DOWN) {
                                if (boost::next(TEXT()->cursor.irow()) != TEXT()->rows().end()) {
@@ -860,7 +861,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                                        TEXT()->cursorRight(view());
                                }
                                moveCursorUpdate(true, false);
-                               owner->view_state_changed();
+                               owner->clearMessage();
                                goto exit_with_message;
                        }
 #warning I am not sure this is still right, please have a look! (Jug 20020417)