Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
bc76692
Improve 'format_tooltip' logic
jnsebgosselin Nov 5, 2025
9996519
Create shortcuts.py
jnsebgosselin Nov 5, 2025
c28cf8b
Add lazy imports to the managers module
jnsebgosselin Nov 5, 2025
6eeb295
Update __init__.py
jnsebgosselin Nov 5, 2025
3916b3b
Refactor ui sync logic
jnsebgosselin Nov 6, 2025
4daa293
Don't save default keyseq to user config
jnsebgosselin Nov 6, 2025
e032034
Improve conflict handling logic
jnsebgosselin Nov 6, 2025
8e89db6
Set back default key seq to default config (correctly this time)
jnsebgosselin Nov 6, 2025
dbdce05
Add ActionMenuSyncTranslator
jnsebgosselin Nov 11, 2025
e65e9c2
Improve check shortcuts logic
jnsebgosselin Nov 11, 2025
9079d44
ShortcutItem: add key_sequence property
jnsebgosselin Nov 16, 2025
7822d6e
ShortcutManager: rename 'update_key_sequence'
jnsebgosselin Nov 16, 2025
8784add
Major rework to allow separate declaration and binding shortcut opera…
jnsebgosselin Nov 27, 2025
a9c3082
Merge branch 'add_shortcut_manager' of https://github.com/geo-stack/q…
jnsebgosselin Nov 27, 2025
3508866
Remove '__post_init__' from 'ShortcutDefinition'
jnsebgosselin Nov 27, 2025
6c5c26b
Fix minor regression bug in format_tooltip
jnsebgosselin Dec 8, 2025
4b8de4d
Make 'ShortcutItem' a standard class with a __init__
jnsebgosselin Dec 9, 2025
eff6946
Return '' key_sequence when shortcut is None and add calls to '_updat…
jnsebgosselin Dec 9, 2025
153de0e
Fix ShortcutManager.declare_shortcut default_key management
jnsebgosselin Dec 9, 2025
abf3afc
Update wrong class attribute name
jnsebgosselin Dec 9, 2025
b52238e
Rename 'iter_bound_shortcuts'
jnsebgosselin Dec 9, 2025
6710056
Create test_shortcut_manager.py
jnsebgosselin Dec 9, 2025
b382d33
Remove deps to appconfigs
jnsebgosselin Dec 9, 2025
44bb246
Fix appconfig import
jnsebgosselin Dec 9, 2025
c1954ec
Fix Type hint and bump Python test version to 3.11
jnsebgosselin Dec 9, 2025
8f2a8c9
Fix cp error handling
jnsebgosselin Dec 13, 2025
44be201
Add console warning utility with color output
jnsebgosselin Dec 17, 2025
2af8070
Update imports
jnsebgosselin Dec 17, 2025
d985f8d
Add blocklist support for reserved shortcut keys
jnsebgosselin Dec 17, 2025
85a6666
Add method to print all shortcuts in a table
jnsebgosselin Dec 17, 2025
657aa54
Use print_warning for shortcut conflict messages
jnsebgosselin Dec 17, 2025
0f34330
Refactor and rename set_key_sequence to set_shortcut
jnsebgosselin Dec 17, 2025
442ccf0
Fix method call in print_shortcuts_table
jnsebgosselin Dec 17, 2025
5adbf0c
Update test_shortcut_manager.py
jnsebgosselin Dec 17, 2025
eff0a56
Update warning title from 'Shortcut Error' to 'ShortcutError'
jnsebgosselin Dec 17, 2025
361b584
Add test_blocklist
jnsebgosselin Dec 17, 2025
5f948a1
Don't raise error in 'declare_shortcut', only warns
jnsebgosselin Dec 17, 2025
1bc89c0
Update test_shortcut_manager.py
jnsebgosselin Dec 17, 2025
388f9f5
Update test_shortcut_manager.py
jnsebgosselin Dec 17, 2025
35e5568
Add test_print_shortcuts
jnsebgosselin Dec 17, 2025
d0b960a
Remove trailing newline from warning print output
jnsebgosselin Dec 17, 2025
1ea3aee
Remove redundant QKeySequence validation in ShortcutManager
jnsebgosselin Dec 18, 2025
bd56b93
Add 'test_shortcut_controls'
jnsebgosselin Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

permissions:
contents: read

jobs:
build:

Expand All @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
66 changes: 64 additions & 2 deletions qtapputils/managers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,67 @@
# This file is part of QtAppUtils.
# Licensed under the terms of the MIT License.
# -----------------------------------------------------------------------------
from .taskmanagers import WorkerBase, TaskManagerBase, LIFOTaskManager
from .fileio import SaveFileManager
import importlib
from typing import TYPE_CHECKING
if TYPE_CHECKING:
# Direct imports for type-checking and IDE introspection.
from .taskmanagers import WorkerBase, TaskManagerBase, LIFOTaskManager
from .fileio import SaveFileManager
from .shortcuts import (
ShortcutManager, TitleSyncTranslator, ToolTipSyncTranslator,
ActionMenuSyncTranslator)
else:
# Module-level exports for explicit __all__.
__all__ = [
'WorkerBase',
'TaskManagerBase',
'LIFOTaskManager',
'SaveFileManager',
'ShortcutManager',
'TitleSyncTranslator',
'ToolTipSyncTranslator',
'ActionMenuSyncTranslator',
]

# Lazy import mapping.
__LAZYIMPORTS__ = {
'WorkerBase': 'qtapputils.managers.taskmanagers',
'TaskManagerBase': 'qtapputils.managers.taskmanagers',
'LIFOTaskManager': 'qtapputils.managers.taskmanagers',
'SaveFileManager': 'qtapputils.managers.fileio',
'ShortcutManager': 'qtapputils.managers.shortcuts',
'TitleSyncTranslator': 'qtapputils.managers.shortcuts',
'ToolTipSyncTranslator': 'qtapputils.managers.shortcuts',
'ActionMenuSyncTranslator': 'qtapputils.managers.shortcuts'
}

def __getattr__(name):
if name in __LAZYIMPORTS__:
module_path = __LAZYIMPORTS__[name]

try:
module = importlib.import_module(module_path)
attr = getattr(module, name)
globals()[name] = attr

return attr

except ImportError as e:
raise ImportError(
f"Failed to lazy import {name!r} from {module_path!r}: {e}"
) from e

except AttributeError as e:
raise AttributeError(
f"Module {module_path!r} has no attribute {name!r}"
) from e

# Standard AttributeError for unknown attributes
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

def __dir__():
return sorted(set(
list(globals().keys()) +
list(__LAZYIMPORTS__.keys()) +
list(__all__)
))
Loading