]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Make the filter-behavior similar to applications like Kate, where activating the...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 7 Nov 2010 14:55:33 +0000 (14:55 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 7 Nov 2010 14:55:33 +0000 (14:55 +0000)
BUG: 256160
FIXED-IN: 4.6.0

svn path=/trunk/KDE/kdebase/apps/; revision=1193912

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/filterbar/filterbar.cpp

index 8017e9c82511d671c9e0069a752d4bddce974b48..8bba990c78f70ec899af98a700fec1fb409e834a 100644 (file)
@@ -841,9 +841,9 @@ void DolphinMainWindow::disableStopAction()
     actionCollection()->action("stop")->setEnabled(false);
 }
 
-void DolphinMainWindow::toggleFilterBarVisibility(bool show)
+void DolphinMainWindow::showFilterBar()
 {
-    m_activeViewContainer->setFilterBarVisible(show);
+    m_activeViewContainer->setFilterBarVisible(true);
 }
 
 void DolphinMainWindow::toggleEditLocation()
@@ -1517,11 +1517,11 @@ void DolphinMainWindow::setupActions()
     KStandardAction::home(this, SLOT(goHome()), actionCollection());
 
     // setup 'Tools' menu
-    KToggleAction* showFilterBar = actionCollection()->add<KToggleAction>("show_filter_bar");
+    KAction* showFilterBar = actionCollection()->addAction("show_filter_bar");
     showFilterBar->setText(i18nc("@action:inmenu Tools", "Show Filter Bar"));
     showFilterBar->setIcon(KIcon("view-filter"));
     showFilterBar->setShortcut(Qt::CTRL | Qt::Key_I);
-    connect(showFilterBar, SIGNAL(triggered(bool)), this, SLOT(toggleFilterBarVisibility(bool)));
+    connect(showFilterBar, SIGNAL(triggered()), this, SLOT(showFilterBar()));
 
     KAction* compareFiles = actionCollection()->addAction("compare_files");
     compareFiles->setText(i18nc("@action:inmenu Tools", "Compare Files"));
index 4a747ac5aa6a28a030af0e7013b6fc095a987ea7..fdfa931442163b2f06f90b033ff690a6fe2121fc 100644 (file)
@@ -250,10 +250,7 @@ private slots:
     void enableStopAction();
     void disableStopAction();
 
-    /**
-     * Toggles between showing and hiding of the filter bar
-     */
-    void toggleFilterBarVisibility(bool show);
+    void showFilterBar();
 
     /**
      * Toggles between edit and browse mode of the navigation bar.
index 7fd0cfa2999cf81ceea7afefe51fe20266d2c43e..9e927ee9810a108b80f65b597518976defce08d3 100644 (file)
@@ -303,6 +303,7 @@ void DolphinViewContainer::setFilterBarVisible(bool visible)
     Q_ASSERT(m_filterBar != 0);
     if (visible) {
         m_filterBar->show();
+        m_filterBar->setFocus();
     } else {
         closeFilterBar();
     }
index 6abeab4b0879eab1022375aa4d82d32acf017ad9..44f5dd9060c610e16089156c0383a39c82b59443 100644 (file)
@@ -111,6 +111,8 @@ public slots:
 
     /**
      * Popups the filter bar above the status bar if \a visible is true.
+     * It \a visible is true, it is assured that the filter bar gains
+     * the keyboard focus.
      */
     void setFilterBarVisible(bool visible);
 
index b108570ce4c5e872efd4937faf5be6ffd49e0d8c..c5dd99d78470432f1607e7e76a0434fd5f216835 100644 (file)
@@ -48,6 +48,7 @@ FilterBar::FilterBar(QWidget* parent) :
     m_filterInput->setClearButtonShown(true);
     connect(m_filterInput, SIGNAL(textChanged(const QString&)),
             this, SIGNAL(filterChanged(const QString&)));
+    setFocusProxy(m_filterInput);
 
     // Apply layout
     QHBoxLayout* hLayout = new QHBoxLayout(this);