Browse Source

open each wallet in a separate window

283
ThomasV 9 years ago
parent
commit
ce06d92100
  1. 6
      gui/qt/__init__.py
  2. 12
      gui/qt/main_window.py

6
gui/qt/__init__.py

@ -109,7 +109,11 @@ class ElectrumGui:
def new_window(self, config): def new_window(self, config):
self.app.emit(SIGNAL('new_window'), config) self.app.emit(SIGNAL('new_window'), config)
def start_new_window(self, config): def load_wallet_file(self, path):
self.app.emit(SIGNAL('new_window'), self.config, path)
def start_new_window(self, config, path=None):
if path is None:
path = config.get_wallet_path() path = config.get_wallet_path()
for w in self.windows: for w in self.windows:
if w.config.get_wallet_path() == path: if w.config.get_wallet_path() == path:

12
gui/qt/main_window.py

@ -141,10 +141,10 @@ class ElectrumWindow(QMainWindow):
tabs.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) tabs.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.setCentralWidget(tabs) self.setCentralWidget(tabs)
try: #try:
self.setGeometry(*self.config.get("winpos-qt")) # self.setGeometry(*self.config.get("winpos-qt"))
except: #except:
self.setGeometry(100, 100, 840, 400) # self.setGeometry(100, 100, 840, 400)
if self.config.get("is_maximized"): if self.config.get("is_maximized"):
self.showMaximized() self.showMaximized()
@ -293,7 +293,7 @@ class ElectrumWindow(QMainWindow):
filename = unicode(QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder)) filename = unicode(QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder))
if not filename: if not filename:
return return
self.load_wallet_file(filename) self.gui_object.load_wallet_file(filename)
def run_wizard(self, storage, action): def run_wizard(self, storage, action):
import installwizard import installwizard
@ -423,7 +423,7 @@ class ElectrumWindow(QMainWindow):
for i, k in enumerate(sorted(recent)): for i, k in enumerate(sorted(recent)):
b = os.path.basename(k) b = os.path.basename(k)
def loader(k): def loader(k):
return lambda: self.load_wallet_file(k) return lambda: self.gui_object.load_wallet_file(k)
self.recently_visited_menu.addAction(b, loader(k)).setShortcut(QKeySequence("Ctrl+%d"%(i+1))) self.recently_visited_menu.addAction(b, loader(k)).setShortcut(QKeySequence("Ctrl+%d"%(i+1)))
self.recently_visited_menu.setEnabled(len(recent)) self.recently_visited_menu.setEnabled(len(recent))

Loading…
Cancel
Save