#162 collection: allow rescan when browsing

This commit is contained in:
Thibault Deckers 2022-01-27 10:30:09 +09:00
parent b97c51e541
commit c75d4fe6d2
4 changed files with 19 additions and 16 deletions

View file

@ -6,9 +6,10 @@ All notable changes to this project will be documented in this file.
### Added
- Info: edit location of JPG/PNG/WEBP/DNG images via Exif
- Collection / Info: edit location of JPG/PNG/WEBP/DNG images via Exif
- Viewer: resize option when exporting
- Settings: export/import covers & favourites along with settings
- Collection: allow rescan when browsing
- Portuguese translation (thanks Jonatas De Almeida Barros)
### Removed
@ -21,6 +22,7 @@ All notable changes to this project will be documented in this file.
- handling timestamps provided in 10^-8 s (18 digits)
- Viewer: SVG export
- Viewer: sending to editing app on some environments
- Map: projected center anchoring
## <a id="v1.5.10"></a>[v1.5.10] - 2022-01-07

View file

@ -15,12 +15,12 @@ enum EntrySetAction {
// browsing or selecting
map,
stats,
rescan,
// selecting
share,
delete,
copy,
move,
rescan,
toggleFavourite,
rotateCCW,
rotateCW,
@ -46,6 +46,7 @@ class EntrySetActions {
EntrySetAction.addShortcut,
EntrySetAction.map,
EntrySetAction.stats,
EntrySetAction.rescan,
];
static const selection = [
@ -54,9 +55,9 @@ class EntrySetActions {
EntrySetAction.copy,
EntrySetAction.move,
EntrySetAction.toggleFavourite,
EntrySetAction.rescan,
EntrySetAction.map,
EntrySetAction.stats,
EntrySetAction.rescan,
// editing actions are in their subsection
];
}
@ -86,6 +87,8 @@ extension ExtraEntrySetAction on EntrySetAction {
return context.l10n.menuActionMap;
case EntrySetAction.stats:
return context.l10n.menuActionStats;
case EntrySetAction.rescan:
return context.l10n.collectionActionRescan;
// selecting
case EntrySetAction.share:
return context.l10n.entryActionShare;
@ -95,8 +98,6 @@ extension ExtraEntrySetAction on EntrySetAction {
return context.l10n.collectionActionCopy;
case EntrySetAction.move:
return context.l10n.collectionActionMove;
case EntrySetAction.rescan:
return context.l10n.collectionActionRescan;
case EntrySetAction.toggleFavourite:
// different data depending on toggle state
return context.l10n.entryActionAddFavourite;
@ -147,6 +148,8 @@ extension ExtraEntrySetAction on EntrySetAction {
return AIcons.map;
case EntrySetAction.stats:
return AIcons.stats;
case EntrySetAction.rescan:
return AIcons.refresh;
// selecting
case EntrySetAction.share:
return AIcons.share;
@ -156,8 +159,6 @@ extension ExtraEntrySetAction on EntrySetAction {
return AIcons.copy;
case EntrySetAction.move:
return AIcons.move;
case EntrySetAction.rescan:
return AIcons.refresh;
case EntrySetAction.toggleFavourite:
// different data depending on toggle state
return AIcons.favourite;

View file

@ -429,12 +429,12 @@ class _CollectionAppBarState extends State<CollectionAppBar> with SingleTickerPr
// browsing or selecting
case EntrySetAction.map:
case EntrySetAction.stats:
case EntrySetAction.rescan:
// selecting
case EntrySetAction.share:
case EntrySetAction.delete:
case EntrySetAction.copy:
case EntrySetAction.move:
case EntrySetAction.rescan:
case EntrySetAction.toggleFavourite:
case EntrySetAction.rotateCCW:
case EntrySetAction.rotateCW:

View file

@ -67,13 +67,13 @@ class EntrySetActionDelegate with EntryEditorMixin, FeedbackMixin, PermissionAwa
// browsing or selecting
case EntrySetAction.map:
case EntrySetAction.stats:
case EntrySetAction.rescan:
return appMode == AppMode.main;
// selecting
case EntrySetAction.share:
case EntrySetAction.delete:
case EntrySetAction.copy:
case EntrySetAction.move:
case EntrySetAction.rescan:
case EntrySetAction.toggleFavourite:
case EntrySetAction.rotateCCW:
case EntrySetAction.rotateCW:
@ -111,13 +111,13 @@ class EntrySetActionDelegate with EntryEditorMixin, FeedbackMixin, PermissionAwa
return true;
case EntrySetAction.map:
case EntrySetAction.stats:
case EntrySetAction.rescan:
return (!isSelecting && hasItems) || (isSelecting && hasSelection);
// selecting
case EntrySetAction.share:
case EntrySetAction.delete:
case EntrySetAction.copy:
case EntrySetAction.move:
case EntrySetAction.rescan:
case EntrySetAction.toggleFavourite:
case EntrySetAction.rotateCCW:
case EntrySetAction.rotateCW:
@ -156,6 +156,9 @@ class EntrySetActionDelegate with EntryEditorMixin, FeedbackMixin, PermissionAwa
case EntrySetAction.stats:
_goToStats(context);
break;
case EntrySetAction.rescan:
_rescan(context);
break;
// selecting
case EntrySetAction.share:
_share(context);
@ -169,9 +172,6 @@ class EntrySetActionDelegate with EntryEditorMixin, FeedbackMixin, PermissionAwa
case EntrySetAction.move:
_move(context, moveType: MoveType.move);
break;
case EntrySetAction.rescan:
_rescan(context);
break;
case EntrySetAction.toggleFavourite:
_toggleFavourite(context);
break;
@ -215,12 +215,12 @@ class EntrySetActionDelegate with EntryEditorMixin, FeedbackMixin, PermissionAwa
}
void _rescan(BuildContext context) {
final source = context.read<CollectionSource>();
final selection = context.read<Selection<AvesEntry>>();
final selectedItems = _getExpandedSelectedItems(selection);
final collection = context.read<CollectionLens>();
final entries = (selection.isSelecting ? _getExpandedSelectedItems(selection) : collection.sortedEntries.toSet());
final controller = AnalysisController(canStartService: true, force: true);
source.analyze(controller, entries: selectedItems);
collection.source.analyze(controller, entries: entries);
selection.browse();
}