comparison src/cagou/kv/profile_manager.kv @ 15:56838ad5c84b

files reorganisation, cagou is now launched with python2 cagou.py in src/
author Goffi <goffi@goffi.org>
date Sat, 09 Jul 2016 17:24:01 +0200
parents src/profile_manager.kv@33b619506832
children 1922506846be
comparison
equal deleted inserted replaced
14:21a432afd06d 15:56838ad5c84b
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
2 # Copyright (C) 2016 Jérôme Poisson (goffi@goffi.org)
3
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
18 <ProfileManager>:
19 Label:
20 text: "Profile Manager"
21 size_hint: 1,0.05
22
23 <PMLabel@Label>:
24 size_hint: 1, 0.1
25
26 <PMInput@TextInput>:
27 multiline: False
28 size_hint: 1, 0.1
29 write_tab: False
30
31 <PMButton@Button>:
32 size_hint: 1, 0.2
33
34
35 <NewProfileScreen>:
36 profile_name: profile_name
37 jid: jid
38 password: password
39
40 BoxLayout:
41 orientation: "vertical"
42
43 Label:
44 text: "Creation of a new profile"
45 bold: True
46 size_hint: 1, 0.1
47 Label:
48 text: root.error_msg
49 bold: True
50 size_hint: 1, 0.1
51 color: 1,0,0,1
52 GridLayout:
53 cols: 2
54
55 PMLabel:
56 text: "Profile name"
57 PMInput:
58 id: profile_name
59
60 PMLabel:
61 text: "JID"
62 PMInput:
63 id: jid
64
65 PMLabel:
66 text: "Password"
67 PMInput:
68 id: password
69 password: True
70
71 Widget:
72 size_hint: 1, 0.2
73
74 Widget:
75 size_hint: 1, 0.2
76
77 PMButton:
78 text: "OK"
79 on_press: root.doCreate()
80
81 PMButton:
82 text: "Cancel"
83 on_press:
84 root.pm.screen_manager.transition.direction = 'right'
85 root.pm.screen_manager.current = 'profiles'
86
87 Widget:
88
89
90 <DeleteProfilesScreen>:
91 BoxLayout:
92 orientation: "vertical"
93
94 Label:
95 text: "Are you sure you want to delete the following profiles?"
96 size_hint: 1, 0.1
97
98 Label:
99 text: u'\n'.join([i.text for i in root.pm.profiles_screen.list_adapter.selection])
100 bold: True
101
102 Label:
103 text: u'/!\\ WARNING: this operation is irreversible'
104 color: 1,0,0,1
105 bold: True
106 size_hint: 1, 0.2
107
108 GridLayout:
109 cols: 2
110
111 Button:
112 text: "Delete"
113 size_hint: 1, 0.2
114 on_press: root.doDelete()
115
116 Button:
117 text: "Cancel"
118 size_hint: 1, 0.2
119 on_press:
120 root.pm.screen_manager.transition.direction = 'right'
121 root.pm.screen_manager.current = 'profiles'
122
123 Widget:
124
125
126 <ProfilesScreen>:
127 layout: layout
128 BoxLayout:
129 id: layout
130 orientation: 'vertical'
131
132 Label:
133 text: "Select a profile to connect with, or create a new one"
134 size_hint: 1,0.05
135
136 GridLayout:
137 cols: 2
138 size_hint: 1, 0.1
139 Button:
140 size_hint: 1, 0.1
141 text: "New"
142 on_press:
143 root.pm.screen_manager.transition.direction = 'left'
144 root.pm.screen_manager.current = 'new_profile'
145 Button:
146 disabled: not root.list_adapter.selection
147 text: "Delete"
148 size_hint: 1, 0.1
149 on_press:
150 root.pm.screen_manager.transition.direction = 'left'
151 root.pm.screen_manager.current = 'delete_profiles'
152
153
154 <ConnectButton>:
155 text: "Connect"
156 size_hint: 1, 0.1
157 disabled: not self.profile_screen.list_adapter.selection
158 on_press: self.pm._onConnectProfiles()
159
160
161 <ProfileItem>:
162 # FIXME: using cagou/images path for now, will use atlas later
163 background_normal: "cagou/images/button_selected.png" if self.is_selected else "cagou/images/button.png"
164 deselected_color: 1,1,1,1
165 selected_color: 1,1,1,1
166 color: 0,0,0,1