From aca73d98bc0644926d5dc1f46e8fd00f2bdd989b Mon Sep 17 00:00:00 2001 From: LexiconCode Date: Sat, 27 Feb 2021 18:30:37 -0600 Subject: [PATCH] Simplified show_window --- .../show_window_on_error_hook.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/castervoice/lib/merge/ccrmerging2/hooks/standard_hooks/show_window_on_error_hook.py b/castervoice/lib/merge/ccrmerging2/hooks/standard_hooks/show_window_on_error_hook.py index d2ca5b1c3..411864de8 100644 --- a/castervoice/lib/merge/ccrmerging2/hooks/standard_hooks/show_window_on_error_hook.py +++ b/castervoice/lib/merge/ccrmerging2/hooks/standard_hooks/show_window_on_error_hook.py @@ -1,4 +1,4 @@ -from castervoice.lib import settings, textformat +from castervoice.lib import settings, textformat, utilities from castervoice.lib.merge.ccrmerging2.hooks.base_hook import BaseHook from castervoice.lib.merge.ccrmerging2.hooks.events.event_types import EventType from castervoice.lib import printer @@ -8,21 +8,8 @@ from dragonfly.windows.window import Window def show_window(): - title = None - engine = get_current_engine().name - if engine == 'natlink': - import natlinkstatus # pylint: disable=import-error - status = natlinkstatus.NatlinkStatus() - if status.NatlinkIsEnabled() == 1: - if six.PY2: - title = "Messages from Python Macros" - else: - title= "Messages from Natlink" - else: - title = "Caster: Status Window" - if engine != 'natlink': - title = "Caster: Status Window" - windows = Window.get_matching_windows(title=title) + window_title = utilities.get_caster_messaging_window() + windows = Window.get_matching_windows(title=window_title) if windows: windows[0].set_foreground()