reimplement showConfigurationInterface

This commit is contained in:
Marco Martin 2013-09-11 12:05:09 +02:00
parent 98a681a0e7
commit 5157958c00
2 changed files with 29 additions and 1 deletions

View File

@ -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<Plasma::Containment *>(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) {

View File

@ -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<PanelConfigView> m_panelConfigView;
QPointer<ConfigView> m_panelConfigView;
ShellCorona *m_corona;
};