From 9ab0ab3934e2df7ae24d71b547ed178cc7fbdced Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 16 May 2024 15:27:31 +0400 Subject: [PATCH] Add on_settings to scripts without it --- README.md | 1 + community/counter-widget.lua | 4 ++++ community/kodi-remote-widget.lua | 4 ++++ community/net-file-widget.lua | 7 ++++++- community/period-progress-widget.lua | 5 +++++ community/uptimerobot-2-widget.lua | 6 +++++- community/uptimerobot-widget.lua | 5 +++++ samples/currencies-widget.lua | 4 ++++ 8 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae0f3af..159e739 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ The type of script is determined by the line (meta tag) at the beginning of the * Added `prefs:show_dialog` method * Added support for SVG icons to the Rich UI API +* To show settings dialog you must declare `on_settings` function ### 5.2.3 diff --git a/community/counter-widget.lua b/community/counter-widget.lua index bcc460e..a5c97b5 100644 --- a/community/counter-widget.lua +++ b/community/counter-widget.lua @@ -47,6 +47,10 @@ function on_click() settings:show_dialog() end +function on_settings() + settings:show_dialog() +end + -- utils function get_milestone_idx(passed) diff --git a/community/kodi-remote-widget.lua b/community/kodi-remote-widget.lua index 970eb6e..b2be331 100644 --- a/community/kodi-remote-widget.lua +++ b/community/kodi-remote-widget.lua @@ -93,6 +93,10 @@ function on_network_result_cmd(result) end end +function on_settings() + settings:show_dialog() +end + -- utils function init_url_from_settings() diff --git a/community/net-file-widget.lua b/community/net-file-widget.lua index f292415..deafa03 100644 --- a/community/net-file-widget.lua +++ b/community/net-file-widget.lua @@ -14,9 +14,14 @@ function on_resume() end function on_click() - aio:show_args_dialog() + settings:show_dialog() end function on_network_result(result) ui:show_text(result) end + +function on_settings() + settings:show_dialog() +end + diff --git a/community/period-progress-widget.lua b/community/period-progress-widget.lua index 8be2091..b5052cf 100644 --- a/community/period-progress-widget.lua +++ b/community/period-progress-widget.lua @@ -31,3 +31,8 @@ function init_progressbar() percent = math.floor((current_time - start_period) / ((end_period - start_period) / 100)) ui:show_progress_bar(name_period..": "..percent.."%", current_time - start_period, end_period - start_period, "#7069f0ae") end + +function on_settings() + settings:show_dialog() +end + diff --git a/community/uptimerobot-2-widget.lua b/community/uptimerobot-2-widget.lua index 722d528..296a043 100644 --- a/community/uptimerobot-2-widget.lua +++ b/community/uptimerobot-2-widget.lua @@ -65,5 +65,9 @@ function on_network_result(result, code) end ui:show_buttons(names, colours) +end + +function on_settings() + settings:show_dialog() +end -end \ No newline at end of file diff --git a/community/uptimerobot-widget.lua b/community/uptimerobot-widget.lua index fb1a5a7..44cdff5 100644 --- a/community/uptimerobot-widget.lua +++ b/community/uptimerobot-widget.lua @@ -91,3 +91,8 @@ function table_to_tables(tab, num) return out_tab end + +function on_settings() + settings:show_dialog() +end + diff --git a/samples/currencies-widget.lua b/samples/currencies-widget.lua index 41c78ee..801eb3e 100644 --- a/samples/currencies-widget.lua +++ b/samples/currencies-widget.lua @@ -92,6 +92,10 @@ function create_tab(result) return tab end +function on_settings() + settings:show_dialog() +end + -- utils -- function get_formatted_change_text(change)