annotate src/cagou/kv/profile_manager.kv @ 18:790dbc5c4e89

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