else:
self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
elif scope == "project":
- if self.project.loadProject(path):
- self.initConfigList()
+ self.path = path
+ print "len(self.titles)", len(self.project.titles)
+ if len(self.project.titles):
+ self.session.openWithCallback(self.askLoadCB, MessageBox,text = _("Your current collection will get lost!") + "\n" + _("Do you want to restore your settings?"), type = MessageBox.TYPE_YESNO)
else:
- self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+ self.askLoadCB(True)
elif scope:
configRef.setValue(path)
self.initConfigList()
+
+ def askLoadCB(self, answer):
+ if answer is not None and answer:
+ if self.project.loadProject(self.path):
+ self.initConfigList()
+ else:
+ self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
\ No newline at end of file