Commit Graph

10951 Commits

Author SHA1 Message Date
Laurent Monin
84f4ca3f48 Move code from _update_imagelist_state() to metadataitem_update_metadata_images() 2024-05-23 10:05:22 +02:00
Laurent Monin
2aa4e12525 imagelist._remove_images() -> Metadate.remove_images() 2024-05-23 10:05:22 +02:00
Laurent Monin
8111f4fe75 imagelist._add_images() -> Metadata.add_images() 2024-05-23 10:05:22 +02:00
Laurent Monin
3ce951bd47 imagelist._process_images() -> ImageListState.process_images() 2024-05-23 10:05:22 +02:00
Laurent Monin
8ff5f7a92c imagelist._get_metadata_images() -> ImageListState.get_metadata_images() 2024-05-23 10:05:22 +02:00
Laurent Monin
24cacb9be4 imagelist._get_state() -> MetadataItem._get_imagelist_state() 2024-05-23 10:05:22 +02:00
Laurent Monin
c6dde741a3 imagelist._update_state() -> MetadataItem._update_imagelist_state() 2024-05-23 10:05:22 +02:00
Laurent Monin
18e8a24810 Use proper keyword argument when calling Album.update(boolean) 2024-05-23 10:05:22 +02:00
Laurent Monin
1c75c82eea Move update_metadata_images() from imagelist to MetadataItem.metadataitem_update_metadata_images()
The long name is to avoid conflicts with existing update_metadata_images() in Album/Cluster
2024-05-23 10:05:22 +02:00
Laurent Monin
df8fa5f330 Move add_metadata_images() to MetadataItem 2024-05-23 10:05:22 +02:00
Laurent Monin
6db8ae5382 Move remove_metadata_images() from imagelist to MetadataItem
- it doesn't belong here anyway
- it depends on an object passed as obj -> self
- transitional: local imports
2024-05-23 10:05:22 +02:00
Laurent Monin
e246eaa6b9 Introduce MetadataItem as a subclass of Item
It defines:
- metadata & orig_metadata properties
- metadata_images_changed signal
- move methods related to metadata from FileListItem to it
2024-05-23 10:05:22 +02:00
Laurent Monin
ebf6bfeabd Move picard.ui.item to picard.item
- classes defined here are mainly used at top level
- they aren't specific to UI, as they are used to define important classes like Cluster, Album, etc...
- there's not even any Qt import in there
2024-05-23 10:05:22 +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