┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information
diff options
context:
space:
mode:
Diffstat (limited to 'src/panels/information')
-rw-r--r--src/panels/information/informationpanel.cpp3
-rw-r--r--src/panels/information/informationpanelcontent.cpp7
-rw-r--r--src/panels/information/informationpanelcontent.h4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp
index 0fd67b2b6..6681dc30d 100644
--- a/src/panels/information/informationpanel.cpp
+++ b/src/panels/information/informationpanel.cpp
@@ -167,7 +167,8 @@ void InformationPanel::resizeEvent(QResizeEvent* event)
void InformationPanel::contextMenuEvent(QContextMenuEvent* event)
{
- m_content->configureSettings();
+ // TODO: Move code from InformationPanelContent::configureSettings() here
+ m_content->configureSettings(customContextMenuActions());
Panel::contextMenuEvent(event);
}
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index 371bdaf96..f8a72fb70 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -265,7 +265,7 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event)
return QWidget::eventFilter(obj, event);
}
-void InformationPanelContent::configureSettings()
+void InformationPanelContent::configureSettings(const QList<QAction*>& customContextMenuActions)
{
KMenu popup(this);
@@ -277,6 +277,11 @@ void InformationPanelContent::configureSettings()
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
configureAction->setIcon(KIcon("configure"));
+ popup.addSeparator();
+ foreach (QAction* action, customContextMenuActions) {
+ popup.addAction(action);
+ }
+
// Open the popup and adjust the settings for the
// selected action.
QAction* action = popup.exec(QCursor::pos());
diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h
index f918b8582..c41f4043f 100644
--- a/src/panels/information/informationpanelcontent.h
+++ b/src/panels/information/informationpanelcontent.h
@@ -61,8 +61,10 @@ public:
/**
* Opens a menu which allows to configure which meta information
* should be shown.
+ *
+ * TODO: Move this code to the class InformationPanel
*/
- void configureSettings();
+ void configureSettings(const QList<QAction*>& customContextMenuActions);
signals:
void urlActivated( const KUrl& url );