Movieplayer context menu - display 'Reset playback position' when it is possible...
authorims <ims21@users.sourceforge.net>
Mon, 13 Apr 2015 18:18:47 +0000 (20:18 +0200)
committerlittlesat <littlesat99@yahoo.com>
Mon, 13 Apr 2015 20:59:42 +0000 (22:59 +0200)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Screens/MovieSelection.py

index f32712f..0ee24f0 100644 (file)
@@ -389,7 +389,8 @@ class MovieContextMenu(Screen, ProtectedScreen):
                                append_to_menu(menu, (_("Rename"), csel.do_rename), key="2")
                                if not (service.flags & eServiceReference.mustDescent):
                                        append_to_menu(menu, (_("Copy"), csel.do_copy), key="5")
-                                       append_to_menu(menu, (_("Reset playback position"), csel.do_reset))
+                                       if self.isResetable(service):
+                                               append_to_menu(menu, (_("Reset playback position"), csel.do_reset))
                                        append_to_menu(menu, (_("Start offline decode"), csel.do_decode))
                                if config.ParentalControl.hideBlacklist.value and config.ParentalControl.storeservicepin.value != "never":
                                        from Components.ParentalControl import parentalControl
@@ -413,6 +414,13 @@ class MovieContextMenu(Screen, ProtectedScreen):
        def isProtected(self):
                return self.csel.protectContextMenu and config.ParentalControl.setuppinactive.value and config.ParentalControl.config_sections.context_menus.value
 
+       def isResetable(self, service):
+               serviceHandler = eServiceCenter.getInstance()
+               info = serviceHandler.info(service)
+               if info and moviePlayState(service.getPath() + ".cuts", service, info.getLength(service)) is None:
+                       return False
+               return True
+
        def pinEntered(self, answer):
                if answer:
                        self.csel.protectContextMenu = False