auto load first page

This commit is contained in:
Marco Martin 2013-02-26 13:58:37 +01:00
parent 3a5e5f931b
commit fd9282d22f
2 changed files with 15 additions and 4 deletions

View File

@ -60,8 +60,6 @@ ConfigView::ConfigView(AppletInterface *interface, QWindow *parent)
engine()->rootContext()->setContextProperty("plasmoid", interface);
engine()->rootContext()->setContextProperty("configDialog", this);
setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
}
ConfigView::~ConfigView()

View File

@ -44,6 +44,11 @@ Rectangle {
}
}
Component.onCompleted: {
main.sourceComponent = configDialog.configPages[0].component
root.restoreConfig()
}
Column {
anchors.fill: parent
Row {
@ -74,6 +79,10 @@ Rectangle {
}
width: childrenRect.width
height: childrenRect.height
Rectangle {
anchors.fill: parent
visible: (main.sourceComponent == configDialog.configPages[modelData].component)
}
Column {
anchors {
left: parent.left
@ -96,8 +105,12 @@ Rectangle {
}
}
onClicked: {
main.sourceComponent = configDialog.configPages[modelData].component
root.restoreConfig()
if (main.sourceComponent == configDialog.configPages[modelData].component) {
return
} else {
main.sourceComponent = configDialog.configPages[modelData].component
root.restoreConfig()
}
}
}
}