Commit Graph

10913 Commits

Author SHA1 Message Date
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
wileyfoxyx
205037081e Translated using Weblate (Russian)
Currently translated at 46.3% (482 of 1041 strings)

Translated using Weblate (Russian)

Currently translated at 100.0% (15 of 15 strings)

Translated using Weblate (Russian)

Currently translated at 100.0% (17 of 17 strings)

Translated using Weblate (Russian)

Currently translated at 56.2% (680 of 1208 strings)

Co-authored-by: wileyfoxyx <wileyfoxyx@users.noreply.translations.metabrainz.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/ru/
Translate-URL: https://translations.metabrainz.org/projects/picard/3/appstream/ru/
Translate-URL: https://translations.metabrainz.org/projects/picard/3/constants/ru/
Translate-URL: https://translations.metabrainz.org/projects/picard/3/installer/ru/
Translation: Picard/App
Translation: Picard/AppStream
Translation: Picard/Constants
Translation: Picard/Installer
2024-05-19 17:42:30 +00:00
Laurent Monin
86736c5cc1 normalized_types(): ensure front type is first and the rest sorted
It fixes a minor issue where back cover could appear before front cover in dialogs showing those
2024-05-19 17:31:22 +02:00
Laurent Monin
970c6d3b61 Merge pull request #2479 from zas/infodialog_cleanup
Infodialog cleanup
2024-05-19 13:10:10 +02:00
Laurent Monin
38304afadc Merge pull request #2476 from zas/metadatabox_cleanup
Metadatabox cleanup
2024-05-19 13:07:28 +02:00
Laurent Monin
c18febd534 Subclass ArtworkTable and drop display_existing_artwork
- Make ArtworkTable more generic
- Add 2 subclasses ArtworkTableSimple & ArtworkTableExisting
2024-05-18 17:27:42 +02:00
Laurent Monin
faf266bdde ArtworkTable: introduce get_column_index() method and drop access to private properties 2024-05-18 16:57:14 +02:00
Laurent Monin
12678e4b37 ArtworkTable: insert column at NUM_COLS position 2024-05-18 16:38:23 +02:00
Laurent Monin
2b09b9c46d ArtworkTable: shorten lines and reduce code redundancy 2024-05-18 16:37:13 +02:00
Laurent Monin
56de836fa5 ArtworkTable: stretch last section 2024-05-18 16:36:24 +02:00
Laurent Monin
e75822e6f6 ArtworkTable: use class properties instead of hardcoded numbers 2024-05-18 16:35:57 +02:00
Laurent Monin
df1041767c ArtworkTable: pass parent to inherited class and class properties instead of hardcoded numbers for rows & cols 2024-05-18 16:34:08 +02:00
Laurent Monin
72c7c60fd5 Variables orig_tags and new_tags aren't needed, drop keys() as it's the default for dicts 2024-05-17 22:33:19 +02:00
Laurent Monin
14db96d5d1 Add two helper functions to toggle between grouped and normal values 2024-05-17 20:04:10 +02:00
Laurent Monin
a095e31f42 different -> is_grouped 2024-05-17 19:49:41 +02:00
Laurent Monin
138996d219 Use a namedtuple for display values, with fields text and is_grouped
- it makes things a bit clearer
- it will be easier to add new fields
2024-05-17 19:41:00 +02:00
Laurent Monin
be261bb9d3 _update_items(): regroup code per column
- alignment never changes, move it outside the loop
- set new_item flags once at object creation
- it makes the code a bit easier to read imho
2024-05-17 18:18:37 +02:00
Laurent Monin
4e1ff55274 Consistency: we use tag instead of name everywhere else in the file 2024-05-17 17:52:13 +02:00
Laurent Monin
43a11032df Minor code redundancy reduction 2024-05-17 17:48:59 +02:00
Laurent Monin
f82c5ac1dd Use self.tag_diff after it was set to result
It will make it easier to move code
2024-05-17 17:46:03 +02:00
Laurent Monin
6ed7802777 Use if/continue instead of filter(lambda...), more readable 2024-05-17 17:40:53 +02:00
Laurent Monin
6157063671 name -> tag (as we iterate among tags) 2024-05-17 17:36:58 +02:00
Laurent Monin
1d06036d1b Use named columns instead of numerical values 2024-05-17 17:30:16 +02:00
Laurent Monin
6a1d568152 Test if methods listed in MetadataBox.LOOKUP_TAGS are valid FileLookup methods 2024-05-17 17:11:00 +02:00
Laurent Monin
94ff51ec37 Drop _lookup_tags() in favor of new _lookup_tag(tag)
- define methods to use as strings and use getattr()
2024-05-17 16:43:48 +02:00
Laurent Monin
953bdbcbbc set_item_value() -> _set_item_value() 2024-05-17 16:31:05 +02:00
Laurent Monin
7a620f0fbd _selected_tags(): make it a generator 2024-05-17 16:31:05 +02:00
Laurent Monin
888df2349e selected_tags() -> _selected_tags() 2024-05-17 16:31:05 +02:00
Laurent Monin
03968083c4 remove_selected_tags(): no need to check if tag is removable, as the list is filtered already 2024-05-17 16:31:05 +02:00
Laurent Monin
8e53ebbd05 tag_is_(removable|editable)() -> _tag_is_(removable|editable)() 2024-05-17 16:31:05 +02:00
Laurent Monin
901acc91a5 remove_tag() -> _remove_tag() 2024-05-17 16:31:05 +02:00
Laurent Monin
d1a9f0d519 set_tag_values() -> _set_tag_values() 2024-05-17 16:20:53 +02:00
Laurent Monin
02d191d2d7 toggle_changes_first() -> _toggle_changes_first() 2024-05-17 16:20:53 +02:00
Laurent Monin
a106bc97ee edit_selected_tag() -> _edit_selected_tag() 2024-05-17 16:20:53 +02:00