SomberNight 7 years ago
parent
commit
c0a42b756b
  1. 12
      gui/qt/main_window.py
  2. 4
      lib/simple_config.py

12
gui/qt/main_window.py

@ -396,7 +396,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.show_warning(msg, title=_('Information'))
def open_wallet(self):
wallet_folder = self.get_wallet_folder()
try:
wallet_folder = self.get_wallet_folder()
except FileNotFoundError as e:
self.show_error(str(e))
return
filename, __ = QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder)
if not filename:
return
@ -440,7 +444,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
return os.path.dirname(os.path.abspath(self.config.get_wallet_path()))
def new_wallet(self):
wallet_folder = self.get_wallet_folder()
try:
wallet_folder = self.get_wallet_folder()
except FileNotFoundError as e:
self.show_error(str(e))
return
i = 1
while True:
filename = "wallet_%d" % i

4
lib/simple_config.py

@ -233,6 +233,10 @@ class SimpleConfig(PrintError):
return path
# default path
if not os.path.exists(self.path):
raise FileNotFoundError(
_('Electrum datadir does not exist. Was it deleted while running?') + '\n' +
_('Should be at {}').format(self.path))
dirpath = os.path.join(self.path, "wallets")
if not os.path.exists(dirpath):
if os.path.islink(dirpath):

Loading…
Cancel
Save