]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/folders/treeviewcontextmenu.cpp
Fix regression introduced in 4.5 and allow to add the menu actions "Show Information...
[dolphin.git] / src / panels / folders / treeviewcontextmenu.cpp
index 32e92e05c2e8fcb874580c9d7536cff0960d291c..de93e096c1d5b59eea2258987b61185b67ba8bd3 100644 (file)
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and              *
- *   Cvetoslav Ludmiloff                                                   *
+ *   Copyright (C) 2006-2010 by Peter Penz <peter.penz19@gmail.com>        *
+ *   Copyright (C) 2006 by Cvetoslav Ludmiloff                             *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -20,8 +20,6 @@
 
 #include "treeviewcontextmenu.h"
 
-#include "dolphin_folderspanelsettings.h"
-
 #include <kfileitem.h>
 #include <kiconloader.h>
 #include <kio/deletejob.h>
@@ -79,6 +77,7 @@ void TreeViewContextMenu::open()
         // insert 'Rename'
         QAction* renameAction = new QAction(i18nc("@action:inmenu", "Rename..."), this);
         renameAction->setEnabled(capabilities.supportsMoving());
+        renameAction->setIcon(KIcon("edit-rename"));
         connect(renameAction, SIGNAL(triggered()), this, SLOT(rename()));
         popup->addAction(renameAction);
 
@@ -87,7 +86,7 @@ void TreeViewContextMenu::open()
         KConfigGroup configGroup(globalConfig, "KDE");
         bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
 
-        const KUrl& url = m_fileInfo.url();
+        const KUrl url = m_fileInfo.url();
         if (url.isLocalFile()) {
             QAction* moveToTrashAction = new QAction(KIcon("user-trash"),
                                                     i18nc("@action:inmenu", "Move to Trash"), this);
@@ -110,6 +109,7 @@ void TreeViewContextMenu::open()
 
         // insert 'Properties' entry
         QAction* propertiesAction = new QAction(i18nc("@action:inmenu", "Properties"), this);
+        propertiesAction->setIcon(KIcon("document-properties"));
         connect(propertiesAction, SIGNAL(triggered()), this, SLOT(showProperties()));
         popup->addAction(propertiesAction);
 
@@ -118,11 +118,17 @@ void TreeViewContextMenu::open()
 
     QAction* showHiddenFilesAction = new QAction(i18nc("@action:inmenu", "Show Hidden Files"), this);
     showHiddenFilesAction->setCheckable(true);
-    showHiddenFilesAction->setChecked(FoldersPanelSettings::showHiddenFiles());
+    showHiddenFilesAction->setChecked(m_parent->showHiddenFiles());
     popup->addAction(showHiddenFilesAction);
-
     connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool)));
 
+    QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this);
+    autoScrollingAction->setCheckable(true);
+    autoScrollingAction->setChecked(m_parent->autoScrolling());
+    popup->addAction(autoScrollingAction);
+    connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool)));
+
+
     popup->exec(QCursor::pos());
     popup->deleteLater();
 }
@@ -193,4 +199,9 @@ void TreeViewContextMenu::setShowHiddenFiles(bool show)
     m_parent->setShowHiddenFiles(show);
 }
 
+void TreeViewContextMenu::setAutoScrolling(bool enable)
+{
+    m_parent->setAutoScrolling(enable);
+}
+
 #include "treeviewcontextmenu.moc"