X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=gui%2Fqt%2Fmain_window.py;h=028deb509703fc929b53379adf55b2e1b126fea5;hb=4da85c00e313d3e087f52d3c7263e79553ef8147;hp=c83a6f78cef63aa57f9ca7c3acb616bb9f6c9cd8;hpb=042c65939dde0eae0736f778703ae734e513e142;p=electrum-nvc.git diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index c83a6f7..028deb5 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -75,7 +75,7 @@ PR_ERROR = 4 # could not parse from electrum import ELECTRUM_VERSION import re -from util import * +from util import MyTreeWidget, HelpButton, EnterButton, line_dialog, text_dialog, ok_cancel_buttons, close_button, WaitingDialog def format_status(x): @@ -286,12 +286,20 @@ class ElectrumWindow(QMainWindow): import installwizard wallet_folder = os.path.dirname(self.wallet.storage.path) - filename = unicode( QFileDialog.getSaveFileName(self, _('Enter a new file name'), wallet_folder) ) + i = 1 + while True: + filename = "wallet_%d"%i + if filename in os.listdir(wallet_folder): + i += 1 + else: + break + + filename = line_dialog(self, _('New Wallet'), _('Enter file name') + ':', _('OK'), filename) if not filename: return - filename = os.path.join(wallet_folder, filename) - storage = WalletStorage({'wallet_path': filename}) + full_path = os.path.join(wallet_folder, filename) + storage = WalletStorage({'wallet_path': full_path}) if storage.file_exists: QMessageBox.critical(None, "Error", _("File exists")) return @@ -748,7 +756,7 @@ class ElectrumWindow(QMainWindow): def new_receive_address(self): domain = self.wallet.get_account_addresses(self.current_account, include_change=False) for addr in domain: - if not self.wallet.address_is_old(addr) and addr not in self.receive_requests.keys(): + if not self.wallet.history.get(addr) and addr not in self.receive_requests.keys(): break else: if isinstance(self.wallet, Imported_Wallet):