Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions electrum/gui/qml/components/wizard/WCKeystoreType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ WizardComponent {
property string keystoretype: 'haveseed'
text: qsTr('I already have a seed')
}
ElRadioButton {
Layout.fillWidth: true
ButtonGroup.group: keystoregroup
property string keystoretype: 'masterkey'
text: qsTr('Use a master key')
}
ElRadioButton {
Layout.fillWidth: true
enabled: false
visible: false
ButtonGroup.group: keystoregroup
property string keystoretype: 'hardware'
text: qsTr('Use a hardware device')
}
#ElRadioButton {
# Layout.fillWidth: true
# ButtonGroup.group: keystoregroup
# property string keystoretype: 'masterkey'
# text: qsTr('Use a master key')
#}
#ElRadioButton {
# Layout.fillWidth: true
# enabled: false
# visible: false
# ButtonGroup.group: keystoregroup
# property string keystoretype: 'hardware'
# text: qsTr('Use a hardware device')
#}
}
}

75 changes: 37 additions & 38 deletions electrum/gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def __init__(self, gui_object: 'ElectrumGui', wallet: Abstract_Wallet):
self.gui_thread = gui_object.gui_thread
assert wallet, "no wallet"
self.wallet = wallet
if wallet.has_lightning() and not self.config.cv.GUI_QT_SHOW_TAB_CHANNELS.is_set():
self.config.GUI_QT_SHOW_TAB_CHANNELS = False # override default, but still allow disabling tab manually
#if wallet.has_lightning() and not self.config.cv.GUI_QT_SHOW_TAB_CHANNELS.is_set():
# self.config.GUI_QT_SHOW_TAB_CHANNELS = False # override default, but still allow disabling tab manually

Exception_Hook.maybe_setup(config=self.config, wallet=self.wallet)

Expand Down Expand Up @@ -436,16 +436,16 @@ def on_event_on_quotes(self, *args):
def on_event_on_history(self, *args):
self.on_fx_history()

@qt_event_listener
def on_event_gossip_db_loaded(self, *args):
self.channels_list.gossip_db_loaded.emit(*args)
#@qt_event_listener
#def on_event_gossip_db_loaded(self, *args):
# self.channels_list.gossip_db_loaded.emit(*args)

@qt_event_listener
def on_event_channel(self, *args):
wallet = args[0]
if wallet == self.wallet:
self.channels_list.update_single_row.emit(*args)
self.update_status()
#qt_event_listener
#def on_event_channel(self, *args):
# wallet = args[0]
# if wallet == self.wallet:
# self.channels_list.update_single_row.emit(*args)
# self.update_status()

@qt_event_listener
def on_event_banner(self, *args):
Expand All @@ -461,9 +461,9 @@ def on_event_verified(self, *args):
def on_event_fee_histogram(self, *args):
self.history_model.on_fee_histogram()

@qt_event_listener
def on_event_ln_gossip_sync_progress(self, *args):
self.update_lightning_icon()
#@qt_event_listener
#def on_event_ln_gossip_sync_progress(self, *args):
# self.update_lightning_icon()

@qt_event_listener
def on_event_cert_mismatch(self, *args):
Expand All @@ -477,8 +477,8 @@ def close_wallet(self):
@profiler
def load_wallet(self, wallet: Abstract_Wallet):
self.update_recently_visited(wallet.storage.path)
if wallet.has_lightning():
util.trigger_callback('channels_updated', wallet)
#if wallet.has_lightning():
# util.trigger_callback('channels_updated', wallet)
self.need_update.set()
# Once GUI has been initialized check if we want to announce something since the callback has been called before the GUI was initialized
# update menus
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def update_tabs(self, wallet=None):
self.address_list.update()
self.utxo_list.update()
self.contact_list.update()
self.channels_list.update_rows.emit(wallet)
#self.channels_list.update_rows.emit(wallet)
self.update_completions()

def refresh_tabs(self, wallet=None):
Expand All @@ -1019,11 +1019,11 @@ def refresh_tabs(self, wallet=None):
self.address_list.refresh_all()
self.utxo_list.refresh_all()
self.contact_list.refresh_all()
self.channels_list.update_rows.emit(self.wallet)
#self.channels_list.update_rows.emit(self.wallet)

def create_channels_tab(self):
self.channels_list = ChannelsList(self)
tab = self.create_list_tab(self.channels_list)
#self.channels_list = ChannelsList(self)
#tab = self.create_list_tab(self.channels_list)
tab.is_shown_cv = self.config.cv.GUI_QT_SHOW_TAB_CHANNELS
return tab

