ok-script 3.0.4__tar.gz → 3.0.5b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ok_script-3.0.4 → ok_script-3.0.5b2}/PKG-INFO +1 -1
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/__init__.py +12 -16
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/start_controller.py +83 -3
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/MainWindow.py +2 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/en_US.qm +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/en_US.ts +40 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/es_ES.qm +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/es_ES.ts +40 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/ja_JP.qm +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/ja_JP.ts +40 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/ko_KR.qm +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/ko_KR.ts +40 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/zh_CN.qm +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/zh_CN.ts +40 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/zh_TW.qm +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/zh_TW.ts +40 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/icons.py +24 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/inputs.py +30 -2
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/navigation.py +21 -8
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/window.py +12 -4
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/resources.py +6680 -6482
- ok_script-3.0.5b2/ok/ui/qt/settings/config_section.py +172 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/settings/settings_page.py +15 -4
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/nav_icons.py +3 -1
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/tasks_page.py +30 -5
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/YesNonWidgetItem.py +2 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/GlobalConfig.py +85 -12
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/logger.py +15 -0
- ok_script-3.0.5b2/ok/util/shortcut.py +42 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/PKG-INFO +1 -1
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/SOURCES.txt +1 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_settings_page.py +50 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_shell.py +76 -1
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_tasks_page.py +15 -0
- ok_script-3.0.4/ok/ui/qt/settings/config_section.py +0 -53
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/develop/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/develop/agents/openai.yaml +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/develop/references/windows-input.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/generate-templates/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/reload-tasks/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/reload-tasks/agents/openai.yaml +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/setup-env/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/setup-env/agents/openai.yaml +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/setup-env/assets/ok-script-develop/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/setup-project/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/setup-project/agents/openai.yaml +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/use_venv/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/write-test/SKILL.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/.agents/skills/write-test/agents/openai.yaml +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/LICENSE.txt +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/MANIFEST.in +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/README.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/diagnostics/qq_trace.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/docs/agent-setup.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/docs/feature-crops.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/docs/mcp.md +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/examples/mcp_observe.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/__main__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/alas/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/alas/emulator_base.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/alas/emulator_windows.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/alas/platform_windows.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/alas/utils.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/assets/default-icon.png +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/deep.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/minitouch.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/nemu_ipc.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/nemu_utils.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/pool.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/timer.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/adb/util.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/windows/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/windows/d3d11.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/capture/windows/dump.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/cli.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/capture_labels.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/code_runner.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/config_schema.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/downloads.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/events.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/icons.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/mcp_runner.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/mcp_server.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/notifications.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/plugin_staging.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/plugins.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/screenshot.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/script_editing.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/script_packager.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/script_templates.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/skills.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/task_manager.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/template_store.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/translation.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/core/ui_config.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/DeviceManager.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/adb.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/base.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/bitblt.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/bitblt_utils.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/browser.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/desktop_duplication.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/hwnd_window.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/image.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/nemu_ipc.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/types.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/update.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/windows_graphics.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/capture_methods/windows_graphics_hdr.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/adb.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/base.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/browser.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/do_nothing.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/foreground_post_message.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/genshin.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/keys.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/post_message.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/pydirect.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/pynput.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/interaction_methods/swipe.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/device/intercation.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/feature/Box.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/feature/Feature.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/feature/FeatureSet.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/feature/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/gui/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/gui/util/pyappify_startup.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/manager.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/messenger_images.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/pipeline.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/ppocr.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/providers.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/system.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/notification/windows_messenger.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ocr/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ocr/download_paddle_model.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/UI/ViewManagement/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/UI/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/Windows/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/delegate.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/export.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/idldsl.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/inspectable.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/roapi.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/types.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/rotypes/winstring.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/task/DiagnosisTask.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/task/TaskExecutor.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/task/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/task/exceptions.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/task/task.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/test/OKTestRunner.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/test/RunTests.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/test/TaskTestCase.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/test/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/third_party/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/third_party/paperclip.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/overlay/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/overlay/win32_gdi.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/Communicate.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/MessageWindow.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/StartController.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/about/AboutTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/about/UpdateCard.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/about/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/common/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/common/config.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/debug/OverlayWidget.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/debug/Screenshot.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/debug/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/debug/diagnosis_page.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/events.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/GettextTranslator.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/path.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/i18n/update.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/buttons.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/cards.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/dialogs.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/feedback.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/gallery.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/labels.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/layout.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/mica.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/motion.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/options.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/popover.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/qss.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/switch.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/tabs.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/kit/theme.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/overlay/OverlayWindow.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/overlay/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/plugins/PluginTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/plugins/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/plugins/imported_tabs.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/qt.qrc +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/settings/GlobalConfigTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/settings/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/connection.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/diagnostics.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/lazy_page.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/log_page.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/shell/run_bar.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/start/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/EditTaskTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/MarkUpWindow.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/ModifyListDialog.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/PythonHighlighter.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/RecordScript.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/ScheduleTaskTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/ScriptPackager.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/TaskManger.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/TaskOpButton.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/TemplateFactory.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/TemplateTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/config_editors.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/config_form.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/mouse_buttons.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/tasks/schedule_index_sync.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/Alert.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/InitWorker.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/app.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/download.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/pip_util.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/pyappify_startup.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/touch_scroll.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/util/windows_thumbnail.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/Card.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/CustomTab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/FlowLayout.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/ImageWidget.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/ImportWarningDialog.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/ListTableWidgetItem.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/NumericTableWidgetItem.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/SortingTableWidgetItem.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/StartLoadingDialog.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/Tab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/TabWidget.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/UpdateConfigWidgetItem.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/ui/qt/widget/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/update/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/update/copy_ok_folder.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/update/inline_ok_requirements.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/Analytics.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/__init__.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/blur.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/clazz.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/collection.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/color.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/config.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/explorer.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/file.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/gpu_driver_settings.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/handler.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/i18n.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/partial_sync_repo.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/print_hwnd.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/process.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/version.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/window.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok/util/windows_schedule.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/entry_points.txt +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/not-zip-safe +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/requires.txt +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/ok_script.egg-info/top_level.txt +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/pyproject.toml +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/setup.cfg +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/setup.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_app.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_base_interaction.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_blur.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_box.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_capture_update.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_cli.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_core_events.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_core_ui_services.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_device_manager.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_diagnosis_page.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_executor_jobs.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_explorer.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_global_config.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_gpu_driver_settings.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_handler.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_headless_imports.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_inline_ok_requirements.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_kit.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_lazy_page.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_log_page.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_logger.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_main_window_notifications.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_main_window_startup_tab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_main_window_system_theme.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_markup_window.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_mcp_cleanup.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_mcp_runner.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_mcp_server.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_mcp_setting.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_missing_frame.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_mouse_buttons.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_navigation_state.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_nemu_ipc_capture.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_notifications.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_ok_mutex.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_overlay_custom_draw.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_overlay_lifecycle.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_package_metadata.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_plugin_staging.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_plugin_tabs.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_plugins.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_process.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_process_mutex.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_pyappify_startup_update.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_qt_events.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_qt_page_layout.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_runtime_startup.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_schedule_startup.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_schedule_task_index_sync.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_screenshot_naming.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_screenshot_rendering.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_skills.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_start_controller.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_task_executor_next_frame.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_task_executor_queue.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_task_reloading.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_template_compression.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_template_generation.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_template_tab.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_touch_scroll.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_translation_fallback.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_ui_config.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_version.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_windows_graphics_capture.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_windows_graphics_hdr.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_windows_schedule_target_parse.py +0 -0
- {ok_script-3.0.4 → ok_script-3.0.5b2}/tests/test_windows_schedule_xml.py +0 -0
|
@@ -724,7 +724,9 @@ class OK:
|
|
|
724
724
|
logger.info(f"ok-script init {config.get('version')}, {sys.argv}, pid={os.getpid()} config: {config}")
|
|
725
725
|
if self.debug:
|
|
726
726
|
logger.debug(f"environment contains {len(os.environ)} entries")
|
|
727
|
-
pyappify.
|
|
727
|
+
# pyappify logs printf-style (log.info("%s", value)), which ok's Logger does not accept.
|
|
728
|
+
from ok.util.logger import get_std_logger
|
|
729
|
+
pyappify.logger = get_std_logger('pyappify')
|
|
728
730
|
logger.info(
|
|
729
731
|
f"pyappify app_version:{pyappify.app_version}, app_profile:{pyappify.app_profile}, pyappify_version:{pyappify.pyappify_version} pyappify_upgradeable:{pyappify.pyappify_upgradeable}, pyappify_executable:{pyappify.pyappify_executable}")
|
|
730
732
|
self._runtime_start_lock = threading.Lock()
|
|
@@ -797,6 +799,11 @@ class OK:
|
|
|
797
799
|
and not self.args.get('headless', False))
|
|
798
800
|
task_arg = self.args.get('task', 0)
|
|
799
801
|
has_task = bool(task_arg) if isinstance(task_arg, str) else task_arg > 0
|
|
802
|
+
if not use_gui:
|
|
803
|
+
# The GUI creates shortcuts once its main window is shown.
|
|
804
|
+
from ok.util.GlobalConfig import basic_options
|
|
805
|
+
from ok.util.shortcut import create_app_shortcut
|
|
806
|
+
create_app_shortcut(self.global_config.get_config(basic_options))
|
|
800
807
|
if not use_gui and has_task:
|
|
801
808
|
self.run_task(task_arg, exit_after=self.args.get('exit', False))
|
|
802
809
|
return
|
|
@@ -1251,21 +1258,10 @@ class OkGlobals:
|
|
|
1251
1258
|
logger.info(f'app path {self.app_path}')
|
|
1252
1259
|
|
|
1253
1260
|
def set_use_dml(self):
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
use_dml =
|
|
1258
|
-
if use_dml_txt_option == 'Auto':
|
|
1259
|
-
nv_free_gpu_memory = get_first_gpu_free_memory_mib()
|
|
1260
|
-
if nv_free_gpu_memory > 3000:
|
|
1261
|
-
use_dml = True
|
|
1262
|
-
logger.info(f'Use DirectML is auto nv_free_gpu_memory: {nv_free_gpu_memory}, use_dml: {use_dml}')
|
|
1263
|
-
elif use_dml_txt_option == 'Yes':
|
|
1264
|
-
use_dml = True
|
|
1265
|
-
if use_dml:
|
|
1266
|
-
window_build_number_str = platform.version().split(".")[-1]
|
|
1267
|
-
window_build_number = int(window_build_number_str) if window_build_number_str.isdigit() else 0
|
|
1268
|
-
use_dml = window_build_number >= 18362
|
|
1261
|
+
# DirectML is no longer a setting: use it wherever Windows supports it (1903+).
|
|
1262
|
+
window_build_number_str = platform.version().split(".")[-1]
|
|
1263
|
+
window_build_number = int(window_build_number_str) if window_build_number_str.isdigit() else 0
|
|
1264
|
+
use_dml = window_build_number >= 18362
|
|
1269
1265
|
logger.info(f'use_dml result is {use_dml}')
|
|
1270
1266
|
self.use_dml = use_dml
|
|
1271
1267
|
|
|
@@ -35,10 +35,66 @@ class StartController:
|
|
|
35
35
|
event = self.__dict__['_cancel_event'] = threading.Event()
|
|
36
36
|
return event
|
|
37
37
|
|
|
38
|
+
@property
|
|
39
|
+
def _pending(self):
|
|
40
|
+
"""Tasks requested by :meth:`start` that are not enabled yet, in request order."""
|
|
41
|
+
state = self.__dict__.get('_pending_state')
|
|
42
|
+
if state is None:
|
|
43
|
+
state = self.__dict__['_pending_state'] = (threading.Lock(), [])
|
|
44
|
+
return state
|
|
45
|
+
|
|
46
|
+
def is_task_pending(self, task):
|
|
47
|
+
"""Whether ``task`` waits for the game to launch before it is queued."""
|
|
48
|
+
lock, tasks = self._pending
|
|
49
|
+
with lock:
|
|
50
|
+
return task in tasks
|
|
51
|
+
|
|
52
|
+
def _add_pending(self, task):
|
|
53
|
+
if task is None or isinstance(task, int):
|
|
54
|
+
return
|
|
55
|
+
lock, tasks = self._pending
|
|
56
|
+
with lock:
|
|
57
|
+
if task not in tasks:
|
|
58
|
+
tasks.append(task)
|
|
59
|
+
communicate.task.emit(task)
|
|
60
|
+
|
|
61
|
+
def _discard_pending(self, task):
|
|
62
|
+
if task is None or isinstance(task, int):
|
|
63
|
+
return False
|
|
64
|
+
lock, tasks = self._pending
|
|
65
|
+
with lock:
|
|
66
|
+
if task not in tasks:
|
|
67
|
+
return False
|
|
68
|
+
tasks.remove(task)
|
|
69
|
+
communicate.task.emit(task)
|
|
70
|
+
return True
|
|
71
|
+
|
|
72
|
+
def cancel_task(self, task):
|
|
73
|
+
"""Drop a task that waits for the game to launch.
|
|
74
|
+
|
|
75
|
+
If the launch in progress was started for that task, stop waiting for
|
|
76
|
+
the game too. Returns whether the task was pending.
|
|
77
|
+
"""
|
|
78
|
+
if not self._discard_pending(task):
|
|
79
|
+
return False
|
|
80
|
+
logger.info(f'cancel pending start of {task}')
|
|
81
|
+
if self.__dict__.get('_active_task') is task:
|
|
82
|
+
self._cancel_requested.set()
|
|
83
|
+
return True
|
|
84
|
+
|
|
38
85
|
def cancel_start(self):
|
|
39
|
-
"""Stop waiting for the game to launch
|
|
86
|
+
"""Stop waiting for the game to launch and drop every task waiting for it.
|
|
87
|
+
|
|
88
|
+
The game process is left running.
|
|
89
|
+
"""
|
|
40
90
|
logger.info('cancel_start requested')
|
|
41
91
|
self._cancel_requested.set()
|
|
92
|
+
lock, tasks = self._pending
|
|
93
|
+
with lock:
|
|
94
|
+
dropped = list(tasks)
|
|
95
|
+
tasks.clear()
|
|
96
|
+
for task in dropped:
|
|
97
|
+
communicate.task.emit(task)
|
|
42
98
|
|
|
43
99
|
def _cancelled(self):
|
|
44
100
|
if self._cancel_requested.is_set():
|
|
@@ -61,19 +117,32 @@ class StartController:
|
|
|
61
117
|
communicate.task.emit(task)
|
|
62
118
|
|
|
63
119
|
def start(self, task=None, exit_after=False):
|
|
120
|
+
"""Launch the game if needed, then run ``task``.
|
|
121
|
+
|
|
122
|
+
Until the game is ready the task is pending: :meth:`is_task_pending`
|
|
123
|
+
reports it and :meth:`cancel_task` drops it.
|
|
124
|
+
"""
|
|
64
125
|
self.starting = True
|
|
126
|
+
self._add_pending(task)
|
|
65
127
|
try:
|
|
66
|
-
self.handler.post(lambda: self.do_start(task, exit_after))
|
|
128
|
+
self.handler.post(lambda: self.do_start(task, exit_after, from_queue=True))
|
|
67
129
|
except Exception:
|
|
68
130
|
self.starting = False
|
|
131
|
+
self._discard_pending(task)
|
|
69
132
|
raise
|
|
70
133
|
|
|
71
|
-
def do_start(self, task=None, exit_after=False):
|
|
134
|
+
def do_start(self, task=None, exit_after=False, from_queue=False):
|
|
135
|
+
if from_queue and task is not None and not isinstance(task, int) and not self.is_task_pending(task):
|
|
136
|
+
logger.info(f'do_start skipped, {task} was cancelled or already started')
|
|
137
|
+
return False
|
|
72
138
|
self.starting = True
|
|
73
139
|
self._cancel_requested.clear()
|
|
140
|
+
self.__dict__['_active_task'] = task
|
|
74
141
|
try:
|
|
75
142
|
return self._do_start(task, exit_after)
|
|
76
143
|
finally:
|
|
144
|
+
self.__dict__['_active_task'] = None
|
|
145
|
+
self._discard_pending(task)
|
|
77
146
|
self.starting = False
|
|
78
147
|
|
|
79
148
|
def _do_start(self, task=None, exit_after=False):
|
|
@@ -138,10 +207,21 @@ class StartController:
|
|
|
138
207
|
logger.info(f"enable_after_start task {start_task}")
|
|
139
208
|
add_task_to_enable(start_task)
|
|
140
209
|
|
|
210
|
+
lock, pending = self._pending
|
|
211
|
+
with lock:
|
|
212
|
+
if task is not None and not isinstance(task, int) and task not in pending:
|
|
213
|
+
logger.info(f'{task} was cancelled while the game was starting')
|
|
214
|
+
task = None
|
|
215
|
+
waiting = list(pending)
|
|
216
|
+
pending.clear()
|
|
217
|
+
|
|
141
218
|
if task:
|
|
142
219
|
add_task_to_enable(task)
|
|
143
220
|
if exit_after:
|
|
144
221
|
task.exit_after_task = True
|
|
222
|
+
# Tasks requested during this launch run once the game is ready.
|
|
223
|
+
for waiting_task in waiting:
|
|
224
|
+
add_task_to_enable(waiting_task)
|
|
145
225
|
|
|
146
226
|
for task in tasks_to_enable:
|
|
147
227
|
self._mark_task_enabled(task)
|
|
@@ -43,6 +43,7 @@ from ok.ui.qt.util.pyappify_startup import get_startup_version_change
|
|
|
43
43
|
from ok.util.GlobalConfig import basic_options, KILL_LAUNCHER_AFTER_START, NOTIFICATION_OPTION_NAME
|
|
44
44
|
from ok.util.clazz import init_class_by_name
|
|
45
45
|
from ok.util.process import restart_as_admin
|
|
46
|
+
from ok.util.shortcut import create_app_shortcut
|
|
46
47
|
|
|
47
48
|
from ok.util.logger import Logger
|
|
48
49
|
|
|
@@ -619,6 +620,7 @@ class MainWindow(KitWindow):
|
|
|
619
620
|
QTimer.singleShot(0, self.bring_to_front)
|
|
620
621
|
QTimer.singleShot(250, self.show_startup_version_change_notice)
|
|
621
622
|
self._startup_update_check()
|
|
623
|
+
create_app_shortcut(self.basic_global_config)
|
|
622
624
|
|
|
623
625
|
# --- geometry -------------------------------------------------------------
|
|
624
626
|
|
|
Binary file
|
|
@@ -1978,6 +1978,46 @@
|
|
|
1978
1978
|
<source>Paused because browser exited</source>
|
|
1979
1979
|
<translation>Paused because browser exited</translation>
|
|
1980
1980
|
</message>
|
|
1981
|
+
<message>
|
|
1982
|
+
<source>Create Start Menu Shortcut</source>
|
|
1983
|
+
<translation>Create Start Menu Shortcut</translation>
|
|
1984
|
+
</message>
|
|
1985
|
+
<message>
|
|
1986
|
+
<source>Create Desktop Shortcut</source>
|
|
1987
|
+
<translation>Create Desktop Shortcut</translation>
|
|
1988
|
+
</message>
|
|
1989
|
+
<message>
|
|
1990
|
+
<source>Create or update the Start Menu shortcut when the app starts</source>
|
|
1991
|
+
<translation>Create or update the Start Menu shortcut when the app starts</translation>
|
|
1992
|
+
</message>
|
|
1993
|
+
<message>
|
|
1994
|
+
<source>Create or update the Desktop shortcut when the app starts</source>
|
|
1995
|
+
<translation>Create or update the Desktop shortcut when the app starts</translation>
|
|
1996
|
+
</message>
|
|
1997
|
+
<message>
|
|
1998
|
+
<source>Game</source>
|
|
1999
|
+
<translation>Game</translation>
|
|
2000
|
+
</message>
|
|
2001
|
+
<message>
|
|
2002
|
+
<source>Tasks</source>
|
|
2003
|
+
<translation>Tasks</translation>
|
|
2004
|
+
</message>
|
|
2005
|
+
<message>
|
|
2006
|
+
<source>Application</source>
|
|
2007
|
+
<translation>Application</translation>
|
|
2008
|
+
</message>
|
|
2009
|
+
<message>
|
|
2010
|
+
<source>Shortcuts</source>
|
|
2011
|
+
<translation>Shortcuts</translation>
|
|
2012
|
+
</message>
|
|
2013
|
+
<message>
|
|
2014
|
+
<source>Developer</source>
|
|
2015
|
+
<translation>Developer</translation>
|
|
2016
|
+
</message>
|
|
2017
|
+
<message>
|
|
2018
|
+
<source>Other</source>
|
|
2019
|
+
<translation>Other</translation>
|
|
2020
|
+
</message>
|
|
1981
2021
|
</context>
|
|
1982
2022
|
<context>
|
|
1983
2023
|
<name>ScheduleTaskTable</name>
|
|
Binary file
|
|
@@ -1976,6 +1976,46 @@
|
|
|
1976
1976
|
<source>Paused because browser exited</source>
|
|
1977
1977
|
<translation>En pausa porque se cerró el navegador</translation>
|
|
1978
1978
|
</message>
|
|
1979
|
+
<message>
|
|
1980
|
+
<source>Create Start Menu Shortcut</source>
|
|
1981
|
+
<translation>Crear acceso directo en el menú Inicio</translation>
|
|
1982
|
+
</message>
|
|
1983
|
+
<message>
|
|
1984
|
+
<source>Create Desktop Shortcut</source>
|
|
1985
|
+
<translation>Crear acceso directo en el escritorio</translation>
|
|
1986
|
+
</message>
|
|
1987
|
+
<message>
|
|
1988
|
+
<source>Create or update the Start Menu shortcut when the app starts</source>
|
|
1989
|
+
<translation>Crear o actualizar el acceso directo del menú Inicio al iniciar la aplicación</translation>
|
|
1990
|
+
</message>
|
|
1991
|
+
<message>
|
|
1992
|
+
<source>Create or update the Desktop shortcut when the app starts</source>
|
|
1993
|
+
<translation>Crear o actualizar el acceso directo del escritorio al iniciar la aplicación</translation>
|
|
1994
|
+
</message>
|
|
1995
|
+
<message>
|
|
1996
|
+
<source>Game</source>
|
|
1997
|
+
<translation>Juego</translation>
|
|
1998
|
+
</message>
|
|
1999
|
+
<message>
|
|
2000
|
+
<source>Tasks</source>
|
|
2001
|
+
<translation>Tareas</translation>
|
|
2002
|
+
</message>
|
|
2003
|
+
<message>
|
|
2004
|
+
<source>Application</source>
|
|
2005
|
+
<translation>Aplicación</translation>
|
|
2006
|
+
</message>
|
|
2007
|
+
<message>
|
|
2008
|
+
<source>Shortcuts</source>
|
|
2009
|
+
<translation>Accesos directos</translation>
|
|
2010
|
+
</message>
|
|
2011
|
+
<message>
|
|
2012
|
+
<source>Developer</source>
|
|
2013
|
+
<translation>Desarrollador</translation>
|
|
2014
|
+
</message>
|
|
2015
|
+
<message>
|
|
2016
|
+
<source>Other</source>
|
|
2017
|
+
<translation>Otros</translation>
|
|
2018
|
+
</message>
|
|
1979
2019
|
</context>
|
|
1980
2020
|
<context>
|
|
1981
2021
|
<name>ScheduleTaskTable</name>
|
|
Binary file
|
|
@@ -1972,6 +1972,46 @@
|
|
|
1972
1972
|
<source>Paused because browser exited</source>
|
|
1973
1973
|
<translation>ブラウザーが終了したため一時停止しました</translation>
|
|
1974
1974
|
</message>
|
|
1975
|
+
<message>
|
|
1976
|
+
<source>Create Start Menu Shortcut</source>
|
|
1977
|
+
<translation>スタートメニューのショートカットを作成</translation>
|
|
1978
|
+
</message>
|
|
1979
|
+
<message>
|
|
1980
|
+
<source>Create Desktop Shortcut</source>
|
|
1981
|
+
<translation>デスクトップのショートカットを作成</translation>
|
|
1982
|
+
</message>
|
|
1983
|
+
<message>
|
|
1984
|
+
<source>Create or update the Start Menu shortcut when the app starts</source>
|
|
1985
|
+
<translation>アプリ起動時にスタートメニューのショートカットを作成または更新します</translation>
|
|
1986
|
+
</message>
|
|
1987
|
+
<message>
|
|
1988
|
+
<source>Create or update the Desktop shortcut when the app starts</source>
|
|
1989
|
+
<translation>アプリ起動時にデスクトップのショートカットを作成または更新します</translation>
|
|
1990
|
+
</message>
|
|
1991
|
+
<message>
|
|
1992
|
+
<source>Game</source>
|
|
1993
|
+
<translation>ゲーム</translation>
|
|
1994
|
+
</message>
|
|
1995
|
+
<message>
|
|
1996
|
+
<source>Tasks</source>
|
|
1997
|
+
<translation>タスク</translation>
|
|
1998
|
+
</message>
|
|
1999
|
+
<message>
|
|
2000
|
+
<source>Application</source>
|
|
2001
|
+
<translation>アプリ</translation>
|
|
2002
|
+
</message>
|
|
2003
|
+
<message>
|
|
2004
|
+
<source>Shortcuts</source>
|
|
2005
|
+
<translation>ショートカット</translation>
|
|
2006
|
+
</message>
|
|
2007
|
+
<message>
|
|
2008
|
+
<source>Developer</source>
|
|
2009
|
+
<translation>開発者</translation>
|
|
2010
|
+
</message>
|
|
2011
|
+
<message>
|
|
2012
|
+
<source>Other</source>
|
|
2013
|
+
<translation>その他</translation>
|
|
2014
|
+
</message>
|
|
1975
2015
|
</context>
|
|
1976
2016
|
<context>
|
|
1977
2017
|
<name>ScheduleTaskTable</name>
|
|
Binary file
|
|
@@ -1977,6 +1977,46 @@
|
|
|
1977
1977
|
<source>Paused because browser exited</source>
|
|
1978
1978
|
<translation>브라우저가 종료되어 일시 중지되었습니다</translation>
|
|
1979
1979
|
</message>
|
|
1980
|
+
<message>
|
|
1981
|
+
<source>Create Start Menu Shortcut</source>
|
|
1982
|
+
<translation>시작 메뉴 바로 가기 만들기</translation>
|
|
1983
|
+
</message>
|
|
1984
|
+
<message>
|
|
1985
|
+
<source>Create Desktop Shortcut</source>
|
|
1986
|
+
<translation>바탕 화면 바로 가기 만들기</translation>
|
|
1987
|
+
</message>
|
|
1988
|
+
<message>
|
|
1989
|
+
<source>Create or update the Start Menu shortcut when the app starts</source>
|
|
1990
|
+
<translation>앱 시작 시 시작 메뉴 바로 가기를 만들거나 업데이트합니다</translation>
|
|
1991
|
+
</message>
|
|
1992
|
+
<message>
|
|
1993
|
+
<source>Create or update the Desktop shortcut when the app starts</source>
|
|
1994
|
+
<translation>앱 시작 시 바탕 화면 바로 가기를 만들거나 업데이트합니다</translation>
|
|
1995
|
+
</message>
|
|
1996
|
+
<message>
|
|
1997
|
+
<source>Game</source>
|
|
1998
|
+
<translation>게임</translation>
|
|
1999
|
+
</message>
|
|
2000
|
+
<message>
|
|
2001
|
+
<source>Tasks</source>
|
|
2002
|
+
<translation>작업</translation>
|
|
2003
|
+
</message>
|
|
2004
|
+
<message>
|
|
2005
|
+
<source>Application</source>
|
|
2006
|
+
<translation>앱</translation>
|
|
2007
|
+
</message>
|
|
2008
|
+
<message>
|
|
2009
|
+
<source>Shortcuts</source>
|
|
2010
|
+
<translation>바로 가기</translation>
|
|
2011
|
+
</message>
|
|
2012
|
+
<message>
|
|
2013
|
+
<source>Developer</source>
|
|
2014
|
+
<translation>개발자</translation>
|
|
2015
|
+
</message>
|
|
2016
|
+
<message>
|
|
2017
|
+
<source>Other</source>
|
|
2018
|
+
<translation>기타</translation>
|
|
2019
|
+
</message>
|
|
1980
2020
|
</context>
|
|
1981
2021
|
<context>
|
|
1982
2022
|
<name>ScheduleTaskTable</name>
|
|
Binary file
|
|
@@ -1974,6 +1974,46 @@
|
|
|
1974
1974
|
<source>Paused because browser exited</source>
|
|
1975
1975
|
<translation>浏览器已退出,任务已暂停</translation>
|
|
1976
1976
|
</message>
|
|
1977
|
+
<message>
|
|
1978
|
+
<source>Create Start Menu Shortcut</source>
|
|
1979
|
+
<translation>创建开始菜单快捷方式</translation>
|
|
1980
|
+
</message>
|
|
1981
|
+
<message>
|
|
1982
|
+
<source>Create Desktop Shortcut</source>
|
|
1983
|
+
<translation>创建桌面快捷方式</translation>
|
|
1984
|
+
</message>
|
|
1985
|
+
<message>
|
|
1986
|
+
<source>Create or update the Start Menu shortcut when the app starts</source>
|
|
1987
|
+
<translation>应用启动时创建或更新开始菜单快捷方式</translation>
|
|
1988
|
+
</message>
|
|
1989
|
+
<message>
|
|
1990
|
+
<source>Create or update the Desktop shortcut when the app starts</source>
|
|
1991
|
+
<translation>应用启动时创建或更新桌面快捷方式</translation>
|
|
1992
|
+
</message>
|
|
1993
|
+
<message>
|
|
1994
|
+
<source>Game</source>
|
|
1995
|
+
<translation>游戏</translation>
|
|
1996
|
+
</message>
|
|
1997
|
+
<message>
|
|
1998
|
+
<source>Tasks</source>
|
|
1999
|
+
<translation>任务</translation>
|
|
2000
|
+
</message>
|
|
2001
|
+
<message>
|
|
2002
|
+
<source>Application</source>
|
|
2003
|
+
<translation>应用</translation>
|
|
2004
|
+
</message>
|
|
2005
|
+
<message>
|
|
2006
|
+
<source>Shortcuts</source>
|
|
2007
|
+
<translation>快捷方式</translation>
|
|
2008
|
+
</message>
|
|
2009
|
+
<message>
|
|
2010
|
+
<source>Developer</source>
|
|
2011
|
+
<translation>开发者</translation>
|
|
2012
|
+
</message>
|
|
2013
|
+
<message>
|
|
2014
|
+
<source>Other</source>
|
|
2015
|
+
<translation>其他</translation>
|
|
2016
|
+
</message>
|
|
1977
2017
|
</context>
|
|
1978
2018
|
<context>
|
|
1979
2019
|
<name>ScheduleTaskTable</name>
|
|
Binary file
|
|
@@ -1972,6 +1972,46 @@
|
|
|
1972
1972
|
<source>Paused because browser exited</source>
|
|
1973
1973
|
<translation>瀏覽器已結束,任務已暫停</translation>
|
|
1974
1974
|
</message>
|
|
1975
|
+
<message>
|
|
1976
|
+
<source>Create Start Menu Shortcut</source>
|
|
1977
|
+
<translation>建立開始功能表捷徑</translation>
|
|
1978
|
+
</message>
|
|
1979
|
+
<message>
|
|
1980
|
+
<source>Create Desktop Shortcut</source>
|
|
1981
|
+
<translation>建立桌面捷徑</translation>
|
|
1982
|
+
</message>
|
|
1983
|
+
<message>
|
|
1984
|
+
<source>Create or update the Start Menu shortcut when the app starts</source>
|
|
1985
|
+
<translation>應用程式啟動時建立或更新開始功能表捷徑</translation>
|
|
1986
|
+
</message>
|
|
1987
|
+
<message>
|
|
1988
|
+
<source>Create or update the Desktop shortcut when the app starts</source>
|
|
1989
|
+
<translation>應用程式啟動時建立或更新桌面捷徑</translation>
|
|
1990
|
+
</message>
|
|
1991
|
+
<message>
|
|
1992
|
+
<source>Game</source>
|
|
1993
|
+
<translation>遊戲</translation>
|
|
1994
|
+
</message>
|
|
1995
|
+
<message>
|
|
1996
|
+
<source>Tasks</source>
|
|
1997
|
+
<translation>任務</translation>
|
|
1998
|
+
</message>
|
|
1999
|
+
<message>
|
|
2000
|
+
<source>Application</source>
|
|
2001
|
+
<translation>應用程式</translation>
|
|
2002
|
+
</message>
|
|
2003
|
+
<message>
|
|
2004
|
+
<source>Shortcuts</source>
|
|
2005
|
+
<translation>捷徑</translation>
|
|
2006
|
+
</message>
|
|
2007
|
+
<message>
|
|
2008
|
+
<source>Developer</source>
|
|
2009
|
+
<translation>開發者</translation>
|
|
2010
|
+
</message>
|
|
2011
|
+
<message>
|
|
2012
|
+
<source>Other</source>
|
|
2013
|
+
<translation>其他</translation>
|
|
2014
|
+
</message>
|
|
1975
2015
|
</context>
|
|
1976
2016
|
<context>
|
|
1977
2017
|
<name>ScheduleTaskTable</name>
|
|
@@ -301,6 +301,30 @@ def tinted_icon(source: QIcon, color) -> QIcon:
|
|
|
301
301
|
return QIcon(_ColorizedIconEngine(source, color))
|
|
302
302
|
|
|
303
303
|
|
|
304
|
+
def is_single_color(source: QIcon, tolerance: int = 32) -> bool:
|
|
305
|
+
"""Whether the artwork draws in one color, so tinting it keeps its look.
|
|
306
|
+
|
|
307
|
+
Monochrome glyphs qualify; logos with several colors, or a glyph on an
|
|
308
|
+
opaque background, do not.
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
image = source.pixmap(QSize(32, 32)).toImage().convertToFormat(QImage.Format.Format_RGBA8888)
|
|
312
|
+
if image.isNull():
|
|
313
|
+
return False
|
|
314
|
+
data = bytes(image.constBits())
|
|
315
|
+
first = None
|
|
316
|
+
# Faint pixels are anti-aliased edges; their color is not reliable.
|
|
317
|
+
for offset in range(0, len(data), 4):
|
|
318
|
+
if data[offset + 3] < 128:
|
|
319
|
+
continue
|
|
320
|
+
rgb = data[offset:offset + 3]
|
|
321
|
+
if first is None:
|
|
322
|
+
first = rgb
|
|
323
|
+
elif max(abs(a - b) for a, b in zip(rgb, first)) > tolerance:
|
|
324
|
+
return False
|
|
325
|
+
return first is not None
|
|
326
|
+
|
|
327
|
+
|
|
304
328
|
def _trim_transparent(image: QImage) -> QImage:
|
|
305
329
|
rgba = image.convertToFormat(QImage.Format.Format_RGBA8888)
|
|
306
330
|
# Ignore nearly invisible export fringes when measuring the artwork.
|
|
@@ -5,17 +5,44 @@ styled by the kit stylesheet and are used directly. This module adds the
|
|
|
5
5
|
inputs that need structure beyond a stylesheet.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from PySide6.QtCore import Qt, Signal
|
|
9
|
-
from PySide6.QtWidgets import QComboBox, QDoubleSpinBox, QFrame, QHBoxLayout, QListView, QSpinBox
|
|
8
|
+
from PySide6.QtCore import QEvent, QObject, Qt, Signal
|
|
9
|
+
from PySide6.QtWidgets import QComboBox, QDoubleSpinBox, QFrame, QHBoxLayout, QListView, QSpinBox, QWidget
|
|
10
10
|
|
|
11
11
|
from ok.ui.qt.kit.buttons import Button
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
class _FocusedWheelFilter(QObject):
|
|
15
|
+
"""Ignores wheel events on widgets that do not have keyboard focus.
|
|
16
|
+
|
|
17
|
+
The ignored event propagates to the parent, so hovering an input inside
|
|
18
|
+
a scroll area scrolls the page instead of changing the value.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def eventFilter(self, obj, event) -> bool:
|
|
22
|
+
if event.type() == QEvent.Type.Wheel and isinstance(obj, QWidget) and not obj.hasFocus():
|
|
23
|
+
event.ignore()
|
|
24
|
+
return True
|
|
25
|
+
return super().eventFilter(obj, event)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_focused_wheel_filter = None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def require_focus_for_wheel(widget: QWidget) -> None:
|
|
32
|
+
"""Make ``widget`` respond to the mouse wheel only while it has focus."""
|
|
33
|
+
global _focused_wheel_filter
|
|
34
|
+
if _focused_wheel_filter is None:
|
|
35
|
+
_focused_wheel_filter = _FocusedWheelFilter()
|
|
36
|
+
widget.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
|
37
|
+
widget.installEventFilter(_focused_wheel_filter)
|
|
38
|
+
|
|
39
|
+
|
|
14
40
|
class ComboBox(QComboBox):
|
|
15
41
|
"""A combo box whose popup items can be styled (rounded, padded rows)."""
|
|
16
42
|
|
|
17
43
|
def __init__(self, items=None, parent=None):
|
|
18
44
|
super().__init__(parent)
|
|
45
|
+
require_focus_for_wheel(self)
|
|
19
46
|
self.setView(QListView(self))
|
|
20
47
|
self.view().window().setWindowFlag(Qt.WindowType.NoDropShadowWindowHint, True)
|
|
21
48
|
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
@@ -43,6 +70,7 @@ class NumberBox(QFrame):
|
|
|
43
70
|
self._spin.setSingleStep(step)
|
|
44
71
|
self._spin.setValue(value)
|
|
45
72
|
self._spin.setKeyboardTracking(False)
|
|
73
|
+
require_focus_for_wheel(self._spin)
|
|
46
74
|
|
|
47
75
|
self.minus_button = Button(icon="minus", variant="subtle")
|
|
48
76
|
self.minus_button.setObjectName("numberMinus")
|
|
@@ -3,7 +3,7 @@ from PySide6.QtGui import QColor, QIcon, QImage, QLinearGradient, QPainter, QPix
|
|
|
3
3
|
from PySide6.QtWidgets import (QButtonGroup, QFrame, QHBoxLayout, QLabel, QPushButton, QScrollArea, QSizePolicy,
|
|
4
4
|
QVBoxLayout, QWidget)
|
|
5
5
|
|
|
6
|
-
from ok.ui.qt.kit.icons import icon as kit_icon
|
|
6
|
+
from ok.ui.qt.kit.icons import icon as kit_icon, is_single_color, tinted_icon
|
|
7
7
|
from ok.ui.qt.kit.labels import Label
|
|
8
8
|
from ok.ui.qt.kit.motion import SlidingIndicator, paint_rounded
|
|
9
9
|
from ok.ui.qt.kit.theme import set_style_property, theme
|
|
@@ -60,12 +60,16 @@ ICON_LEFT = (COMPACT_WIDTH - 2 * SIDEBAR_PADDING - 18) // 2
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
class NavItem(QPushButton):
|
|
63
|
-
"""One navigation entry: icon, text and an optional attention dot.
|
|
63
|
+
"""One navigation entry: icon, text and an optional attention dot.
|
|
64
|
+
|
|
65
|
+
Bundled icons and single-color app artwork take theme colors and the
|
|
66
|
+
selection sweep; multicolor app icons keep their own colors.
|
|
67
|
+
"""
|
|
64
68
|
|
|
65
69
|
def __init__(self, key: str, text: str, icon=None, parent=None):
|
|
66
70
|
super().__init__(parent)
|
|
67
71
|
self.key = key
|
|
68
|
-
self.
|
|
72
|
+
self._set_source(icon)
|
|
69
73
|
self.setCheckable(True)
|
|
70
74
|
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
71
75
|
self.setFixedHeight(36)
|
|
@@ -116,9 +120,14 @@ class NavItem(QPushButton):
|
|
|
116
120
|
self.setToolTip(text)
|
|
117
121
|
|
|
118
122
|
def set_icon(self, icon) -> None:
|
|
119
|
-
self.
|
|
123
|
+
self._set_source(icon)
|
|
120
124
|
self._refresh_icon()
|
|
121
125
|
|
|
126
|
+
def _set_source(self, icon) -> None:
|
|
127
|
+
self._icon_source = icon
|
|
128
|
+
# Recoloring multicolor artwork would flatten it into a silhouette.
|
|
129
|
+
self._tinted = isinstance(icon, str) or (isinstance(icon, QIcon) and is_single_color(icon))
|
|
130
|
+
|
|
122
131
|
def set_badge(self, visible: bool) -> None:
|
|
123
132
|
self.dot.setVisible(visible)
|
|
124
133
|
|
|
@@ -127,9 +136,7 @@ class NavItem(QPushButton):
|
|
|
127
136
|
|
|
128
137
|
def _on_toggled(self, checked: bool) -> None:
|
|
129
138
|
set_style_property(self.text_label, "selected", checked)
|
|
130
|
-
|
|
131
|
-
if checked and isinstance(source, str) and self.isVisible() and self._fill.duration() > 0:
|
|
132
|
-
# Bundled icons are single-color, so they can be recolored; app icons keep theirs.
|
|
139
|
+
if checked and self._tinted and self.isVisible() and self._fill.duration() > 0:
|
|
133
140
|
self._fill.stop()
|
|
134
141
|
self._fill_from = self._icon_pixmap(False)
|
|
135
142
|
self._fill_to = self._icon_pixmap(True)
|
|
@@ -140,7 +147,13 @@ class NavItem(QPushButton):
|
|
|
140
147
|
|
|
141
148
|
def _icon_pixmap(self, selected: bool):
|
|
142
149
|
source = self._icon_source
|
|
143
|
-
|
|
150
|
+
color = "accent" if selected else "text_secondary"
|
|
151
|
+
if isinstance(source, str):
|
|
152
|
+
qicon = kit_icon(source, color, 1.7)
|
|
153
|
+
elif self._tinted:
|
|
154
|
+
qicon = tinted_icon(source, color)
|
|
155
|
+
else:
|
|
156
|
+
qicon = source
|
|
144
157
|
return qicon.pixmap(QSize(18, 18), self.devicePixelRatioF())
|
|
145
158
|
|
|
146
159
|
def _refresh_icon(self) -> None:
|