@ -3,17 +3,14 @@ import click, time
from textual import events
from textual import events
from textual . app import App , ComposeResult
from textual . app import App , ComposeResult
from textual . screen import Screen
from textual . screen import Screen
from textual . widgets import Header , Footer , Placeholder , Label , ListView , ListItem , Static , DataTable , Button , Input , Checkbox , SelectionList , Select
from textual . widgets import Header , Footer , Static , Button , SelectionList , Select , DataTable , Input
from textual . containers import Grid , Horizontal
from textual . containers import Grid
from textual . coordinate import Coordinate
from ffx . model . show import Show
from ffx . model . pattern import Pattern
from ffx . model . pattern import Pattern
from . track_controller import TrackController
from . track_controller import TrackController
from . pattern_controller import PatternController
from . pattern_controller import PatternController
from . tag_controller import TagController
from . tag_controller import TagController
# from .show_controller import ShowController
from . track_type import TrackType
from . track_type import TrackType
@ -301,8 +298,6 @@ class TrackDetailsScreen(Screen):
trackDescriptor = self . getTrackDescriptorFromInput ( )
trackDescriptor = self . getTrackDescriptorFromInput ( )
# raise click.ClickException(f"td.tags={trackDescriptor.getTags()}") # language=ger, title=Deutsch
# Check for multiple default/forced disposition flags
# Check for multiple default/forced disposition flags
if self . __trackType == TrackType . AUDIO :
if self . __trackType == TrackType . AUDIO :
@ -341,29 +336,24 @@ class TrackDetailsScreen(Screen):
else :
else :
self . app . pop_screen ( )
self . app . pop_screen ( )
if event . button . id == " cancel_button " :
if event . button . id == " cancel_button " :
self . app . pop_screen ( )
self . app . pop_screen ( )
if event . button . id == " button_add_stream_tag " :
if event . button . id == " button_add_stream_tag " :
self . app . push_screen ( TagDetailsScreen ( ) , self . handle_add_tag )
if not self . __isNew :
self . app . push_screen ( TagDetailsScreen ( ) , self . handle_update_tag )
#row = ('<key>','<value>')
#self.trackTagsTable.add_row(*map(str, row))
if event . button . id == " button_edit_stream_tag " :
if event . button . id == " button_edit_stream_tag " :
tagKey , tagValue = self . getSelectedTag ( )
tagKey , tagValue = self . getSelectedTag ( )
self . app . push_screen ( TagDetailsScreen ( key = tagKey , value = tagValue ) , self . handle_ add _tag)
self . app . push_screen ( TagDetailsScreen ( key = tagKey , value = tagValue ) , self . handle_ update _tag)
if event . button . id == " button_delete_stream_tag " :
if event . button . id == " button_delete_stream_tag " :
tagKey , tagValue = self . getSelectedTag ( )
tagKey , tagValue = self . getSelectedTag ( )
self . app . push_screen ( TagDeleteScreen ( key = tagKey , value = tagValue ) , self . handle_delete_tag )
self . app . push_screen ( TagDeleteScreen ( key = tagKey , value = tagValue ) , self . handle_delete_tag )
def handle_update_tag ( self , tag ) :
def handle_add_tag ( self , tag ) :
trackId = self . __trackDescriptor . getId ( )
trackId = self . __trackDescriptor . getId ( )
@ -373,32 +363,6 @@ class TrackDetailsScreen(Screen):
if self . __tac . updateTrackTag ( trackId , tag [ 0 ] , tag [ 1 ] ) is not None :
if self . __tac . updateTrackTag ( trackId , tag [ 0 ] , tag [ 1 ] ) is not None :
self . updateTags ( )
self . updateTags ( )
def handle_edit_tag ( self , tag ) :
pass
# try:
# if trackDescriptor.getType() == TrackType.AUDIO:
#
# row_key, col_key = self.audioStreamsTable.coordinate_to_cell_key(self.audioStreamsTable.cursor_coordinate)
#
# self.audioStreamsTable.update_cell(row_key, self.column_key_audio_language, trackDescriptor.getLanguage().label())
# self.audioStreamsTable.update_cell(row_key, self.column_key_audio_title, trackDescriptor.getTitle())
# self.audioStreamsTable.update_cell(row_key, self.column_key_audio_default, 'Yes' if TrackDisposition.DEFAULT in trackDescriptor.getDispositionSet() else 'No')
# self.audioStreamsTable.update_cell(row_key, self.column_key_audio_forced, 'Yes' if TrackDisposition.FORCED in trackDescriptor.getDispositionSet() else 'No')
#
# if trackDescriptor.getType() == TrackType.SUBTITLE:
#
# row_key, col_key = self.subtitleStreamsTable.coordinate_to_cell_key(self.subtitleStreamsTable.cursor_coordinate)
#
# self.subtitleStreamsTable.update_cell(row_key, self.column_key_subtitle_language, trackDescriptor.getLanguage().label())
# self.subtitleStreamsTable.update_cell(row_key, self.column_key_subtitle_title, trackDescriptor.getTitle())
# self.subtitleStreamsTable.update_cell(row_key, self.column_key_subtitle_default, 'Yes' if TrackDisposition.DEFAULT in trackDescriptor.getDispositionSet() else 'No')
# self.subtitleStreamsTable.update_cell(row_key, self.column_key_subtitle_forced, 'Yes' if TrackDisposition.FORCED in trackDescriptor.getDispositionSet() else 'No')
#
# except CellDoesNotExist:
# pass
def handle_delete_tag ( self , trackTag ) :
def handle_delete_tag ( self , trackTag ) :
trackId = self . __trackDescriptor . getId ( )
trackId = self . __trackDescriptor . getId ( )
@ -410,5 +374,4 @@ class TrackDetailsScreen(Screen):
if tag is not None :
if tag is not None :
if self . __tac . deleteTrackTag ( tag . id ) :
if self . __tac . deleteTrackTag ( tag . id ) :
# raise click.ClickException('deleted!')
self . updateTags ( )
self . updateTags ( )