kivy: simplify wallets dialog
This commit is contained in:
parent
f7859c041e
commit
b6c6b694f7
|
@ -13,7 +13,6 @@
|
||||||
text_size: self.width, None
|
text_size: self.width, None
|
||||||
height: self.texture_size[1]
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
|
||||||
<VGridLayout@GridLayout>:
|
<VGridLayout@GridLayout>:
|
||||||
rows: 1
|
rows: 1
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
|
|
|
@ -17,53 +17,29 @@ Builder.load_string('''
|
||||||
path: ''
|
path: ''
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
BoxLayout:
|
|
||||||
height: '48dp'
|
|
||||||
size_hint_y: None
|
|
||||||
orientation: 'horizontal'
|
|
||||||
Label:
|
|
||||||
text: _('Current Wallet') + ': '
|
|
||||||
height: '48dp'
|
|
||||||
size_hint_y: None
|
|
||||||
Label:
|
|
||||||
id: wallet_name
|
|
||||||
height: '48dp'
|
|
||||||
size_hint_y: None
|
|
||||||
text: os.path.basename(app.wallet.storage.path)
|
|
||||||
on_text:
|
|
||||||
popup.path = os.path.join(wallet_selector.path, self.text)
|
|
||||||
Widget
|
|
||||||
size_hint_y: None
|
|
||||||
Label:
|
|
||||||
height: '48dp'
|
|
||||||
size_hint_y: None
|
|
||||||
text: _('Wallets')
|
|
||||||
FileChooserListView:
|
FileChooserListView:
|
||||||
id: wallet_selector
|
id: wallet_selector
|
||||||
dirselect: False
|
dirselect: False
|
||||||
filter_dirs: True
|
filter_dirs: True
|
||||||
filter: '*.*'
|
filter: '*.*'
|
||||||
path: os.path.dirname(app.wallet.storage.path)
|
path: os.path.dirname(app.wallet.storage.path)
|
||||||
on_selection:
|
size_hint_y: 0.6
|
||||||
wallet_name.text = os.path.basename(self.selection[0]) if self.selection else ''
|
|
||||||
size_hint_y: 0.4
|
|
||||||
Widget
|
Widget
|
||||||
size_hint_y: 0.1
|
size_hint_y: 0.1
|
||||||
|
|
||||||
GridLayout:
|
GridLayout:
|
||||||
cols: 2
|
cols: 2
|
||||||
size_hint_y: None
|
size_hint_y: 0.1
|
||||||
Button:
|
Button:
|
||||||
size_hint: 0.5, None
|
size_hint: 0.1, None
|
||||||
height: '48dp'
|
height: '48dp'
|
||||||
text: _('Cancel')
|
text: _('Cancel')
|
||||||
on_release:
|
on_release:
|
||||||
popup.dismiss()
|
popup.dismiss()
|
||||||
Button:
|
Button:
|
||||||
id: open_button
|
id: open_button
|
||||||
size_hint: 0.5, None
|
size_hint: 0.1, None
|
||||||
height: '48dp'
|
height: '48dp'
|
||||||
text: _('Open') if popup.path else _('New Wallet')
|
text: _('Open') if wallet_selector.selection else _('New Wallet')
|
||||||
on_release:
|
on_release:
|
||||||
popup.dismiss()
|
popup.dismiss()
|
||||||
root.new_wallet(app, wallet_selector.path)
|
root.new_wallet(app, wallet_selector.path)
|
||||||
|
@ -79,4 +55,3 @@ class WalletDialog(Factory.Popup):
|
||||||
else:
|
else:
|
||||||
d = LabelDialog(_('Enter wallet name'), '', cb)
|
d = LabelDialog(_('Enter wallet name'), '', cb)
|
||||||
d.open()
|
d.open()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue