]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Hide an already visible KMessageWidget message before showing a new one
authorArjun AK <arjunak234@gmail.com>
Fri, 22 Aug 2014 13:12:50 +0000 (18:42 +0530)
committerArjun AK <arjunak234@gmail.com>
Fri, 22 Aug 2014 13:12:50 +0000 (18:42 +0530)
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

src/dolphinviewcontainer.cpp

index 2a45152bd056fda049d929209c03d31b250c5e8f..93af3e8fbc547d128ab8f6750177cf75149558b1 100644 (file)
@@ -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();
 }