Changeset 99c2b0
- Timestamp:
- 01/13/12 16:47:20 (4 months ago)
- Branches:
- ('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
- Children:
- 1e650c7142f7844537be880bdfa4b4229880b6ad
- Parents:
- 64e2b354af0c1166afff3ea763e1c12b6b1be779
- git-author:
- Micke Prag <micke.prag@telldus.se>2012-01-13 16:47:20+01:00
- git-committer:
- Micke Prag <micke.prag@telldus.se>2012-01-13 16:47:20+01:00
- Location:
- telldus-gui/Plugins/Sensors
- Files:
-
- 2 edited
-
SensorView.qml (modified) (2 diffs)
-
sensor.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
telldus-gui/Plugins/Sensors/SensorView.qml
r64e2b3 r99c2b0 9 9 height: childrenRect.height 10 10 width: parent.width 11 12 property string state: main.state 13 onStateChanged: { 14 if (state != "EDIT") { 15 modelData.setName(nameEdit.text) 16 } 17 } 11 18 12 19 BorderImage { … … 23 30 height: 40 24 31 verticalAlignment: Text.AlignVCenter 25 text: modelData.name ;32 text: modelData.name == '' ? '<unnamed>' : modelData.name; 26 33 color: "#004275" 27 34 } 28 Rectangle{29 color: "white"35 TextField { 36 id: nameEdit 30 37 visible: main.state == "EDIT" 31 38 anchors.left: parent.left 32 39 anchors.leftMargin: 15 33 width: nameEdit.width + 4 34 height: 22 35 TextInput{ 36 id: nameEdit 37 anchors.centerIn: parent 38 text: modelData.name; 39 color: "#004275" 40 41 onActiveFocusChanged: { 42 if(!activeFocus){ 43 //todo other way? 44 modelData.setName(nameEdit.text); 45 } 46 } 47 onAccepted: { 48 modelData.setName(nameEdit.text); 49 } 50 } 40 anchors.top: parent.top 41 anchors.topMargin: (40-nameEdit.height)/2 42 text: modelData.name; 43 placeholderText: 'Enter a name' 51 44 } 52 45 Text{ -
telldus-gui/Plugins/Sensors/sensor.cpp
ref9a20 r99c2b0 47 47 48 48 QString Sensor::name() const { 49 //return QString("%1 %2").arg(this->protocol()).arg(this->id()); //TODO: Remove when name is fully implemented50 if(d->name == ""){51 return "<unnamed>";52 }53 49 return d->name; 54 50 }
Note: See TracChangeset
for help on using the changeset viewer.
