Zcash changes to gui/(qt|stdio|text), app icon, icons.qrc

This commit is contained in:
zebra-lucky 2018-03-11 13:42:07 +02:00
parent 96c05a5594
commit e77f58d815
27 changed files with 169 additions and 171 deletions

View File

@ -37,14 +37,14 @@ from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import PyQt5.QtCore as QtCore
from electrum.i18n import _, set_language
from electrum.plugins import run_hook
from electrum import WalletStorage
# from electrum.synchronizer import Synchronizer
# from electrum.verifier import SPV
# from electrum.util import DebugMem
from electrum.util import UserCancelled, print_error
# from electrum.wallet import Abstract_Wallet
from electrum_zcash.i18n import _, set_language
from electrum_zcash.plugins import run_hook
from electrum_zcash import WalletStorage
# from electrum_zcash.synchronizer import Synchronizer
# from electrum_zcash.verifier import SPV
# from electrum_zcash.util import DebugMem
from electrum_zcash.util import UserCancelled, print_error
# from electrum_zcash.wallet import Abstract_Wallet
from .installwizard import InstallWizard, GoBack
@ -54,7 +54,7 @@ try:
except Exception as e:
print(e)
print("Error: Could not find icons file.")
print("Please run 'pyrcc5 icons.qrc -o gui/qt/icons_rc.py', and reinstall Electrum")
print("Please run 'pyrcc5 icons.qrc -o gui/qt/icons_rc.py', and reinstall Electrum-Zcash")
sys.exit(1)
from .util import * # * needed for plugins
@ -105,7 +105,7 @@ class ElectrumGui:
# init tray
self.dark_icon = self.config.get("dark_icon", False)
self.tray = QSystemTrayIcon(self.tray_icon(), None)
self.tray.setToolTip('Electrum')
self.tray.setToolTip('Electrum-Zcash')
self.tray.activated.connect(self.tray_activated)
self.build_tray_menu()
self.tray.show()
@ -127,7 +127,7 @@ class ElectrumGui:
submenu.addAction(_("Close"), window.close)
m.addAction(_("Dark/Light"), self.toggle_tray_icon)
m.addSeparator()
m.addAction(_("Exit Electrum"), self.close)
m.addAction(_("Exit Electrum-Zcash"), self.close)
def tray_icon(self):
if self.dark_icon:
@ -159,7 +159,7 @@ class ElectrumGui:
def show_network_dialog(self, parent):
if not self.daemon.network:
parent.show_warning(_('You are using Electrum in offline mode; restart Electrum if you want to get connected'), title=_('Offline'))
parent.show_warning(_('You are using Electrum-Zcash in offline mode; restart Electrum-Zcash if you want to get connected'), title=_('Offline'))
return
if self.nd:
self.nd.on_update()

View File

@ -23,7 +23,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from electrum.i18n import _
from electrum_zcash.i18n import _
from PyQt5.QtCore import *
from PyQt5.QtGui import *

View File

@ -25,10 +25,10 @@
import webbrowser
from .util import *
from electrum.i18n import _
from electrum.util import block_explorer_URL
from electrum.plugins import run_hook
from electrum.bitcoin import is_address
from electrum_zcash.i18n import _
from electrum_zcash.util import block_explorer_URL
from electrum_zcash.plugins import run_hook
from electrum_zcash.bitcoin import is_address
class AddressList(MyTreeWidget):
@ -113,7 +113,7 @@ class AddressList(MyTreeWidget):
self.setCurrentItem(address_item)
def create_menu(self, position):
from electrum.wallet import Multisig_Wallet
from electrum_zcash.wallet import Multisig_Wallet
is_multisig = isinstance(self.wallet, Multisig_Wallet)
can_delete = self.wallet.can_delete_address()
selected = self.selectedItems()

View File

@ -5,7 +5,7 @@ from PyQt5.QtGui import *
from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame)
from decimal import Decimal
from electrum.util import format_satoshis_plain
from electrum_zcash.util import format_satoshis_plain
class MyLineEdit(QLineEdit):
@ -80,11 +80,11 @@ class BTCAmountEdit(AmountEdit):
p = self.decimal_point()
assert p in [2, 5, 8]
if p == 8:
return 'BTC'
return 'ZEC'
if p == 5:
return 'mBTC'
return 'mZEC'
if p == 2:
return 'bits'
return 'uZEC'
raise Exception('Unknown base unit')
def get_amount(self):

View File

@ -6,7 +6,7 @@ import traceback, platform
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from electrum import util
from electrum_zcash import util
if platform.system() == 'Windows':

View File

