Skip to content

Commit

Permalink
Add addon name to title of Setup Wizard confirmation prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Dec 7, 2024
1 parent 0584588 commit 3ab383b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion resources/lib/youtube_plugin/kodion/abstract_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
):
Expand Down
63 changes: 54 additions & 9 deletions resources/lib/youtube_plugin/youtube/helper/yt_setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
):
Expand All @@ -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'))
):
Expand All @@ -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'))
):
Expand Down Expand Up @@ -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'))
):
Expand All @@ -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'))
):
Expand Down Expand Up @@ -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'))
):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 3ab383b

Please sign in to comment.