Changeset df5e08


Ignore:
Timestamp:
01/12/12 17:30:23 (4 months ago)
Author:
Micke Prag <micke.prag@…>
Branches:
('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
Children:
332bf966f52568b7ac890e860f686d984c765309
Parents:
ef9a201f9052aef710ebaa70b3e4458e014564f0
git-author:
Micke Prag <micke.prag@telldus.se>2012-01-12 17:30:23+01:00
git-committer:
Micke Prag <micke.prag@telldus.se>2012-01-12 17:30:23+01:00
Message:

Move SensorView to its own file

Location:
telldus-gui/Plugins/Sensors
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • telldus-gui/Plugins/Sensors/CMakeLists.txt

    re7ec37 rdf5e08  
    3434        qmldir 
    3535        SensorValue.qml 
     36        SensorView.qml 
    3637) 
    3738 
  • telldus-gui/Plugins/Sensors/main.qml

    ref9a20 rdf5e08  
    55        state: "VIEW" 
    66 
    7         Component { 
     7        SensorView { 
    88                id: sensorView 
    9                 Item{ 
    10                         id: sensorViewItem 
    11                         visible: main.state == "EDIT" || modelData.showInList 
    12                         height: childrenRect.height 
    13                         width: parent.width 
    14  
    15                         BorderImage { 
    16                                 source: "row_bg.png" 
    17                                 border.left: 5; border.top: 5 
    18                                 border.right: 5; border.bottom: 5 
    19                                 height: sensorInfo.height 
    20                                 width: parent.width 
    21  
    22                                 Text { 
    23                                         visible: main.state == "VIEW" 
    24                                         anchors.left: parent.left 
    25                                         anchors.leftMargin: 15 
    26                                         height: 40 
    27                                         verticalAlignment: Text.AlignVCenter 
    28                                         text: modelData.name; 
    29                                         color: "#004275" 
    30                                 } 
    31                                 Rectangle{ 
    32                                         color: "white" 
    33                                         visible: main.state == "EDIT" 
    34                                         anchors.left: parent.left 
    35                                         anchors.leftMargin: 15 
    36                                         width: nameEdit.width + 4 
    37                                         height: 22 
    38                                         TextInput{ 
    39                                                 id: nameEdit 
    40                                                 anchors.centerIn: parent 
    41                                                 text: modelData.name; 
    42                                                 color: "#004275" 
    43  
    44                                                 onActiveFocusChanged: { 
    45                                                         if(!activeFocus){ 
    46                                                                 //todo other way? 
    47                                                                 modelData.setName(nameEdit.text); 
    48                                                         } 
    49                                                 } 
    50                                                 onAccepted: { 
    51                                                         modelData.setName(nameEdit.text); 
    52                                                 } 
    53                                         } 
    54                                 } 
    55                                 Text{ 
    56                                         anchors.right: model.left 
    57                                         visible: main.state == "EDIT" 
    58                                         height: 40 
    59                                         verticalAlignment: Text.AlignVCenter 
    60                                         text: modelData.id 
    61                                         color: "#004275" 
    62                                         width: 50 
    63                                 } 
    64                                 Text{ 
    65                                         id: model 
    66                                         anchors.right: visibleinlistcheckbox.left 
    67                                         visible: main.state == "EDIT" 
    68                                         height: 40 
    69                                         verticalAlignment: Text.AlignVCenter 
    70                                         text: modelData.model 
    71                                         color: "#004275" 
    72                                         width: 100 
    73                                 } 
    74                                 Item{ 
    75                                         id: visibleinlistcheckbox 
    76                                         anchors.right: sensorInfo.left 
    77                                         visible: main.state == "EDIT" 
    78                                         height: 40 
    79                                         Rectangle{ 
    80                                                 anchors.centerIn: parent 
    81                                                 height: 10 
    82                                                 width: 10 
    83                                                 color: "white" 
    84                                                 Text{ 
    85                                                         anchors.centerIn: parent 
    86                                                         color: "#004275" 
    87                                                         text: modelData.showInList ? "X" : "" 
    88                                                 } 
    89                                                 MouseArea{ 
    90                                                         anchors.fill: parent 
    91                                                         onClicked: { 
    92                                                                 modelData.setShowInList(!modelData.showInList); 
    93                                                         } 
    94                                                 } 
    95                                         } 
    96                                         width: 100 
    97                                 } 
    98  
    99                                 Column { 
    100                                         id: sensorInfo 
    101                                         anchors.right: parent.right 
    102                                         width: 250 
    103                                         SensorValue { 
    104                                                 visible: modelData.hasTemperature 
    105                                                 text: visible ? modelData.sensorValue(1).value + '°C' : '' 
    106                                                 icon: "icon_temp.png" 
    107                                                 lastUpdated: visible ? modelData.sensorValue(1).lastUpdated : new Date() 
    108                                         } 
    109                                         SensorValue { 
    110                                                 visible: modelData.hasHumidity 
    111                                                 text: visible ? modelData.sensorValue(2).value + '%' : '' 
    112                                                 icon: "icon_humidity.png" 
    113                                                 lastUpdated: visible ? modelData.sensorValue(2).lastUpdated : new Date() 
    114                                         } 
    115                                 } 
    116                         } 
    117                 } 
    1189        } 
    11910 
  • telldus-gui/Plugins/Sensors/qmldir

    r1bebae rdf5e08  
    11HeaderTitle 1.0 HeaderTitle.qml 
    22SensorValue 1.0 SensorValue.qml 
     3SensorView 1.0 SensorView.qml 
Note: See TracChangeset for help on using the changeset viewer.