From 8dcaf666fb9f29a155d39f0dc3a3b6e2ea7407ba Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 23 Nov 2022 19:25:09 +0100 Subject: facilitate manual package updates after repository refreshals --- src/hydrilla/locales/en_US/LC_MESSAGES/messages.po | 130 +++++++++++--------- src/hydrilla/locales/pl_PL/LC_MESSAGES/messages.po | 132 ++++++++++++--------- src/hydrilla/proxy/state.py | 5 + src/hydrilla/proxy/state_impl/concrete_state.py | 32 ++++- src/hydrilla/proxy/web_ui/root.py | 7 ++ .../proxy/web_ui/templates/index.html.jinja | 26 ++++ 6 files changed, 214 insertions(+), 118 deletions(-) (limited to 'src') diff --git a/src/hydrilla/locales/en_US/LC_MESSAGES/messages.po b/src/hydrilla/locales/en_US/LC_MESSAGES/messages.po index 73527fd..f40397b 100644 --- a/src/hydrilla/locales/en_US/LC_MESSAGES/messages.po +++ b/src/hydrilla/locales/en_US/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: hydrilla 2.0\n" "Report-Msgid-Bugs-To: koszko@koszko.org\n" -"POT-Creation-Date: 2022-10-31 22:18+0100\n" +"POT-Creation-Date: 2022-11-23 19:21+0100\n" "PO-Revision-Date: 2022-02-12 00:00+0000\n" "Last-Translator: Wojtek Kosior \n" "Language: en_US\n" @@ -312,19 +312,19 @@ msgstr "Requested file could not be found." msgid "api.resource_not_enabled_for_access" msgstr "Requested resource is not enabled for access." -#: src/hydrilla/proxy/state_impl/concrete_state.py:119 +#: src/hydrilla/proxy/state_impl/concrete_state.py:127 msgid "err.proxy.unknown_db_schema" msgstr "" "Haketilo's data files have been altered, possibly by a newer version of " "Haketilo." -#: src/hydrilla/proxy/state_impl/concrete_state.py:146 +#: src/hydrilla/proxy/state_impl/concrete_state.py:161 msgid "err.proxy.no_sqlite_foreign_keys" msgstr "" "This installation of Haketilo uses an SQLite version which does not " "support foreign key constraints." -#: src/hydrilla/proxy/state_impl/concrete_state.py:298 +#: src/hydrilla/proxy/state_impl/concrete_state.py:326 msgid "warn.proxy.failed_to_register_landing_page_at_{}" msgstr "Failed to register landing page at \"{}\"." @@ -437,20 +437,32 @@ msgid "web_ui.home.title" msgstr "Welcome" #: src/hydrilla/proxy/web_ui/templates/index.html.jinja:35 +#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:44 +#: src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja:30 +#: src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja:35 +msgid "web_ui.err.file_installation_error" +msgstr "Failed to install needed items from repository." + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:39 +#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:48 +msgid "web_ui.err.impossible_situation_error" +msgstr "Item constraints prevent the action from succeeding." + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:43 msgid "web_ui.home.heading.welcome_to_haketilo" msgstr "Welcome to Haketilo!" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:39 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:47 msgid "web_ui.home.this_is_haketilo_page" msgstr "" "This is a virtual site hosted locally by Haketilo. You can use it to " "configure Haketilo proxy." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:45 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:53 msgid "web_ui.home.heading.about_haketilo" msgstr "About this tool" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:49 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:57 msgid "web_ui.home.html.haketilo_is_blah_blah" msgstr "" "Haketilo is a tool that gives users more control over their web browsing." @@ -459,17 +471,17 @@ msgstr "" "extension but has since been made into an HTTP proxy. It is built on top " "of the popular mitmproxy." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:53 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:61 msgid "web_ui.home.html.see_haketilo_doc_{url}" msgstr "" "Helpful information concerning use of this tool can be found in " "Haketilo's embedded documentation." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:62 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:70 msgid "web_ui.home.heading.configuring_browser_for_haketilo" msgstr "Configuring the browser for Haketilo" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:66 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:74 msgid "web_ui.home.html.to_add_certs_do_xyz" msgstr "" "Haketilo proxy works by modifying data exchanged by your browser and web " @@ -481,197 +493,199 @@ msgstr "" "href=\"http://mitm.it\">this page and add it to your operating " "system, browser or both." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:73 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:81 msgid "web_ui.home.heading.options" msgstr "Global options" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:76 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:84 msgid "web_ui.home.choose_language_label" msgstr "Choose your language" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:95 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:103 msgid "web_ui.home.mapping_usage_mode_label" msgstr "Package usage mode" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:106 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:114 msgid "web_ui.home.packages_are_used_when_enabled" msgstr "" "Haketilo is currently configured to only use packages that were " "explicitly enabled." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:109 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:117 msgid "web_ui.home.user_gets_asked_whether_to_enable_package" msgstr "" "Haketilo is currently configured to ask whenever a package is found that " "could be used for the current site." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:113 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:121 msgid "web_ui.home.packages_are_used_automatically" msgstr "" "Haketilo is currently configured to automatically use packages that are " "available for the current site." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:120 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:128 msgid "web_ui.home.use_enabled_button" msgstr "Use when enabled" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:123 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:131 msgid "web_ui.home.use_question_button" msgstr "Ask whether to use" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:126 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:134 msgid "web_ui.home.use_auto_button" msgstr "Use automatically" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:133 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:141 msgid "web_ui.home.script_blocking_mode_label" msgstr "Default scripts treatment" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:143 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:151 msgid "web_ui.home.scripts_are_allowed_by_default" msgstr "" "By default Haketilo currently allows JavaScript sent by websites to the " "browser to execute." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:146 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:154 msgid "web_ui.home.scripts_are_blocked_by_default" msgstr "" "By default Haketilo currently blocks JavaScript sent by websites to the " "browser from executing." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:150 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:158 msgid "web_ui.home.allow_scripts_button" msgstr "Allow scripts" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:151 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:159 msgid "web_ui.home.block_scripts_button" msgstr "Block scripts" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:162 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:170 msgid "web_ui.home.advanced_features_label" msgstr "Advanced features" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:172 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:180 msgid "web_ui.home.user_is_advanced_user" msgstr "Interface features for advanced users are currently enabled." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:175 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:183 msgid "web_ui.home.user_is_simple_user" msgstr "Interface features for advanced users are currently disabled." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:182 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:190 msgid "web_ui.home.user_make_advanced_button" msgstr "Enable" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:185 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:193 msgid "web_ui.home.user_make_simple_button" msgstr "Disable" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:193 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:201 +msgid "web_ui.home.update_waiting_label" +msgstr "Package updates" + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:204 +msgid "web_ui.home.update_is_awaiting" +msgstr "There might be some enabled items that can be updated to newer versions." + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:207 +msgid "web_ui.home.update_items_button" +msgstr "Update now" + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:219 msgid "web_ui.home.orphans_label" msgstr "Orphans" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:199 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:225 msgid "web_ui.home.orphans_to_delete_{mappings}" msgstr "Haketilo is holding some unused packages that can be removed ({mappings})." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:203 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:229 msgid "web_ui.home.orphans_to_delete_exist" msgstr "Haketilo is holding some unused libraries that can be removed." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:207 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:233 msgid "web_ui.home.orphans_to_delete_{mappings}_{resources}" msgstr "" "Haketilo is holding some unused items that can be removed (packages: " "{mappings}; libraries: {resources})." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:216 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:242 msgid "web_ui.home.prune_orphans_button" msgstr "Prune orphans" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:227 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:253 msgid "web_ui.home.popup_settings_label" msgstr "Popup settings" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:243 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:269 msgid "web_ui.home.configure_popup_settings_on_pages_with" msgstr "Configure popup settings on pages with" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:249 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:275 msgid "web_ui.home.popup_settings_jsallowed_button" msgstr "JS allowed" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:250 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:276 msgid "web_ui.home.popup_settings_jsblocked_button" msgstr "JS blocked" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:251 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:277 msgid "web_ui.home.popup_settings_payloadon_button" msgstr "Payload used" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:301 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:327 msgid "web_ui.home.popup_no_button" msgstr "Disable popup" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:304 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:330 msgid "web_ui.home.popup_yes_button" msgstr "Enable popup" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:314 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:340 msgid "web_ui.home.jsallowed_popup_yes" msgstr "" "Haketilo currently makes it possible to open its popup window on pages " "where native JS has been allowed to execute. This is a convenience that " "comes at a price of greater risk of user fingerprinting." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:316 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:342 msgid "web_ui.home.jsallowed_popup_no" msgstr "" "Haketilo currently does not make it possible to open its popup window on " "pages with their native JS allowed. This setting is less convenient but " "decreases the risk of user fingerprinting." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:322 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:348 msgid "web_ui.home.jsblocked_popup_yes" msgstr "" "Haketilo currently makes it possible to open its popup window on pages " "where native JS has been blocked from executing." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:324 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:350 msgid "web_ui.home.jsblocked_popup_no" msgstr "" "Haketilo currently does not make it possible to open its popup window on " "pages where native JS has been blocked from executing." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:330 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:356 msgid "web_ui.home.payloadon_popup_yes" msgstr "" "Haketilo currently makes it possible to open its popup window on pages " "where payload is used." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:332 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:358 msgid "web_ui.home.payloadon_popup_no" msgstr "" "Haketilo currently does not make it possible to open its popup window on " "pages where payload is used." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:337 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:363 msgid "web_ui.home.popup_can_be_opened_by" msgstr "" "When enabled on given page, popup dialog can be opened by typing big " "letters \"HKT\". It can be subsequently closed by clicking anywhere on " "the dark area around it." -#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:44 -#: src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja:30 -#: src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja:35 -msgid "web_ui.err.file_installation_error" -msgstr "Failed to install needed items from repository." - -#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:48 -msgid "web_ui.err.impossible_situation_error" -msgstr "Item constraints prevent the action from succeeding." - #: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:52 #: src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja:34 #: src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja:39 diff --git a/src/hydrilla/locales/pl_PL/LC_MESSAGES/messages.po b/src/hydrilla/locales/pl_PL/LC_MESSAGES/messages.po index 833979b..2834afe 100644 --- a/src/hydrilla/locales/pl_PL/LC_MESSAGES/messages.po +++ b/src/hydrilla/locales/pl_PL/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: hydrilla 3.0-beta2\n" "Report-Msgid-Bugs-To: koszko@koszko.org\n" -"POT-Creation-Date: 2022-10-31 22:18+0100\n" +"POT-Creation-Date: 2022-11-23 19:21+0100\n" "PO-Revision-Date: 2022-02-12 00:00+0000\n" "Last-Translator: Wojtek Kosior \n" "Language: pl_PL\n" @@ -323,19 +323,19 @@ msgstr "Żądany plik nie został znaleziony." msgid "api.resource_not_enabled_for_access" msgstr "Żądany zasób nie jest udostępniony." -#: src/hydrilla/proxy/state_impl/concrete_state.py:119 +#: src/hydrilla/proxy/state_impl/concrete_state.py:127 msgid "err.proxy.unknown_db_schema" msgstr "" "Dane Haketilo zostały zmodyfikowane, prawdopodobnie przez nowszą wersję " "Haketilo." -#: src/hydrilla/proxy/state_impl/concrete_state.py:146 +#: src/hydrilla/proxy/state_impl/concrete_state.py:161 msgid "err.proxy.no_sqlite_foreign_keys" msgstr "" "Ta instalacja Haketilo używa wersji SQLite, które nie wspiera ograniczeń " "kluczy obcych." -#: src/hydrilla/proxy/state_impl/concrete_state.py:298 +#: src/hydrilla/proxy/state_impl/concrete_state.py:326 msgid "warn.proxy.failed_to_register_landing_page_at_{}" msgstr "Nie udało się zarejestrować strony lądowania pod \"{}\"." @@ -448,20 +448,32 @@ msgid "web_ui.home.title" msgstr "Witaj" #: src/hydrilla/proxy/web_ui/templates/index.html.jinja:35 +#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:44 +#: src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja:30 +#: src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja:35 +msgid "web_ui.err.file_installation_error" +msgstr "Nie udało się zainstalować potrzebnych elementów z repozytorium." + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:39 +#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:48 +msgid "web_ui.err.impossible_situation_error" +msgstr "Ograniczenia własne elementów uniemożliły wykonanie akcji." + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:43 msgid "web_ui.home.heading.welcome_to_haketilo" msgstr "Witaj w Haketilo!" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:39 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:47 msgid "web_ui.home.this_is_haketilo_page" msgstr "" "To jest wirtualna witryna hostowana lokalnie przez Haketilo. Możesz użyć " "jej do skonfigurowania proxy Haketilo." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:45 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:53 msgid "web_ui.home.heading.about_haketilo" msgstr "O narzędziu" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:49 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:57 msgid "web_ui.home.html.haketilo_is_blah_blah" msgstr "" "Haketilo to narządzie, które daje użytkownikom więcej kontroli nad " @@ -471,17 +483,17 @@ msgstr "" "utworzone na nowo jako proxy HTTP. Jest zbudowane na popularnym mitmproxy." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:53 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:61 msgid "web_ui.home.html.see_haketilo_doc_{url}" msgstr "" "Pomocne informacje dotyczące użycia tego narządzia można znaleźć we wbudowanej dokumentacji Haketilo." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:62 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:70 msgid "web_ui.home.heading.configuring_browser_for_haketilo" msgstr "Konfiguracja przeglądarki pod Haketilo" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:66 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:74 msgid "web_ui.home.html.to_add_certs_do_xyz" msgstr "" "Proxy Haketilo działa modyfikując dane wymieniane przez przeglądarkę z " @@ -494,146 +506,160 @@ msgstr "" "href=\"http://mitm.it\">tej strony i dodaj go do swojego systemu " "operacyjnego, przeglądarki lub obydwu." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:73 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:81 msgid "web_ui.home.heading.options" msgstr "Opcje globalne" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:76 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:84 msgid "web_ui.home.choose_language_label" msgstr "Wybierz swój język" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:95 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:103 msgid "web_ui.home.mapping_usage_mode_label" msgstr "Tryb używania pakietów" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:106 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:114 msgid "web_ui.home.packages_are_used_when_enabled" msgstr "" "Haketilo jest obecnie skonfigurowane tak, aby używać wyłącznie pakietów, " "które użytkownik sam aktywował." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:109 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:117 msgid "web_ui.home.user_gets_asked_whether_to_enable_package" msgstr "" "Haketilo jest obecnie skonfigurowane tak, aby pytać zawsze, kiedy " "zostanie znaleziony pakiet, który mógłby być użyty na odwiedzanej " "stronie." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:113 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:121 msgid "web_ui.home.packages_are_used_automatically" msgstr "" "Haketilo jest obecnie skonfigurowane tak, żeby automatycznie używać " "pakietów, które są dostępne dla odwiedzanej strony." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:120 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:128 msgid "web_ui.home.use_enabled_button" msgstr "Używaj aktywowanych" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:123 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:131 msgid "web_ui.home.use_question_button" msgstr "Pytaj, czy użyć" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:126 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:134 msgid "web_ui.home.use_auto_button" msgstr "Używaj automatycznie" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:133 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:141 msgid "web_ui.home.script_blocking_mode_label" msgstr "Domyślne traktowanie skryptów" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:143 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:151 msgid "web_ui.home.scripts_are_allowed_by_default" msgstr "" "Haketilo obecnie domyślnie pozwala na wykonanie JavaScript'u przysyłanego" " przez strony." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:146 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:154 msgid "web_ui.home.scripts_are_blocked_by_default" msgstr "" "Haketilo obecnie domyślnie blokuje wykonanie JavaScript'u przysyłanego " "przez strony." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:150 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:158 msgid "web_ui.home.allow_scripts_button" msgstr "Pozwalaj" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:151 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:159 msgid "web_ui.home.block_scripts_button" msgstr "Blokuj" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:162 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:170 msgid "web_ui.home.advanced_features_label" msgstr "Zaawansowane funkcje" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:172 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:180 msgid "web_ui.home.user_is_advanced_user" msgstr "Funkcje interfejsu dla zaawansowanych użytkowników są obecnie włączone." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:175 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:183 msgid "web_ui.home.user_is_simple_user" msgstr "Funkcje interfejsu dla zaawansowanych użytkowników są obecnie wyłączone." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:182 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:190 msgid "web_ui.home.user_make_advanced_button" msgstr "Włącz" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:185 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:193 msgid "web_ui.home.user_make_simple_button" msgstr "Wyłącz" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:193 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:201 +msgid "web_ui.home.update_waiting_label" +msgstr "Aktualizacje pakietów" + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:204 +msgid "web_ui.home.update_is_awaiting" +msgstr "" +"Możliwe, że niektóre aktywne elementy mogą być uaktualnione do nowych " +"wersji." + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:207 +msgid "web_ui.home.update_items_button" +msgstr "Uaktualnij teraz" + +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:219 msgid "web_ui.home.orphans_label" msgstr "Opuszczone pakiety" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:199 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:225 msgid "web_ui.home.orphans_to_delete_{mappings}" msgstr "" "Haketilo przechowuje obecnie opuszczone pakiety, które można usunąć " "({mappings})." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:203 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:229 msgid "web_ui.home.orphans_to_delete_exist" msgstr "Haketilo przechowuje obecnie opuszczone biblioteki, które można usunąć." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:207 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:233 msgid "web_ui.home.orphans_to_delete_{mappings}_{resources}" msgstr "" "Haketilo przechowuje obecnie opuszczone elementy, które można usunąć " "(pakiety: {mappings}; biblioteki: {resources})." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:216 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:242 msgid "web_ui.home.prune_orphans_button" msgstr "Wyrzuć opuszczone" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:227 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:253 msgid "web_ui.home.popup_settings_label" msgstr "Ustawienia popup'u" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:243 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:269 msgid "web_ui.home.configure_popup_settings_on_pages_with" msgstr "Konfiguruj ustawienia popup'u na stronach, gdzie" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:249 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:275 msgid "web_ui.home.popup_settings_jsallowed_button" msgstr "JS może się wykonywać" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:250 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:276 msgid "web_ui.home.popup_settings_jsblocked_button" msgstr "JS jest zablokowany" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:251 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:277 msgid "web_ui.home.popup_settings_payloadon_button" msgstr "Modyfikator w użyciu" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:301 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:327 msgid "web_ui.home.popup_no_button" msgstr "Wyłącz popup" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:304 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:330 msgid "web_ui.home.popup_yes_button" msgstr "Włącz popup" -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:314 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:340 msgid "web_ui.home.jsallowed_popup_yes" msgstr "" "Haketilo obecnie umożliwia otwieranie okna popup'u na stronach, gdzie " @@ -641,7 +667,7 @@ msgstr "" "przychodzi za cenę większego ryzyka zarejstrowania unikatowego \"odcisku " "przeglądarki\" (tzw. fingerprinting)." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:316 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:342 msgid "web_ui.home.jsallowed_popup_no" msgstr "" "Haketilo obecnie nie umożliwia otwierania okna popup'u na stronach, gdzie" @@ -649,47 +675,37 @@ msgstr "" "dogodne ale zmniejsza ryzyko zarejstrowania unikatowego \"odcisku " "przeglądarki\" (tzw. fingerprinting)." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:322 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:348 msgid "web_ui.home.jsblocked_popup_yes" msgstr "" "Haketilo obecnie umożliwia otwieranie okna popup'u na stronach, gdzie " "zablokowano wykonanie oryginalnego JS'a." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:324 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:350 msgid "web_ui.home.jsblocked_popup_no" msgstr "" "Haketilo obecnie nie umożliwia otwierania okna popup'u na stronach, gdzie" " zablokowano wykonanie oryginalnego JS'a." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:330 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:356 msgid "web_ui.home.payloadon_popup_yes" msgstr "" "Haketilo obecnie umożliwia otwieranie okna popup'u na stronach, gdzie w " "użyciu jest modyfikator." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:332 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:358 msgid "web_ui.home.payloadon_popup_no" msgstr "" "Haketilo obecnie nie umożliwia otwierania okna popup'u na stronach, gdzie" " w użyciu jest modyfikator.pages where payload is used." -#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:337 +#: src/hydrilla/proxy/web_ui/templates/index.html.jinja:363 msgid "web_ui.home.popup_can_be_opened_by" msgstr "" "Gdy aktywne na danej stronie, okno pupup'u może być otworzone przez " "wpisanie wielkich liter \"HKT\". Może być następnie zamknięte przez " "kliknięcie gdziekolwiek na ciemnym obszarze naokoło niego." -#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:44 -#: src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja:30 -#: src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja:35 -msgid "web_ui.err.file_installation_error" -msgstr "Nie udało się zainstalować potrzebnych elementów z repozytorium." - -#: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:48 -msgid "web_ui.err.impossible_situation_error" -msgstr "Ograniczenia własne elementów uniemożliły wykonanie akcji." - #: src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja:52 #: src/hydrilla/proxy/web_ui/templates/prompts/package_suggestion.html.jinja:34 #: src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja:39 diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py index 1a2d344..f73d01f 100644 --- a/src/hydrilla/proxy/state.py +++ b/src/hydrilla/proxy/state.py @@ -545,6 +545,7 @@ class HaketiloGlobalSettings: advanced_user: bool repo_refresh_seconds: int locale: t.Optional[str] + update_waiting: bool default_popup_jsallowed: PopupSettings default_popup_jsblocked: PopupSettings @@ -633,6 +634,10 @@ class HaketiloState(ABC): ) -> None: ... + @abstractmethod + def upate_all_items(self) -> None: + ... + @property @abstractmethod def listen_host(self) -> str: diff --git a/src/hydrilla/proxy/state_impl/concrete_state.py b/src/hydrilla/proxy/state_impl/concrete_state.py index e97514a..89a2eb2 100644 --- a/src/hydrilla/proxy/state_impl/concrete_state.py +++ b/src/hydrilla/proxy/state_impl/concrete_state.py @@ -79,6 +79,14 @@ def _add_locale_column(cursor: sqlite3.Cursor) -> None: ''' ) +def _add_update_waiting_column(cursor: sqlite3.Cursor) -> None: + cursor.execute( + ''' + ALTER TABLE general ADD COLUMN + update_waiting BOOLEAN NOT NULL DEFAULT TRUE; + ''' + ) + def _prepare_database(connection: sqlite3.Connection) -> None: cursor = connection.cursor() @@ -120,6 +128,7 @@ def _prepare_database(connection: sqlite3.Connection) -> None: popup_settings_columns_present = False locale_column_present = False + update_waiting_column_present = False cursor.execute("PRAGMA TABLE_INFO('general')") for __cid, name, __type, __notnull, __dflt_value, __pk \ @@ -130,12 +139,18 @@ def _prepare_database(connection: sqlite3.Connection) -> None: if name == 'locale': locale_column_present = True + if name == 'update_waiting': + update_waiting_column_present = True + if not popup_settings_columns_present: _add_popup_settings_columns(cursor) if not locale_column_present: _add_locale_column(cursor) + if not update_waiting_column_present: + _add_update_waiting_column(cursor) + cursor.execute('COMMIT TRANSACTION;') except: cursor.execute('ROLLBACK TRANSACTION;') @@ -158,14 +173,15 @@ def load_settings(cursor: sqlite3.Cursor) -> st.HaketiloGlobalSettings: advanced_user, repo_refresh_seconds, mapping_use_mode, - locale + locale, + update_waiting FROM general; ''' ) (default_allow_scripts, advanced_user, repo_refresh_seconds, - mapping_use_mode, locale), = cursor.fetchall() + mapping_use_mode, locale, update_waiting), = cursor.fetchall() popup_settings_dict = {} @@ -196,6 +212,7 @@ def load_settings(cursor: sqlite3.Cursor) -> st.HaketiloGlobalSettings: repo_refresh_seconds = repo_refresh_seconds, mapping_use_mode = st.MappingUseMode(mapping_use_mode), locale = locale, + update_waiting = update_waiting, **popup_settings_dict ) @@ -221,6 +238,9 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields): repo_id = repo_id ) + cursor.execute('UPDATE general SET update_waiting = TRUE;') + self.settings = dc.replace(self.settings, update_waiting=True) + self.rebuild_structures(rules=False) def count_orphan_items(self) -> st.OrphanItemsStats: @@ -267,8 +287,16 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields): unlocked_required_mappings = unlocked_required_mappings ) + if unlocked_required_mappings == 'all_mappings_unlocked': + cursor.execute('UPDATE general SET update_waiting = FALSE;') + self.settings = dc.replace(self.settings, update_waiting=False) + self.rebuild_structures(rules=False) + def upate_all_items(self) -> None: + with self.cursor(transaction=True): + self.recompute_dependencies('all_mappings_unlocked') + def pull_missing_files(self) -> None: with self.cursor() as cursor: assert self.connection.in_transaction diff --git a/src/hydrilla/proxy/web_ui/root.py b/src/hydrilla/proxy/web_ui/root.py index 6f9e349..9a14268 100644 --- a/src/hydrilla/proxy/web_ui/root.py +++ b/src/hydrilla/proxy/web_ui/root.py @@ -195,6 +195,13 @@ def home_post() -> werkzeug.Response: state.update_settings(advanced_user=True) elif action == 'user_make_simple': state.update_settings(advanced_user=False) + elif action == 'upate_all_items': + try: + state.upate_all_items() + except st.FileInstallationError: + return home({'file_installation_error': True}) + except st.ImpossibleSituation: + return home({'impossible_situation_error': True}) elif action == 'prune_orphans': state.prune_orphan_items() else: diff --git a/src/hydrilla/proxy/web_ui/templates/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/index.html.jinja index fe9c5d5..d6a47f0 100644 --- a/src/hydrilla/proxy/web_ui/templates/index.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/index.html.jinja @@ -31,6 +31,14 @@ code in a proprietary work, I am not going to enforce this in court. {% import 'import/checkbox_tricks.html.jinja' as tricks %} {% block main %} + {% if file_installation_error is defined %} + {{ error_note(_('web_ui.err.file_installation_error')) }} + {% endif %} + + {% if impossible_situation_error is defined %} + {{ error_note(_('web_ui.err.impossible_situation_error')) }} + {% endif %} +

{{ _('web_ui.home.heading.welcome_to_haketilo') }}

@@ -187,6 +195,24 @@ code in a proprietary work, I am not going to enforce this in court. ]) }} + {% if settings.update_waiting %} +
+ + {{ label(_('web_ui.home.update_waiting_label')) }} + +

+ {{ _('web_ui.home.update_is_awaiting') }} +

+ + {% set update_but_text = _('web_ui.home.update_items_button') %} + + {{ + button_row([ + (['green-button'], update_but_text, {'action': 'upate_all_items'}) + ]) + }} + {% endif %} + {% if orphan_item_stats.mappings > 0 or orphan_item_stats.resources > 0 %}
-- cgit v1.2.3