close window on ok/cancel pressed
delete window on close
This commit is contained in:
parent
45147081e7
commit
3a5e5f931b
@ -37,6 +37,7 @@
|
||||
#include <kcoreauthorized.h>
|
||||
#include <kcolorscheme.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <kdebug.h>
|
||||
#include <kplugininfo.h>
|
||||
#include <klocalizedstring.h>
|
||||
#include <kservice.h>
|
||||
|
@ -63,8 +63,6 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, QQuickItem *pa
|
||||
{
|
||||
qmlRegisterType<AppletInterface>();
|
||||
|
||||
m_configuration = new ConfigPropertyMap(applet()->configScheme(), this);
|
||||
|
||||
connect(this, SIGNAL(releaseVisualFocus()), applet(), SIGNAL(releaseVisualFocus()));
|
||||
connect(this, SIGNAL(configNeedsSaving()), applet(), SIGNAL(configNeedsSaving()));
|
||||
connect(applet(), SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)), this, SIGNAL(immutableChanged()));
|
||||
@ -97,6 +95,8 @@ void AppletInterface::init()
|
||||
return;
|
||||
}
|
||||
|
||||
m_configuration = new ConfigPropertyMap(applet()->configScheme(), this);
|
||||
|
||||
//use our own custom network access manager that will access Plasma packages and to manage security (i.e. deny access to remote stuff when the proper extension isn't enabled
|
||||
QQmlEngine *engine = m_qmlObject->engine();
|
||||
QQmlNetworkAccessManagerFactory *factory = engine->networkAccessManagerFactory();
|
||||
|
@ -74,4 +74,11 @@ QVariantList ConfigView::configPages() const
|
||||
return m_configPages;
|
||||
}
|
||||
|
||||
//To emulate Qt::WA_DeleteOnClose that QWindow doesn't have
|
||||
void ConfigView::hideEvent(QHideEvent *ev)
|
||||
{
|
||||
QQuickWindow::hideEvent(ev);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
#include "moc_configview.cpp"
|
||||
|
@ -37,6 +37,9 @@ public:
|
||||
|
||||
QVariantList configPages() const;
|
||||
|
||||
protected:
|
||||
void hideEvent(QHideEvent *ev);
|
||||
|
||||
private:
|
||||
AppletInterface *m_appletInterface;
|
||||
QVariantList m_configPages;
|
||||
|
@ -133,18 +133,18 @@ Rectangle {
|
||||
text: "Ok"
|
||||
onClicked: {
|
||||
root.saveConfig()
|
||||
configDialog.close()
|
||||
}
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
iconSource: "dialog-ok-apply"
|
||||
text: "Apply"
|
||||
onClicked: {
|
||||
root.saveConfig()
|
||||
}
|
||||
onClicked: root.saveConfig()
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
iconSource: "dialog-cancel"
|
||||
text: "Cancel"
|
||||
onClicked: configDialog.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user