|
|
@ -1,3 +1,5 @@ |
|
|
|
from typing import TYPE_CHECKING |
|
|
|
|
|
|
|
from kivy.factory import Factory |
|
|
|
from kivy.lang import Builder |
|
|
|
from kivy.core.clipboard import Clipboard |
|
|
@ -8,6 +10,9 @@ from electrum.gui.kivy.i18n import _ |
|
|
|
from electrum.util import pr_tooltips, pr_color, get_request_status |
|
|
|
from electrum.util import PR_UNKNOWN, PR_UNPAID, PR_FAILED, PR_TYPE_LN |
|
|
|
|
|
|
|
if TYPE_CHECKING: |
|
|
|
from ...main_window import ElectrumWindow |
|
|
|
|
|
|
|
|
|
|
|
Builder.load_string(''' |
|
|
|
<RequestDialog@Popup> |
|
|
@ -84,7 +89,7 @@ class RequestDialog(Factory.Popup): |
|
|
|
def __init__(self, title, data, key, *, is_lightning=False): |
|
|
|
self.status = PR_UNKNOWN |
|
|
|
Factory.Popup.__init__(self) |
|
|
|
self.app = App.get_running_app() |
|
|
|
self.app = App.get_running_app() # type: ElectrumWindow |
|
|
|
self.title = title |
|
|
|
self.data = data |
|
|
|
self.key = key |
|
|
@ -107,7 +112,7 @@ class RequestDialog(Factory.Popup): |
|
|
|
self.status, self.status_str = get_request_status(req) |
|
|
|
self.status_color = pr_color[self.status] |
|
|
|
if self.status == PR_UNPAID and self.is_lightning and self.app.wallet.lnworker: |
|
|
|
if self.amount and self.amount > self.app.wallet.lnworker.can_receive(): |
|
|
|
if self.amount and self.amount > self.app.wallet.lnworker.num_sats_can_receive(): |
|
|
|
self.warning = _('Warning') + ': ' + _('This amount exceeds the maximum you can currently receive with your channels') |
|
|
|
|
|
|
|
def on_dismiss(self): |
|
|
|