]> cloud.milkyroute.net Git - dolphin.git/commitdiff
stay consistent with Konqueror: F10 creates a new directory
authorPeter Penz <peter.penz19@gmail.com>
Sat, 19 Jan 2008 16:59:10 +0000 (16:59 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 19 Jan 2008 16:59:10 +0000 (16:59 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=763500

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index 2048de1a5618aee14bf80411ae4ad917624ca6d4..1157124f927e90f04d4c885379547ca2bd1dea50 100644 (file)
@@ -59,6 +59,7 @@
 #include <kmenu.h>
 #include <kmenubar.h>
 #include <kmessagebox.h>
+#include <konq_operations.h>
 #include <konqmimedata.h>
 #include <kpropertiesdialog.h>
 #include <kprotocolinfo.h>
@@ -422,6 +423,12 @@ void DolphinMainWindow::readProperties(const KConfigGroup& group)
     }
 }
 
+void DolphinMainWindow::createDir()
+{
+    const KUrl& url = m_activeViewContainer->view()->url();
+    KonqOperations::newDir(this, url);
+}
+
 void DolphinMainWindow::updateNewMenu()
 {
     m_newMenu->slotCheckUpToDate();
@@ -985,6 +992,13 @@ void DolphinMainWindow::setupActions()
     connect(menu, SIGNAL(aboutToShow()),
             this, SLOT(updateNewMenu()));
 
+    // This action doesn't appear in the GUI, it's for the shortcut only.
+    // KNewMenu takes care of the GUI stuff.
+    KAction* newDirAction = actionCollection()->addAction("create_dir");
+    newDirAction->setText(i18n("Create Folder..."));
+    connect(newDirAction, SIGNAL(triggered()), SLOT(createDir()));
+    newDirAction->setShortcut(Qt::Key_F10);
+
     KAction* newWindow = actionCollection()->addAction("new_window");
     newWindow->setIcon(KIcon("window-new"));
     newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
@@ -1012,8 +1026,8 @@ void DolphinMainWindow::setupActions()
                           SLOT(undo()),
                           actionCollection());
 
-    //Need to remove shift+del from cut action, else the shortcut for deletejob
-    //doesn't work
+    // need to remove shift+del from cut action, else the shortcut for deletejob
+    // doesn't work
     KAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
     KShortcut cutShortcut = cut->shortcut();
     cutShortcut.remove(Qt::SHIFT + Qt::Key_Delete, KShortcut::KeepEmpty);
@@ -1040,7 +1054,6 @@ void DolphinMainWindow::setupActions()
                              SLOT(zoomOut()),
                              actionCollection());
 
-
     KToggleAction* iconsView = DolphinView::iconsModeAction(actionCollection());
     KToggleAction* detailsView = DolphinView::detailsModeAction(actionCollection());
     KToggleAction* columnView = DolphinView::columnsModeAction(actionCollection());
index f757520c371a7e10ee3daa0311e7d45a8922a220..43dc2248aa5657e276f4e3d57ab816fd675c2fd9 100644 (file)
@@ -163,6 +163,9 @@ protected:
     virtual void readProperties(const KConfigGroup& group);
 
 private slots:
+    /** Opens the dialog for creating a directory. */
+    void createDir();
+
     /** Updates the 'Create New...' sub menu. */
     void updateNewMenu();