From 5157958c0046123794a73f15bbb3ef3248cdebc1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 11 Sep 2013 12:05:09 +0200 Subject: [PATCH] reimplement showConfigurationInterface --- src/shell/panelview.cpp | 22 ++++++++++++++++++++++ src/shell/panelview.h | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 9179cc7d5..0088cf73c 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -379,6 +379,28 @@ void PanelView::restore() emit alignmentChanged(); } +void PanelView::showConfigurationInterface(Plasma::Applet *applet) +{ + if (m_panelConfigView) { + m_panelConfigView.data()->hide(); + m_panelConfigView.data()->deleteLater(); + } + + if (!applet || !applet->containment()) { + return; + } + + Plasma::Containment *cont = qobject_cast(applet); + + if (cont) { + m_panelConfigView = new PanelConfigView(cont, this); + } else { + m_panelConfigView = new ConfigView(applet); + } + m_panelConfigView.data()->init(); + m_panelConfigView.data()->show(); +} + void PanelView::resizeEvent(QResizeEvent *ev) { if (containment()->formFactor() == Plasma::Types::Vertical) { diff --git a/src/shell/panelview.h b/src/shell/panelview.h index 72fbd3875..e3d846c5a 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -75,6 +75,12 @@ Q_SIGNALS: void minimumLengthChanged(); void screenChanged(QScreen *screen); +protected Q_SLOTS: + /** + * It will be called when the configuration is requested + */ + virtual void showConfigurationInterface(Plasma::Applet *applet); + private Q_SLOTS: void positionPanel(); void restore(); @@ -84,7 +90,7 @@ private: int m_maxLength; int m_minLength; Qt::Alignment m_alignment; - QPointer m_panelConfigView; + QPointer m_panelConfigView; ShellCorona *m_corona; };