|
@ -19,15 +19,6 @@ |
|
|
# Kivy GUI |
|
|
# Kivy GUI |
|
|
|
|
|
|
|
|
import sys |
|
|
import sys |
|
|
#, time, datetime, re, threading |
|
|
|
|
|
#from electrum.i18n import _, set_language |
|
|
|
|
|
from electrum.util import print_error, print_msg |
|
|
|
|
|
|
|
|
|
|
|
#:TODO: replace this with kivy's own plugin managment |
|
|
|
|
|
#from electrum.plugins import run_hook |
|
|
|
|
|
#import os.path, json, ast, traceback |
|
|
|
|
|
#import shutil |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
sys.argv = [''] |
|
|
sys.argv = [''] |
|
|
import kivy |
|
|
import kivy |
|
@ -39,25 +30,7 @@ except ImportError: |
|
|
# minimum required version for kivy |
|
|
# minimum required version for kivy |
|
|
kivy.require('1.8.0') |
|
|
kivy.require('1.8.0') |
|
|
from kivy.logger import Logger |
|
|
from kivy.logger import Logger |
|
|
|
|
|
|
|
|
from electrum.bitcoin import MIN_RELAY_TX_FEE |
|
|
|
|
|
|
|
|
|
|
|
from main_window import ElectrumWindow |
|
|
from main_window import ElectrumWindow |
|
|
#from electrum.plugins import init_plugins |
|
|
|
|
|
|
|
|
|
|
|
#:TODO find a equivalent method to register to `bitcoin:` uri |
|
|
|
|
|
#: ref: http://stackoverflow.com/questions/30931/register-file-extensions-mime-types-in-linux |
|
|
|
|
|
#class OpenFileEventFilter(object): |
|
|
|
|
|
# def __init__(self, windows): |
|
|
|
|
|
# self.windows = windows |
|
|
|
|
|
# super(OpenFileEventFilter, self).__init__() |
|
|
|
|
|
# |
|
|
|
|
|
# def eventFilter(self, obj, event): |
|
|
|
|
|
# if event.type() == QtCore.QEvent.FileOpen: |
|
|
|
|
|
# if len(self.windows) >= 1: |
|
|
|
|
|
# self.windows[0].set_url(event.url().toEncoded()) |
|
|
|
|
|
# return True |
|
|
|
|
|
# return False |
|
|
|
|
|
|
|
|
|
|
|
class ElectrumGui: |
|
|
class ElectrumGui: |
|
|
|
|
|
|
|
@ -67,21 +40,9 @@ class ElectrumGui: |
|
|
self.config = config |
|
|
self.config = config |
|
|
self.plugins = plugins |
|
|
self.plugins = plugins |
|
|
|
|
|
|
|
|
#:TODO |
|
|
|
|
|
# implement kivy plugin mechanism that needs to be more extensible |
|
|
|
|
|
# and integrated into the ui so can't be common with existing plugin |
|
|
|
|
|
# base |
|
|
|
|
|
#init_plugins(self) |
|
|
|
|
|
|
|
|
|
|
|
def main(self): |
|
|
def main(self): |
|
|
''' The main entry point of the kivy ux |
|
|
w = ElectrumWindow(config=self.config, |
|
|
:param url: 'bitcoin:' uri as mentioned in bip0021 |
|
|
network=self.network, |
|
|
:type url: str |
|
|
plugins = self.plugins, |
|
|
:ref: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki |
|
|
gui_object=self) |
|
|
''' |
|
|
|
|
|
|
|
|
|
|
|
self.main_window = w = ElectrumWindow(config=self.config, |
|
|
|
|
|
network=self.network, |
|
|
|
|
|
plugins = self.plugins, |
|
|
|
|
|
gui_object=self) |
|
|
|
|
|
w.run() |
|
|
w.run() |
|
|