Expand Down Expand Up @@ -1058,10 +1058,10 @@ def show_transaction(
):
show_transaction(tx, parent=self, external_keypairs=external_keypairs, payment_identifier=payment_identifier)

def show_lightning_transaction(self, tx_item):
from .lightning_tx_dialog import LightningTxDialog
d = LightningTxDialog(self, tx_item)
d.show()
#def show_lightning_transaction(self, tx_item):
# from .lightning_tx_dialog import LightningTxDialog
# d = LightningTxDialog(self, tx_item)
# d.show()

def create_receive_tab(self):
from .receive_tab import ReceiveTab
Expand Down Expand Up @@ -1741,19 +1741,19 @@ def new_contact_dialog(self):
if d.exec_():
self.set_contact(line2.text(), line1.text())

def init_lightning_dialog(self, dialog):
assert not self.wallet.has_lightning()
if self.wallet.can_have_deterministic_lightning():
msg = _(
"Lightning is not enabled because this wallet was created with an old version of Electrum. "
"Create lightning keys?")
else:
msg = _(
"Warning: this wallet type does not support channel recovery from seed. "
"You will need to backup your wallet everytime you create a new channel. "
"Create lightning keys?")
if self.question(msg):
self._init_lightning_dialog(dialog=dialog)
#def init_lightning_dialog(self, dialog):
# assert not self.wallet.has_lightning()
# if self.wallet.can_have_deterministic_lightning():
# msg = _(
# "Lightning is not enabled because this wallet was created with an old version of Electrum. "
# "Create lightning keys?")
# else:
# msg = _(
# "Warning: this wallet type does not support channel recovery from seed. "
# "You will need to backup your wallet everytime you create a new channel. "
# "Create lightning keys?")
# if self.question(msg):
# self._init_lightning_dialog(dialog=dialog)

@protected
def _init_lightning_dialog(self, *, dialog, password):
Expand Down Expand Up @@ -2670,4 +2670,3 @@ def on_swap_result(self, txid):
else:
msg += _("Lightning funds were not received.")
self.show_error_signal.emit(msg)

10 changes: 5 additions & 5 deletions electrum/gui/qt/receive_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def expiry_dialog(self):
_('The bitcoin address never expires and will always be part of this electrum wallet.'), ' ',
_('You can reuse a bitcoin address any number of times but it is not good for your privacy.'),
'\n\n',
_('For Lightning requests, payments will not be accepted after the expiration.'),
_('Lightning not supported.'),
])
expiry = self.config.WALLET_PAYREQ_EXPIRY_SECONDS
v = self.window.query_choice(msg, pr_expiration_values, title=_('Expiry'), default_choice=expiry)
Expand All @@ -207,11 +207,11 @@ def on_toggle_bolt11_fallback(self):
def update_view_button(self):
i = self.config.GUI_QT_RECEIVE_TABS_INDEX
if i == 0:
icon, text = read_QIcon("link.png"), _('FACT0RN URI')
icon, text = read_QIcon("bitcoin.png"), _('Address')
elif i == 1:
icon, text = read_QIcon("bitcoin.png"), _('Address')
elif i == 2:
icon, text = read_QIcon("lightning.png"), _('Lightning')
icon, text = read_QIcon("bitcoin.png"), _('Address')
self.toggle_view_button.setText(text)
self.toggle_view_button.setIcon(icon)

Expand Down Expand Up @@ -283,13 +283,13 @@ def update_current_request(self):
def get_tab_data(self):
i = self.config.GUI_QT_RECEIVE_TABS_INDEX
if i == 0:
out = self.URI, self.URI, self.URI_help, _('FACT0RN URI')
out = self.addr, self.addr, self.address_help, _('Address')
elif i == 1:
out = self.addr, self.addr, self.address_help, _('Address')
elif i == 2:
# encode lightning invoices as uppercase so QR encoding can use
# alphanumeric mode; resulting in smaller QR codes
out = self.lnaddr, self.lnaddr.upper(), self.ln_help, _('Lightning Request')
out = self.addr, self.addr, self.address_help, _('Address')
return out

