]> cloud.milkyroute.net Git - dolphin.git/commitdiff
added signals errorMessage(const QString&) and infoMessage(const QString&) for the...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 8 Jun 2007 14:14:34 +0000 (14:14 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 8 Jun 2007 14:14:34 +0000 (14:14 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=672944

src/dolphinview.cpp
src/dolphinview.h
src/dolphinviewcontainer.cpp

index 0154453b6090933e9aa7f6fa10b16088a6c94246..ae56c6ea25893701879f639b8dcf3c7a1ac2221d 100644 (file)
@@ -58,8 +58,7 @@ DolphinView::DolphinView(QWidget* parent,
                          KDirLister* dirLister,
                          KDirModel* dirModel,
                          DolphinSortFilterProxyModel* proxyModel,
                          KDirLister* dirLister,
                          KDirModel* dirModel,
                          DolphinSortFilterProxyModel* proxyModel,
-                         Mode mode,
-                         bool showHiddenFiles) :
+                         Mode mode) :
     QWidget(parent),
     m_active(true),
     m_blockContentsMovedSignal(false),
     QWidget(parent),
     m_active(true),
     m_blockContentsMovedSignal(false),
@@ -542,15 +541,12 @@ void DolphinView::emitSelectionChangedSignal()
 void DolphinView::startDirLister(const KUrl& url, bool reload)
 {
     if (!url.isValid()) {
 void DolphinView::startDirLister(const KUrl& url, bool reload)
 {
     if (!url.isValid()) {
-        // TODO: temporary deactivated due to DolphinView/DolphinViewController split
-
-        //const QString location(url.pathOrUrl());
-        //if (location.isEmpty()) {
-        //    m_statusBar->setMessage(i18n("The location is empty."), DolphinStatusBar::Error);
-        //} else {
-        //    m_statusBar->setMessage(i18n("The location '%1' is invalid.", location),
-        //                            DolphinStatusBar::Error);
-        //}
+        const QString location(url.pathOrUrl());
+        if (location.isEmpty()) {
+            emit errorMessage(i18n("The location is empty."));
+        } else {
+            emit errorMessage(i18n("The location '%1' is invalid.", location));
+        }
         return;
     }
 
         return;
     }
 
@@ -679,9 +675,6 @@ void DolphinView::setUrl(const KUrl& url)
 
     startDirLister(url);
     emit urlChanged(url);
 
     startDirLister(url);
     emit urlChanged(url);
-
-    // TODO: temporary deactivated due to DolphinView/DolphinViewController split
-    //m_statusBar->clear();
 }
 
 void DolphinView::changeSelection(const KFileItemList& selection)
 }
 
 void DolphinView::changeSelection(const KFileItemList& selection)
index 97ab01dadc7cc234f2a61c70a1d15e8380166368..bcccb7404d1da39a03c197f0265574e1b24d126a 100644 (file)
@@ -123,8 +123,7 @@ public:
                 KDirLister* dirLister,
                 KDirModel* dirModel,
                 DolphinSortFilterProxyModel* proxyModel,
                 KDirLister* dirLister,
                 KDirModel* dirModel,
                 DolphinSortFilterProxyModel* proxyModel,
-                Mode mode = IconsView,
-                bool showHiddenFiles = false);
+                Mode mode);
 
     virtual ~DolphinView();
 
 
     virtual ~DolphinView();
 
@@ -373,6 +372,18 @@ signals:
      */
     void urlsDropped(const KUrl::List& urls, const KUrl& destination);
 
      */
     void urlsDropped(const KUrl::List& urls, const KUrl& destination);
 
+    /**
+     * Is emitted if an information message with the content \a msg
+     * should be shown.
+     */
+    void infoMessage(const QString& msg);
+
+    /**
+     * Is emitted if an error message with the content \a msg
+     * should be shown.
+     */
+    void errorMessage(const QString& msg);
+
 protected:
     /** @see QWidget::mouseReleaseEvent */
     virtual void mouseReleaseEvent(QMouseEvent* event);
 protected:
     /** @see QWidget::mouseReleaseEvent */
     virtual void mouseReleaseEvent(QMouseEvent* event);
index 8eab3efaced4842127aff7f16a403eb5ce1f9f8f..a2a899beae926b9cc8082cf8a378ccdfffb77544 100644 (file)
@@ -131,8 +131,7 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
                              m_dirLister,
                              m_dirModel,
                              m_proxyModel,
                              m_dirLister,
                              m_dirModel,
                              m_proxyModel,
-                             mode,
-                             showHiddenFiles);
+                             mode);
     connect(m_view, SIGNAL(urlChanged(const KUrl&)),
             m_urlNavigator, SLOT(setUrl(const KUrl&)));
     connect(m_view, SIGNAL(requestContextMenu(KFileItem*, const KUrl&)),
     connect(m_view, SIGNAL(urlChanged(const KUrl&)),
             m_urlNavigator, SLOT(setUrl(const KUrl&)));
     connect(m_view, SIGNAL(requestContextMenu(KFileItem*, const KUrl&)),
@@ -141,6 +140,10 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
             m_mainWindow, SLOT(dropUrls(const KUrl::List&, const KUrl&)));
     connect(m_view, SIGNAL(requestItemInfo(const KUrl&)),
             this, SLOT(showItemInfo(const KUrl&)));
             m_mainWindow, SLOT(dropUrls(const KUrl::List&, const KUrl&)));
     connect(m_view, SIGNAL(requestItemInfo(const KUrl&)),
             this, SLOT(showItemInfo(const KUrl&)));
+    connect(m_view, SIGNAL(errorMessage(const QString&)),
+            this, SLOT(showErrorMessage(const QString&)));
+    connect(m_view, SIGNAL(infoMessage(const QString&)),
+            this, SLOT(showInfoMessage(const QString&)));
 
     connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
             m_view, SLOT(setUrl(const KUrl&)));
 
     connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
             m_view, SLOT(setUrl(const KUrl&)));