From: Arjun AK Date: Fri, 22 Aug 2014 13:12:50 +0000 (+0530) Subject: Hide an already visible KMessageWidget message before showing a new one X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/4290827540d88829d3d06f828a11ac2c3df00d54 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 --- diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 2a45152bd..93af3e8fb 100644 --- a/src/dolphinviewcontainer.cpp +++ b/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(); }