]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewactionhandler.cpp
revert fix for bug 167044 - although the crash is fixed the autoscroll does not work...
[dolphin.git] / src / dolphinviewactionhandler.cpp
index d87937bb26fe27d64215d830b04cd92e446bc72e..cd5880c794b7a776a751a2e7f69fc27d6c87460a 100644 (file)
@@ -29,6 +29,7 @@
 #include <klocale.h>
 #include <ktoggleaction.h>
 #include <krun.h>
+#include <kpropertiesdialog.h>
 
 DolphinViewActionHandler::DolphinViewActionHandler(KActionCollection* collection, QObject* parent)
     : QObject(parent),
@@ -104,6 +105,12 @@ void DolphinViewActionHandler::createActions()
     deleteWithTrashShortcut->setEnabled(false);
     connect(deleteWithTrashShortcut, SIGNAL(triggered()), this, SLOT(slotDeleteItems()));
 
+    KAction *propertiesAction = m_actionCollection->addAction( "properties" );
+    // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :)
+    propertiesAction->setText( i18nc("@action:inmenu File", "Properties") );
+    propertiesAction->setShortcut(Qt::ALT | Qt::Key_Return);
+    connect(propertiesAction, SIGNAL(triggered()), SLOT(slotProperties()));
+
     // View menu
 
     QActionGroup* viewModeActions = new QActionGroup(this);
@@ -506,3 +513,20 @@ void DolphinViewActionHandler::slotFindFile()
 {
     KRun::run("kfind", m_currentView->url(), m_currentView->window());
 }
+
+void DolphinViewActionHandler::slotProperties()
+{
+    KPropertiesDialog* dialog = 0;
+    const KFileItemList list = m_currentView->selectedItems();
+    if (list.isEmpty()) {
+        const KUrl url = m_currentView->url();
+        dialog = new KPropertiesDialog(url, m_currentView);
+    } else {
+        dialog = new KPropertiesDialog(list, m_currentView);
+    }
+
+    dialog->setAttribute(Qt::WA_DeleteOnClose);
+    dialog->show();
+    dialog->raise();
+    dialog->activateWindow();
+}