fix 'ok' priority
[enigma2.git] / lib / python / Plugins / Extensions / CutListEditor / plugin.py
index 7e591d26968a6d68253d0ad8eb059f463f91d909..241f43bb407fabc0e5e9b51f3422988b56bc14a1 100644 (file)
@@ -111,21 +111,17 @@ class CutList(GUIComponent):
        def getCurrentIndex(self):
                return self.l.getCurrentSelectionIndex()
        
-       def GUIcreate(self, parent):
-               self.instance = eListbox(parent)
-               self.instance.setContent(self.l)
-               self.instance.setItemHeight(30)
-               self.instance.selectionChanged.get().append(self.selectionChanged)
+       GUI_WIDGET = eListbox
+       
+       def postWidgetCreate(self, instance):
+               instance.setContent(self.l)
+               instance.setItemHeight(30)
+               instance.selectionChanged.get().append(self.selectionChanged)
 
        def selectionChanged(self):
                for x in self.onSelectionChanged:
                        x()
        
-       def GUIdelete(self):
-               self.instance.selectionChanged.get().remove(self.selectionChanged)
-               self.instance.setContent(None)
-               self.instance = None
-       
        def invalidateEntry(self, index):
                self.l.invalidateEntry(index)
        
@@ -178,7 +174,7 @@ class CutListEditor(Screen, InfoBarSeek, InfoBarCueSheetSupport):
                                "removeMark": (self.__removeMark, _("Remove a mark")),
                                "leave": (self.exit, _("Exit editor")),
                                "showMenu": self.showMenu,
-                       })
+                       }, prio=-4)
                
                self.tutorial_seen = False
                
@@ -207,8 +203,9 @@ Then seek to the end, press OK, select 'end cut'. That's it.
                pass
        
        def setType(self, index, type):
-               self.cut_list[index] = (self.cut_list[index][0], type)
-               self["Cutlist"].setIndex(index, CutListEntry(*self.cut_list[index]))
+               if len(self.cut_list):
+                       self.cut_list[index] = (self.cut_list[index][0], type)
+                       self["Cutlist"].setIndex(index, CutListEntry(*self.cut_list[index]))
        
        def setIn(self):
                m = self["Cutlist"].getCurrentIndex()