From 94815093253e5db99aa100f0834cd6c74c96a91a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 31 Dec 2010 10:59:46 +0000 Subject: Lock panels per default and allow to unlock them like in Amarok. BUG: 229811 FIXED-IN: 4.7.0 svn path=/trunk/KDE/kdebase/apps/; revision=1210424 --- src/panels/information/informationpanel.cpp | 3 ++- src/panels/information/informationpanelcontent.cpp | 7 ++++++- src/panels/information/informationpanelcontent.h | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/panels/information') 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& 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& customContextMenuActions); signals: void urlActivated( const KUrl& url ); -- cgit v1.3