~ubuntu-branches/ubuntu/vivid/sflphone/vivid

« back to all changes in this revision

Viewing changes to kde/plasma/plasmoid-qml/package/contents/ui/Settingstab.qml

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-30 11:40:56 UTC
  • mfrom: (4.1.18 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130630114056-0np50jkyqo6vnmii
Tags: 1.2.3-2
* changeset_r92d62cfc54732bbbcfff2b1d36c096b120b981a5.diff 
  - fixes automatic endian detection 
* Update Vcs: fixes vcs-field-not-canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 *   Copyright (C) 2012 by Savoir-Faire Linux                                 *
 
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>   *
 
4
 *                                                                            *
 
5
 *   This library is free software; you can redistribute it and/or            *
 
6
 *   modify it under the terms of the GNU Lesser General Public               *
 
7
 *   License as published by the Free Software Foundation; either             *
 
8
 *   version 2.1 of the License, or (at your option) any later version.       *
 
9
 *                                                                            *
 
10
 *   This library is distributed in the hope that it will be useful,          *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of           *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
 
13
 *   Lesser General Public License for more details.                          *
 
14
 *                                                                            *
 
15
 *   You should have received a copy of the Lesser GNU General Public License *
 
16
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.    *
 
17
 *****************************************************************************/
 
18
import QtQuick 1.1
 
19
import org.kde.plasma.components 0.1 as Plasma
 
20
import org.kde.plasma.core       0.1 as PlasmaCore
 
21
 
 
22
Plasma.Page {
 
23
   id:settingsTab
 
24
   
 
25
   property string defaultaccount: "IP2IP"
 
26
   
 
27
   anchors {
 
28
      top: tabs.bottom;
 
29
      left: parent.left;
 
30
      right: parent.right;
 
31
      bottom: parent.bottom;
 
32
   }
 
33
 
 
34
   Image {
 
35
      source: "plasmapackage:/images/configure.svgz";
 
36
      width:parent.width
 
37
      fillMode: Image.PreserveAspectFit
 
38
      height:parent.height-50
 
39
      sourceSize.width: parent.width
 
40
      sourceSize.height: parent.width
 
41
   }
 
42
 
 
43
   PlasmaCore.DataSource {
 
44
      id: accountSource
 
45
      engine: "sflphone"
 
46
      interval: 250
 
47
      connectedSources: ["accounts"]
 
48
      onDataChanged: {
 
49
         plasmoid.busy = false
 
50
      }
 
51
   }
 
52
 
 
53
   PlasmaCore.DataSource {
 
54
      id: infoSource
 
55
      engine: "sflphone"
 
56
      interval: 250
 
57
      connectedSources: ["info"]
 
58
      onDataChanged: {
 
59
         plasmoid.busy = false
 
60
         defaultaccount = infoSource.data["info"]["Current_account"]
 
61
      }
 
62
   }
 
63
 
 
64
   PlasmaCore.SortFilterModel {
 
65
      id: accountFilter
 
66
      filterRole: "alias"
 
67
      sortRole: "alias"
 
68
      sortOrder: "AscendingOrder"
 
69
      sourceModel: PlasmaCore.DataModel {
 
70
         dataSource: accountSource
 
71
         keyRoleFilter: "[\\d]*"
 
72
      }
 
73
   }
 
74
   
 
75
   Column {
 
76
      width:parent.width
 
77
      spacing:3
 
78
 
 
79
      Plasma.Label {
 
80
         text: "Default account"
 
81
      }
 
82
 
 
83
      Rectangle {
 
84
         height:1
 
85
         width:parent.width -30
 
86
         color:theme.textColor
 
87
         anchors.bottomMargin:10
 
88
      }
 
89
 
 
90
      Repeater {
 
91
         model: accountFilter
 
92
         Plasma.RadioButton {
 
93
            id:checkbox2
 
94
            text:alias
 
95
            width:parent.width
 
96
            onCheckedChanged: {
 
97
               if (checkbox2.checked == false && defaultaccount != id) {
 
98
                  return
 
99
               }
 
100
               if (defaultaccount == id) {
 
101
                  checkbox2.checked = true
 
102
               }
 
103
               defaultaccount = id;
 
104
            }
 
105
            states: [
 
106
               State {
 
107
                  name: "selected"
 
108
                  when: (id==defaultaccount)
 
109
                  PropertyChanges {target: checkbox2;checked:true}
 
110
               },
 
111
               State {
 
112
                  name: "unselected"
 
113
                  when: (id!=defaultaccount)
 
114
                  PropertyChanges {target: checkbox2;checked:false}
 
115
               }
 
116
            ]
 
117
         }
 
118
      }
 
119
      
 
120
      Item {
 
121
         height:15
 
122
         width:1
 
123
         anchors.bottomMargin:10
 
124
      }
 
125
      
 
126
      Plasma.Label {
 
127
         text: "Bookmark"
 
128
      }
 
129
      
 
130
      Rectangle {
 
131
         height:1
 
132
         width:parent.width -30
 
133
         color:theme.textColor
 
134
         anchors.bottomMargin:10
 
135
      }
 
136
      
 
137
      Plasma.CheckBox {
 
138
         text:"Show popular as bookmark"
 
139
         width:parent.width
 
140
      }
 
141
      
 
142
      Item {
 
143
         height:15
 
144
         width:1
 
145
         anchors.bottomMargin:10
 
146
      }
 
147
      
 
148
      Plasma.Label {
 
149
         text: "Advanced"
 
150
      }
 
151
      
 
152
      Rectangle {
 
153
         height:1
 
154
         width:parent.width -30
 
155
         color:theme.textColor
 
156
         anchors.bottomMargin:10
 
157
      }
 
158
      
 
159
      Item {
 
160
         height:5
 
161
         width:1
 
162
         anchors.bottomMargin:10
 
163
      }
 
164
      
 
165
      Plasma.Button {
 
166
         text:"Configure sflphone"
 
167
         anchors.margins : 10
 
168
         width:parent.width
 
169
      }
 
170
   }
 
171
}