Browse Source

fix: return type of QFileDialog.getOpenFileName() changed

seed_v14
SomberNight 7 years ago
parent
commit
f1a4f998d2
  1. 2
      gui/qt/contact_list.py
  2. 2
      gui/qt/installwizard.py
  3. 2
      gui/qt/invoice_list.py
  4. 4
      gui/qt/main_window.py
  5. 2
      gui/qt/qrtextedit.py
  6. 2
      plugins/trezor/qt_generic.py

2
gui/qt/contact_list.py

@ -61,7 +61,7 @@ class ContactList(MyTreeWidget):
def import_contacts(self):
wallet_folder = self.parent.get_wallet_folder()
filename = QFileDialog.getOpenFileName(self.parent, "Select your wallet file", wallet_folder)
filename, _ = QFileDialog.getOpenFileName(self.parent, "Select your wallet file", wallet_folder)
if not filename:
return
self.parent.contacts.import_file(filename)

2
gui/qt/installwizard.py

@ -179,7 +179,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
wallet_folder = os.path.dirname(self.storage.path)
def on_choose():
path = QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder)
path, _ = QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder)
if path:
self.name_e.setText(path)

2
gui/qt/invoice_list.py

@ -64,7 +64,7 @@ class InvoiceList(MyTreeWidget):
def import_invoices(self):
wallet_folder = self.parent.get_wallet_folder()
filename = QFileDialog.getOpenFileName(self.parent, "Select your wallet file", wallet_folder)
filename, _ = QFileDialog.getOpenFileName(self.parent, "Select your wallet file", wallet_folder)
if not filename:
return
self.parent.invoices.import_file(filename)

4
gui/qt/main_window.py

@ -390,7 +390,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def open_wallet(self):
wallet_folder = self.get_wallet_folder()
filename = QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder)
filename, _ = QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder)
if not filename:
return
self.gui_object.new_window(filename)
@ -584,7 +584,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
# custom wrappers for getOpenFileName and getSaveFileName, that remember the path selected by the user
def getOpenFileName(self, title, filter = ""):
directory = self.config.get('io_dir', os.path.expanduser('~'))
fileName = QFileDialog.getOpenFileName(self, title, directory, filter)
fileName, _ = QFileDialog.getOpenFileName(self, title, directory, filter)
if fileName and directory != os.path.dirname(fileName):
self.config.set_key('io_dir', os.path.dirname(fileName), True)
return fileName

2
gui/qt/qrtextedit.py

@ -46,7 +46,7 @@ class ScanQRTextEdit(ButtonsTextEdit, MessageBoxMixin):
run_hook('scan_text_edit', self)
def file_input(self):
fileName = QFileDialog.getOpenFileName(self, 'select file')
fileName, _ = QFileDialog.getOpenFileName(self, 'select file')
if not fileName:
return
with open(fileName, "r") as f:

2
plugins/trezor/qt_generic.py

@ -377,7 +377,7 @@ class SettingsDialog(WindowModalDialog):
def change_homescreen():
from PIL import Image # FIXME
dialog = QFileDialog(self, _("Choose Homescreen"))
filename = dialog.getOpenFileName()
filename, _ = dialog.getOpenFileName()
if filename:
im = Image.open(str(filename))
if im.size != (hs_cols, hs_rows):

Loading…
Cancel
Save