ShowImage: Adds an option to launch tracker file info for currently viewed file.
Fixes #12241 Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
parent
da455572ed
commit
fb94ed118a
@ -94,6 +94,7 @@ enum {
|
||||
MSG_SHOW_CAPTION = 'mSCP',
|
||||
MSG_PAGE_SETUP = 'mPSU',
|
||||
MSG_PREPARE_PRINT = 'mPPT',
|
||||
MSG_GET_INFO = 'mGFI',
|
||||
MSG_SET_RATING = 'mSRT',
|
||||
kMsgFitToWindow = 'mFtW',
|
||||
kMsgOriginalSize = 'mOSZ',
|
||||
@ -392,6 +393,8 @@ ShowImageWindow::_AddMenus(BMenuBar* bar)
|
||||
menu->AddItem(menuSaveAs);
|
||||
_AddItemMenu(menu, B_TRANSLATE("Close"), B_QUIT_REQUESTED, 'W', 0, this);
|
||||
_AddItemMenu(menu, B_TRANSLATE("Move to Trash"), kMsgDeleteCurrentFile, 'T', 0, this);
|
||||
_AddItemMenu(menu, B_TRANSLATE("Get info" B_UTF8_ELLIPSIS),
|
||||
MSG_GET_INFO, 'I', 0, this);
|
||||
menu->AddSeparatorItem();
|
||||
_AddItemMenu(menu, B_TRANSLATE("Page setup" B_UTF8_ELLIPSIS),
|
||||
MSG_PAGE_SETUP, 0, 0, this);
|
||||
@ -872,6 +875,10 @@ ShowImageWindow::MessageReceived(BMessage* message)
|
||||
fImageView->Flip(false);
|
||||
break;
|
||||
|
||||
case MSG_GET_INFO:
|
||||
_GetFileInfo(fNavigator.CurrentRef());
|
||||
break;
|
||||
|
||||
case MSG_SLIDE_SHOW:
|
||||
{
|
||||
bool fullScreen = false;
|
||||
@ -1061,6 +1068,16 @@ ShowImageWindow::MessageReceived(BMessage* message)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::_GetFileInfo(const entry_ref& ref)
|
||||
{
|
||||
BMessage message('Tinf');
|
||||
BMessenger tracker("application/x-vnd.Be-TRAK");
|
||||
message.AddRef("refs", &ref);
|
||||
tracker.SendMessage(&message);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::_UpdateStatusText(const BMessage* message)
|
||||
{
|
||||
|
@ -104,6 +104,8 @@ private:
|
||||
|
||||
void _UpdateRatingMenu();
|
||||
|
||||
void _GetFileInfo(const entry_ref& ref);
|
||||
|
||||
void _SetToolBarVisible(bool visible,
|
||||
bool animate = false);
|
||||
void _SetToolBarBorder(bool visible);
|
||||
|
Loading…
Reference in New Issue
Block a user