Browse Source

kivy: fix GridLayout orientations all over

Pre kivy 2.0, "orientation" was undefined for GridLayouts, not sure why we were setting it, it was a no-op.
kivy 2.0 added meaning to the field, and the values we were setting it to are invalid.

related:
https://github.com/kivy/kivy/pull/6741
https://github.com/kivy/kivy/issues/7142

-----

traceback:

E | gui.kivy.uix.dialogs.crash_reporter.ExceptionHook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
    setattr(widget_set, key, value)
  File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
  File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
  File "kivy/properties.pyx", line 542, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 533, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 1253, in kivy.properties.OptionProperty.check
ValueError: GridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
  File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/ui_screens/receive.kv", line 141, in <lambda>
    on_release: Clock.schedule_once(lambda dt: s.expiration_dialog(s))
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 517, in expiration_dialog
    d = ChoiceDialog(_('Expiration date'), pr_expiration_values, self.expiry(), callback)
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/dialogs/choice_dialog.py", line 53, in __init__
    Factory.Popup.__init__(self)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/modalview.py", line 187, in __init__
    super(ModalView, self).__init__(**kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/anchorlayout.py", line 68, in __init__
    super(AnchorLayout, self).__init__(**kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/layout.py", line 76, in __init__
    super(Layout, self).__init__(**kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/widget.py", line 359, in __init__
    self.apply_class_lang_rules(
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/widget.py", line 463, in apply_class_lang_rules
    Builder.apply(
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 541, in apply
    self._apply_rule(
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 710, in _apply_rule
    raise BuilderException(rule.ctx, rule.line,
kivy.lang.builder.BuilderException: Parser: File "<inline>", line 21:
...
     19:            GridLayout:
     20:                row_default_height: '48dp'
>>   21:                orientation: 'vertical'
     22:                id: choices
     23:                cols: 2
...
ValueError: GridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
    setattr(widget_set, key, value)
  File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
  File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
  File "kivy/properties.pyx", line 542, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 533, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 1253, in kivy.properties.OptionProperty.check
patch-4
SomberNight 4 years ago
parent
commit
0e01db4cee
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/gui/kivy/uix/dialogs/choice_dialog.py
  2. 8
      electrum/gui/kivy/uix/dialogs/installwizard.py

1
electrum/gui/kivy/uix/dialogs/choice_dialog.py

@ -26,7 +26,6 @@ Builder.load_string('''
size_hint: 1, 0.8 size_hint: 1, 0.8
GridLayout: GridLayout:
row_default_height: '48dp' row_default_height: '48dp'
orientation: 'vertical'
id: choices id: choices
cols: 2 cols: 2
size_hint: 1, None size_hint: 1, None

8
electrum/gui/kivy/uix/dialogs/installwizard.py

@ -130,7 +130,6 @@ Builder.load_string('''
Widget Widget
size_hint: 1, 1 size_hint: 1, 1
GridLayout: GridLayout:
orientation: 'vertical'
cols: 2 cols: 2
spacing: '14dp' spacing: '14dp'
size_hint: 1, 1 size_hint: 1, 1
@ -179,7 +178,6 @@ Builder.load_string('''
size_hint: 1, 1 size_hint: 1, 1
GridLayout: GridLayout:
row_default_height: '48dp' row_default_height: '48dp'
orientation: 'vertical'
id: choices id: choices
cols: 1 cols: 1
spacing: '14dp' spacing: '14dp'
@ -333,7 +331,6 @@ Builder.load_string('''
text: '' text: ''
options_dialog: None options_dialog: None
rows: 1 rows: 1
orientation: 'horizontal'
size_hint: 1, None size_hint: 1, None
height: self.minimum_height height: self.minimum_height
BigLabel: BigLabel:
@ -358,7 +355,6 @@ Builder.load_string('''
GridLayout: GridLayout:
cols: 1 cols: 1
padding: 0, '12dp' padding: 0, '12dp'
orientation: 'vertical'
spacing: '12dp' spacing: '12dp'
size_hint: 1, None size_hint: 1, None
height: self.minimum_height height: self.minimum_height
@ -461,7 +457,6 @@ Builder.load_string('''
GridLayout GridLayout
cols: 1 cols: 1
padding: 0, '12dp' padding: 0, '12dp'
orientation: 'vertical'
spacing: '12dp' spacing: '12dp'
size_hint: 1, None size_hint: 1, None
height: self.minimum_height height: self.minimum_height
@ -498,7 +493,6 @@ Builder.load_string('''
GridLayout GridLayout
cols: 1 cols: 1
padding: 0, '12dp' padding: 0, '12dp'
orientation: 'vertical'
spacing: '12dp' spacing: '12dp'
size_hint: 1, None size_hint: 1, None
height: self.minimum_height height: self.minimum_height
@ -534,7 +528,6 @@ Builder.load_string('''
pos_hint: {'center_y': .5} pos_hint: {'center_y': .5}
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
orientation: 'vertical'
spacing: '12dp' spacing: '12dp'
SeedButton: SeedButton:
text: root.seed_text text: root.seed_text
@ -562,7 +555,6 @@ Builder.load_string('''
text: root.message1 text: root.message1
GridLayout: GridLayout:
row_default_height: '48dp' row_default_height: '48dp'
orientation: 'vertical'
id: choices id: choices
cols: 1 cols: 1
spacing: '14dp' spacing: '14dp'

Loading…
Cancel
Save