Skip to content

Commit

Permalink
Refresh scene editor tree view after sync, closes #1354
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 1, 2024
1 parent 7a6b3f6 commit 048b800
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/python/plotlyst/view/scene_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
from plotlyst.event.core import EventListener, Event, emit_event
from plotlyst.event.handler import event_dispatchers
from plotlyst.events import NovelAboutToSyncEvent, SceneStoryBeatChangedEvent, \
NovelStorylinesToggleEvent, NovelStructureToggleEvent, NovelPovTrackingToggleEvent, SceneChangedEvent
NovelStorylinesToggleEvent, NovelStructureToggleEvent, NovelPovTrackingToggleEvent, SceneChangedEvent, \
NovelSyncEvent
from plotlyst.model.characters_model import CharactersSceneAssociationTableModel
from plotlyst.service.cache import acts_registry
from plotlyst.service.persistence import RepositoryPersistenceManager
Expand Down Expand Up @@ -204,14 +205,17 @@ def __init__(self, novel: Novel):
self.ui.splitter.setSizes([140, 500])

dispatcher = event_dispatchers.instance(self.novel)
dispatcher.register(self, NovelAboutToSyncEvent, NovelStorylinesToggleEvent, NovelStructureToggleEvent,
dispatcher.register(self, NovelAboutToSyncEvent, NovelSyncEvent, NovelStorylinesToggleEvent,
NovelStructureToggleEvent,
NovelPovTrackingToggleEvent)

@overrides
def event_received(self, event: Event):
if isinstance(event, NovelAboutToSyncEvent):
if self.scene is not None:
self._on_close()
elif isinstance(event, NovelSyncEvent):
self.ui.treeScenes.refresh()
elif isinstance(event, NovelStorylinesToggleEvent):
self.ui.wdgStorylines.setVisible(event.toggled)
self._btnPlotSelector.setVisible(event.toggled)
Expand Down

0 comments on commit 048b800

Please sign in to comment.