From 22719833756e66e71d4c5be58771c0e4dee154aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 6 May 2010 13:20:37 +0000 Subject: [PATCH] Patch by Jorma Karvonen, modified by myself to remove translations of BView names and localization unfriendly string composition. Closes ticket #5563, thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36647 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/Jamfile | 2 ++ src/apps/showimage/ProgressWindow.cpp | 7 ++++++- src/apps/showimage/ShowImageView.cpp | 16 ++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/apps/showimage/Jamfile b/src/apps/showimage/Jamfile index d5140f6c30..c9b6100c97 100644 --- a/src/apps/showimage/Jamfile +++ b/src/apps/showimage/Jamfile @@ -25,7 +25,9 @@ DoCatalogs ShowImage : x-vnd.Haiku-ShowImage : PrintOptionsWindow.cpp + ProgressWindow.cpp ResizerWindow.cpp ShowImageApp.cpp + ShowImageView.cpp ShowImageWindow.cpp ; diff --git a/src/apps/showimage/ProgressWindow.cpp b/src/apps/showimage/ProgressWindow.cpp index 6762ac155e..c270ed85ab 100644 --- a/src/apps/showimage/ProgressWindow.cpp +++ b/src/apps/showimage/ProgressWindow.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include #include #include #include @@ -18,10 +20,13 @@ static const uint32 kMsgShow = 'show'; +#undef TR_CONTEXT +#define TR_CONTEXT "ProgressWindow" + ProgressWindow::ProgressWindow(BWindow* referenceWindow, bool center) : - BWindow(BRect(0, 0, 250, 100), "Progress monitor", + BWindow(BRect(0, 0, 250, 100), TR("Progress monitor"), B_MODAL_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS), fRunner(NULL) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index b833833a60..78c6e27c98 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -13,6 +13,7 @@ * Bernd Korz */ + #include "ShowImageView.h" #include @@ -23,11 +24,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -1245,11 +1248,15 @@ ShowImageView::_OutputFormatForType(BBitmap* bitmap, const char* type, } +#undef TR_CONTEXT +#define TR_CONTEXT "SaveToFile" + + void ShowImageView::SaveToFile(BDirectory* dir, const char* name, BBitmap* bitmap, const translation_format* format) { - if (!bitmap) { + if (bitmap == NULL) { // If no bitmap is supplied, write out the whole image bitmap = fBitmap; } @@ -1277,9 +1284,10 @@ ShowImageView::SaveToFile(BDirectory* dir, const char* name, BBitmap* bitmap, } if (loop) { // If loop terminated because of a break, there was an error - BString errText; - errText << "Sorry, the file '" << name << "' could not be written."; - BAlert *palert = new BAlert(NULL, errText.String(), "OK"); + char buffer[512]; + snprintf(buffer, sizeof(buffer), TR("The file '%s' could not " + "be written."), name); + BAlert *palert = new BAlert("", buffer, TR("OK")); palert->Go(); }