commit 464a89ddf530d3c748812b4122198d537fa06ba7
parent b40f3571e80a00c0f349c406e430899566154a6b
Author: ThomasV <thomasv@gitorious>
Date: Fri, 7 Aug 2015 19:24:43 +0200
improve recently_open menu
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -290,6 +290,10 @@ class ElectrumWindow(QMainWindow):
return
if not storage.file_exists:
self.show_message(_("File not found") + ' ' + filename)
+ recent = self.config.get('recently_open', [])
+ if filename in recent:
+ recent.remove(filename)
+ self.config.set_key('recently_open', recent)
return
# read wizard action
try:
@@ -373,10 +377,10 @@ class ElectrumWindow(QMainWindow):
recent = self.config.get('recently_open', [])
if filename and filename not in recent:
recent.insert(0, filename)
- recent = recent[:10]
+ recent = recent[:5]
self.config.set_key('recently_open', recent)
self.recently_visited_menu.clear()
- for i, k in enumerate(recent):
+ for i, k in enumerate(sorted(recent)):
b = os.path.basename(k)
def loader(k):
return lambda: self.load_wallet_file(k)