Commit Graph

10972 Commits

Author SHA1 Message Date
Laurent Monin
86ba49aeb1 ImageList._changed -> _dirty 2024-05-23 14:18:34 +02:00
Laurent Monin
d45dd9bf57 Drop now unused update_new_metadata/update_orig_metadata 2024-05-23 13:40:23 +02:00
Laurent Monin
84445b1399 Reduce code redundancy 2024-05-23 13:25:16 +02:00
Laurent Monin
6743b42c87 Use getattr() and rename variables to make duplicated code even more obvious 2024-05-23 13:16:56 +02:00
Laurent Monin
492bfea73a Introduce iter_children_items_metadata() and finally make the code deduplication possible 2024-05-23 13:07:05 +02:00
Laurent Monin
df0f11cc9f Move ImageListState declaration where it is used (only one place) 2024-05-23 12:34:19 +02:00
Laurent Monin
99b8e60c2d Move variables declarations where they are used 2024-05-23 12:30:03 +02:00
Laurent Monin
7223de0db2 Make ImageListState more generic, and greatly simplify code
- it is (now) only used in update_metadata_images_from_children()
- drop now unused _get_imagelist_state()
- it opens the door to even more code duplication reduction
2024-05-23 11:23:37 +02:00
Laurent Monin
1b8294da9b ImageListState.process_images_*(): pass metadata instead of parent object 2024-05-23 11:11:47 +02:00
Laurent Monin
bef084ffcc Split ImageListState.process_images() in two methods
- move check for src_obj instance in caller
2024-05-23 11:08:49 +02:00
Laurent Monin
3a46081366 Declare sources where it is used, and drop unused state where applicable 2024-05-23 11:04:15 +02:00
Laurent Monin
f41e86ddfc state.sources was never used in ImageListState, drop it 2024-05-23 10:59:41 +02:00
Laurent Monin
543a4f4095 sources -> sources_metadata, as that's different from state.sources 2024-05-23 10:57:37 +02:00
Laurent Monin
e5bae38e34 get_sources_metadata_images(): move at module level as it doesn't depend on ImageListState 2024-05-23 10:47:48 +02:00
Laurent Monin
2c6164440f Drop ImageListState.get_metadata_images(), call get_sources_metadata_images directly 2024-05-23 10:05:22 +02:00
Laurent Monin
77b3b51b9a ImageListState.get_metadata_images(): start to reduce code redundancy 2024-05-23 10:05:22 +02:00
Laurent Monin
8c22dd0733 Replace update_new/orig_metadata by a set
Compatibility preserved defining matching `@property`, that's transitional
2024-05-23 10:05:22 +02:00
Laurent Monin
8a184d0ff0 metadataitem_update_metadata_images() -> update_metadata_images_from_children() 2024-05-23 10:05:22 +02:00
Laurent Monin
2ce5470390 Replace get_imagelist_state() by a generator and set ImageListState.sources using it
It is much cleaner.
The new method is named `children_metadata_items()`
2024-05-23 10:05:22 +02:00
Laurent Monin
ab463c6456 Define update_new/orig_metadata in MetadataItem and its subclasses
Then pass them to ImageListState() constructor
Those don't change, and are only set to True for Album & FileItem
2024-05-23 10:05:22 +02:00
Laurent Monin
741be9595c Define new get_imagelist_state() in Album & FileListItem
Called from MetadataItem._get_imagelist_state()
2024-05-23 10:05:22 +02:00
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