better code organization
function parameters should be lowercase Fix crash on invalid labels import Added invoice exporting and reduced duplicate code Better exception handling removed json module import some more cleanup Cleaned up some stuff Added exporting contacts
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
from .util import *
|
||||
from electrum.i18n import _
|
||||
from electrum.util import format_time, FileImportFailed
|
||||
from electrum.util import format_time
|
||||
|
||||
|
||||
class InvoiceList(MyTreeWidget):
|
||||
@@ -57,15 +57,10 @@ class InvoiceList(MyTreeWidget):
|
||||
self.parent.invoices_label.setVisible(len(inv_list))
|
||||
|
||||
def import_invoices(self):
|
||||
wallet_folder = self.parent.get_wallet_folder()
|
||||
filename, __ = QFileDialog.getOpenFileName(self.parent, "Select your wallet file", wallet_folder)
|
||||
if not filename:
|
||||
return
|
||||
try:
|
||||
self.parent.invoices.import_file(filename)
|
||||
except FileImportFailed as e:
|
||||
self.parent.show_message(str(e))
|
||||
self.on_update()
|
||||
import_meta_gui(self.parent, _('invoices'), self.parent.invoices.import_file, self.on_update)
|
||||
|
||||
def export_invoices(self):
|
||||
export_meta_gui(self.parent, _('invoices'), self.parent.invoices.export_file)
|
||||
|
||||
def create_menu(self, position):
|
||||
menu = QMenu()
|
||||
|
||||
Reference in New Issue
Block a user