[DVDBurn] usability improvements: title list layout, bottom info area, consistency...
[enigma2.git] / lib / python / Plugins / Extensions / DVDBurn / ProjectSettings.py
index 0a0106bbbbca9e880de976e99e3e5ef46e84170f..39d7277e96801e15c7c987a3482f1af0da13b56a 100755 (executable)
@@ -233,10 +233,19 @@ class ProjectSettings(Screen,ConfigListScreen):
                        else:
                                self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
                elif scope == "project":
                        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:
                        else:
-                               self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+                               self.askLoadCB(True)
                elif scope:
                        configRef.setValue(path)
                        self.initConfigList()
                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