Tracker: Force Identify - don't require holding shift (#4857)

Don't require to hold shift when clicking on force identify,
can now be released after popup menu have appeared.
This commit is contained in:
Philippe Saint-Pierre 2012-12-24 15:57:02 -05:00
parent 939600d2ad
commit 205cf6950c
3 changed files with 17 additions and 9 deletions

View File

@ -2554,10 +2554,13 @@ BContainerWindow::SetupMoveCopyMenus(const entry_ref* item_ref, BMenu* parent)
// Set the "Identify" item label
BMenuItem* identifyItem = parent->FindItem(kIdentifyEntry);
if (identifyItem != NULL) {
if (modifierKeys & B_SHIFT_KEY)
if (modifierKeys & B_SHIFT_KEY) {
identifyItem->SetLabel(B_TRANSLATE("Force identify"));
else
identifyItem->Message()->ReplaceBool("force", true);
} else {
identifyItem->SetLabel(B_TRANSLATE("Identify"));
identifyItem->Message()->ReplaceBool("force", false);
}
}
}
@ -2778,8 +2781,9 @@ BContainerWindow::AddFileContextMenus(BMenu* menu)
#endif
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("Identify"),
new BMessage(kIdentifyEntry)));
BMessage* message = new BMessage(kIdentifyEntry);
message->AddBool("force", false);
menu->AddItem(new BMenuItem(B_TRANSLATE("Identify"), message));
BMenu* addOnMenuItem = new BMenu(B_TRANSLATE("Add-ons"));
addOnMenuItem->SetFont(be_plain_font);
menu->AddItem(addOnMenuItem);

View File

@ -2368,8 +2368,13 @@ BPoseView::MessageReceived(BMessage* message)
break;
case kIdentifyEntry:
IdentifySelection();
{
bool force;
if (message->FindBool("force", &force) != B_OK)
force = false;
IdentifySelection(force);
break;
}
case kEditItem:
{
@ -8360,9 +8365,8 @@ BPoseView::OpenParent()
void
BPoseView::IdentifySelection()
{
bool force = (modifiers() & B_SHIFT_KEY) != 0;
BPoseView::IdentifySelection(bool force)
{
int32 count = fSelectionList->CountItems();
for (int32 index = 0; index < count; index++) {
BPose* pose = fSelectionList->ItemAt(index);

View File

@ -284,7 +284,7 @@ class BPoseView : public BView {
void OpenInfoWindows();
void SetDefaultPrinter();
void IdentifySelection();
void IdentifySelection(bool force = false);
void UnmountSelectedVolumes();
virtual void OpenParent();