comparison src/profile_manager.kv @ 2:8f9ed634a5eb

Profile manager: profile(s) deletion is handled
author Goffi <goffi@goffi.org>
date Sat, 26 Mar 2016 19:47:09 +0100
parents 189b76859110
children 440a743b58ee
comparison
equal deleted inserted replaced
1:189b76859110 2:8f9ed634a5eb
12 # GNU Affero General Public License for more details. 12 # GNU Affero General Public License for more details.
13 13
14 # You should have received a copy of the GNU Affero General Public License 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/>. 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16
17
17 <ProfileManager>: 18 <ProfileManager>:
18 Label: 19 Label:
19 text: "Profile Manager" 20 text: "Profile Manager"
20 size_hint: 1,0.05 21 size_hint: 1,0.05
21 22
27 size_hint: 1, 0.1 28 size_hint: 1, 0.1
28 write_tab: False 29 write_tab: False
29 30
30 <PMButton@Button>: 31 <PMButton@Button>:
31 size_hint: 1, 0.2 32 size_hint: 1, 0.2
33
32 34
33 <NewProfileScreen>: 35 <NewProfileScreen>:
34 profile_name: profile_name 36 profile_name: profile_name
35 jid: jid 37 jid: jid
36 password: password 38 password: password
71 73
72 Widget: 74 Widget:
73 size_hint: 1, 0.2 75 size_hint: 1, 0.2
74 76
75 PMButton: 77 PMButton:
78 text: "OK"
79 on_press: root.doCreate()
80
81 PMButton:
76 text: "Cancel" 82 text: "Cancel"
77 on_press: 83 on_press:
78 root.pm.screen_manager.transition.direction = 'right' 84 root.pm.screen_manager.transition.direction = 'right'
79 root.pm.screen_manager.current = 'profiles' 85 root.pm.screen_manager.current = 'profiles'
80 86
81 PMButton: 87 Widget:
82 text: "OK" 88
83 on_press: root.doCreate() 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'
84 122
85 Widget: 123 Widget:
124
86 125
87 <ProfilesScreen>: 126 <ProfilesScreen>:
88 layout: layout 127 layout: layout
89 BoxLayout: 128 BoxLayout:
90 id: layout 129 id: layout
102 text: "New" 141 text: "New"
103 on_press: 142 on_press:
104 root.pm.screen_manager.transition.direction = 'left' 143 root.pm.screen_manager.transition.direction = 'left'
105 root.pm.screen_manager.current = 'new_profile' 144 root.pm.screen_manager.current = 'new_profile'
106 Button: 145 Button:
146 disabled: not root.list_adapter.selection
107 text: "Delete" 147 text: "Delete"
108 size_hint: 1, 0.1 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
109 153
110 <ConnectButton>: 154 <ConnectButton>:
111 text: "Connect" 155 text: "Connect"
112 size_hint: 1, 0.1 156 size_hint: 1, 0.1
157
113 158
114 <ProfileItem>: 159 <ProfileItem>:
115 background_normal: "button_selected.png" if self.is_selected else "button.png" 160 background_normal: "button_selected.png" if self.is_selected else "button.png"
116 deselected_color: 1,1,1,1 161 deselected_color: 1,1,1,1
117 selected_color: 1,1,1,1 162 selected_color: 1,1,1,1