Skip to content

Commit

Permalink
fix config initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
David Baum committed Jul 8, 2016
1 parent 1e0ff42 commit 97aaf92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions contents/config/config.qml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
* Copyright (C) 2016 by David Baum <[email protected]>
*
* 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 <http://www.gnu.org/licenses/>.
* along with plasma-yamaha. If not, see <http://www.gnu.org/licenses/>.
*/

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'
}
Expand Down
7 changes: 3 additions & 4 deletions contents/ui/config/Config.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
}
Expand Down
3 changes: 1 addition & 2 deletions contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 97aaf92

Please sign in to comment.