Ticket #9602: 0001-Added-shortcut-for-location-bar.patch

File 0001-Added-shortcut-for-location-bar.patch, 2.4 KB (added by puckipedia, 11 years ago)

New version of patch, code style fixed

  • src/kits/tracker/ContainerWindow.cpp

    From 561b348c793a5a515757db5c25176b08db881adb Mon Sep 17 00:00:00 2001
    From: Puck Meerburg <puck@puckipedia.nl>
    Date: Tue, 19 Nov 2013 22:22:42 +0000
    Subject: [PATCH] Added shortcut for location bar
    
    ---
     src/kits/tracker/ContainerWindow.cpp |  4 ++++
     src/kits/tracker/Navigator.cpp       | 11 +++++++++++
     src/kits/tracker/Navigator.h         |  4 +++-
     3 files changed, 18 insertions(+), 1 deletion(-)
    
    diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
    index 294bca4..221b791 100644
    a b BContainerWindow::SetSingleWindowBrowseShortcuts(bool enabled)  
    40564056            new BMessage(kNavigatorCommandUp), Navigator());
    40574057        AddShortcut(B_DOWN_ARROW, B_OPTION_KEY | B_COMMAND_KEY,
    40584058            new BMessage(kOpenSelection), PoseView());
     4059        AddShortcut('L', B_COMMAND_KEY,
     4060            new BMessage(kNavigatorCommandFocusLocation), Navigator());
    40594061
    40604062    } else {
     4063        RemoveShortcut('L', B_COMMAND_KEY);
     4064
    40614065        RemoveShortcut(B_LEFT_ARROW, B_COMMAND_KEY);
    40624066        RemoveShortcut(B_RIGHT_ARROW, B_COMMAND_KEY);
    40634067        RemoveShortcut(B_UP_ARROW, B_COMMAND_KEY);
  • src/kits/tracker/Navigator.cpp

    diff --git a/src/kits/tracker/Navigator.cpp b/src/kits/tracker/Navigator.cpp
    index 3d0ef5c..74df099 100644
    a b BNavigator::MessageReceived(BMessage* message)  
    234234            GoTo();
    235235            break;
    236236
     237        case kNavigatorCommandFocusLocation:
     238            FocusLocation();
     239            break;
     240       
    237241        default:
    238242        {
    239243            // Catch any dropped refs and try to switch to this new directory
    BNavigator::MessageReceived(BMessage* message)  
    257261
    258262
    259263void
     264BNavigator::FocusLocation()
     265{
     266    fLocation->MakeFocus();
     267}
     268
     269
     270void
    260271BNavigator::GoBackward(bool option)
    261272{
    262273    int32 itemCount = fBackHistory.CountItems();
  • src/kits/tracker/Navigator.h

    diff --git a/src/kits/tracker/Navigator.h b/src/kits/tracker/Navigator.h
    index d290a2f..19e7eea 100644
    a b enum NavigationAction  
    5858    kNavigatorCommandBackward = 'NVBW',
    5959    kNavigatorCommandForward = 'NVFW',
    6060    kNavigatorCommandUp = 'NVUP',
    61     kNavigatorCommandLocation = 'NVLC'
     61    kNavigatorCommandLocation = 'NVLC',
     62    kNavigatorCommandFocusLocation = 'NVFL'
    6263};
    6364
    6465
    protected:  
    104105    void GoBackward(bool option);
    105106    void GoUp(bool option);
    106107    void SendNavigationMessage(NavigationAction, BEntry*, bool option);
     108    void FocusLocation();
    107109
    108110    void GoTo();
    109111