From: John Levon Date: Mon, 7 Apr 2003 05:20:07 +0000 (+0000) Subject: status bar msg fixes X-Git-Tag: 1.6.10~17044 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e3f870562d7b0085bf860f26b31542e677ae100d;p=lyx.git status bar msg fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6723 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index e054316c3e..aedbd92228 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,10 @@ +2003-04-07 John Levon + + * 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 * QCommandBuffer.C: diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index 8be43d0d6c..63b60e32ee 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -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()))); } diff --git a/src/frontends/qt2/QtView.h b/src/frontends/qt2/QtView.h index 830f616db9..bc0f91b2df 100644 --- a/src/frontends/qt2/QtView.h +++ b/src/frontends/qt2/QtView.h @@ -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_;