Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Mar 30, 2024
2 parents ccdb6eb + e4eb9ce commit 0150753
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion electrum_grs/gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
from electrum_grs.lnaddr import lndecode
from electrum_grs.submarine_swaps import SwapServerError

from .rate_limiter import rate_limited
from .exception_window import Exception_Hook
from .amountedit import BTCAmountEdit
from .qrcodewidget import QRDialog
Expand Down Expand Up @@ -1573,8 +1574,17 @@ def create_notes_tab(self):
notes_tab.setFont(QtGui.QFont(MONOSPACE_FONT, 10, QtGui.QFont.Normal))
notes_tab.setPlainText(self.wallet.db.get('notes_text', ''))
notes_tab.is_shown_cv = self.config.cv.GUI_QT_SHOW_TAB_NOTES
notes_tab.textChanged.connect(self.maybe_save_notes_text)
return notes_tab

@rate_limited(10, ts_after=True)
def maybe_save_notes_text(self):
self.save_notes_text()

def save_notes_text(self):
self.logger.info('saving notes')
self.wallet.db.put('notes_text', self.notes_tab.toPlainText())

def update_console(self):
console = self.console
console.history = self.wallet.db.get_stored_item("qt-console-history", [])
Expand Down Expand Up @@ -2521,7 +2531,7 @@ def clean_up(self):
fut.cancel()
self.unregister_callbacks()
self.config.GUI_QT_WINDOW_IS_MAXIMIZED = self.isMaximized()
self.wallet.db.put('notes_text', self.notes_tab.toPlainText())
self.save_notes_text()
if not self.isMaximized():
g = self.geometry()
self.wallet.db.put("winpos-qt", [g.left(),g.top(),
Expand Down
8 changes: 4 additions & 4 deletions electrum_grs/plugins/jade/jadepy/jade.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _hexlify(data):
# The default implementation used in JadeAPI._jadeRpc() below.
# NOTE: Only available if the 'requests' dependency is available.
#
# Callers can supply their own implmentation of this call where it is required.
# Callers can supply their own implementation of this call where it is required.
#
# Parameters
# ----------
Expand Down Expand Up @@ -1422,7 +1422,7 @@ def create_serial(device=None, baud=None, timeout=None):
Returns
-------
JadeInterface
Inerface object configured to use given serial parameters.
Interface object configured to use given serial parameters.
NOTE: the instance has not yet tried to contact the hw
- caller must call 'connect()' before trying to use the Jade.
"""
Expand Down Expand Up @@ -1464,7 +1464,7 @@ def create_ble(device_name=None, serial_number=None,
Returns
-------
JadeInterface
Inerface object configured to use given BLE parameters.
Interface object configured to use given BLE parameters.
NOTE: the instance has not yet tried to contact the hw
- caller must call 'connect()' before trying to use the Jade.
Expand Down Expand Up @@ -1718,7 +1718,7 @@ def validate_reply(request, reply):
def make_rpc_call(self, request, long_timeout=False):
"""
Method to send a request over the underlying interface, and await a response.
The request is minimally validated before it is sent, and the response is simialrly
The request is minimally validated before it is sent, and the response is similarly
validated before being returned.
Any read-timeout is respected unless 'long_timeout' is passed, in which case the call
blocks indefinitely awaiting a response.
Expand Down

0 comments on commit 0150753

Please sign in to comment.