@ -24,10 +24,10 @@
# SOFTWARE.
import webbrowser
from electrum.i18n import _
from electrum.bitcoin import is_address
from electrum.util import block_explorer_URL
from electrum.plugins import run_hook
from electrum_zcash.i18n import _
from electrum_zcash.bitcoin import is_address
from electrum_zcash.util import block_explorer_URL
from electrum_zcash.plugins import run_hook
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import (

View File

@ -1,5 +1,5 @@
from electrum.i18n import _
from electrum_zcash.i18n import _
from PyQt5.QtGui import *
from PyQt5.QtCore import *
@ -28,7 +28,7 @@ class FeeSlider(QSlider):
self.callback(self.dyn, pos, fee_rate)
def get_tooltip(self, pos, fee_rate):
from electrum.util import fee_levels
from electrum_zcash.util import fee_levels
rate_str = self.window.format_fee_rate(fee_rate) if fee_rate else _('unknown')
if self.dyn:
tooltip = fee_levels[pos] + '\n' + rate_str

View File

@ -26,9 +26,9 @@
import webbrowser
from .util import *
from electrum.i18n import _
from electrum.util import block_explorer_URL
from electrum.util import timestamp_to_datetime, profiler
from electrum_zcash.i18n import _
from electrum_zcash.util import block_explorer_URL
from electrum_zcash.util import timestamp_to_datetime, profiler
TX_ICONS = [

View File

@ -8,10 +8,10 @@ from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum import Wallet, WalletStorage
from electrum.util import UserCancelled, InvalidPassword
from electrum.base_wizard import BaseWizard
from electrum.i18n import _
from electrum_zcash import Wallet, WalletStorage
from electrum_zcash.util import UserCancelled, InvalidPassword
from electrum_zcash.base_wizard import BaseWizard
from electrum_zcash.i18n import _
from .seed_dialog import SeedLayout, KeysLayout
from .network_dialog import NetworkChoiceLayout
@ -22,9 +22,9 @@ from .password_dialog import PasswordLayout, PW_NEW
class GoBack(Exception):
pass
MSG_GENERATING_WAIT = _("Electrum is generating your addresses, please wait...")
MSG_GENERATING_WAIT = _("Electrum-Zcash is generating your addresses, please wait...")
MSG_ENTER_ANYTHING = _("Please enter a seed phrase, a master key, a list of "
"Bitcoin addresses, or a list of private keys")
"Zcash addresses, or a list of private keys")
MSG_ENTER_SEED_OR_MPK = _("Please enter a seed phrase or a master key (xpub or xprv):")
MSG_COSIGNER = _("Please enter the master public key of cosigner #%d:")
MSG_ENTER_PASSWORD = _("Choose a password to encrypt your wallet keys.") + '\n'\
@ -102,7 +102,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
def __init__(self, config, app, plugins, storage):
BaseWizard.__init__(self, config, storage)
QDialog.__init__(self, None)
self.setWindowTitle('Electrum - ' + _('Install Wizard'))
self.setWindowTitle('Electrum-Zcash - ' + _('Install Wizard'))
self.app = app
self.config = config
# Set for base base class
@ -147,7 +147,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
hbox.setStretchFactor(scroll, 1)
outer_vbox.addLayout(hbox)
outer_vbox.addLayout(Buttons(self.back_button, self.next_button))
self.set_icon(':icons/electrum.png')
self.set_icon(':icons/electrum-zcash.png')
self.show()
self.raise_()
self.refresh_gui() # Need for QT on MacOSX. Lame.
@ -174,7 +174,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
hbox2.addWidget(self.pw_e)
hbox2.addStretch()
vbox.addLayout(hbox2)
self.set_layout(vbox, title=_('Electrum wallet'))
self.set_layout(vbox, title=_('Electrum-Zcash wallet'))
wallet_folder = os.path.dirname(self.storage.path)
@ -242,7 +242,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
path = self.storage.path
if self.storage.requires_split():
self.hide()
msg = _("The wallet '%s' contains multiple accounts, which are no longer supported since Electrum 2.7.\n\n"
msg = _("The wallet '%s' contains multiple accounts, which are no longer supported since Electrum-Zcash 2.7.\n\n"
"Do you want to split your wallet into multiple files?"%path)
if not self.question(msg):
return
@ -488,10 +488,10 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
return None
def init_network(self, network):
message = _("Electrum communicates with remote servers to get "
message = _("Electrum-Zcash communicates with remote servers to get "
"information about your transactions and addresses. The "
"servers all fulfill the same purpose only differing in "
"hardware. In most cases you simply want to let Electrum "
"hardware. In most cases you simply want to let Electrum-Zcash "
"pick one at random. However if you prefer feel free to "
"select a server manually.")
choices = [_("Auto connect"), _("Select server manually")]

View File

@ -24,8 +24,8 @@
# SOFTWARE.
from .util import *
from electrum.i18n import _
from electrum.util import format_time
from electrum_zcash.i18n import _
from electrum_zcash.util import format_time
class InvoiceList(MyTreeWidget):

View File

@ -36,21 +36,21 @@ from PyQt5.QtCore import Qt
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum.util import bh2u, bfh
from electrum_zcash.util import bh2u, bfh
from electrum import keystore
from electrum.bitcoin import COIN, is_address, TYPE_ADDRESS, NetworkConstants
from electrum.plugins import run_hook
from electrum.i18n import _
from electrum.util import (format_time, format_satoshis, PrintError,
from electrum_zcash import keystore
from electrum_zcash.bitcoin import COIN, is_address, TYPE_ADDRESS, NetworkConstants
from electrum_zcash.plugins import run_hook
from electrum_zcash.i18n import _
from electrum_zcash.util import (format_time, format_satoshis, PrintError,
format_satoshis_plain, NotEnoughFunds,
UserCancelled)
from electrum import Transaction
from electrum import util, bitcoin, commands, coinchooser
from electrum import paymentrequest
from electrum.wallet import Multisig_Wallet
from electrum_zcash import Transaction
from electrum_zcash import util, bitcoin, commands, coinchooser
from electrum_zcash import paymentrequest
from electrum_zcash.wallet import Multisig_Wallet
try:
from electrum.plot import plot_history
from electrum_zcash.plot import plot_history
except:
plot_history = None
@ -82,7 +82,7 @@ class StatusBarButton(QPushButton):
self.func()
from electrum.paymentrequest import PR_PAID
from electrum_zcash.paymentrequest import PR_PAID
class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
@ -159,7 +159,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self.config.get("is_maximized"):
self.showMaximized()
self.setWindowIcon(QIcon(":icons/electrum.png"))
self.setWindowIcon(QIcon(":icons/electrum-zcash.png"))
self.init_menubar()
wrtabs = weakref.proxy(tabs)
@ -363,7 +363,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.setGeometry(100, 100, 840, 400)
def watching_only_changed(self):
name = "Electrum Testnet" if NetworkConstants.TESTNET else "Electrum"
name = "Electrum-Zcash Testnet" if NetworkConstants.TESTNET else "Electrum-Zcash"
title = '%s %s - %s' % (name, self.wallet.electrum_version,
self.wallet.basename())
extra = [self.wallet.storage.get('wallet_type', '?')]
@ -381,8 +381,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self.wallet.is_watching_only():
msg = ' '.join([
_("This wallet is watching-only."),
_("This means you will not be able to spend Bitcoins with it."),
_("Make sure you own the seed phrase or the private keys, before you request Bitcoins to be sent to this wallet.")
_("This means you will not be able to spend Zcash coins with it."),
_("Make sure you own the seed phrase or the private keys, before you request Zcash coins to be sent to this wallet.")
])
self.show_warning(msg, title=_('Information'))
@ -407,7 +407,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
shutil.copy2(path, new_path)
self.show_message(_("A copy of your wallet file was created in")+" '%s'" % str(new_path), title=_("Wallet backup created"))
except (IOError, os.error) as reason:
self.show_critical(_("Electrum was unable to copy your wallet file to the specified location.") + "\n" + str(reason), title=_("Unable to create backup"))
self.show_critical(_("Electrum-Zcash was unable to copy your wallet file to the specified location.") + "\n" + str(reason), title=_("Unable to create backup"))
def update_recently_visited(self, filename):
recent = self.config.get('recently_open', [])
@ -496,7 +496,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
tools_menu = menubar.addMenu(_("&Tools"))
# Settings / Preferences are all reserved keywords in OSX using this as work around
tools_menu.addAction(_("Electrum preferences") if sys.platform == 'darwin' else _("Preferences"), self.settings_dialog)
tools_menu.addAction(_("Electrum-Zcash preferences") if sys.platform == 'darwin' else _("Preferences"), self.settings_dialog)
tools_menu.addAction(_("&Network"), lambda: self.gui_object.show_network_dialog(self))
tools_menu.addAction(_("&Plugins"), self.plugins_dialog)
tools_menu.addSeparator()
@ -529,24 +529,24 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
d = self.network.get_donation_address()
if d:
host = self.network.get_parameters()[0]
self.pay_to_URI('bitcoin:%s?message=donation for %s'%(d, host))
self.pay_to_URI('zcash:%s?message=donation for %s'%(d, host))
else:
self.show_error(_('No donation address for this server'))
def show_about(self):
QMessageBox.about(self, "Electrum",
QMessageBox.about(self, "Electrum-Zcash",
_("Version")+" %s" % (self.wallet.electrum_version) + "\n\n" +
_("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Bitcoin system." + "\n\n" +
_("Electrum-Zcash focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Bitcoin system." + "\n\n" +
_("Uses icons from the Icons8 icon pack (icons8.com).")))
def show_report_bug(self):
msg = ' '.join([
_("Please report any bugs as issues on github:<br/>"),
"<a href=\"https://github.com/spesmilo/electrum/issues\">https://github.com/spesmilo/electrum/issues</a><br/><br/>",
_("Before reporting a bug, upgrade to the most recent version of Electrum (latest release or git HEAD), and include the version number in your report."),
_("Before reporting a bug, upgrade to the most recent version of Electrum-Zcash (latest release or git HEAD), and include the version number in your report."),
_("Try to explain not only what the bug is, but how it occurs.")
])
self.show_message(msg, title="Electrum - " + _("Reporting Bugs"))
self.show_message(msg, title="Electrum-Zcash - " + _("Reporting Bugs"))
def notify_transactions(self):
if not self.network or not self.network.is_connected():
@ -576,9 +576,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self.tray:
try:
# this requires Qt 5.9
self.tray.showMessage("Electrum", message, QIcon(":icons/electrum_dark_icon"), 20000)
self.tray.showMessage("Electrum-Zcash", message, QIcon(":icons/electrum_dark_icon"), 20000)
except TypeError:
self.tray.showMessage("Electrum", message, QSystemTrayIcon.Information, 20000)
self.tray.showMessage("Electrum-Zcash", message, QSystemTrayIcon.Information, 20000)
@ -636,11 +636,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def base_unit(self):
assert self.decimal_point in [2, 5, 8]
if self.decimal_point == 2:
return 'bits'
return 'uZEC'
if self.decimal_point == 5:
return 'mBTC'
return 'mZEC'
if self.decimal_point == 8:
return 'BTC'
return 'ZEC'
raise Exception('Unknown base unit')
def connect_fields(self, window, btc_e, fiat_e, fee_e):
@ -764,7 +764,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.receive_address_e = ButtonsLineEdit()
self.receive_address_e.addCopyButton(self.app)
self.receive_address_e.setReadOnly(True)
msg = _('Bitcoin address where the payment should be received. Note that each payment request uses a different Bitcoin address.')
msg = _('Zcash address where the payment should be received. Note that each payment request uses a different Zcash address.')
self.receive_address_label = HelpLabel(_('Receiving address'), msg)
self.receive_address_e.textChanged.connect(self.update_receive_qr)
self.receive_address_e.setFocusPolicy(Qt.NoFocus)
@ -794,8 +794,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
msg = ' '.join([
_('Expiration date of your request.'),
_('This information is seen by the recipient if you send them a signed payment request.'),
_('Expired requests have to be deleted manually from your list, in order to free the corresponding Bitcoin addresses.'),
_('The bitcoin address never expires and will always be part of this electrum wallet.'),
_('Expired requests have to be deleted manually from your list, in order to free the corresponding Zcash addresses.'),
_('The Zcash address never expires and will always be part of this electrum-zcash wallet.'),
])
grid.addWidget(HelpLabel(_('Request expires'), msg), 3, 0)
grid.addWidget(self.expires_combo, 3, 1)
@ -1010,7 +1010,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.amount_e = BTCAmountEdit(self.get_decimal_point)
self.payto_e = PayToEdit(self)
msg = _('Recipient of the funds.') + '\n\n'\
+ _('You may enter a Bitcoin address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a Bitcoin address)')
+ _('You may enter a Zcash address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a Zcash address)')
payto_label = HelpLabel(_('Pay to'), msg)
grid.addWidget(payto_label, 1, 0)
grid.addWidget(self.payto_e, 1, 1, 1, -1)
@ -1057,7 +1057,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
hbox.addStretch(1)
grid.addLayout(hbox, 4, 4)
msg = _('Bitcoin transactions are in general not free. A transaction fee is paid by the sender of the funds.') + '\n\n'\
msg = _('Zcash transactions are in general not free. A transaction fee is paid by the sender of the funds.') + '\n\n'\
+ _('The amount of fee can be decided freely by the sender. However, transactions with low fees take more time to be processed.') + '\n\n'\
+ _('A suggested fee is automatically added to this field. You may override it. The suggested fee increases with the size of the transaction.')
self.fee_e_label = HelpLabel(_('Fee'), msg)
@ -1295,10 +1295,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
for _type, addr, amount in outputs:
if addr is None:
self.show_error(_('Bitcoin Address is None'))
self.show_error(_('Zcash Address is None'))
return
if _type == TYPE_ADDRESS and not bitcoin.is_address(addr):
self.show_error(_('Invalid Bitcoin Address'))
self.show_error(_('Invalid Zcash Address'))
return
if amount is None:
self.show_error(_('Invalid Amount'))
@ -1507,7 +1507,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
try:
out = util.parse_URI(URI, self.on_pr)
except BaseException as e:
self.show_error(_('Invalid bitcoin URI:') + '\n' + str(e))
self.show_error(_('Invalid zcash URI:') + '\n' + str(e))
return
self.show_send_tab()
r = out.get('r')
@ -1924,7 +1924,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
address = address.text().strip()
message = message.toPlainText().strip()
if not bitcoin.is_address(address):
self.show_message('Invalid Bitcoin address.')
self.show_message('Invalid Zcash address.')
return
txin_type = self.wallet.get_txin_type(address)
if txin_type not in ['p2pkh']:
@ -1943,7 +1943,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
address = address.text().strip()
message = message.toPlainText().strip().encode('utf-8')
if not bitcoin.is_address(address):
self.show_message('Invalid Bitcoin address.')
self.show_message('Invalid Zcash address.')
return
try:
# This can throw on invalid base64
@ -2055,16 +2055,16 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
return d.run()
def tx_from_text(self, txt):
from electrum.transaction import tx_from_str
from electrum_zcash.transaction import tx_from_str
try:
tx = tx_from_str(txt)
return Transaction(tx)
except BaseException as e:
self.show_critical(_("Electrum was unable to parse your transaction") + ":\n" + str(e))
self.show_critical(_("Electrum-Zcash was unable to parse your transaction") + ":\n" + str(e))
return
def read_tx_from_qrcode(self):
from electrum import qrscanner
from electrum_zcash import qrscanner
try:
data = qrscanner.scan_barcode(self.config.get_video_device())
except BaseException as e:
@ -2073,7 +2073,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if not data:
return
# if the user scanned a bitcoin URI
if str(data).startswith("bitcoin:"):
if str(data).startswith("zcash:"):
self.pay_to_URI(data)
return
# else if the user scanned an offline signed tx
@ -2091,12 +2091,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
with open(fileName, "r") as f:
file_content = f.read()
except (ValueError, IOError, os.error) as reason:
self.show_critical(_("Electrum was unable to open your transaction file") + "\n" + str(reason), title=_("Unable to read file or no transaction found"))
self.show_critical(_("Electrum-Zcash was unable to open your transaction file") + "\n" + str(reason), title=_("Unable to read file or no transaction found"))
return
return self.tx_from_text(file_content)
def do_process_from_text(self):
from electrum.transaction import SerializationError
from electrum_zcash.transaction import SerializationError
text = text_dialog(self, _('Input raw transaction'), _("Transaction:"), _("Load transaction"))
if not text:
return
@ -2105,19 +2105,19 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if tx:
self.show_transaction(tx)
except SerializationError as e:
self.show_critical(_("Electrum was unable to deserialize the transaction:") + "\n" + str(e))
self.show_critical(_("Electrum-Zcash was unable to deserialize the transaction:") + "\n" + str(e))
def do_process_from_file(self):
from electrum.transaction import SerializationError
from electrum_zcash.transaction import SerializationError
try:
tx = self.read_tx_from_file()
if tx:
self.show_transaction(tx)
except SerializationError as e:
self.show_critical(_("Electrum was unable to deserialize the transaction:") + "\n" + str(e))
self.show_critical(_("Electrum-Zcash was unable to deserialize the transaction:") + "\n" + str(e))
def do_process_from_txid(self):
from electrum import transaction
from electrum_zcash import transaction
txid, ok = QInputDialog.getText(self, _('Lookup transaction'), _('Transaction ID') + ':')
if ok and txid:
txid = str(txid).strip()
@ -2148,7 +2148,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
e.setReadOnly(True)
vbox.addWidget(e)
defaultname = 'electrum-private-keys.csv'
defaultname = 'electrum-zcash-private-keys.csv'
select_msg = _('Select file to export your private keys to')
hbox, filename_e, csv_button = filename_field(self, self.config, defaultname, select_msg)
vbox.addLayout(hbox)
@ -2193,7 +2193,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.do_export_privkeys(filename, private_keys, csv_button.isChecked())
except (IOError, os.error) as reason:
txt = "\n".join([
_("Electrum was unable to produce a private key-export."),
_("Electrum-Zcash was unable to produce a private key-export."),
str(reason)
])
self.show_critical(txt, title=_("Unable to create csv"))
@ -2225,26 +2225,26 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.wallet.set_label(key, value)
self.show_message(_("Your labels were imported from") + " '%s'" % str(labelsFile))
except (IOError, os.error) as reason:
self.show_critical(_("Electrum was unable to import your labels.") + "\n" + str(reason))
self.show_critical(_("Electrum-Zcash was unable to import your labels.") + "\n" + str(reason))
self.address_list.update()
self.history_list.update()
def do_export_labels(self):
labels = self.wallet.labels
try:
fileName = self.getSaveFileName(_("Select file to save your labels"), 'electrum_labels.json', "*.json")
fileName = self.getSaveFileName(_("Select file to save your labels"), 'electrum_zcash_labels.json', "*.json")
if fileName:
with open(fileName, 'w+') as f:
json.dump(labels, f, indent=4, sort_keys=True)
self.show_message(_("Your labels were exported to") + " '%s'" % str(fileName))
except (IOError, os.error) as reason:
self.show_critical(_("Electrum was unable to export your labels.") + "\n" + str(reason))
self.show_critical(_("Electrum-Zcash was unable to export your labels.") + "\n" + str(reason))
def export_history_dialog(self):
d = WindowModalDialog(self, _('Export History'))
d.setMinimumSize(400, 200)
vbox = QVBoxLayout(d)
defaultname = os.path.expanduser('~/electrum-history.csv')
defaultname = os.path.expanduser('~/electrum-zcash-history.csv')
select_msg = _('Select file to export your wallet transactions to')
hbox, filename_e, csv_button = filename_field(self, self.config, defaultname, select_msg)
vbox.addLayout(hbox)
@ -2261,7 +2261,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
try:
self.do_export_history(self.wallet, filename, csv_button.isChecked())
except (IOError, os.error) as reason:
export_error_label = _("Electrum was unable to produce a transaction export.")
export_error_label = _("Electrum-Zcash was unable to produce a transaction export.")
self.show_critical(export_error_label + "\n" + str(reason), title=_("Unable to export history"))
return
self.show_message(_("Your wallet history has been successfully exported."))
@ -2354,7 +2354,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
address_e.textChanged.connect(on_address)
if not d.exec_():
return
from electrum.wallet import sweep_preparations
from electrum_zcash.wallet import sweep_preparations
try:
self.do_clear()
coins, keypairs = sweep_preparations(get_pk(), self.network)
@ -2426,7 +2426,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
lang_help = _('Select which language is used in the GUI (after restart).')
lang_label = HelpLabel(_('Language') + ':', lang_help)
lang_combo = QComboBox()
from electrum.i18n import languages
from electrum_zcash.i18n import languages
lang_combo.addItems(list(languages.values()))
try:
index = languages.keys().index(self.config.get("language",''))
@ -2482,7 +2482,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.fee_unit = self.config.get('fee_unit', 0)
fee_unit_label = HelpLabel(_('Fee Unit') + ':', '')
fee_unit_combo = QComboBox()
fee_unit_combo.addItems([_('sat/byte'), _('mBTC/kB')])
fee_unit_combo.addItems([_('sat/byte'), _('mZEC/kB')])
fee_unit_combo.setCurrentIndex(self.fee_unit)
def on_fee_unit(x):
self.fee_unit = x
@ -2541,9 +2541,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
SSL_id_e.setReadOnly(True)
id_widgets.append((SSL_id_label, SSL_id_e))
units = ['BTC', 'mBTC', 'bits']
units = ['ZEC', 'mZEC', 'uZEC']
msg = _('Base unit of your wallet.')\
+ '\n1BTC=1000mBTC.\n' \
+ '\n1ZEC=1000mZEC.\n' \
+ _(' These settings affects the fields in the Send tab')+' '
unit_label = HelpLabel(_('Base unit') + ':', msg)
unit_combo = QComboBox()
@ -2555,11 +2555,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
return
edits = self.amount_e, self.fee_e, self.receive_amount_e
amounts = [edit.get_amount() for edit in edits]
if unit_result == 'BTC':
if unit_result == 'ZEC':
self.decimal_point = 8
elif unit_result == 'mBTC':
elif unit_result == 'mZEC':
self.decimal_point = 5
elif unit_result == 'bits':
elif unit_result == 'uZEC':
self.decimal_point = 2
else:
raise Exception('Unknown base unit')
@ -2585,7 +2585,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
block_ex_combo.currentIndexChanged.connect(on_be)
gui_widgets.append((block_ex_label, block_ex_combo))
from electrum import qrscanner
from electrum_zcash import qrscanner
system_cameras = qrscanner._find_system_cameras()
qr_combo = QComboBox()
qr_combo.addItem("Default","default")
@ -2778,7 +2778,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
run_hook('close_settings_dialog')
if self.need_restart:
self.show_warning(_('Please restart Electrum to activate the new GUI settings'), title=_('Success'))
self.show_warning(_('Please restart Electrum-Zcash to activate the new GUI settings'), title=_('Success'))
def closeEvent(self, event):
@ -2805,7 +2805,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.gui_object.close_window(self)
def plugins_dialog(self):
self.pluginsdialog = d = WindowModalDialog(self, _('Electrum Plugins'))
self.pluginsdialog = d = WindowModalDialog(self, _('Electrum-Zcash Plugins'))
plugins = self.gui_object.plugins

View File

@ -30,9 +30,9 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import PyQt5.QtCore as QtCore
from electrum.i18n import _
from electrum.bitcoin import NetworkConstants
from electrum.util import print_error
from electrum_zcash.i18n import _
from electrum_zcash.bitcoin import NetworkConstants
from electrum_zcash.util import print_error
from .util import *
@ -215,8 +215,8 @@ class NetworkChoiceLayout(object):
self.autoconnect_cb.clicked.connect(self.update)
msg = ' '.join([
_("If auto-connect is enabled, Electrum will always use a server that is on the longest blockchain."),
_("If it is disabled, you have to choose a server you want to use. Electrum will warn you if your server is lagging.")
_("If auto-connect is enabled, Electrum-Zcash will always use a server that is on the longest blockchain."),
_("If it is disabled, you have to choose a server you want to use. Electrum-Zcash will warn you if your server is lagging.")
])
grid.addWidget(self.autoconnect_cb, 0, 0, 1, 3)
grid.addWidget(HelpButton(msg), 0, 4)
@ -270,10 +270,10 @@ class NetworkChoiceLayout(object):
self.tor_cb.clicked.connect(self.use_tor_proxy)
grid.addWidget(self.ssl_cb, 0, 0, 1, 3)
grid.addWidget(HelpButton(_('SSL is used to authenticate and encrypt your connections with Electrum servers.')), 0, 4)
grid.addWidget(HelpButton(_('SSL is used to authenticate and encrypt your connections with Electrum-Zcash servers.')), 0, 4)
grid.addWidget(self.tor_cb, 1, 0, 1, 3)
grid.addWidget(self.proxy_cb, 2, 0, 1, 3)
grid.addWidget(HelpButton(_('Proxy settings apply to all connections: with Electrum servers, but also with third-party services.')), 2, 4)
grid.addWidget(HelpButton(_('Proxy settings apply to all connections: with Electrum-Zcash servers, but also with third-party services.')), 2, 4)
grid.addWidget(self.proxy_mode, 4, 1)
grid.addWidget(self.proxy_host, 4, 2)
grid.addWidget(self.proxy_port, 4, 3)
@ -284,7 +284,7 @@ class NetworkChoiceLayout(object):
# Blockchain Tab
grid = QGridLayout(blockchain_tab)
msg = ' '.join([
_("Electrum connects to several nodes in order to download block headers and find out the longest blockchain."),
_("Electrum-Zcash connects to several nodes in order to download block headers and find out the longest blockchain."),
_("This blockchain is used to verify the transactions sent by your transaction server.")
])
self.status_label = QLabel('')
@ -293,7 +293,7 @@ class NetworkChoiceLayout(object):
grid.addWidget(HelpButton(msg), 0, 4)
self.server_label = QLabel('')
msg = _("Electrum sends your wallet addresses to a single server, in order to receive your transaction history.")
msg = _("Electrum-Zcash sends your wallet addresses to a single server, in order to receive your transaction history.")
grid.addWidget(QLabel(_('Server') + ':'), 1, 0)
grid.addWidget(self.server_label, 1, 1, 1, 3)
grid.addWidget(HelpButton(msg), 1, 4)

View File

@ -26,12 +26,12 @@
from PyQt5.QtCore import Qt
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum.i18n import _
from electrum_zcash.i18n import _
from .util import *
import re
import math
from electrum.plugins import run_hook
from electrum_zcash.plugins import run_hook
def check_password_strength(password):
@ -173,7 +173,7 @@ class ChangePasswordDialog(WindowModalDialog):
msg += ' ' + _('Use this dialog to add a password to your wallet.')
else:
if not is_encrypted:
msg = _('Your bitcoins are password protected. However, your wallet file is not encrypted.')
msg = _('Your Zcash coins are password protected. However, your wallet file is not encrypted.')
else:
msg = _('Your wallet is password protected and encrypted.')
msg += ' ' + _('Use this dialog to change your password.')

View File

@ -30,7 +30,7 @@ from .qrtextedit import ScanQRTextEdit
import re
from decimal import Decimal
from electrum import bitcoin
from electrum_zcash import bitcoin
from . import util
@ -88,7 +88,7 @@ class PayToEdit(ScanQRTextEdit):
return bitcoin.TYPE_SCRIPT, script
def parse_script(self, x):
from electrum.transaction import opcodes, push_script
from electrum_zcash.transaction import opcodes, push_script
script = ''
for word in x.split():
if word[0:3] == 'OP_':
@ -122,7 +122,7 @@ class PayToEdit(ScanQRTextEdit):
self.payto_address = None
if len(lines) == 1:
data = lines[0]
if data.startswith("bitcoin:"):
if data.startswith("zcash:"):
self.scan_f(data)
return
try:
@ -260,7 +260,7 @@ class PayToEdit(ScanQRTextEdit):
def qr_input(self):
data = super(PayToEdit,self).qr_input()
if data.startswith("bitcoin:"):
if data.startswith("zcash:"):
self.scan_f(data)
# TODO: update fee

View File

@ -8,8 +8,8 @@ from PyQt5.QtWidgets import (
import os
import qrcode
import electrum
from electrum.i18n import _
import electrum_zcash
from electrum_zcash.i18n import _
from .util import WindowModalDialog
@ -102,7 +102,7 @@ class QRDialog(WindowModalDialog):
hbox = QHBoxLayout()
hbox.addStretch(1)
config = electrum.get_config()
config = electrum_zcash.get_config()
if config:
filename = os.path.join(config.path, "qrcode.png")

View File

@ -1,6 +1,6 @@
from electrum.i18n import _
from electrum.plugins import run_hook
from electrum_zcash.i18n import _
from electrum_zcash.plugins import run_hook
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QFileDialog
@ -50,7 +50,7 @@ class ScanQRTextEdit(ButtonsTextEdit, MessageBoxMixin):
self.setText(data)
def qr_input(self):
from electrum import qrscanner, get_config
from electrum_zcash import qrscanner, get_config
try:
data = qrscanner.scan_barcode(get_config().get_video_device())
except BaseException as e:

View File

@ -29,8 +29,8 @@ from PyQt5.QtCore import Qt
from PyQt5.QtGui import *
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QLabel, QWidget
from electrum_gui.qt.qrcodewidget import QRCodeWidget
from electrum.i18n import _
from electrum_zcash_gui.qt.qrcodewidget import QRCodeWidget
from electrum_zcash.i18n import _
if platform.system() == 'Windows':
MONOSPACE_FONT = 'Lucida Console'
@ -46,7 +46,7 @@ class QR_Window(QWidget):
def __init__(self, win):
QWidget.__init__(self)
self.win = win
self.setWindowTitle('Electrum - '+_('Payment Request'))
self.setWindowTitle('Electrum-Zcash - '+_('Payment Request'))
self.setMinimumSize(800, 250)
self.address = ''
self.label = ''

View File

@ -23,10 +23,10 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from electrum.i18n import _
from electrum.util import format_time, age
from electrum.plugins import run_hook
from electrum.paymentrequest import PR_UNKNOWN
from electrum_zcash.i18n import _
from electrum_zcash.util import format_time, age
from electrum_zcash.plugins import run_hook
from electrum_zcash.paymentrequest import PR_UNKNOWN
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QTreeWidgetItem, QMenu

View File

@ -26,7 +26,7 @@
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from electrum.i18n import _
from electrum_zcash.i18n import _
from .util import *
from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit
@ -68,10 +68,10 @@ class SeedLayout(QVBoxLayout):
if b:
msg = ' '.join([
'<b>' + _('Warning') + ':</b> ',
_('BIP39 seeds can be imported in Electrum, so that users can access funds locked in other wallets.'),
_('BIP39 seeds can be imported in Electrum-Zcash, so that users can access funds locked in other wallets.'),
_('However, we do not generate BIP39 seeds, because they do not meet our safety standard.'),
_('BIP39 seeds do not include a version number, which compromises compatibility with future software.'),
_('We do not guarantee that BIP39 imports will always be supported in Electrum.'),
_('We do not guarantee that BIP39 imports will always be supported in Electrum-Zcash.'),
])
else:
msg = ''
@ -137,14 +137,14 @@ class SeedLayout(QVBoxLayout):
return ' '.join(text.split())
def on_edit(self):
from electrum.bitcoin import seed_type
from electrum_zcash.bitcoin import seed_type
s = self.get_seed()
b = self.is_seed(s)
if not self.is_bip39:
t = seed_type(s)
label = _('Seed Type') + ': ' + t if t else ''
else:
from electrum.keystore import bip39_is_checksum_valid
from electrum_zcash.keystore import bip39_is_checksum_valid
is_checksum, is_wordlist = bip39_is_checksum_valid(s)
status = ('checksum: ' + ('ok' if is_checksum else 'failed')) if is_wordlist else 'unknown wordlist'
label = 'BIP39' + ' (%s)'%status
@ -173,7 +173,7 @@ class KeysLayout(QVBoxLayout):
class SeedDialog(WindowModalDialog):
def __init__(self, parent, seed, passphrase):
WindowModalDialog.__init__(self, parent, ('Electrum - ' + _('Seed')))
WindowModalDialog.__init__(self, parent, ('Electrum-Zcash - ' + _('Seed')))
self.setMinimumWidth(400)
vbox = QVBoxLayout(self)
title = _("Your wallet generation seed is:")

View File

@ -30,11 +30,11 @@ from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum.bitcoin import base_encode
from electrum.i18n import _
from electrum.plugins import run_hook
from electrum_zcash.bitcoin import base_encode
from electrum_zcash.i18n import _
from electrum_zcash.plugins import run_hook
from electrum.util import bfh
from electrum_zcash.util import bfh
from .util import *
dialogs = [] # Otherwise python randomly garbage collects the dialogs...

View File

@ -6,7 +6,7 @@ import queue
from collections import namedtuple
from functools import partial
from electrum.i18n import _
from electrum_zcash.i18n import _
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
@ -21,7 +21,7 @@ else:
dialogs = []
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_EXPIRED
from electrum_zcash.paymentrequest import PR_UNPAID, PR_PAID, PR_EXPIRED
pr_icons = {
PR_UNPAID:":icons/unpaid.png",

View File

@ -23,7 +23,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from .util import *
from electrum.i18n import _
from electrum_zcash.i18n import _
class UTXOList(MyTreeWidget):

View File

@ -1,9 +1,9 @@
from decimal import Decimal
_ = lambda x:x
#from i18n import _
from electrum import WalletStorage, Wallet
from electrum.util import format_satoshis, set_verbosity
from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS
from electrum_zcash import WalletStorage, Wallet
from electrum_zcash.util import format_satoshis, set_verbosity
from electrum_zcash.bitcoin import is_address, COIN, TYPE_ADDRESS
import getpass, datetime
# minimal fdisk like gui for console usage
@ -16,7 +16,7 @@ class ElectrumGui:
self.network = daemon.network
storage = WalletStorage(config.get_wallet_path())
if not storage.file_exists:
print("Wallet not found. try 'electrum create'")
print("Wallet not found. try 'electrum-zcash create'")
exit()
if storage.is_encrypted():
password = getpass.getpass('Password:', stream=None)
@ -163,7 +163,7 @@ class ElectrumGui:
def do_send(self):
if not is_address(self.str_recipient):
print(_('Invalid Bitcoin address'))
print(_('Invalid Zcash address'))
return
try:
amount = int(Decimal(self.str_amount) * COIN)
@ -208,12 +208,12 @@ class ElectrumGui:
print(_('Error'))
def network_dialog(self):
print("use 'electrum setconfig server/proxy' to change your network settings")
print("use 'electrum-zcash setconfig server/proxy' to change your network settings")
return True
def settings_dialog(self):
print("use 'electrum setconfig' to change your settings")
print("use 'electrum-zcash setconfig' to change your settings")
return True
def password_dialog(self):

View File

@ -3,10 +3,10 @@ import curses, datetime, locale
from decimal import Decimal
import getpass
import electrum
from electrum.util import format_satoshis, set_verbosity
from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS
from electrum import Wallet, WalletStorage
import electrum_zcash
from electrum_zcash.util import format_satoshis, set_verbosity
from electrum_zcash.bitcoin import is_address, COIN, TYPE_ADDRESS
from electrum_zcash import Wallet, WalletStorage
_ = lambda x:x
@ -20,7 +20,7 @@ class ElectrumGui:
self.network = daemon.network
storage = WalletStorage(config.get_wallet_path())
if not storage.file_exists():
print("Wallet not found. try 'electrum create'")
print("Wallet not found. try 'electrum-zcash create'")
exit()
if storage.is_encrypted():
password = getpass.getpass('Password:', stream=None)
@ -320,7 +320,7 @@ class ElectrumGui:
def do_send(self):
if not is_address(self.str_recipient):
self.show_message(_('Invalid Bitcoin address'))
self.show_message(_('Invalid Zcash address'))
return
try:
amount = int(Decimal(self.str_amount) * COIN)
@ -392,7 +392,7 @@ class ElectrumGui:
self.show_message("Error:" + server + "\nIn doubt, type \"auto-connect\"")
return False
if out.get('server') or out.get('proxy'):
proxy = electrum.network.deserialize_proxy(out.get('proxy')) if out.get('proxy') else proxy_config
proxy = electrum_zcash.network.deserialize_proxy(out.get('proxy')) if out.get('proxy') else proxy_config
self.network.set_parameters(host, port, protocol, proxy, auto_connect)
def settings_dialog(self):

View File

@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/" >
<file>icons/electrum.png</file>
<file>icons/electrum-zcash.png</file>
<file>icons/clock1.png</file>
<file>icons/clock2.png</file>
<file>icons/clock3.png</file>
@ -43,8 +43,6 @@
<file>icons/speaker.png</file>
<file>icons/trezor_unpaired.png</file>
<file>icons/trezor.png</file>
<file>icons/trustedcoin-status.png</file>
<file>icons/trustedcoin-wizard.png</file>
<file>icons/unconfirmed.png</file>
<file>icons/unpaid.png</file>
<file>icons/unlock.png</file>

BIN
icons/electrum-zcash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB