Laurent Monin
037128a88c
Collection: defined as subclass of QObject but QObject.__init__() is not called
...
Just make it a normal Python object
2024-05-28 13:40:41 +02:00
Laurent Monin
2d05dc7dd9
ScriptingDocumentationDialog: pass parent as keyword argument
...
- PreserveGeometry needs to accept arguments (even if they are unused) because __init__() is called from PicardDialog via super()
- PicardDialog calls also QtWidgets.QDialog.__init__(), use proper keyword arguments for it
2024-05-28 13:21:43 +02:00
Laurent Monin
38e0174834
MetadataBox(): pass parent by keyword argument and do not redefine a parent property
...
- do not use parent as main window object, use self.tagger.window
- it reveals an chicken-egg issue: we try to update metadata even before the main window is initialized
2024-05-28 13:00:07 +02:00
Laurent Monin
325e887edc
ActiveLabel/CoverArtThumbnail: fix funky parameters, pass parent via keyword argument
2024-05-28 12:31:15 +02:00
Laurent Monin
3c052c9982
Merge pull request #2500 from zas/update_metadata_images_context
...
Introduce MetadataItem.suspend_metadata_images_update context manager
2024-05-27 21:49:25 +02:00
Laurent Monin
3ad7a5a90b
Introduce MetadataItem.suspend_metadata_images_update context manager
...
It just enable/disable update_metadata_images_enabled
2024-05-27 21:23:42 +02:00
Laurent Monin
79c227c4d4
Merge pull request #2501 from zas/color_groups
...
Options > Interface > Colors: Separate colors in different groups
2024-05-27 19:09:39 +02:00
Laurent Monin
f191de9bef
Options > Interface > Colors: Separate colors in different groups
...
- properly sort colors in each group (locale-aware)
- use group boxes
- add ColorDescription class with 2 fields: title & group
2024-05-27 15:05:32 +02:00
Laurent Monin
5e24e8047d
Merge pull request #2496 from zas/list_of_scripts
...
Introduce TaggingScriptSetting and few associated methods
2024-05-27 12:32:34 +02:00
Laurent Monin
40ca58436a
Merge pull request #2499 from zas/script_syntax_style
...
Script syntax style adjustements
2024-05-27 12:32:03 +02:00
Laurent Monin
b1f327252d
Move iter_active_tagging_scripts() generator near over iter_*() methods
2024-05-27 12:17:03 +02:00
Laurent Monin
a5a13e01a2
unicode -> drop italic, it can now have its own color if needed
2024-05-27 12:13:46 +02:00
Laurent Monin
145b5e0949
syntax_hl_error -> red / light red for light/dark theme
2024-05-27 12:12:30 +02:00
Laurent Monin
9548b75293
PicardFileNamingScript -> FileNamingScriptInfo
2024-05-27 12:06:17 +02:00
Laurent Monin
10160b5848
PicardTaggingScript -> TaggingScriptInfo
2024-05-27 12:04:35 +02:00
Laurent Monin
d9e89bf5a9
PicardScript -> ScriptSerializer
2024-05-27 12:03:04 +02:00
Laurent Monin
929214b3f7
FileNamingScript -> PicardFileNamingScript
2024-05-27 11:59:07 +02:00
Laurent Monin
e95665d704
Introduce PicardScriptImportError/PicardScriptExportError
...
They are subclassing PicardScriptImportExportError
2024-05-27 11:59:07 +02:00
Laurent Monin
f1c5bb4e48
Introduce a base exception class PicardScriptError
2024-05-27 11:59:07 +02:00
Laurent Monin
e46428c3a4
ScriptImportExportError -> PicardScriptImportExportError
2024-05-27 11:59:07 +02:00
Laurent Monin
4fc43af380
ScriptImportError -> PicardScriptFromFileError
2024-05-27 11:59:07 +02:00
Laurent Monin
3761c7e492
TaggingScript -> PicardTaggingScript
...
- it's less ambiguous vs TaggingScriptSetting
- it's a subclass of PicardScript
2024-05-27 11:59:07 +02:00
Laurent Monin
dec700e9ed
Consistently name list items list_item(s)
2024-05-27 11:59:07 +02:00
Laurent Monin
e70d1fbda0
script_item -> tagging_script
2024-05-27 11:59:07 +02:00
Laurent Monin
9bf130dc06
export_script(): rename variables and simplify code
2024-05-27 11:59:07 +02:00
Laurent Monin
1f49e7809f
Replace enabled_tagger_scripts_texts() with iter_active_tagging_scripts()
...
- it iterates over enabled and non-empty tagger scripts
- it yields TaggingScriptSetting objects
2024-05-27 11:59:07 +02:00
Laurent Monin
2207e9f034
Pass TaggingScriptSetting instance if possible
2024-05-27 11:59:07 +02:00
Laurent Monin
fe88e79665
Use iter_tagging_scripts_from_*()
2024-05-27 11:59:07 +02:00
Laurent Monin
e801f83da4
Introduce TaggingScriptSetting and few helper methods
2024-05-27 11:59:07 +02:00
Laurent Monin
cdbf6431b2
Merge pull request #2498 from zas/config_syntax_colors
...
PICARD-2913: Let user configure syntax highlighting colors
2024-05-27 11:33:22 +02:00
Philipp Wolfer
bf454353b9
update plural rules in Spanish and Italian po files
2024-05-27 08:52:33 +02:00
Laurent Monin
a2906f2853
Let user configure syntax highlighting colors
2024-05-26 20:36:04 +02:00
Laurent Monin
1676cf1dba
Merge pull request #2497 from phw/missing-function-tooltip
...
PICARD-2912: Show a tooltip for missing functions in script editor
2024-05-26 16:31:56 +02:00
Philipp Wolfer
f95ac57379
PICARD-2912: Show a tooltip for missing functions in script editor
2024-05-26 11:33:10 +02:00
Laurent Monin
27a6caac1d
Merge pull request #2491 from zas/ignoreupdatescontext
...
Improve IgnoreUpdatesContext and use it for MainWindow sorting
2024-05-26 11:05:36 +02:00
Laurent Monin
5f21a6b5b9
Merge pull request #2488 from zas/image_list_cleanup
...
Image list cleanup
2024-05-26 11:05:16 +02:00
Laurent Monin
4de1cf830f
Merge pull request #2492 from zas/scripteditor_hl
...
PICARD-2912: Script editor syntax highlighting fixes and improvements
2024-05-26 11:00:02 +02:00
Philipp Wolfer
f78d02e415
Fix misleading comment on dark theme colors
2024-05-26 10:41:24 +02:00
Laurent Monin
99e9cfe9c2
Introduce HighlightFormat and HighlightRule classes, simplify code
2024-05-25 22:08:14 +02:00
Laurent Monin
548a7f092b
No need to make all regex and matching formats properties, move them near their use
...
- Most are used once to build rules
- rules themselves are stored in a property
2024-05-25 22:08:14 +02:00
Laurent Monin
383716783e
Use a namedtuple to describe rules
...
Suggested by rdswift
2024-05-25 22:08:14 +02:00
Laurent Monin
5b565eba7d
Avoid using match as variable name
...
See https://docs.python.org/3/reference/compound_stmts.html#the-match-statement
2024-05-25 22:08:14 +02:00
Laurent Monin
2735b54403
If a rule already matched a part of the text, don't apply next rules
...
So first rules have priority over later ones.
2024-05-25 22:08:14 +02:00
Laurent Monin
fb699cbda7
Properly match existing functions, and differentiate them from unknown ones
...
Before this patch, `$numXXX()` was highlighted the same way as `$num()`, even though it was raising a syntax error.
After this patch they have different formats.
2024-05-25 22:08:14 +02:00
Laurent Monin
3ef967a3d7
Fix special_re matching, causing alternative colors on sequence of commas and parenthesis
...
Before this patch, ",,,," was handled as ",," and ",," subsets, and only last character was highlighted.
Use a negative lookbehind assertion to avoid this issue, it still handles escaped characters.
2024-05-25 22:08:14 +02:00
Laurent Monin
cbc425c7d7
Add few blank lines to make code easier to read
2024-05-25 22:08:14 +02:00
Laurent Monin
e4168b5385
Merge pull request #2494 from zas/avoid_using_match
...
match -> match_: match is a statement in Python 3.10+
2024-05-25 19:56:08 +02:00
Laurent Monin
d771f6f3e9
Introduce ProgressStatus class and use an instance of it to pass values around
2024-05-25 19:03:39 +02:00
Laurent Monin
c774465605
Fix AttributeError: 'ScriptEditorDialog' object has no attribute 'unsaved_changes_confirmation'
...
Traceback (most recent call last):
File "/home/zas/src/picard/./picard/ui/mainwindow/__init__.py", line 300, in closeEvent
if not self.script_editor_dialog.unsaved_changes_confirmation():
AttributeError: 'ScriptEditorDialog' object has no attribute 'unsaved_changes_confirmation'. Did you mean: 'unsaved_changes_in_profile_confirmation'?
This issue was introduced in e253ef4956
2024-05-25 18:58:38 +02:00
Laurent Monin
b1bd41016a
Fix AttributeError: 'ScriptEditorDialog' object has no attribute 'unsaved_changes_confirmation'
...
Traceback (most recent call last):
File "/home/zas/src/picard/./picard/ui/mainwindow/__init__.py", line 300, in closeEvent
if not self.script_editor_dialog.unsaved_changes_confirmation():
AttributeError: 'ScriptEditorDialog' object has no attribute 'unsaved_changes_confirmation'. Did you mean: 'unsaved_changes_in_profile_confirmation'?
This issue was introduced in e253ef4956
2024-05-25 18:57:35 +02:00