Tracker: Allow Get info without selection in File menu

If you don't have a selection, Get info on the window instead.

Change-Id: I83db030798788a487ce3123bb8b2c25056d4fbf2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7170
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
John Scipione 2023-11-30 23:39:29 -05:00 committed by waddlesplash
parent 0509d19b91
commit 9bc1ff61eb
3 changed files with 9 additions and 8 deletions

View File

@ -3277,7 +3277,6 @@ BContainerWindow::UpdateMenu(BMenu* menu, UpdateMenuContext context)
if (context == kMenuBarContext) {
EnableNamedMenuItem(menu, kOpenSelection, selectCount > 0);
EnableNamedMenuItem(menu, kGetInfo, selectCount > 0);
EnableNamedMenuItem(menu, kIdentifyEntry, selectCount > 0);
EnableNamedMenuItem(menu, kRestoreFromTrash, selectCount > 0);
EnableNamedMenuItem(menu, kDelete,

View File

@ -1076,15 +1076,12 @@ TFilePanel::MenusBeginning()
PoseView()->CommitActivePose();
}
int32 selectCount = PoseView()->CountSelected();
EnableNamedMenuItem(fMenuBar, kNewFolder, !TargetModel()->IsRoot()
&& !PoseView()->TargetVolumeIsReadOnly());
EnableNamedMenuItem(fMenuBar, kDuplicateSelection,
PoseView()->CanMoveToTrashOrDuplicate());
EnableNamedMenuItem(fMenuBar, kMoveToTrash,
PoseView()->CanMoveToTrashOrDuplicate());
EnableNamedMenuItem(fMenuBar, kGetInfo, selectCount > 0);
EnableNamedMenuItem(fMenuBar, kEditItem, PoseView()->CanEditName());
SetCutItem(fMenuBar);
@ -1120,7 +1117,6 @@ TFilePanel::ShowContextMenu(BPoint where, const entry_ref* ref)
// Volume context menu
fContextMenu = fVolumeContextMenu;
EnableNamedMenuItem(fContextMenu, kOpenSelection, true);
EnableNamedMenuItem(fContextMenu, kGetInfo, true);
EnableNamedMenuItem(fContextMenu, kEditItem,
PoseView()->CanEditName());
@ -1128,7 +1124,6 @@ TFilePanel::ShowContextMenu(BPoint where, const entry_ref* ref)
} else {
// File context menu
fContextMenu = fFileContextMenu;
EnableNamedMenuItem(fContextMenu, kGetInfo, true);
EnableNamedMenuItem(fContextMenu, kEditItem,
PoseView()->CanEditName());
EnableNamedMenuItem(fContextMenu, kDuplicateSelection,

View File

@ -8601,7 +8601,14 @@ BPoseView::OpenInfoWindows()
alert->Go();
return;
}
if (fSelectionList != NULL && fSelectionList->CountItems() > 0)
SendSelectionAsRefs(kGetInfo);
else if (TargetModel()->EntryRef() != NULL) {
BMessage message(kGetInfo);
message.AddRef("refs", TargetModel()->EntryRef());
BMessenger(kTrackerSignature).SendMessage(&message);
}
}