2 * vdr-tv-client: TV frontend for watching tv streams from the vdr server.
4 * Copyright (c) 2011, Mika Laitio. <lamikr@pilppa.org>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24 import com.nokia.meego 1.0
25 import com.meego.vdrclient 1.0
28 property string locTxt_CaptionServerSelection: qsTr("Enter VDR server address:")
29 property string locTxt_BtnRestoreDefault: qsTr("Restore Default Address")
30 property string locTxt_BtnConnect: qsTr("Watch VDR TV")
31 property string defaultVDRServerAddress: "xvdr+tcp://192.168.2.1:37890"
32 property TextInput textInput: editVDRServerSelectionAddress
34 VDRClient { id: adapter } // callback to QMLVDRClient c++ class
36 function restoreDefaultVDRServerAddress() {
37 editVDRServerSelectionAddress.color = "red";
38 editVDRServerSelectionAddress.text = defaultVDRServerAddress;
41 function connectVDRServer() {
42 if (editVDRServerSelectionAddress.text.length > 5) {
43 adapter.launch_viewer(editVDRServerSelectionAddress.text);
49 anchors {top: parent.top; left: parent.left; margins: 10}
50 text: locTxt_CaptionServerSelection
51 id: captionServerSelection
55 id: editVDRServerSelectionAddress
56 anchors {top: captionServerSelection.bottom; left: parent.left; right: parent.right; margins: 10}
57 color: style.foregroundLight
59 //activeFocusOnPress: true
60 inputMethodHints: Qt.ImhDialableCharactersOnly
62 text: defaultVDRServerAddress
66 if (text.length == 0) {
67 cmp.restoreDefaultVDRServerAddress();
69 if (text == defaultVDRServerAddress) {
77 if (text.length > 5) {
78 cmp.connectVDRServer(text)
85 anchors {top: editVDRServerSelectionAddress.bottom; left: parent.left; margins: 24}
86 text: locTxt_BtnRestoreDefault
91 if (editVDRServerSelectionAddress.text != defaultVDRServerAddress) {
92 cmp.restoreDefaultVDRServerAddress();
100 anchors {top: editVDRServerSelectionAddress.bottom; right: parent.right; margins: 24}
101 text: locTxt_BtnConnect
106 if (editVDRServerSelectionAddress.text.length > 5) {
107 cmp.connectVDRServer(editVDRServerSelectionAddress.text);