mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
make tree select viewed group
This commit is contained in:
parent
c96304106e
commit
3cd00b0aa0
@ -703,12 +703,12 @@ public class GroupManager {
|
||||
DrawableAttribute attributeOfCurrentGroup
|
||||
= viewedKey.map(GroupKey::getAttribute)
|
||||
.orElse(null);
|
||||
|
||||
/* if no group or if groupbies are different or if data
|
||||
* source != null and does not equal group */
|
||||
if (viewedGroup.isPresent() == false
|
||||
|| (getDataSource() != null && notEqual(dataSourceOfCurrentGroup, getDataSource()))
|
||||
|| getGroupBy() != attributeOfCurrentGroup) {
|
||||
|
||||
//the current group should not be visible so ...
|
||||
if (isNotEmpty(unSeenGroups)) {// show then next unseen group
|
||||
controller.advance(GroupViewState.tile(unSeenGroups.get(0)));
|
||||
@ -718,7 +718,7 @@ public class GroupManager {
|
||||
} else { //there are no groups, clear the group area.
|
||||
controller.advance(GroupViewState.tile(null));
|
||||
}
|
||||
} //else, the current group is for the given datasource, so just keep it in view.
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
groupProgress.finish();
|
||||
|
@ -38,6 +38,7 @@ import org.sleuthkit.autopsy.imagegallery.FXMLConstructor;
|
||||
import org.sleuthkit.autopsy.imagegallery.ImageGalleryController;
|
||||
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute;
|
||||
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup;
|
||||
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState;
|
||||
|
||||
/**
|
||||
* Shows path based groups as a tree and others kinds of groups as a flat list (
|
||||
@ -82,7 +83,12 @@ final public class GroupTree extends NavPanel<TreeItem<GroupTreeNode>> {
|
||||
change.getAddedSubList().stream().forEach(this::insertGroup);
|
||||
change.getRemoved().stream().forEach(this::removeFromTree);
|
||||
}
|
||||
Platform.runLater(this::sortGroups);
|
||||
Platform.runLater(() -> {
|
||||
GroupTree.this.sortGroups();
|
||||
Optional.ofNullable(getController().getViewState())
|
||||
.flatMap(GroupViewState::getGroup)
|
||||
.ifPresent(this::setFocusedGroup);
|
||||
});
|
||||
});
|
||||
|
||||
getGroupManager().getAnalyzedGroups().forEach(this::insertGroup);
|
||||
|
@ -92,11 +92,10 @@ abstract class NavPanel<X> extends Tab {
|
||||
|
||||
//keep selection in sync with controller
|
||||
controller.viewStateProperty().addListener(observable -> {
|
||||
Platform.runLater(() -> {
|
||||
Optional.ofNullable(controller.getViewState())
|
||||
.flatMap(GroupViewState::getGroup)
|
||||
.ifPresent(this::setFocusedGroup);
|
||||
});
|
||||
Platform.runLater(()
|
||||
-> Optional.ofNullable(controller.getViewState())
|
||||
.flatMap(GroupViewState::getGroup)
|
||||
.ifPresent(this::setFocusedGroup));
|
||||
});
|
||||
|
||||
// notify controller about group selection in this view
|
||||
|
Loading…
x
Reference in New Issue
Block a user