From 763f409c2f3cf9429313eed7207eefb1ad4ef63e Mon Sep 17 00:00:00 2001
From: Avi Brenner <avi.brenner@gmail.com>
Date: Thu, 31 Dec 2015 11:54:47 +0000
Subject: [PATCH] ShowImage: Adds an option to launch tracker file info for
currently viewed file.
Fixes #12241
---
src/apps/showimage/ShowImageWindow.cpp | 17 +++++++++++++++++
src/apps/showimage/ShowImageWindow.h | 2 ++
2 files changed, 19 insertions(+)
diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp
index 9844119..e873eb3 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)
|
392 | 393 | menu->AddItem(menuSaveAs); |
393 | 394 | _AddItemMenu(menu, B_TRANSLATE("Close"), B_QUIT_REQUESTED, 'W', 0, this); |
394 | 395 | _AddItemMenu(menu, B_TRANSLATE("Move to Trash"), kMsgDeleteCurrentFile, 'T', 0, this); |
| 396 | _AddItemMenu(menu, B_TRANSLATE("Get info" B_UTF8_ELLIPSIS), |
| 397 | MSG_GET_INFO, 'I', 0, this); |
395 | 398 | menu->AddSeparatorItem(); |
396 | 399 | _AddItemMenu(menu, B_TRANSLATE("Page setup" B_UTF8_ELLIPSIS), |
397 | 400 | MSG_PAGE_SETUP, 0, 0, this); |
… |
… |
ShowImageWindow::MessageReceived(BMessage* message)
|
872 | 875 | fImageView->Flip(false); |
873 | 876 | break; |
874 | 877 | |
| 878 | case MSG_GET_INFO: |
| 879 | _GetFileInfo(fNavigator.CurrentRef()); |
| 880 | break; |
| 881 | |
875 | 882 | case MSG_SLIDE_SHOW: |
876 | 883 | { |
877 | 884 | bool fullScreen = false; |
… |
… |
ShowImageWindow::MessageReceived(BMessage* message)
|
1062 | 1069 | |
1063 | 1070 | |
1064 | 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 | } |
| 1079 | |
| 1080 | |
| 1081 | void |
1065 | 1082 | ShowImageWindow::_UpdateStatusText(const BMessage* message) |
1066 | 1083 | { |
1067 | 1084 | BString frameText; |
diff --git a/src/apps/showimage/ShowImageWindow.h b/src/apps/showimage/ShowImageWindow.h
index 32fc6d1..1fb2871 100644
a
|
b
|
private:
|
104 | 104 | |
105 | 105 | void _UpdateRatingMenu(); |
106 | 106 | |
| 107 | void _GetFileInfo(const entry_ref& ref); |
| 108 | |
107 | 109 | void _SetToolBarVisible(bool visible, |
108 | 110 | bool animate = false); |
109 | 111 | void _SetToolBarBorder(bool visible); |