┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinpart.cpp
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2007-08-28 19:48:36 +0000
committerDavid Faure <[email protected]>2007-08-28 19:48:36 +0000
commit246c18a93c63cd3eaa7b53ce27f82009481f3401 (patch)
tree09d01413490e56f08122d15f9a1fda8bc3cb1d02 /src/dolphinpart.cpp
parent9c7ccd477a32ad52ff0126024ffbad0f6ea164b5 (diff)
Implement contextMenu handling in dolphin part (for konqueror)
svn path=/trunk/KDE/kdebase/apps/; revision=705873
Diffstat (limited to 'src/dolphinpart.cpp')
-rw-r--r--src/dolphinpart.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 22f7940bd..39df8feae 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -72,11 +72,15 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QStringLi
this, SLOT(slotErrorMessage(QString)));
connect(m_view, SIGNAL(itemTriggered(KFileItem)),
this, SLOT(slotItemTriggered(KFileItem)));
- // TODO connect to urlsDropped
- // TOOD connect to requestContextMenu
- connect(m_view, SIGNAL(selectionChanged(QList<KFileItem>)), m_extension, SIGNAL(selectionInfo(QList<KFileItem>)));
+ connect(m_view, SIGNAL(requestContextMenu(KFileItem, const KUrl&)),
+ this, SLOT(slotOpenContextMenu(KFileItem, const KUrl&)));
+ connect(m_view, SIGNAL(selectionChanged(QList<KFileItem>)),
+ m_extension, SIGNAL(selectionInfo(QList<KFileItem>)));
+
+ connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
+ this, SLOT(slotRequestItemInfo(KFileItem)));
- connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(slotRequestItemInfo(KFileItem)));
+ // TODO connect to urlsDropped
// TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror
// (sort of spacial navigation)
@@ -101,8 +105,8 @@ KAboutData* DolphinPart::createAboutData()
bool DolphinPart::openUrl(const KUrl& url)
{
const QString prettyUrl = url.pathOrUrl();
- setWindowCaption(prettyUrl);
- m_extension->setLocationBarUrl(prettyUrl);
+ emit setWindowCaption(prettyUrl);
+ emit m_extension->setLocationBarUrl(prettyUrl);
m_view->setUrl(url);
if (arguments().reload())
m_view->reload();
@@ -141,4 +145,19 @@ void DolphinPart::slotItemTriggered(const KFileItem& item)
emit m_extension->openUrlRequest(item.url());
}
+void DolphinPart::slotOpenContextMenu(const KFileItem& item, const KUrl&)
+{
+ // TODO KonqKfmIconView had if ( !rootItem->isWritable() )
+ // popupFlags |= KParts::BrowserExtension::NoDeletion;
+
+ // and when clicking on the viewport:
+ // KParts::BrowserExtension::PopupFlags popupFlags = KParts::BrowserExtension::ShowNavigationItems | KParts::BrowserExtension::ShowUp;
+
+
+ KFileItem* itemCopy = new KFileItem(item); // ugly
+ KFileItemList items; items.append(itemCopy);
+ emit m_extension->popupMenu( 0, QCursor::pos(), items );
+ delete itemCopy;
+}
+
#include "dolphinpart.moc"