actually load config ui files
This commit is contained in:
parent
cfe6a40d3d
commit
ff089521af
@ -627,6 +627,12 @@ void AppletInterface::setConfigurationInterfaceShown(bool show)
|
|||||||
|
|
||||||
m_configView.data()->setResizeMode(QQuickView::SizeRootObjectToView);
|
m_configView.data()->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
m_configView.data()->setSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
|
m_configView.data()->setSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
|
||||||
|
|
||||||
|
if (m_configView.data()->rootObject()) {
|
||||||
|
m_configView.data()->engine()->rootContext()->setContextProperty("plasmoid", this);
|
||||||
|
m_configView.data()->rootObject()->metaObject()->invokeMethod(m_configView.data()->rootObject(), "addConfigPage", Q_ARG(QVariant, QUrl::fromLocalFile(m_appletScriptEngine->package().filePath("ui", "ConfigGeneral.qml"))));
|
||||||
|
}
|
||||||
|
|
||||||
m_configView.data()->show();
|
m_configView.data()->show();
|
||||||
} else {
|
} else {
|
||||||
if (m_configView) {
|
if (m_configView) {
|
||||||
|
40
src/shell/applets/testapplet/contents/ui/ConfigGeneral.qml
Normal file
40
src/shell/applets/testapplet/contents/ui/ConfigGeneral.qml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013 Marco Martin <mart@kde.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||||
|
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: iconsPage
|
||||||
|
height: childrenRect.height
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.fill: parent
|
||||||
|
spacing: 4
|
||||||
|
Row {
|
||||||
|
PlasmaComponents.Label {
|
||||||
|
text: "Text Config value"
|
||||||
|
}
|
||||||
|
PlasmaComponents.TextField {
|
||||||
|
id: testConfigField
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -28,6 +28,11 @@ Rectangle {
|
|||||||
width: 640
|
width: 640
|
||||||
height: 480
|
height: 480
|
||||||
|
|
||||||
|
function addConfigPage(url) {
|
||||||
|
print("Loading config page: " + url)
|
||||||
|
main.source = url
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Row {
|
Row {
|
||||||
@ -78,13 +83,10 @@ Rectangle {
|
|||||||
Flickable {
|
Flickable {
|
||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: main.height
|
contentHeight: main.height
|
||||||
Item {
|
Loader {
|
||||||
id: main
|
id: main
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
Text {
|
|
||||||
text: "Configuration goes here"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user