From fd9282d22f1c4098c81a13cfa7afd88fb11fe2fa Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 26 Feb 2013 13:58:37 +0100 Subject: [PATCH] auto load first page --- src/scriptengines/qml/plasmoid/configview.cpp | 2 -- .../desktop/contents/ui/Configuration.qml | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/scriptengines/qml/plasmoid/configview.cpp b/src/scriptengines/qml/plasmoid/configview.cpp index 99ab71baa..0017aa925 100644 --- a/src/scriptengines/qml/plasmoid/configview.cpp +++ b/src/scriptengines/qml/plasmoid/configview.cpp @@ -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() diff --git a/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml b/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml index c91cf818d..5c8fa0431 100644 --- a/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml +++ b/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml @@ -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() + } } } }