mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26: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
|
DrawableAttribute attributeOfCurrentGroup
|
||||||
= viewedKey.map(GroupKey::getAttribute)
|
= viewedKey.map(GroupKey::getAttribute)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
/* if no group or if groupbies are different or if data
|
/* if no group or if groupbies are different or if data
|
||||||
* source != null and does not equal group */
|
* source != null and does not equal group */
|
||||||
if (viewedGroup.isPresent() == false
|
if (viewedGroup.isPresent() == false
|
||||||
|| (getDataSource() != null && notEqual(dataSourceOfCurrentGroup, getDataSource()))
|
|| (getDataSource() != null && notEqual(dataSourceOfCurrentGroup, getDataSource()))
|
||||||
|| getGroupBy() != attributeOfCurrentGroup) {
|
|| getGroupBy() != attributeOfCurrentGroup) {
|
||||||
|
|
||||||
//the current group should not be visible so ...
|
//the current group should not be visible so ...
|
||||||
if (isNotEmpty(unSeenGroups)) {// show then next unseen group
|
if (isNotEmpty(unSeenGroups)) {// show then next unseen group
|
||||||
controller.advance(GroupViewState.tile(unSeenGroups.get(0)));
|
controller.advance(GroupViewState.tile(unSeenGroups.get(0)));
|
||||||
@ -718,7 +718,7 @@ public class GroupManager {
|
|||||||
} else { //there are no groups, clear the group area.
|
} else { //there are no groups, clear the group area.
|
||||||
controller.advance(GroupViewState.tile(null));
|
controller.advance(GroupViewState.tile(null));
|
||||||
}
|
}
|
||||||
} //else, the current group is for the given datasource, so just keep it in view.
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
groupProgress.finish();
|
groupProgress.finish();
|
||||||
|
@ -38,6 +38,7 @@ import org.sleuthkit.autopsy.imagegallery.FXMLConstructor;
|
|||||||
import org.sleuthkit.autopsy.imagegallery.ImageGalleryController;
|
import org.sleuthkit.autopsy.imagegallery.ImageGalleryController;
|
||||||
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute;
|
import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute;
|
||||||
import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup;
|
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 (
|
* 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.getAddedSubList().stream().forEach(this::insertGroup);
|
||||||
change.getRemoved().stream().forEach(this::removeFromTree);
|
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);
|
getGroupManager().getAnalyzedGroups().forEach(this::insertGroup);
|
||||||
|
@ -92,11 +92,10 @@ abstract class NavPanel<X> extends Tab {
|
|||||||
|
|
||||||
//keep selection in sync with controller
|
//keep selection in sync with controller
|
||||||
controller.viewStateProperty().addListener(observable -> {
|
controller.viewStateProperty().addListener(observable -> {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(()
|
||||||
Optional.ofNullable(controller.getViewState())
|
-> Optional.ofNullable(controller.getViewState())
|
||||||
.flatMap(GroupViewState::getGroup)
|
.flatMap(GroupViewState::getGroup)
|
||||||
.ifPresent(this::setFocusedGroup);
|
.ifPresent(this::setFocusedGroup));
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// notify controller about group selection in this view
|
// notify controller about group selection in this view
|
||||||
|
Loading…
x
Reference in New Issue
Block a user