]> git.lyx.org Git - lyx.git/commitdiff
status bar msg fixes
authorJohn Levon <levon@movementarian.org>
Mon, 7 Apr 2003 05:20:07 +0000 (05:20 +0000)
committerJohn Levon <levon@movementarian.org>
Mon, 7 Apr 2003 05:20:07 +0000 (05:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6723 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QtView.C
src/frontends/qt2/QtView.h

index e054316c3ea7c462bf32cbc75fc7381053357a43..aedbd92228128a9ed0acc316b13b351ce06f6d83 100644 (file)
@@ -1,3 +1,10 @@
+2003-04-07  John Levon  <levon@movementarian.org>
+
+       * QtView.h:
+       * QtView.C: rename idle_timer_. Make it single-shot.
+         Do not over-write an explicit message with the
+         default message.
+
 2003-04-05  John Levon  <levon@movementarian.org>
 
        * QCommandBuffer.C:
index 8be43d0d6cb4b0b87917f9db909b006d22f492a8..63b60e32eeb05a38e0a5cd4ec0f63f972f297b26 100644 (file)
@@ -45,7 +45,7 @@ using namespace bv_funcs;
 
 namespace {
 
-int const idle_timer_value = 3000;
+int const statusbar_timer_value = 3000;
 
 } // namespace anon
 
@@ -71,9 +71,7 @@ QtView::QtView(unsigned int width, unsigned int height)
        statusBar()->setSizeGripEnabled(false);
 
        view_state_changed.connect(boost::bind(&QtView::update_view_state, this));
-       connect(&idle_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
-
-       idle_timer_.start(idle_timer_value);
+       connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
 
        focus_command_buffer.connect(boost::bind(&QtView::focus_command_widget, this));
 
@@ -106,8 +104,8 @@ void QtView::setWindowTitle(string const & t, string const & it)
 void QtView::message(string const & str)
 {
        statusBar()->message(toqstr(str));
-       idle_timer_.stop();
-       idle_timer_.start(idle_timer_value);
+       statusbar_timer_.stop();
+       statusbar_timer_.start(statusbar_timer_value);
 }
 
 
@@ -120,11 +118,16 @@ void QtView::focus_command_widget()
 void QtView::update_view_state_qt()
 {
        statusBar()->message(toqstr(currentState(view().get())));
+       statusbar_timer_.stop();
 }
 
 
 void QtView::update_view_state()
 {
+       // let the user see the explicit message
+       if (statusbar_timer_.isActive())
+                       return;
+
        statusBar()->message(toqstr(currentState(view().get())));
 }
 
index 830f616db91a4bc5afaaa75936526bcc3d8c45f2..bc0f91b2dfb85865ec093cf259619d966efb5b58 100644 (file)
@@ -65,8 +65,7 @@ private:
         */
        virtual void setWindowTitle(string const & t, string const & it);
 
-       /// idle timer
-       QTimer idle_timer_;
+       QTimer statusbar_timer_;
 
        /// command buffer
        QCommandBuffer * commandbuffer_;