diff options
| author | Peter Penz <[email protected]> | 2007-01-31 22:03:35 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-01-31 22:03:35 +0000 |
| commit | cd3df82730865636c92c5bb9f38a0490c0deffaa (patch) | |
| tree | c95b4c58a7944681b676cf27c425ec00757e84eb /src/dolphinstatusbar.cpp | |
| parent | 5a0b3330d66db6ef72e8c302065968f1886526e3 (diff) | |
Queue error messages so that a currently shown error message is not replaced until the user confirmed the reading. If there are no pending error messages and a timeout has been exceeded, the currently shown error messages automatically fades out as soon as the user triggered another action. This behavior should correspond to Ellens suggestions (I hope :-)).
svn path=/trunk/playground/utils/dolphin/; revision=628905
Diffstat (limited to 'src/dolphinstatusbar.cpp')
| -rw-r--r-- | src/dolphinstatusbar.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp index 4cdffec94..26a373875 100644 --- a/src/dolphinstatusbar.cpp +++ b/src/dolphinstatusbar.cpp @@ -71,8 +71,7 @@ DolphinStatusBar::~DolphinStatusBar() void DolphinStatusBar::setMessage(const QString& msg, Type type) { - m_messageLabel->setText(msg); - m_messageLabel->setType(type); + m_messageLabel->setMessage(msg, type); const int widthGap = m_messageLabel->widthGap(); if (widthGap > 0) { @@ -123,25 +122,29 @@ void DolphinStatusBar::setProgress(int percent) QTimer::singleShot(500, this, SLOT(updateProgressInfo())); } + const QString& defaultText = m_messageLabel->defaultText(); const QString msg(m_messageLabel->text()); if ((percent == 0) && !msg.isEmpty()) { setMessage(QString::null, Default); } - else if ((percent == 100) && (msg != m_defaultText)) { - setMessage(m_defaultText, Default); + else if ((percent == 100) && (msg != defaultText)) { + setMessage(defaultText, Default); } } void DolphinStatusBar::clear() { - // TODO: check for timeout, so that it's prevented that - // a message is cleared too early. - setMessage(m_defaultText, Default); + setMessage(m_messageLabel->defaultText(), Default); } void DolphinStatusBar::setDefaultText(const QString& text) { - m_defaultText = text; + m_messageLabel->setDefaultText(text); +} + +const QString& DolphinStatusBar::defaultText() const +{ + return m_messageLabel->defaultText(); } void DolphinStatusBar::resizeEvent(QResizeEvent* event) |
