┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-01-19 16:59:10 +0000
committerPeter Penz <[email protected]>2008-01-19 16:59:10 +0000
commitaeec6595302aded5bdf9b00448859b68e375cdcb (patch)
treed8af0393c46514ec95d3a76e8ee22b0eb842ce97 /src/dolphinmainwindow.cpp
parent89bb4eaf198a1427a1000f3f77dcabaee5fdae93 (diff)
stay consistent with Konqueror: F10 creates a new directory
svn path=/trunk/KDE/kdebase/apps/; revision=763500
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 2048de1a5..1157124f9 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -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());