move openalias from plugins to core
This commit is contained in:
@@ -19,6 +19,10 @@
|
||||
import sys, time, threading
|
||||
import os.path, json, traceback
|
||||
import shutil
|
||||
import socket
|
||||
import webbrowser
|
||||
import csv
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
import PyQt4
|
||||
@@ -26,11 +30,10 @@ from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
import PyQt4.QtCore as QtCore
|
||||
|
||||
from electrum.bitcoin import MIN_RELAY_TX_FEE, COIN, is_valid
|
||||
from electrum.plugins import run_hook
|
||||
|
||||
import icons_rc
|
||||
|
||||
from electrum.bitcoin import MIN_RELAY_TX_FEE, COIN, is_valid
|
||||
from electrum.plugins import run_hook
|
||||
from electrum.i18n import _
|
||||
from electrum.util import block_explorer, block_explorer_info, block_explorer_URL
|
||||
from electrum.util import print_error, print_msg
|
||||
@@ -41,6 +44,7 @@ from electrum import util, bitcoin, commands, Wallet
|
||||
from electrum import SimpleConfig, Wallet, WalletStorage
|
||||
from electrum import Imported_Wallet
|
||||
from electrum import paymentrequest
|
||||
from electrum.contacts import Contacts
|
||||
|
||||
from amountedit import AmountEdit, BTCAmountEdit, MyLineEdit
|
||||
from network_dialog import NetworkDialog
|
||||
@@ -48,12 +52,6 @@ from qrcodewidget import QRCodeWidget, QRDialog
|
||||
from qrtextedit import ScanQRTextEdit, ShowQRTextEdit
|
||||
from transaction_dialog import show_transaction
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
import socket
|
||||
import webbrowser
|
||||
import csv
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +118,7 @@ class ElectrumWindow(QMainWindow):
|
||||
self.app = gui_object.app
|
||||
|
||||
self.invoices = InvoiceStore(self.config)
|
||||
self.contacts = util.Contacts(self.config)
|
||||
self.contacts = Contacts(self.config)
|
||||
|
||||
self.create_status_bar()
|
||||
self.need_update = threading.Event()
|
||||
@@ -482,17 +480,16 @@ class ElectrumWindow(QMainWindow):
|
||||
if self.need_update.is_set():
|
||||
self.update_wallet()
|
||||
self.need_update.clear()
|
||||
|
||||
# resolve aliases
|
||||
self.payto_e.resolve()
|
||||
run_hook('timer_actions')
|
||||
|
||||
def format_amount(self, x, is_diff=False, whitespaces=False):
|
||||
return format_satoshis(x, is_diff, self.num_zeros, self.decimal_point, whitespaces)
|
||||
|
||||
|
||||
def get_decimal_point(self):
|
||||
return self.decimal_point
|
||||
|
||||
|
||||
def base_unit(self):
|
||||
assert self.decimal_point in [2, 5, 8]
|
||||
if self.decimal_point == 2:
|
||||
@@ -1051,6 +1048,13 @@ class ElectrumWindow(QMainWindow):
|
||||
return
|
||||
outputs = self.payto_e.get_outputs()
|
||||
|
||||
if self.payto_e.is_alias and self.payto_e.validated is False:
|
||||
alias = self.payto_e.toPlainText()
|
||||
msg = _('WARNING: the alias "%s" could not be validated via an additional security check, DNSSEC, and thus may not be correct.'%alias) + '\n'
|
||||
msg += _('Do you wish to continue?')
|
||||
if not self.question(msg):
|
||||
return
|
||||
|
||||
if not outputs:
|
||||
QMessageBox.warning(self, _('Error'), _('No outputs'), _('OK'))
|
||||
return
|
||||
@@ -1208,6 +1212,7 @@ class ElectrumWindow(QMainWindow):
|
||||
self.payment_request = None
|
||||
return
|
||||
|
||||
self.payto_e.is_pr = True
|
||||
if not pr.has_expired():
|
||||
self.payto_e.setGreen()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user