From e7ef1cb8ece862bde22e7b1750b4235b1d55d1e6 Mon Sep 17 00:00:00 2001 From: Arjun AK Date: Fri, 22 Aug 2014 18:42:50 +0530 Subject: [PATCH] Hide an already visible KMessageWidget message before showing a new one 1. Do some operation that causes the KMessageWidget to show an error message 2. Immediately Repeat the same action. The user has no way to know whether the error message is from the second operation or is a leftover from the first one. By hiding the widget first and then showing it using animatedShow(), the user can clearly see that a new message was generated. Also once the directory successfully loads, the widget should be hidden. BUG: 323077 FIXED-IN: 4.14.1 REVIEW: 119401 --- dolphin/src/dolphinviewcontainer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dolphin/src/dolphinviewcontainer.cpp b/dolphin/src/dolphinviewcontainer.cpp index 2a45152bd0..93af3e8fbc 100644 --- a/dolphin/src/dolphinviewcontainer.cpp +++ b/dolphin/src/dolphinviewcontainer.cpp @@ -110,6 +110,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) : m_view = new DolphinView(url, this); connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setUrl(KUrl))); connect(m_view, SIGNAL(urlChanged(KUrl)), m_messageWidget, SLOT(hide())); + connect(m_view, SIGNAL(directoryLoadingCompleted()), m_messageWidget, SLOT(hide())); connect(m_view, SIGNAL(writeStateChanged(bool)), this, SIGNAL(writeStateChanged(bool))); connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(showItemInfo(KFileItem))); connect(m_view, SIGNAL(itemActivated(KFileItem)), this, SLOT(slotItemActivated(KFileItem))); @@ -277,6 +278,9 @@ void DolphinViewContainer::showMessage(const QString& msg, MessageType type) const int unwrappedWidth = m_messageWidget->sizeHint().width(); m_messageWidget->setWordWrap(unwrappedWidth > size().width()); + if (m_messageWidget->isVisible()) { + m_messageWidget->hide(); + } m_messageWidget->animatedShow(); }