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 {
|
94 | 94 | MSG_SHOW_CAPTION = 'mSCP', |
95 | 95 | MSG_PAGE_SETUP = 'mPSU', |
96 | 96 | MSG_PREPARE_PRINT = 'mPPT', |
| 97 | MSG_GET_INFO = 'mGFI', |
97 | 98 | MSG_SET_RATING = 'mSRT', |
98 | 99 | kMsgFitToWindow = 'mFtW', |
99 | 100 | kMsgOriginalSize = 'mOSZ', |
… |
… |
ShowImageWindow::_AddMenus(BMenuBar* bar)
|
398 | 399 | _AddItemMenu(menu, B_TRANSLATE("Print" B_UTF8_ELLIPSIS), |
399 | 400 | MSG_PREPARE_PRINT, 'P', 0, this); |
400 | 401 | menu->AddSeparatorItem(); |
| 402 | _AddItemMenu(menu, B_TRANSLATE("Get info" B_UTF8_ELLIPSIS), |
| 403 | MSG_GET_INFO, 'I', 0, this); |
| 404 | menu->AddSeparatorItem(); |
401 | 405 | _AddItemMenu(menu, B_TRANSLATE("Quit"), B_QUIT_REQUESTED, 'Q', 0, be_app); |
402 | 406 | bar->AddItem(menu); |
403 | 407 | |
… |
… |
ShowImageWindow::MessageReceived(BMessage* message)
|
871 | 875 | case MSG_FLIP_TOP_TO_BOTTOM: |
872 | 876 | fImageView->Flip(false); |
873 | 877 | break; |
| 878 | |
| 879 | case MSG_GET_INFO: |
| 880 | _GetFileInfo(fNavigator.CurrentRef()); |
| 881 | break; |
874 | 882 | |
875 | 883 | case MSG_SLIDE_SHOW: |
876 | 884 | { |
… |
… |
ShowImageWindow::MessageReceived(BMessage* message)
|
1060 | 1068 | } |
1061 | 1069 | } |
1062 | 1070 | |
| 1071 | void |
| 1072 | ShowImageWindow::_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 | } |
1063 | 1079 | |
1064 | 1080 | void |
1065 | 1081 | ShowImageWindow::_UpdateStatusText(const BMessage* message) |
diff --git a/src/apps/showimage/ShowImageWindow.h b/src/apps/showimage/ShowImageWindow.h
index 32fc6d1..3d89893 100644
a
|
b
|
private:
|
96 | 96 | void _SavePrintOptions(); |
97 | 97 | bool _PageSetup(); |
98 | 98 | void _PrepareForPrint(); |
| 99 | void _GetFileInfo(const entry_ref& ref); |
99 | 100 | void _Print(BMessage* msg); |
100 | 101 | |
101 | 102 | void _SetSlideShowDelay(bigtime_t delay); |