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("plasmoid", interface);
engine()->rootContext()->setContextProperty("configDialog", this); engine()->rootContext()->setContextProperty("configDialog", this);
setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("ui", "Configuration.qml"))); setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
} }
ConfigView::~ConfigView() ConfigView::~ConfigView()

View File

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