From 3ab383b9f7ba90703a7fad451f4ba9e9c7fae9db Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Sun, 1 Dec 2024 07:15:48 +1100 Subject: [PATCH] Add addon name to title of Setup Wizard confirmation prompts --- .../kodion/abstract_provider.py | 2 +- .../youtube/helper/yt_setup_wizard.py | 63 ++++++++++++++++--- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/resources/lib/youtube_plugin/kodion/abstract_provider.py b/resources/lib/youtube_plugin/kodion/abstract_provider.py index c7cf7413b..4ee167bbb 100644 --- a/resources/lib/youtube_plugin/kodion/abstract_provider.py +++ b/resources/lib/youtube_plugin/kodion/abstract_provider.py @@ -135,7 +135,7 @@ def run_wizard(self, context): try: if wizard_steps and ui.on_yes_no_input( - localize('setup_wizard'), + ' - '.join((localize('youtube'), localize('setup_wizard'))), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.settings')) ): diff --git a/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py b/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py index 60e21f41b..c0c1cbdfc 100644 --- a/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py +++ b/resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py @@ -26,7 +26,12 @@ def process_language(provider, context, step, steps): step += 1 if ui.on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.locale')) ): @@ -45,7 +50,12 @@ def process_geo_location(context, step, steps, **_kwargs): step += 1 if context.get_ui().on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.my_location')) ): @@ -65,7 +75,12 @@ def process_default_settings(context, step, steps, **_kwargs): step += 1 if context.get_ui().on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.settings.defaults')) ): @@ -95,7 +110,12 @@ def process_list_detail_settings(context, step, steps, **_kwargs): step += 1 if context.get_ui().on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.settings.list_details')) ): @@ -114,7 +134,12 @@ def process_performance_settings(context, step, steps, **_kwargs): step += 1 if ui.on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.settings.performance')) ): @@ -189,7 +214,12 @@ def process_subtitles(context, step, steps, **_kwargs): step += 1 if context.get_ui().on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), (localize('setup_wizard.prompt') % localize('setup_wizard.prompt.subtitles')) ): @@ -215,7 +245,12 @@ def process_old_search_db(context, step, steps, **_kwargs): search_db_path_str = os.path.join(*search_db_path) step += 1 if xbmcvfs.exists(search_db_path_str) and ui.on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), localize('setup_wizard.prompt.import_search_history'), ): def _convert_old_search_item(value, item): @@ -260,7 +295,12 @@ def process_old_history_db(context, step, steps, **_kwargs): history_db_path_str = os.path.join(*history_db_path) step += 1 if xbmcvfs.exists(history_db_path_str) and ui.on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), localize('setup_wizard.prompt.import_playback_history'), ): def _convert_old_history_item(value, item): @@ -303,7 +343,12 @@ def process_refresh_settings(context, step, steps, **_kwargs): step += 1 if context.get_ui().on_yes_no_input( - localize('setup_wizard') + ' ({0}/{1})'.format(step, steps), + '{youtube} - {setup_wizard} ({step}/{steps})'.format( + youtube=localize('youtube'), + setup_wizard=localize('setup_wizard'), + step=step, + steps=steps, + ), localize('setup_wizard.prompt.settings.refresh'), ): context.execute(