2016-01-11 15:08:12 +09:00
|
|
|
import threading
|
|
|
|
|
|
2016-01-11 14:38:45 +09:00
|
|
|
from PyQt4.Qt import (QDialog, QInputDialog, QLineEdit,
|
|
|
|
|
QVBoxLayout, QLabel, SIGNAL)
|
2015-11-23 19:38:48 +01:00
|
|
|
import PyQt4.QtCore as QtCore
|
2015-12-01 10:00:39 +01:00
|
|
|
|
2016-01-11 15:08:12 +09:00
|
|
|
from electrum.i18n import _
|
2016-08-31 11:50:19 +02:00
|
|
|
from .ledger import LedgerPlugin
|
|
|
|
|
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
2016-08-28 16:38:30 +02:00
|
|
|
from electrum_gui.qt.util import *
|
2015-11-23 19:38:48 +01:00
|
|
|
|
2016-08-31 11:50:19 +02:00
|
|
|
|
|
|
|
|
class Plugin(LedgerPlugin, QtPluginBase):
|
2016-08-28 16:38:30 +02:00
|
|
|
icon_unpaired = ":icons/ledger_unpaired.png"
|
|
|
|
|
icon_paired = ":icons/ledger.png"
|
2015-11-23 19:38:48 +01:00
|
|
|
|
2016-08-31 11:50:19 +02:00
|
|
|
def create_handler(self, window):
|
|
|
|
|
return Ledger_Handler(window)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Ledger_Handler(QtHandlerBase):
|
2015-11-23 19:38:48 +01:00
|
|
|
|
|
|
|
|
def __init__(self, win):
|
2016-08-31 11:50:19 +02:00
|
|
|
super(Ledger_Handler, self).__init__(win, 'Ledger')
|
2015-11-23 19:38:48 +01:00
|
|
|
|
2016-01-30 08:11:41 +01:00
|
|
|
def word_dialog(self, msg):
|
|
|
|
|
response = QInputDialog.getText(self.top_level_window(), "Ledger Wallet Authentication", msg, QLineEdit.Password)
|
|
|
|
|
if not response[1]:
|
|
|
|
|
self.word = None
|
|
|
|
|
else:
|
|
|
|
|
self.word = str(response[0])
|
2016-08-18 11:34:37 +02:00
|
|
|
self.done.set()
|