Ticket #12241: 0001-12241-Adding-Get-Info-option-to-show-image-tool.patch

File 0001-12241-Adding-Get-Info-option-to-show-image-tool.patch, 2.3 KB (added by artcodex, 9 years ago)

Adding Get Info to show image tool

  • src/apps/showimage/ShowImageWindow.cpp

    From aaf79d7a9b6e3515f8055f16aab3b5574f5cf282 Mon Sep 17 00:00:00 2001
    From: Avi Brenner <avi.brenner@gmail.com>
    Date: Thu, 31 Dec 2015 01:26:50 +0000
    Subject: [PATCH] #12241 - Adding Get Info option to show image tool
    
    ---
     src/apps/showimage/ShowImageWindow.cpp | 16 ++++++++++++++++
     src/apps/showimage/ShowImageWindow.h   |  1 +
     2 files changed, 17 insertions(+)
    
    diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp
    index 9844119..b155292 100644
    a b enum {  
    9494    MSG_SHOW_CAPTION            = 'mSCP',
    9595    MSG_PAGE_SETUP              = 'mPSU',
    9696    MSG_PREPARE_PRINT           = 'mPPT',
     97       MSG_GET_INFO             = 'mGFI',
    9798    MSG_SET_RATING              = 'mSRT',
    9899    kMsgFitToWindow             = 'mFtW',
    99100    kMsgOriginalSize            = 'mOSZ',
    ShowImageWindow::_AddMenus(BMenuBar* bar)  
    398399    _AddItemMenu(menu, B_TRANSLATE("Print" B_UTF8_ELLIPSIS),
    399400        MSG_PREPARE_PRINT, 'P', 0, this);
    400401    menu->AddSeparatorItem();
     402    _AddItemMenu(menu, B_TRANSLATE("Get info" B_UTF8_ELLIPSIS),
     403        MSG_GET_INFO, 'I', 0, this);
     404    menu->AddSeparatorItem();
    401405    _AddItemMenu(menu, B_TRANSLATE("Quit"), B_QUIT_REQUESTED, 'Q', 0, be_app);
    402406    bar->AddItem(menu);
    403407
    ShowImageWindow::MessageReceived(BMessage* message)  
    871875        case MSG_FLIP_TOP_TO_BOTTOM:
    872876            fImageView->Flip(false);
    873877            break;
     878   
     879              case MSG_GET_INFO:
     880            _GetFileInfo(fNavigator.CurrentRef());
     881                     break;
    874882
    875883        case MSG_SLIDE_SHOW:
    876884        {
    ShowImageWindow::MessageReceived(BMessage* message)  
    10601068    }
    10611069}
    10621070
     1071void
     1072ShowImageWindow::_GetFileInfo(const entry_ref& ref)
     1073{
     1074    BMessage message('Tinf');
     1075    BMessenger tracker("application/x-vnd.Be-TRAK");
     1076    message.AddRef("refs", &ref);
     1077    tracker.SendMessage(&message);
     1078}
    10631079
    10641080void
    10651081ShowImageWindow::_UpdateStatusText(const BMessage* message)
  • src/apps/showimage/ShowImageWindow.h

    diff --git a/src/apps/showimage/ShowImageWindow.h b/src/apps/showimage/ShowImageWindow.h
    index 32fc6d1..3d89893 100644
    a b private:  
    9696            void                _SavePrintOptions();
    9797            bool                _PageSetup();
    9898            void                _PrepareForPrint();
     99            void                _GetFileInfo(const entry_ref& ref);
    99100            void                _Print(BMessage* msg);
    100101
    101102            void                _SetSlideShowDelay(bigtime_t delay);