~ubuntu-branches/debian/stretch/electrum/stretch

« back to all changes in this revision

Viewing changes to gui/kivy/uix/dialogs/nfc_transaction.py

  • Committer: Package Import Robot
  • Author(s): Tristan Seligmann
  • Date: 2015-10-23 21:00:40 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20151023210040-4ej97tguu585zwlc
Tags: 2.5.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class NFCTransactionDialog(AnimatedPopup):
 
2
 
 
3
    mode = OptionProperty('send', options=('send','receive'))
 
4
 
 
5
    scanner = ObjectProperty(None)
 
6
 
 
7
    def __init__(self, **kwargs):
 
8
        # Delayed Init
 
9
        global NFCSCanner
 
10
        if NFCSCanner is None:
 
11
            from electrum_gui.kivy.nfc_scanner import NFCScanner
 
12
        self.scanner = NFCSCanner
 
13
 
 
14
        super(NFCTransactionDialog, self).__init__(**kwargs)
 
15
        self.scanner.nfc_init()
 
16
        self.scanner.bind()
 
17
 
 
18
    def on_parent(self, instance, value):
 
19
        sctr = self.ids.sctr
 
20
        if value:
 
21
            def _cmp(*l):
 
22
                anim = Animation(rotation=2, scale=1, opacity=1)
 
23
                anim.start(sctr)
 
24
                anim.bind(on_complete=_start)
 
25
 
 
26
            def _start(*l):
 
27
                anim = Animation(rotation=350, scale=2, opacity=0)
 
28
                anim.start(sctr)
 
29
                anim.bind(on_complete=_cmp)
 
30
            _start()
 
31
            return
 
32
        Animation.cancel_all(sctr)
 
 
b'\\ No newline at end of file'