def update_receive_qr_window(self):
Expand Down
37 changes: 1 addition & 36 deletions electrum/gui/qt/wallet_info_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,42 +64,7 @@ def __init__(self, parent: QWidget, *, window: 'ElectrumWindow'):
ks_type = str(keystore_types[0]) if keystore_types else _('No keystore')
grid.addWidget(WWLabel(ks_type), cur_row, 1)
cur_row += 1
# lightning
grid.addWidget(WWLabel(_('Lightning') + ':'), cur_row, 0)
from .util import IconLabel
if wallet.has_lightning():
if wallet.lnworker.has_deterministic_node_id():
grid.addWidget(WWLabel(_('Enabled')), cur_row, 1)
else:
label = IconLabel(text='Enabled, non-recoverable channels')
label.setIcon(read_QIcon('cloud_no'))
grid.addWidget(label, cur_row, 1)
if wallet.db.get('seed_type') == 'segwit':
msg = _("Your channels cannot be recovered from seed, because they were created with an old version of Electrum. "
"This means that you must save a backup of your wallet everytime you create a new channel.\n\n"
"If you want this wallet to have recoverable channels, you must close your existing channels and restore this wallet from seed")
else:
msg = _("Your channels cannot be recovered from seed. "
"This means that you must save a backup of your wallet everytime you create a new channel.\n\n"
"If you want to have recoverable channels, you must create a new wallet with an Electrum seed")
grid.addWidget(HelpButton(msg), cur_row, 3)
cur_row += 1
grid.addWidget(WWLabel(_('Lightning Node ID:')), cur_row, 0)
cur_row += 1
nodeid_text = wallet.lnworker.node_keypair.pubkey.hex()
nodeid_e = ShowQRLineEdit(nodeid_text, config, title=_("Node ID"))
grid.addWidget(nodeid_e, cur_row, 0, 1, 4)
cur_row += 1
else:
if wallet.can_have_lightning():
grid.addWidget(WWLabel('Not enabled'), cur_row, 1)
button = QPushButton(_("Enable"))
button.pressed.connect(lambda: window.init_lightning_dialog(self))
grid.addWidget(button, cur_row, 3)
else:
grid.addWidget(WWLabel(_("Not available for this wallet.")), cur_row, 1)
grid.addWidget(HelpButton(_("Lightning is currently restricted to HD wallets with p2wpkh addresses.")), cur_row, 2)
cur_row += 1

vbox.addLayout(grid)

labels_clayout = None
Expand Down
9 changes: 4 additions & 5 deletions electrum/gui/qt/wizard/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,8 @@ def __init__(self, parent, wizard):
message = _('What kind of wallet do you want to create?')
wallet_kinds = [
('standard', _('Standard wallet')),
('2fa', _('Wallet with two-factor authentication')),
('multisig', _('Multi-signature wallet')),
('imported', _('Import Bitcoin addresses or private keys')),
('imported', _('Import Fact0rn addresses or private keys')),
]
choices = [pair for pair in wallet_kinds if pair[0] in wallet_types]

Expand All @@ -412,8 +411,8 @@ def __init__(self, parent, wizard):
choices = [
('createseed', _('Create a new seed')),
('haveseed', _('I already have a seed')),
('masterkey', _('Use a master key')),
('hardware', _('Use a hardware device'))
# ('masterkey', _('Use a master key')),
# ('hardware', _('Use a hardware device'))
]

self.choice_w = ChoiceWidget(message=message, choices=choices)
Expand Down Expand Up @@ -922,7 +921,7 @@ def apply(self):

class WCImport(WizardComponent):
def __init__(self, parent, wizard):
WizardComponent.__init__(self, parent, wizard, title=_('Import Bitcoin Addresses or Private Keys'))
WizardComponent.__init__(self, parent, wizard, title=_('Import Fact0rn Addresses or Private Keys'))
message = _(
'Enter a list of Bitcoin addresses (this will create a watching-only wallet), or a list of private keys.')
header_layout = QHBoxLayout()
Expand Down
8 changes: 5 additions & 3 deletions electrum/simple_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,10 +1105,12 @@ def _default_swapserver_url(self) -> str:
short_desc=lambda: _('Zeros after decimal point'),
long_desc=lambda: _('Number of zeros displayed after the decimal point. For example, if this is set to 2, "1." will be displayed as "1.00"'),
)
BTC_AMOUNTS_PREC_POST_SAT = ConfigVar(
'amt_precision_post_satoshi', default=0, type_=int,
short_desc=lambda: _("Show Lightning amounts with msat precision"),

BTC_AMOUNTS_PREC_POST_SAT = ConfigVar(
'amt_precision_post_satoshi', default=0, type_=int,
short_desc=lambda: _("Lightning precision (not supported)."),
)

BTC_AMOUNTS_ADD_THOUSANDS_SEP = ConfigVar(
'amt_add_thousands_sep', default=False, type_=bool,
short_desc=lambda: _("Add thousand separators to bitcoin amounts"),
Expand Down