Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <LargerButton@Button>:
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 50
- <SmallerButton@Button>:
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 100, 40
- <CustomScreen@Screen>:
- FloatLayout:
- canvas.before:
- Color:
- rgba: (0.2, 0.2, 0.2, 0.5)
- Rectangle:
- size: self.width, self.height
- # Rectangle top banner
- canvas:
- Color:
- rgba: (0.59, 0.15, 0.17, 1)
- Rectangle:
- size: self.width, self.height / 4
- pos: 0, self.height - self.height / 4
- # Logo
- Image:
- source: 'Logo.png'
- # Need the following line to change size!
- size_hint: (None, None)
- height: dp(100)
- pos: root.width - self.width - 25 , root.height - self.height - 10
- <IdentiKeyRoot>:
- ScreenManager:
- id: screen_manager
- LoginScreen:
- id: login_screen
- name: "Login_Screen"
- AdminScreen:
- id: admin_screen
- name: "Admin_Screen"
- AddUserScreen:
- id: add_user_screen
- name: "Add_User_Screen"
- RemoveUserScreen:
- id: remove_user_screen
- name: "Remove_User_Screen"
- KeyScreen:
- id: key_screen
- name: "Key_Screen"
- <ReturnKeyPopup>:
- id: ReturnKeyPopup
- title: "Check In Ring"
- title_align: 'center'
- title_font: 'Constantia.ttf'
- auto_dismiss: False
- on_dismiss: app.root.checkInRingDismiss()
- size_hint: 0.5, 0.5
- FloatLayout:
- Label:
- text: "Please press 'Placed' after placing key ring on hook!"
- font_name: 'Constantia.ttf'
- pos: app.root.width / 2 - self.width / 2, app.root.height / 2 - 60
- SmallerButton:
- text: "Placed"
- on_release: root.dismiss()
- pos: app.root.width / 2 - self.width / 2, app.root.height / 2 - 90
- <RetrieveKeyPopup>:
- id: RetrieveKeyPopup
- title: "Check Out Ring"
- title_align: 'center'
- title_font: 'Constantia.ttf'
- auto_dismiss: False
- on_dismiss: app.root.checkOutRingDismiss()
- size_hint: 0.5, 0.5
- FloatLayout:
- Label:
- text: "Please touch 'Removed' after removing key ring from hook!"
- font_name: 'Constantia.ttf'
- pos: app.root.width / 2 - self.width / 2, app.root.height / 2 - 60
- SmallerButton:
- text: "Removed"
- on_release: root.dismiss()
- pos: app.root.width / 2 - self.width / 2, app.root.height / 2 - 90
- <LoginScreen@CustomScreen>:
- FloatLayout:
- # Welcome text
- Label:
- text: 'Welcome to IdentiKey!'
- color: (1, 1, 1, 1)
- font_name: 'Constantia.ttf'
- font_size: 30
- pos: -self.width / 3 + 40, self.height / 2 - 80
- # Username label
- Label:
- text: 'Username:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, 18
- # Username entry
- TextInput:
- id: username_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2
- multiline: False
- write_tab: False
- on_text_validate: app.root.check_login_info(username_entry.text, password_entry.text)
- # Password label
- Label:
- text: 'Password:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, -32
- # Password entry
- TextInput:
- id: password_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2 - root.height / 10
- multiline: False
- password: True
- write_tab: False
- on_text_validate: app.root.check_login_info(username_entry.text, password_entry.text)
- # Login button
- SmallerButton:
- text: 'Login'
- pos: root.width / 2 - self.width / 2, root.height / 4 - self.height / 2
- on_release: app.root.check_login_info(username_entry.text, password_entry.text)
- # Username/Password invalid text
- Label:
- id: invalid_text
- text: ""
- font_name: 'Constantia.ttf'
- color: (0.59, 0.15, 0.17, 1)
- font_size: 30
- pos: root.width / 2 - self.width / 2, -200
- <AdminScreen@CustomScreen>:
- FloatLayout:
- # Welcome text
- Label:
- text: 'Welcome, admin!'
- color: (1, 1, 1, 1)
- font_name: 'Constantia.ttf'
- font_size: 30
- pos: -self.width / 3, self.height / 2 - 80
- # Add new user button
- LargerButton:
- text: 'Add New User'
- pos: root.width / 2 - self.width - 5, root.height / 2 + self.height / 2 - 40
- on_release: app.root.ids.screen_manager.current = "Add_User_Screen"
- # Remove user button
- LargerButton:
- text: 'Remove User'
- pos: root.width / 2 + 5, root.height / 2 + self.height / 2 - 40
- on_release: app.root.ids.screen_manager.current = "Remove_User_Screen"
- # Check key status button
- LargerButton:
- text: 'Check Key Status'
- pos: root.width / 2 - self.width / 2, root.height / 2 - self.height / 2 - 60
- # Log out button
- SmallerButton:
- text: 'Log Out'
- pos: 10, 10
- on_release: app.root.log_out()
- <AddUserScreen@CustomScreen>:
- FloatLayout:
- # Welcome text
- Label:
- text: 'Add new user:'
- color: (1, 1, 1, 1)
- font_name: 'Constantia.ttf'
- font_size: 30
- pos: -self.width / 3 - 10, self.height / 2 - 80
- # New username label
- Label:
- text: 'New Username:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, 15
- # New username entry
- TextInput:
- id: new_username_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2
- multiline: False
- # New password label
- Label:
- text: 'New Password:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, -35
- # New password entry
- TextInput:
- id: new_password_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2 - root.height / 10
- multiline: False
- # New access level label
- Label:
- text: 'Access Level:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, -80
- # New access level entry
- TextInput:
- id: new_access_level_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2 - root.height / 5
- # Add new user button
- LargerButton:
- text: 'Add New User'
- pos: root.width / 2 - self.width / 2, 70
- on_release: app.root.add_new_user(new_username_entry.text, new_password_entry.text, new_access_level_entry.text)
- # Back button
- SmallerButton:
- text: '<-- Back'
- pos: 10, 55
- on_release: app.root.ids.screen_manager.current = "Admin_Screen"
- # Log out button
- SmallerButton:
- text: 'Log Out'
- pos: 10, 10
- on_release: app.root.log_out()
- # New username/Password success text
- Label:
- id: new_user_success_text
- text: ""
- font_name: 'Constantia.ttf'
- color: (0.59, 0.15, 0.17, 1)
- font_size: 30
- pos: root.width / 2 - self.width / 2, -200
- <RemoveUserScreen@CustomScreen>:
- FloatLayout:
- # Welcome text
- Label:
- text: 'Remove user:'
- color: (1, 1, 1, 1)
- font_name: 'Constantia.ttf'
- font_size: 30
- pos: -self.width / 3 - 10, self.height / 2 - 80
- # Username to remove label
- Label:
- text: 'User to Remove:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, 20
- # Username to remove entry
- TextInput:
- id: remove_username_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2
- multiline: False
- # User to remove password label
- Label:
- text: 'Password of User:'
- font_name: 'Constantia.ttf'
- font_size: 20
- pos: -130, -35
- # New password entry
- TextInput:
- id: remove_password_entry
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 35
- pos: root.width / 2 - self.width / 10, root.height / 2 - root.height / 10
- multiline: False
- # Remove user button
- LargerButton:
- text: 'Remove User'
- pos: root.width / 2 - self.width / 2, 100
- on_release: app.root.remove_user(remove_username_entry.text, remove_password_entry.text)
- # Remove user success text
- Label:
- id: remove_user_success_text
- text: ""
- font_name: 'Constantia.ttf'
- color: (0.59, 0.15, 0.17, 1)
- font_size: 30
- pos: root.width / 2 - self.width / 2, -200
- # Back button
- SmallerButton:
- text: '<-- Back'
- pos: 10, 55
- on_release: app.root.ids.screen_manager.current = "Admin_Screen"
- # Log out button
- SmallerButton:
- text: 'Log Out'
- pos: 10, 10
- on_release: app.root.log_out()
- <KeyScreen@CustomScreen>:
- FloatLayout:
- canvas:
- Color:
- rgba: (0.59, 0.15, 0.17, 1)
- Rectangle:
- size: 24, root.height
- pos: self.width / 2 - 12, 0
- Rectangle:
- size: 24, root.height - root.height / 4
- pos: 0, 0
- Rectangle:
- size: 24, root.height - root.height / 4
- pos: root.width - 24, 0
- Rectangle:
- size: root.width, root.height / 8
- pos: 0, 0
- # Logo
- Image:
- source: 'Logo.png'
- # Need the following line to change size!
- size_hint: (None, None)
- height: dp(100)
- pos: root.width - self.width - 25 , root.height - self.height - 10
- # Welcome text
- Label:
- id: welcome_text
- color: (1, 1, 1, 1)
- font_name: 'Constantia.ttf'
- font_size: 30
- pos: -self.width / 4 + 20, self.height / 2 - 50
- # Spinner menu
- Spinner:
- id: key_menu
- text: 'Select Key:'
- on_press: app.root.clearErrorLabel()
- font_name: 'Constantia.ttf'
- values: ['']
- size_hint: (None, None)
- size: 300, 50
- pos: (3 * root.width / 4) - 6 - self.width / 2, root.height - root.height / 4 - self.height - 10
- # Error label
- Label:
- id: error_label
- text: ""
- font_name: 'Constantia.ttf'
- font_size: 28
- color: (1, 1, 1, 1)
- pos: root.width / 2 - self.width / 2, root.height / 4 + 20
- # Check Out Button
- LargerButton:
- text: 'Check Out Key'
- pos: (3 * root.width / 4) - 6 - self.width / 2, root.height / 8 + 10
- on_release: app.root.checkOutRing(key_menu.text)
- # Return Key Button
- Button:
- size_hint: (None, None)
- font_name: 'Constantia.ttf'
- size: 200, 150
- text: 'Return Key'
- pos: (root.width / 4) + 6 - self.width / 2, 5 * root.height / 16
- on_release: app.root.checkInRing()
- # Log out button
- SmallerButton:
- text: 'Log Out'
- pos: 24, 10
- on_release: app.root.log_out()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement