From 96c3d6e9edfccd4714e9541d05fb8b17a6b57ce5 Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Tue, 27 Jun 2017 19:51:41 +0200 Subject: [PATCH] Update password & delete account WiP, refs #9 --- src/controller.kv | 25 +++++++++++++++++++++++++ src/main.py | 14 ++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/controller.kv b/src/controller.kv index 6e3d218..e3022b1 100644 --- a/src/controller.kv +++ b/src/controller.kv @@ -182,6 +182,31 @@ # size_hint: None, None text: root.current_account_string on_release: root.open_account_list() + MDTextField: + hint_text: "Password" + helper_text: "Enter the for encrypting your new account" + helper_text_mode: "on_focus" + password: True + text: root.password1 + on_text: root.password1 = args[1] + MDTextField: + # TODO: do validation as we type + hint_text: "Password (again)" + helper_text: "Retype your password" + helper_text_mode: "on_focus" + password: True + text: root.password2 + on_text: root.password2 = args[1] + BoxLayout: + orientation: 'horizontal' + padding: dp(4), dp(4) + spacing: dp(40) + MDRaisedButton: + text: "Update password" + on_release: root.update_password() + MDRaisedButton: + text: "Delete account" + on_release: root.delete_account() PushUp: diff --git a/src/main.py b/src/main.py index 3b3a22d..af2ec31 100755 --- a/src/main.py +++ b/src/main.py @@ -323,6 +323,8 @@ class ManageExisting(BoxLayout): current_account = ObjectProperty(None, allownone=True) current_account_string = StringProperty() + password1 = StringProperty() + password2 = StringProperty() def __init__(self, **kwargs): super(ManageExisting, self).__init__(**kwargs) @@ -335,6 +337,18 @@ def setup(self): self.controller = App.get_running_app().controller self.current_account = self.controller.pywalib.get_main_account() + def delete_account(self): + """ + Not yet implemented. + """ + Controller.show_not_implemented_dialog() + + def update_password(self): + """ + Not yet implemented. + """ + Controller.show_not_implemented_dialog() + def on_current_account(self, instance, account): address = "0x" + account.address.encode("hex") self.current_account_string = address