]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Thanks to David Faure the 'Copy To' and 'Move To' menus in the context menu can also...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 2 Apr 2008 19:49:04 +0000 (19:49 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 2 Apr 2008 19:49:04 +0000 (19:49 +0000)
Minor issue: the Dolphin context menu should take care about the protocol capabilities (copy, move, delete, ...) like in konq_popupmenu (I'll fix this before 4.1).

CCMAIL: faure@kde.org
BUG: 155969

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

src/dolphin_generalsettings.kcfg
src/dolphincontextmenu.cpp
src/dolphincontextmenu.h
src/generalsettingspage.cpp
src/generalsettingspage.h

index 7778db702914a180cb3450a47a29e81a748e4e67..cc498f273ae4d2d4b3f99e521c0fbf2313e7ac93 100644 (file)
             <label context="@label">Show selection toggle</label>
             <default>true</default>
         </entry>
+        <entry name="ShowCopyMoveMenu" type="Bool">
+            <label context="@label">Show 'Copy To' and 'Move To' commands in context menu</label>
+            <default>false</default>
+        </entry>
         <entry name="ViewPropsTimestamp" type="DateTime" >
             <label context="@label">Timestamp since when the view properties are valid</label>
         </entry>
index 6ee2c1672da8807b7944220bffe346fcc619ee72..41673e182d291cbfa88aac0ebe740f1c9cb94ce2 100644 (file)
@@ -24,6 +24,7 @@
 #include "dolphinsettings.h"
 #include "dolphinview.h"
 #include "dolphinviewcontainer.h"
+#include "dolphin_generalsettings.h"
 
 #include <kactioncollection.h>
 #include <kfileplacesmodel.h>
@@ -185,8 +186,16 @@ void DolphinContextMenu::openItemContextMenu()
     // Insert 'Actions' sub menu
     KonqMenuActions menuActions;
     menuActions.setItems(m_selectedItems);
-    if (menuActions.addActionsTo(popup))
+    if (menuActions.addActionsTo(popup)) {
         popup->addSeparator();
+    }
+
+    // Insert 'Copy To' and 'Move To' sub menus
+    if (DolphinSettings::instance().generalSettings()->showCopyMoveMenu()) {
+        m_copyToMenu.setItems(m_selectedItems);
+        m_copyToMenu.addActionsTo(popup);
+        popup->addSeparator();
+    }
 
     // insert 'Properties...' entry
     QAction* propertiesAction = m_mainWindow->actionCollection()->action("properties");
index f7234f8e0b9fc9196843337d29fc6ba95b693103..7eb542b6b1a57850a77711e862145a4cfcf8a147 100644 (file)
@@ -24,6 +24,7 @@
 #include <kfileitem.h>
 #include <kservice.h>
 #include <kurl.h>
+#include <konq_copytomenu.h>
 
 #include <QtCore/QObject>
 
@@ -134,6 +135,7 @@ private:
     KFileItemList m_selectedItems;
     KUrl::List m_selectedUrls;
     int m_context;
+    KonqCopyToMenu m_copyToMenu;
 };
 
 #endif
index f976bbffa9416fd0d385b365034f7086acd547b1..a570141a6e82c7a98edc683eca49a54032997d94 100644 (file)
@@ -38,6 +38,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     m_confirmMoveToTrash(0),
     m_confirmDelete(0),
     m_showDeleteCommand(0),
+    m_showCopyMoveMenu(0),
     m_browseThroughArchives(0),
     m_renameInline(0)
 {
@@ -66,6 +67,9 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     m_showDeleteCommand = new QCheckBox(i18nc("@option:check", "Show 'Delete' command in context menu"), vBox);
     connect(m_showDeleteCommand, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
 
+    m_showCopyMoveMenu = new QCheckBox(i18nc("@option:check", "Show 'Copy To' and 'Move To' commands in context menu"), vBox);
+    connect(m_showCopyMoveMenu, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+
     m_browseThroughArchives = new QCheckBox(i18nc("@option:check", "Browse through archives"), vBox);
     connect(m_browseThroughArchives, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
 
@@ -100,6 +104,7 @@ void GeneralSettingsPage::applySettings()
     kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
     kdeConfig.sync();
 
+    settings->setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked());
     settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked());
     settings->setRenameInline(m_renameInline->isChecked());
 }
@@ -125,6 +130,7 @@ void GeneralSettingsPage::loadSettings()
     m_showDeleteCommand->setChecked(kdeConfig.readEntry("ShowDeleteCommand", false));
 
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+    m_showCopyMoveMenu->setChecked(settings->showCopyMoveMenu());
     m_browseThroughArchives->setChecked(settings->browseThroughArchives());
     m_renameInline->setChecked(settings->renameInline());
 }
index 42ea08185c59c1687115dd5f518dbd2c0ee273e1..55528bc568c7f818c9d15f16d572d370be379fcb 100644 (file)
@@ -51,6 +51,7 @@ private:
     QCheckBox* m_confirmDelete;
 
     QCheckBox* m_showDeleteCommand;
+    QCheckBox* m_showCopyMoveMenu;
     QCheckBox* m_browseThroughArchives;
     QCheckBox* m_renameInline;
 };