Browse Source

fix: return type of QFileDialog.getSaveFileName() changed

seed_v14
SomberNight 7 years ago
parent
commit
6d6f5683cb
  1. 4
      gui/qt/main_window.py
  2. 2
      gui/qt/util.py

4
gui/qt/main_window.py

@ -399,7 +399,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def backup_wallet(self):
path = self.wallet.storage.path
wallet_folder = os.path.dirname(path)
filename = QFileDialog.getSaveFileName(self, _('Enter a filename for the copy of your wallet'), wallet_folder)
filename, __ = QFileDialog.getSaveFileName(self, _('Enter a filename for the copy of your wallet'), wallet_folder)
if not filename:
return
@ -592,7 +592,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def getSaveFileName(self, title, filename, filter = ""):
directory = self.config.get('io_dir', os.path.expanduser('~'))
path = os.path.join( directory, filename )
fileName = QFileDialog.getSaveFileName(self, title, path, filter)
fileName, __ = QFileDialog.getSaveFileName(self, title, path, 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/util.py

@ -351,7 +351,7 @@ def filename_field(parent, config, defaultname, select_msg):
def func():
text = filename_e.text()
_filter = "*.csv" if text.endswith(".csv") else "*.json" if text.endswith(".json") else None
p = QFileDialog.getSaveFileName(None, select_msg, text, _filter)
p, __ = QFileDialog.getSaveFileName(None, select_msg, text, _filter)
if p:
filename_e.setText(p)

Loading…
Cancel
Save