diff --git a/contents/config/config.qml b/contents/config/config.qml index 042aef2..d906d05 100644 --- a/contents/config/config.qml +++ b/contents/config/config.qml @@ -1,28 +1,28 @@ /* * Copyright (C) 2016 by David Baum * - * This file is part of plasma-codeship. + * This file is part of plasma-yamaha. * - * plasma-codeship is free software: you can redistribute it and/or modify + * plasma-yamaha 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 3 of the License, or * (at your option) any later version. * * plasma-codeship 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 + * 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 plasma-codeship. If not, see . + * along with plasma-yamaha. If not, see . */ -import QtQuick 2.2 +import QtQuick 2.5 import org.kde.plasma.configuration 2.0 ConfigModel { ConfigCategory { - name: i18n('General') + name: qsTr('General') icon: 'format-text-code' source: 'config/Config.qml' } diff --git a/contents/ui/config/Config.qml b/contents/ui/config/Config.qml index 8dc30bc..af94de1 100644 --- a/contents/ui/config/Config.qml +++ b/contents/ui/config/Config.qml @@ -22,8 +22,7 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 Item { - property alias cfg_ip: project.text - + property alias cfg_ip: ip.text id: root width: parent.width height: parent.height @@ -39,9 +38,9 @@ Item { text: qsTr("IP address") Layout.alignment: Qt.AlignRight } - + TextField { - id: project + id: ip Layout.fillWidth: true placeholderText: qsTr("Enter IP") } diff --git a/contents/ui/main.qml b/contents/ui/main.qml index 53c7fb9..aba605b 100644 --- a/contents/ui/main.qml +++ b/contents/ui/main.qml @@ -26,14 +26,12 @@ import QtQuick.Controls.Styles 1.2 Item { id: root property string ip: plasmoid.configuration.ip - property string url Connections { target: plasmoid.configuration } Component.onCompleted: { - url = "http://" + root.ip +"/YamahaRemoteControl/ctrl" sync() } @@ -120,6 +118,7 @@ Item { } function request(command) { + var url = "http://" + root.ip +"/YamahaRemoteControl/ctrl" var http = new XMLHttpRequest(); http.open("POST", url, true); http.setRequestHeader("Content-type", "text/xml; charset=UTF-8");