Commit Graph

10946 Commits

Author SHA1 Message Date
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
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
Laurent Monin
2835732962 match -> match_: match is a statement in Python 3.10+
It doesn't really conflict with variable name but it confuses syntax highlighters (if they are Python 3.10+ aware ofc)
2024-05-25 12:21:31 +02:00
Laurent Monin
b5aedad683 Merge pull request #2490 from zas/clustering
Clustering: use tuple and improve debug logging
2024-05-24 13:46:24 +02:00
Laurent Monin
cbf4adc2ba Fix and improve Clustering debug output
- it was logging something like `Clustering <itertools.chain object at 0x7f318466ae60>`
- Now it will log something like:
`Clustering 21 files: (<FLACFile '1-01 Amsterdam, Amsterdam!.flac'>, <FLACFile '1-02 Them There Eyes.flac'>, <FLACFile "1-03 Sinner's Prayer.flac">, <FLACFile "1-04 Can't Let Go.flac">, <FLACFile '1-05 For My Friends.flac'>) and 16 more files...
`
- logged sequence of files is truncated to 5 files, but the number of files is shown in all cases
2024-05-24 12:18:31 +02:00
Laurent Monin
745767bcce cluster()/_do_clustering(): pass files as tuple instead of list
- the sequence isn't modified anywhere between cluster() and _clustering_finished() (that loops over it)
2024-05-24 12:15:24 +02:00
Laurent Monin
17c7768a5e Add missing self.tagger initializations (#2489)
Forgotten from cca828c7b7
2024-05-22 23:48:07 +02:00
Philipp Wolfer
c62c0cdb6f Merge pull request #2484 from zas/collection_menu_cleanup
Collection menu cleanup
2024-05-22 18:24:06 +02:00
Philipp Wolfer
633df8b53b Build with PyInstaller 6.7.0 2024-05-22 10:18:46 +02:00
Laurent Monin
12d0641138 Merge pull request #2481 from zas/infodialog_cleanup2
Infodialog cleanup2
2024-05-21 22:21:59 +02:00
Laurent Monin
440a8cbe50 Merge pull request #2483 from zas/restore_color_default
PICARD-2904: Interface colors: Let the user restore only one color to default
2024-05-21 22:16:54 +02:00
Laurent Monin
fc4bf63b50 Merge pull request #2482 from zas/configurable_colors
Make few more colors configurable
2024-05-21 22:14:13 +02:00
Laurent Monin
762e897512 Rename from generic Ui_Dialog to proper Ui_CDLookupDialog and Ui_OptionsDialog 2024-05-21 21:42:22 +02:00
Laurent Monin
f1ba9c83b8 PICARD-2906: fix the behavior of the Pause button in internal player
Properly resume after a pause, do not disable the button randomly
Add a bunch of useful player attributes: is_playing, is_paused, is_stopped
2024-05-21 21:38:46 +02:00
Laurent Monin
632f0805d8 Properly ignore hovered signal when set to do so
`update_active_action_for_widget()` is using `self._ignore_hover` flag to disable handling of hovered signal,
but this wasn't actually used, because, I think, of a typo in hovered signal handler which was testing `self._ignore_update` instead.
Also `_ignore_hover` wasn't initialized.
2024-05-21 15:12:50 +02:00
Laurent Monin
5f6e64c990 CollectionCheckBox: updateText() -> _update_text()
Camel-case was making the reader think it was an overloaded method, and that's not the case.
2024-05-21 15:02:55 +02:00
Laurent Monin
4fb4a66d85 CollectionCheckBox: label() -> _label() 2024-05-21 14:58:01 +02:00
Laurent Monin
3b08914418 update_highlight() -> _on_hovered() 2024-05-21 14:55:26 +02:00
Laurent Monin
befe6a808e refresh_list() -> _refresh_list() 2024-05-21 14:51:57 +02:00
Laurent Monin
8f8cfa7f91 Always pass *args, **kwargs to parent Qt objects 2024-05-21 14:47:58 +02:00
Laurent Monin
800a005ab4 CollectionMenu.update_collections() -> _update_collections() 2024-05-21 14:47:17 +02:00
Laurent Monin
10521be809 CollectionMenu.__init__(): also pass keyword arguments to parent class 2024-05-21 14:37:25 +02:00
Laurent Monin
c5faa125a6 Use user_collections.values() as id_ isn't used, and drop numerical indexes 2024-05-21 14:34:46 +02:00
Laurent Monin
baf73f0825 Interface colors: Let the user restore only one color to default 2024-05-21 12:00:05 +02:00
Laurent Monin
444d9067a2 Make color of first cover highlight configurable 2024-05-21 11:16:40 +02:00
Laurent Monin
41d2d013c8 Make row highlight configurable
This one is used to highlight current album in release group search from Other versions dialog
Defaults are unchanged.
2024-05-21 11:16:12 +02:00
Laurent Monin
819f89b1f4 Use hasattr() and shorten line 2024-05-20 19:50:51 +02:00
Laurent Monin
2fb190c08c Only setData() if there's an image to display
This is used on double-click action to call external viewer, but if image failed to load no point in this
2024-05-20 18:30:20 +02:00
Laurent Monin
e81a898cf0 Introduce ArtworkRow class
- Replace dict + keys with object + properties
- clearly mark the difference between columns and image sources (new/orig stuff)
2024-05-20 18:30:20 +02:00
Laurent Monin
e8fcfdac70 Make _build_artwork_rows() a generator
And relies on dict(enumerate()) to initialize artwork_rows
2024-05-20 18:30:20 +02:00
Laurent Monin
bdbdc11985 Set artwork_rows after looking for matching new image 2024-05-20 18:30:20 +02:00
Laurent Monin
90bd1e39b8 Call _build_artwork_rows() from _display_artwork_rows() 2024-05-20 18:30:20 +02:00
Laurent Monin
40f3e14c4c _display_artwork_rows(): only iterate existing columns
- rename source to colname
- add a property to ArtworkTable classes, named artwork_columns, listing ... artwork columns
- get rid of exception handling in _display_artwork_image_cell()
2024-05-20 18:30:20 +02:00
Laurent Monin
7884daf810 _display_artwork_image_cell(): always create an item even if empty
- it avoids having editable text in empty cells
2024-05-20 18:30:20 +02:00
Laurent Monin
398ffd0c29 Fix double-click on type cell, return if no data 2024-05-20 18:30:20 +02:00
Laurent Monin
7ccb3bb06a Rework artwork tooltips
- properly escape content as the presence of html-like tags may cause it to switch to rich-text
- filenames displayed could contain such
- since it makes the tooltip rich-text, use strong/em to format text
- as a side effect, tooltip text will automatically wrap, it avoids display issues with very long paths
2024-05-20 18:30:20 +02:00
Laurent Monin
3bdf5f30d2 Introduce _artwork_infos(): properly escape lines
A comment can contain html-like tags
2024-05-20 18:30:20 +02:00
Laurent Monin
6c9898686c Change the artwork tab content building logic totally
- it fixes a lot of issues regarding matching old to new cover art
- build rows first, display them row by row (before it was displaying column after column)
- code is much simpler and easier to follow
- keep orig / new naming scheme as it makes clear where the images are coming from
- display arrow in only one case: there are 2 images in new/orig and their types are matching
- images are sorted once at start (and this is taking care of front images first, matching comments, etc)
- before medium/comment A | medium/comment B could be matched to medium/comment B | medium/comment A, now the correct thing should happen
2024-05-20 18:30:20 +02:00
Laurent Monin
b90d948561 Use normalized_types() as key instead of types_as_string() 2024-05-20 18:30:20 +02:00
Laurent Monin
ad2753cacc Make CoverArtImage sortable + matching tests 2024-05-20 18:30:20 +02:00
Laurent Monin
6bddf8e1b4 normalized_types(): return a tuple (hashable) 2024-05-20 18:30:20 +02:00
Laurent Monin
fd1ec5cb39 Make DataHash sortable (based on _hash, arbitrary order) 2024-05-20 18:30:20 +02:00
Laurent Monin
d80e23d5e6 Introduce coverart.utils.translated_types_as_string() 2024-05-20 18:30:20 +02:00
Laurent Monin
75110e3203 If there's no image to display just hide the tab and return 2024-05-20 18:30:20 +02:00
Laurent Monin
54d2d60dd9 Simplify images/existing_images/artworktable_class related code 2024-05-20 18:30:20 +02:00
Laurent Monin
3887c8655a Reduce the size of the arrow in cover art display
- Pass an optional size parameter
- use half size for the arrow
2024-05-20 18:30:20 +02:00
Laurent Monin
6a2ad04846 Declare common pixmaps once 2024-05-20 18:30:20 +02:00
Laurent Monin
fb4d82e2b0 _display_artwork(): make rows/image types matching more efficient and easier to understand 2024-05-20 18:30:20 +02:00