Skip to content

Commit

Permalink
Fix video player actions being sensitive when playback fails
Browse files Browse the repository at this point in the history
Closes #52
  • Loading branch information
otsaloma committed Jul 17, 2017
1 parent 8d1b06d commit fc0a2f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Gaupol 1.2.1/1.3
================

* [x] Fix unhandled exception when adding recent menu items
* [x] Fix video player actions being sensitive when playback
initialization fails (#52)
3 changes: 3 additions & 0 deletions gaupol/actions/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self):
self.set_state(str(0))
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class VolumeDownAction(gaupol.Action):
def __init__(self):
Expand All @@ -38,6 +39,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class VolumeUpAction(gaupol.Action):
def __init__(self):
Expand All @@ -46,5 +48,6 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

__all__ = tuple(x for x in dir() if x.endswith("Action"))
2 changes: 2 additions & 0 deletions gaupol/actions/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def __init__(self):
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(page is not None)
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class InsertSubtitlesAction(gaupol.Action):
def __init__(self):
Expand Down Expand Up @@ -170,6 +171,7 @@ def __init__(self):
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(page is not None)
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)
aeidon.util.affirm(len(selected_rows) == 1)

class SplitSubtitleAction(gaupol.Action):
Expand Down
8 changes: 8 additions & 0 deletions gaupol/actions/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class PlaySelectionAction(gaupol.Action):
def __init__(self):
Expand All @@ -44,6 +45,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)
aeidon.util.affirm(selected_rows)

class SeekBackwardAction(gaupol.Action):
Expand All @@ -53,6 +55,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class SeekForwardAction(gaupol.Action):
def __init__(self):
Expand All @@ -61,6 +64,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class SeekNextAction(gaupol.Action):
def __init__(self):
Expand All @@ -69,6 +73,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class SeekPreviousAction(gaupol.Action):
def __init__(self):
Expand All @@ -77,6 +82,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)

class SeekSelectionEndAction(gaupol.Action):
def __init__(self):
Expand All @@ -85,6 +91,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)
aeidon.util.affirm(selected_rows)

class SeekSelectionStartAction(gaupol.Action):
Expand All @@ -94,6 +101,7 @@ def __init__(self):
self.action_group = "unsafe"
def _affirm_doable(self, application, page, selected_rows):
aeidon.util.affirm(application.player is not None)
aeidon.util.affirm(application.player.ready)
aeidon.util.affirm(selected_rows)

__all__ = tuple(x for x in dir() if x.endswith("Action"))

0 comments on commit fc0a2f7

Please sign in to comment.