From b4f087c20da713bc30e58067255330a10aef4da8 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Fri, 29 Mar 2013 20:25:42 +0900
Subject: [PATCH] Localizing libprint.a
---
src/add-ons/print/drivers/canon_lips/lips3/Jamfile | 26 ++++++-
src/add-ons/print/drivers/canon_lips/lips4/Jamfile | 26 ++++++-
src/add-ons/print/drivers/gutenprint/Jamfile | 26 +++++++
src/add-ons/print/drivers/pcl5/Jamfile | 26 ++++++-
src/add-ons/print/drivers/pcl6/Jamfile | 26 ++++++-
src/add-ons/print/drivers/pdf/source/Jamfile | 25 +++++++
src/add-ons/print/drivers/postscript/Jamfile | 26 ++++++-
src/add-ons/print/drivers/preview/Jamfile | 27 ++++++-
src/libs/print/libprint/AddPrinterDlg.cpp | 15 ++--
src/libs/print/libprint/GraphicsDriver.cpp | 9 ++-
src/libs/print/libprint/HalftoneView.cpp | 11 +--
src/libs/print/libprint/JobSetupDlg.cpp | 74 ++++++++++++--------
src/libs/print/libprint/MarginView.cpp | 24 ++++---
src/libs/print/libprint/PageSetupDlg.cpp | 26 ++++---
src/libs/print/libprint/Preview.cpp | 41 +++++++----
src/libs/print/libprint/StatusWindow.cpp | 29 ++++----
16 files changed, 343 insertions(+), 94 deletions(-)
diff --git a/src/add-ons/print/drivers/canon_lips/lips3/Jamfile b/src/add-ons/print/drivers/canon_lips/lips3/Jamfile
index b74e921..f62ad14c 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
6 | 6 | |
7 | 7 | AddResources Canon\ LIPS3\ Compatible : Lips3.rdef ; |
8 | 8 | |
| 9 | # libprint.a source files for collecting catalogs |
| 10 | local libprintLocalizeFiles = |
| 11 | libprint/AddPrinterDlg.cpp |
| 12 | libprint/GraphicsDriver.cpp |
| 13 | libprint/HalftoneView.cpp |
| 14 | libprint/JobSetupDlg.cpp |
| 15 | libprint/MarginView.cpp |
| 16 | libprint/PageSetupDlg.cpp |
| 17 | libprint/Preview.cpp |
| 18 | libprint/StatusWindow.cpp |
| 19 | ; |
| 20 | |
| 21 | local LocalizeLibFiles ; |
| 22 | local file ; |
| 23 | for file in $(libprintLocalizeFiles) { |
| 24 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 25 | } |
| 26 | |
9 | 27 | Addon Canon\ LIPS3\ Compatible : |
10 | 28 | Lips3Entry.cpp |
11 | 29 | Lips3.cpp |
12 | 30 | Lips3Cap.cpp |
13 | 31 | Compress3.cpp |
14 | | : be libprint.a $(TARGET_LIBSTDC++) |
| 32 | : be libprint.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) |
| 33 | ; |
| 34 | |
| 35 | DoCatalogs Canon\ LIPS3\ Compatible : |
| 36 | x-vnd.lips3-compatible |
| 37 | : |
| 38 | $(LocalizeLibFiles) |
15 | 39 | ; |
16 | 40 | |
17 | 41 | Package haiku-printingkit-cvs : |
diff --git a/src/add-ons/print/drivers/canon_lips/lips4/Jamfile b/src/add-ons/print/drivers/canon_lips/lips4/Jamfile
index 6ee5d7a..ff00059 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
6 | 6 | |
7 | 7 | AddResources Canon\ LIPS4\ Compatible : Lips4.rdef ; |
8 | 8 | |
| 9 | # libprint.a source files for collecting catalogs |
| 10 | local libprintLocalizeFiles = |
| 11 | libprint/AddPrinterDlg.cpp |
| 12 | libprint/GraphicsDriver.cpp |
| 13 | libprint/HalftoneView.cpp |
| 14 | libprint/JobSetupDlg.cpp |
| 15 | libprint/MarginView.cpp |
| 16 | libprint/PageSetupDlg.cpp |
| 17 | libprint/Preview.cpp |
| 18 | libprint/StatusWindow.cpp |
| 19 | ; |
| 20 | |
| 21 | local LocalizeLibFiles ; |
| 22 | local file ; |
| 23 | for file in $(libprintLocalizeFiles) { |
| 24 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 25 | } |
| 26 | |
9 | 27 | Addon Canon\ LIPS4\ Compatible : |
10 | 28 | Lips4Entry.cpp |
11 | 29 | Lips4.cpp |
12 | 30 | Lips4Cap.cpp |
13 | | : be libprint.a $(TARGET_LIBSTDC++) |
| 31 | : be libprint.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) |
| 32 | ; |
| 33 | |
| 34 | DoCatalogs Canon\ LIPS4\ Compatible : |
| 35 | x-vnd.lips4-compatible |
| 36 | : |
| 37 | $(LocalizeLibFiles) |
14 | 38 | ; |
15 | 39 | |
16 | 40 | Package haiku-printingkit-cvs : |
diff --git a/src/add-ons/print/drivers/gutenprint/Jamfile b/src/add-ons/print/drivers/gutenprint/Jamfile
index e9b76a0..990ab2b 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
5 | 5 | |
6 | 6 | AddResources Gutenprint : Gutenprint.rdef ; |
7 | 7 | |
| 8 | # libprint.a source files for collecting catalogs |
| 9 | local libprintLocalizeFiles = |
| 10 | libprint/AddPrinterDlg.cpp |
| 11 | libprint/GraphicsDriver.cpp |
| 12 | libprint/HalftoneView.cpp |
| 13 | libprint/JobSetupDlg.cpp |
| 14 | libprint/MarginView.cpp |
| 15 | libprint/PageSetupDlg.cpp |
| 16 | libprint/Preview.cpp |
| 17 | libprint/StatusWindow.cpp |
| 18 | ; |
| 19 | |
| 20 | local LocalizeLibFiles ; |
| 21 | local file ; |
| 22 | for file in $(libprintLocalizeFiles) { |
| 23 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 24 | } |
| 25 | |
8 | 26 | Addon Gutenprint : |
9 | 27 | GPBand.cpp |
10 | 28 | GPBinding.cpp |
… |
… |
Addon Gutenprint :
|
22 | 40 | libgutenprint.a |
23 | 41 | libprint.a |
24 | 42 | $(TARGET_LIBSTDC++) |
| 43 | $(HAIKU_LOCALE_LIBS) |
25 | 44 | ; |
| 45 | |
| 46 | DoCatalogs Gutenprint : |
| 47 | x-vnd.gutenprint |
| 48 | : |
| 49 | $(LocalizeLibFiles) |
| 50 | ; |
| 51 | |
diff --git a/src/add-ons/print/drivers/pcl5/Jamfile b/src/add-ons/print/drivers/pcl5/Jamfile
index 8cfefff..ee30aa6 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
6 | 6 | |
7 | 7 | AddResources PCL5\ Compatible : PCL5.rdef ; |
8 | 8 | |
| 9 | # libprint.a source files for collecting catalogs |
| 10 | local libprintLocalizeFiles = |
| 11 | libprint/AddPrinterDlg.cpp |
| 12 | libprint/GraphicsDriver.cpp |
| 13 | libprint/HalftoneView.cpp |
| 14 | libprint/JobSetupDlg.cpp |
| 15 | libprint/MarginView.cpp |
| 16 | libprint/PageSetupDlg.cpp |
| 17 | libprint/Preview.cpp |
| 18 | libprint/StatusWindow.cpp |
| 19 | ; |
| 20 | |
| 21 | local LocalizeLibFiles ; |
| 22 | local file ; |
| 23 | for file in $(libprintLocalizeFiles) { |
| 24 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 25 | } |
| 26 | |
9 | 27 | Addon PCL5\ Compatible : |
10 | 28 | PCL5Entry.cpp |
11 | 29 | PCL5.cpp |
12 | 30 | PCL5Cap.cpp |
13 | | : be libprint.a $(TARGET_LIBSTDC++) |
| 31 | : be libprint.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) |
| 32 | ; |
| 33 | |
| 34 | DoCatalogs PCL5\ Compatible : |
| 35 | x-vnd.pcl5-compatible |
| 36 | : |
| 37 | $(LocalizeLibFiles) |
14 | 38 | ; |
15 | 39 | |
16 | 40 | Package haiku-printingkit-cvs : |
diff --git a/src/add-ons/print/drivers/pcl6/Jamfile b/src/add-ons/print/drivers/pcl6/Jamfile
index c55e927..4853ffc 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
6 | 6 | |
7 | 7 | AddResources PCL6\ Compatible : PCL6.rdef ; |
8 | 8 | |
| 9 | # libprint.a source files for collecting catalogs |
| 10 | local libprintLocalizeFiles = |
| 11 | libprint/AddPrinterDlg.cpp |
| 12 | libprint/GraphicsDriver.cpp |
| 13 | libprint/HalftoneView.cpp |
| 14 | libprint/JobSetupDlg.cpp |
| 15 | libprint/MarginView.cpp |
| 16 | libprint/PageSetupDlg.cpp |
| 17 | libprint/Preview.cpp |
| 18 | libprint/StatusWindow.cpp |
| 19 | ; |
| 20 | |
| 21 | local LocalizeLibFiles ; |
| 22 | local file ; |
| 23 | for file in $(libprintLocalizeFiles) { |
| 24 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 25 | } |
| 26 | |
9 | 27 | Addon PCL6\ Compatible : |
10 | 28 | DeltaRowCompression.cpp |
11 | 29 | PCL6Entry.cpp |
… |
… |
Addon PCL6\ Compatible :
|
14 | 32 | PCL6Rasterizer.cpp |
15 | 33 | PCL6Writer.cpp |
16 | 34 | Rasterizer.cpp |
17 | | : be libprint.a $(TARGET_LIBSTDC++) |
| 35 | : be libprint.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) |
| 36 | ; |
| 37 | |
| 38 | DoCatalogs PCL6\ Compatible : |
| 39 | x-vnd.pcl6-compatible |
| 40 | : |
| 41 | $(LocalizeLibFiles) |
18 | 42 | ; |
19 | 43 | |
20 | 44 | Package haiku-printingkit-cvs : |
diff --git a/src/add-ons/print/drivers/pdf/source/Jamfile b/src/add-ons/print/drivers/pdf/source/Jamfile
index 8518c86..d4fe18c 100644
a
|
b
|
AddResources PDF\ Writer :
|
10 | 10 | PDFWriter.rdef |
11 | 11 | ; |
12 | 12 | |
| 13 | # libprint.a source files for collecting catalogs |
| 14 | local libprintLocalizeFiles = |
| 15 | libprint/AddPrinterDlg.cpp |
| 16 | libprint/GraphicsDriver.cpp |
| 17 | libprint/HalftoneView.cpp |
| 18 | libprint/JobSetupDlg.cpp |
| 19 | libprint/MarginView.cpp |
| 20 | libprint/PageSetupDlg.cpp |
| 21 | libprint/Preview.cpp |
| 22 | libprint/StatusWindow.cpp |
| 23 | ; |
| 24 | |
| 25 | local LocalizeLibFiles ; |
| 26 | local file ; |
| 27 | for file in $(libprintLocalizeFiles) { |
| 28 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 29 | } |
| 30 | |
13 | 31 | Addon PDF\ Writer : |
14 | 32 | AboutText.cpp |
15 | 33 | AdvancedSettingsWindow.cpp |
… |
… |
Addon PDF\ Writer :
|
49 | 67 | libprint.a |
50 | 68 | libprintutils.a |
51 | 69 | $(TARGET_LIBSUPC++) |
| 70 | $(HAIKU_LOCALE_LIBS) |
| 71 | ; |
| 72 | |
| 73 | DoCatalogs PDF\ Writer : |
| 74 | x-vnd.obos.pdfwriter |
| 75 | : |
| 76 | $(LocalizeLibFiles) |
52 | 77 | ; |
53 | 78 | |
54 | 79 | Package haiku-pdf_writer-cvs : |
diff --git a/src/add-ons/print/drivers/postscript/Jamfile b/src/add-ons/print/drivers/postscript/Jamfile
index 6a22891..ebb7489 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
6 | 6 | |
7 | 7 | AddResources PS\ Compatible : PS.rdef ; |
8 | 8 | |
| 9 | # libprint.a source files for collecting catalogs |
| 10 | local libprintLocalizeFiles = |
| 11 | libprint/AddPrinterDlg.cpp |
| 12 | libprint/GraphicsDriver.cpp |
| 13 | libprint/HalftoneView.cpp |
| 14 | libprint/JobSetupDlg.cpp |
| 15 | libprint/MarginView.cpp |
| 16 | libprint/PageSetupDlg.cpp |
| 17 | libprint/Preview.cpp |
| 18 | libprint/StatusWindow.cpp |
| 19 | ; |
| 20 | |
| 21 | local LocalizeLibFiles ; |
| 22 | local file ; |
| 23 | for file in $(libprintLocalizeFiles) { |
| 24 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 25 | } |
| 26 | |
9 | 27 | Addon PS\ Compatible : |
10 | 28 | PSEntry.cpp |
11 | 29 | PS.cpp |
… |
… |
Addon PS\ Compatible :
|
14 | 32 | SelectPPDDlg.cpp |
15 | 33 | PPDParser.cpp |
16 | 34 | FilterIO.cpp |
17 | | : be libprint.a $(TARGET_LIBSTDC++) |
| 35 | : be libprint.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) |
| 36 | ; |
| 37 | |
| 38 | DoCatalogs PS\ Compatible : |
| 39 | x-vnd.ps-compatible |
| 40 | : |
| 41 | $(LocalizeLibFiles) |
18 | 42 | ; |
19 | 43 | |
20 | 44 | Package haiku-printingkit-cvs : |
diff --git a/src/add-ons/print/drivers/preview/Jamfile b/src/add-ons/print/drivers/preview/Jamfile
index b46fb81..afb177b 100644
a
|
b
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
6 | 6 | |
7 | 7 | AddResources Preview : Preview.rdef ; |
8 | 8 | |
| 9 | # libprint.a source files for collecting catalogs |
| 10 | local libprintLocalizeFiles = |
| 11 | libprint/AddPrinterDlg.cpp |
| 12 | libprint/GraphicsDriver.cpp |
| 13 | libprint/HalftoneView.cpp |
| 14 | libprint/JobSetupDlg.cpp |
| 15 | libprint/MarginView.cpp |
| 16 | libprint/PageSetupDlg.cpp |
| 17 | libprint/Preview.cpp |
| 18 | libprint/StatusWindow.cpp |
| 19 | ; |
| 20 | |
| 21 | local LocalizeLibFiles ; |
| 22 | local file ; |
| 23 | for file in $(libprintLocalizeFiles) { |
| 24 | LocalizeLibFiles += [ FDirName $(HAIKU_TOP) src libs print $(file) ] ; |
| 25 | } |
| 26 | |
9 | 27 | Addon Preview : |
10 | 28 | PageSetupWindow.cpp |
11 | 29 | JobSetupWindow.cpp |
12 | 30 | Driver.cpp |
13 | 31 | PrinterDriver.cpp |
14 | 32 | PreviewDriver.cpp |
15 | | : be libprint.a $(TARGET_LIBSTDC++) |
| 33 | : be libprint.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) |
| 34 | ; |
| 35 | |
| 36 | DoCatalogs Preview : |
| 37 | x-vnd.preview |
| 38 | : |
| 39 | $(LocalizeLibFiles) |
16 | 40 | ; |
17 | 41 | |
18 | 42 | Package haiku-printingkit-cvs : |
19 | 43 | Preview : |
20 | 44 | boot home config add-ons Print ; |
| 45 | |
diff --git a/src/libs/print/libprint/AddPrinterDlg.cpp b/src/libs/print/libprint/AddPrinterDlg.cpp
index 719b35e..d5e1d76 100644
a
|
b
|
|
1 | 1 | #include "AddPrinterDlg.h" |
2 | 2 | |
| 3 | #include <Catalog.h> |
3 | 4 | #include <GroupLayoutBuilder.h> |
4 | 5 | |
5 | 6 | #include "PrinterCap.h" |
6 | 7 | #include "PrinterData.h" |
7 | 8 | |
8 | 9 | |
| 10 | #undef B_TRANSLATION_CONTEXT |
| 11 | #define B_TRANSLATION_CONTEXT "libprint_AddPrinterDlg" |
| 12 | |
9 | 13 | enum MSGS { |
10 | 14 | kMsgCancel = 1, |
11 | 15 | kMsgOK, |
… |
… |
AddPrinterView::AttachedToWindow()
|
53 | 57 | { |
54 | 58 | // protocol class box |
55 | 59 | BBox* protocolClassBox = new BBox("protocolClass"); |
56 | | protocolClassBox->SetLabel("Protocol Classes:"); |
| 60 | protocolClassBox->SetLabel(B_TRANSLATE("Protocol Classes:")); |
57 | 61 | |
58 | 62 | // protocol class |
59 | 63 | fProtocolClassList = new BListView("protocolClassList"); |
… |
… |
AddPrinterView::AttachedToWindow()
|
88 | 92 | |
89 | 93 | // description of protocol class box |
90 | 94 | BBox* descriptionBox = new BBox("descriptionBox"); |
91 | | descriptionBox->SetLabel("Description:"); |
| 95 | descriptionBox->SetLabel(B_TRANSLATE("Description:")); |
92 | 96 | |
93 | 97 | // description of protocol class |
94 | 98 | fDescription = new BTextView("description"); |
… |
… |
AddPrinterView::AttachedToWindow()
|
109 | 113 | separator->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 1)); |
110 | 114 | |
111 | 115 | // buttons |
112 | | BButton* cancel = new BButton("cancel", "Cancel", |
| 116 | BButton* cancel = new BButton("cancel", B_TRANSLATE("Cancel"), |
113 | 117 | new BMessage(kMsgCancel)); |
114 | | BButton* ok = new BButton("ok", "OK", new BMessage(kMsgOK)); |
| 118 | BButton* ok = new BButton("ok", B_TRANSLATE("OK"), new BMessage(kMsgOK)); |
115 | 119 | ok->MakeDefault(true); |
116 | 120 | |
117 | 121 | SetLayout(new BGroupLayout(B_VERTICAL)); |
… |
… |
AddPrinterDlg::AddPrinterDlg(PrinterData* printerData,
|
175 | 179 | const PrinterCap *printerCap) |
176 | 180 | : |
177 | 181 | DialogWindow(BRect(100, 100, 120, 120), |
178 | | "Add Printer", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, |
| 182 | B_TRANSLATE("Add Printer"), |
| 183 | B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, |
179 | 184 | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS |
180 | 185 | | B_AUTO_UPDATE_SIZE_LIMITS) |
181 | 186 | { |
diff --git a/src/libs/print/libprint/GraphicsDriver.cpp b/src/libs/print/libprint/GraphicsDriver.cpp
index aa6994f..52efca3 100644
a
|
b
|
|
9 | 9 | |
10 | 10 | #include <Alert.h> |
11 | 11 | #include <Bitmap.h> |
| 12 | #include <Catalog.h> |
12 | 13 | #include <Debug.h> |
13 | 14 | #include <Message.h> |
14 | 15 | #include <PrintJob.h> |
… |
… |
|
30 | 31 | #include "ValidRect.h" |
31 | 32 | #include "DbgMsg.h" |
32 | 33 | |
| 34 | #undef B_TRANSLATION_CONTEXT |
| 35 | #define B_TRANSLATION_CONTEXT "libprint_GraphicsDriver" |
33 | 36 | |
34 | 37 | using namespace std; |
35 | 38 | |
… |
… |
GraphicsDriver::_PrintJob(BFile* spoolFile)
|
699 | 702 | if (success == false) { |
700 | 703 | BAlert *alert; |
701 | 704 | if (fTransport->CheckAbort()) |
702 | | alert = new BAlert("", fTransport->LastError().c_str(), "OK"); |
| 705 | alert = new BAlert("", fTransport->LastError().c_str(), |
| 706 | B_TRANSLATE("OK")); |
703 | 707 | else |
704 | | alert = new BAlert("", "Printer not responding.", "OK"); |
| 708 | alert = new BAlert("", B_TRANSLATE("Printer not responding."), |
| 709 | B_TRANSLATE("OK")); |
705 | 710 | alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); |
706 | 711 | alert->Go(); |
707 | 712 | } |
diff --git a/src/libs/print/libprint/HalftoneView.cpp b/src/libs/print/libprint/HalftoneView.cpp
index 638f327..8031921 100644
a
|
b
|
|
1 | 1 | #include "HalftoneView.h" |
2 | 2 | |
3 | 3 | #include <Bitmap.h> |
| 4 | #include <Catalog.h> |
4 | 5 | #include <StringView.h> |
5 | 6 | |
| 7 | #undef B_TRANSLATION_CONTEXT |
| 8 | #define B_TRANSLATION_CONTEXT "libprint_HalftoneView" |
6 | 9 | |
7 | 10 | HalftonePreviewView::HalftonePreviewView(BRect frame, const char* name, |
8 | 11 | uint32 resizeMask, uint32 flags) |
… |
… |
HalftoneView::HalftoneView(BRect frame, const char* name, uint32 resizeMask,
|
144 | 147 | const float blue_top = green_top + delta; |
145 | 148 | const float gray_top = r.bottom - delta; |
146 | 149 | |
147 | | const char* kRedLabel = "Red: "; |
148 | | const char* kGreenLabel = "Green: "; |
149 | | const char* kBlueLabel = "Blue: "; |
150 | | const char* kGrayLabel = "Black: "; |
| 150 | const char* kRedLabel = B_TRANSLATE("Red: "); |
| 151 | const char* kGreenLabel = B_TRANSLATE("Green: "); |
| 152 | const char* kBlueLabel = B_TRANSLATE("Blue: "); |
| 153 | const char* kGrayLabel = B_TRANSLATE("Black: "); |
151 | 154 | |
152 | 155 | |
153 | 156 | BFont font(be_plain_font); |
diff --git a/src/libs/print/libprint/JobSetupDlg.cpp b/src/libs/print/libprint/JobSetupDlg.cpp
index 93d1012..4e9d7f5 100644
a
|
b
|
|
16 | 16 | #include <Bitmap.h> |
17 | 17 | #include <Box.h> |
18 | 18 | #include <Button.h> |
| 19 | #include <Catalog.h> |
19 | 20 | #include <CheckBox.h> |
20 | 21 | #include <Debug.h> |
21 | 22 | #include <GridView.h> |
… |
… |
|
46 | 47 | #include "PrinterCap.h" |
47 | 48 | #include "DbgMsg.h" |
48 | 49 | |
| 50 | #undef B_TRANSLATION_CONTEXT |
| 51 | #define B_TRANSLATION_CONTEXT "libprint_JobSetupDlg" |
49 | 52 | |
50 | 53 | using namespace std; |
51 | 54 | |
… |
… |
static const NupCap gNup32("32", false, 32);
|
88 | 91 | static const NupCap gNup36("36", false, 36); |
89 | 92 | |
90 | 93 | |
91 | | static const DitherCap gDitherType1("Crosshatch", false, Halftone::kType1); |
92 | | static const DitherCap gDitherType2("Grid", false, Halftone::kType2); |
93 | | static const DitherCap gDitherType3("Stipple", false, Halftone::kType3); |
94 | | static const DitherCap gDitherFloydSteinberg("Floyd-Steinberg", false, |
95 | | Halftone::kTypeFloydSteinberg); |
| 94 | static const DitherCap gDitherType1(B_TRANSLATE("Crosshatch"), |
| 95 | false, Halftone::kType1); |
| 96 | static const DitherCap gDitherType2(B_TRANSLATE("Grid"), |
| 97 | false, Halftone::kType2); |
| 98 | static const DitherCap gDitherType3(B_TRANSLATE("Stipple"), |
| 99 | false, Halftone::kType3); |
| 100 | static const DitherCap gDitherFloydSteinberg(B_TRANSLATE("Floyd-Steinberg"), |
| 101 | false, Halftone::kTypeFloydSteinberg); |
96 | 102 | |
97 | 103 | |
98 | 104 | const BaseCap *gNups[] = { |
… |
… |
JobSetupView::AttachedToWindow()
|
195 | 201 | { |
196 | 202 | // quality |
197 | 203 | BBox* qualityBox = new BBox("quality"); |
198 | | qualityBox->SetLabel("Quality"); |
| 204 | qualityBox->SetLabel(B_TRANSLATE("Quality")); |
199 | 205 | |
200 | 206 | // color |
201 | 207 | fColorType = new BPopUpMenu("color"); |
202 | 208 | fColorType->SetRadioMode(true); |
203 | 209 | FillCapabilityMenu(fColorType, kMsgQuality, PrinterCap::kColor, |
204 | 210 | fJobData->GetColor()); |
205 | | BMenuField* colorMenuField = new BMenuField("color", "Color:", fColorType); |
| 211 | BMenuField* colorMenuField = new BMenuField("color", B_TRANSLATE("Color:"), |
| 212 | fColorType); |
206 | 213 | fColorType->SetTargetForItems(this); |
207 | 214 | |
208 | 215 | if (IsHalftoneConfigurationNeeded()) |
… |
… |
JobSetupView::AttachedToWindow()
|
211 | 218 | // page range |
212 | 219 | |
213 | 220 | BBox* pageRangeBox = new BBox("pageRange"); |
214 | | pageRangeBox->SetLabel("Page Range"); |
| 221 | pageRangeBox->SetLabel(B_TRANSLATE("Page Range")); |
215 | 222 | |
216 | | fAll = new BRadioButton("all", "Print all Pages", new BMessage(kMsgRangeAll)); |
| 223 | fAll = new BRadioButton("all", B_TRANSLATE("Print all Pages"), |
| 224 | new BMessage(kMsgRangeAll)); |
217 | 225 | |
218 | | BRadioButton *range = new BRadioButton("selection", "Print selected Pages:", |
| 226 | BRadioButton *range = new BRadioButton("selection", |
| 227 | B_TRANSLATE("Print selected Pages:"), |
219 | 228 | new BMessage(kMsgRangeSelection)); |
220 | 229 | |
221 | | fFromPage = new BTextControl("from", "From:", "", NULL); |
| 230 | fFromPage = new BTextControl("from", B_TRANSLATE("From:"), "", NULL); |
222 | 231 | fFromPage->SetAlignment(B_ALIGN_LEFT, B_ALIGN_RIGHT); |
223 | 232 | AllowOnlyDigits(fFromPage->TextView(), 6); |
224 | 233 | |
225 | | fToPage = new BTextControl("to", "To:", "", NULL); |
| 234 | fToPage = new BTextControl("to", B_TRANSLATE("To:"), "", NULL); |
226 | 235 | fToPage->SetAlignment(B_ALIGN_LEFT, B_ALIGN_RIGHT); |
227 | 236 | AllowOnlyDigits(fToPage->TextView(), 6); |
228 | 237 | |
… |
… |
JobSetupView::AttachedToWindow()
|
256 | 265 | FillCapabilityMenu(fPaperFeed, kMsgNone, PrinterCap::kPaperSource, |
257 | 266 | fJobData->GetPaperSource()); |
258 | 267 | BMenuField* paperSourceMenufield = new BMenuField("paperSource", |
259 | | "Paper Source:", fPaperFeed); |
| 268 | B_TRANSLATE("Paper Source:"), fPaperFeed); |
260 | 269 | |
261 | 270 | // Pages per sheet |
262 | 271 | fNup = new BPopUpMenu(""); |
… |
… |
JobSetupView::AttachedToWindow()
|
264 | 273 | FillCapabilityMenu(fNup, kMsgNone, gNups, |
265 | 274 | sizeof(gNups) / sizeof(gNups[0]), (int)fJobData->GetNup()); |
266 | 275 | BMenuField* pagesPerSheet = new BMenuField("pagesPerSheet", |
267 | | "Pages Per Sheet:", fNup); |
| 276 | B_TRANSLATE("Pages Per Sheet:"), fNup); |
268 | 277 | |
269 | 278 | // duplex |
270 | 279 | if (fPrinterCap->Supports(PrinterCap::kPrintStyle)) { |
271 | | fDuplex = new BCheckBox("duplex", "Duplex", |
| 280 | fDuplex = new BCheckBox("duplex", B_TRANSLATE("Duplex"), |
272 | 281 | new BMessage(kMsgDuplexChanged)); |
273 | 282 | if (fJobData->GetPrintStyle() != JobData::kSimplex) { |
274 | 283 | fDuplex->SetValue(B_CONTROL_ON); |
… |
… |
JobSetupView::AttachedToWindow()
|
279 | 288 | } |
280 | 289 | |
281 | 290 | // copies |
282 | | fCopies = new BTextControl("copies", "Number of Copies:", "", NULL); |
| 291 | fCopies = new BTextControl("copies", B_TRANSLATE("Number of Copies:"), |
| 292 | "", NULL); |
283 | 293 | AllowOnlyDigits(fCopies->TextView(), 3); |
284 | 294 | |
285 | 295 | BString copies; |
… |
… |
JobSetupView::AttachedToWindow()
|
287 | 297 | fCopies->SetText(copies.String()); |
288 | 298 | |
289 | 299 | // collate |
290 | | fCollate = new BCheckBox("collate", "Collate", |
| 300 | fCollate = new BCheckBox("collate", B_TRANSLATE("Collate"), |
291 | 301 | new BMessage(kMsgCollateChanged)); |
292 | 302 | if (fJobData->GetCollate()) { |
293 | 303 | fCollate->SetValue(B_CONTROL_ON); |
… |
… |
JobSetupView::AttachedToWindow()
|
295 | 305 | fCollate->SetTarget(this); |
296 | 306 | |
297 | 307 | // reverse |
298 | | fReverse = new BCheckBox("reverse", "Reverse Order", |
| 308 | fReverse = new BCheckBox("reverse", B_TRANSLATE("Reverse Order"), |
299 | 309 | new BMessage(kMsgReverseChanged)); |
300 | 310 | if (fJobData->GetReverse()) { |
301 | 311 | fReverse->SetValue(B_CONTROL_ON); |
… |
… |
JobSetupView::AttachedToWindow()
|
313 | 323 | |
314 | 324 | // page selection |
315 | 325 | BBox* pageSelectionBox = new BBox("pageSelection"); |
316 | | pageSelectionBox->SetLabel("Page Selection"); |
| 326 | pageSelectionBox->SetLabel(B_TRANSLATE("Page Selection")); |
317 | 327 | |
318 | | fAllPages = CreatePageSelectionItem("allPages", "All Pages", |
| 328 | fAllPages = CreatePageSelectionItem("allPages", |
| 329 | B_TRANSLATE("All Pages"), |
319 | 330 | JobData::kAllPages); |
320 | 331 | fOddNumberedPages = CreatePageSelectionItem("oddPages", |
321 | | "Odd-Numbered Pages", JobData::kOddNumberedPages); |
| 332 | B_TRANSLATE("Odd-Numbered Pages"), JobData::kOddNumberedPages); |
322 | 333 | fEvenNumberedPages = CreatePageSelectionItem("evenPages", |
323 | | "Even-Numbered Pages", JobData::kEvenNumberedPages); |
| 334 | B_TRANSLATE("Even-Numbered Pages"), JobData::kEvenNumberedPages); |
324 | 335 | |
325 | | fPreview = new BCheckBox("preview", "Show preview before printing", NULL); |
| 336 | fPreview = new BCheckBox("preview", |
| 337 | B_TRANSLATE("Show preview before printing"), NULL); |
326 | 338 | if (fJobData->GetShowPreview()) |
327 | 339 | fPreview->SetValue(B_CONTROL_ON); |
328 | 340 | |
… |
… |
JobSetupView::AttachedToWindow()
|
331 | 343 | separator->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 1)); |
332 | 344 | |
333 | 345 | // buttons |
334 | | BButton* cancel = new BButton("cancel", "Cancel", |
| 346 | BButton* cancel = new BButton("cancel", B_TRANSLATE("Cancel"), |
335 | 347 | new BMessage(kMsgCancel)); |
336 | | BButton* ok = new BButton("ok", "OK", new BMessage(kMsgOK)); |
| 348 | BButton* ok = new BButton("ok", B_TRANSLATE("OK"), new BMessage(kMsgOK)); |
337 | 349 | ok->MakeDefault(true); |
338 | 350 | |
339 | 351 | if (IsHalftoneConfigurationNeeded()) { |
… |
… |
JobSetupView::CreateHalftoneConfigurationUI()
|
465 | 477 | FillCapabilityMenu(fDitherType, kMsgQuality, gDitherTypes, |
466 | 478 | sizeof(gDitherTypes) / sizeof(gDitherTypes[0]), |
467 | 479 | (int)fJobData->GetDitherType()); |
468 | | fDitherMenuField = new BMenuField("dithering", "Dot Pattern:", |
| 480 | fDitherMenuField = new BMenuField("dithering", B_TRANSLATE("Dot Pattern:"), |
469 | 481 | fDitherType); |
470 | 482 | fDitherType->SetTargetForItems(this); |
471 | 483 | |
… |
… |
JobSetupView::CreateHalftoneConfigurationUI()
|
482 | 494 | fHalftone->SetExplicitMaxSize(size); |
483 | 495 | |
484 | 496 | // gamma |
485 | | fGamma = new JSDSlider("gamma", "Gamma", new BMessage(kMsgQuality), |
| 497 | fGamma = new JSDSlider("gamma", B_TRANSLATE("Gamma"), new BMessage(kMsgQuality), |
486 | 498 | -300, 300); |
487 | 499 | |
488 | | fGamma->SetLimitLabels("Lighter", "Darker"); |
| 500 | fGamma->SetLimitLabels(B_TRANSLATE("Lighter"), B_TRANSLATE("Darker")); |
489 | 501 | fGamma->SetValue((int32)(100 * log(fJobData->GetGamma()) / log(2.0))); |
490 | 502 | fGamma->SetHashMarks(B_HASH_MARKS_BOTH); |
491 | 503 | fGamma->SetHashMarkCount(7); |
… |
… |
JobSetupView::CreateHalftoneConfigurationUI()
|
493 | 505 | fGamma->SetTarget(this); |
494 | 506 | |
495 | 507 | // ink density |
496 | | fInkDensity = new JSDSlider("inkDensity", "Ink Usage", |
| 508 | fInkDensity = new JSDSlider("inkDensity", B_TRANSLATE("Ink Usage"), |
497 | 509 | new BMessage(kMsgQuality), 0, 127); |
498 | 510 | |
499 | | fInkDensity->SetLimitLabels("Min", "Max"); |
| 511 | fInkDensity->SetLimitLabels(B_TRANSLATE("Min"), B_TRANSLATE("Max")); |
500 | 512 | fInkDensity->SetValue((int32)fJobData->GetInkDensity()); |
501 | 513 | fInkDensity->SetHashMarks(B_HASH_MARKS_BOTH); |
502 | 514 | fInkDensity->SetHashMarkCount(10); |
… |
… |
JobSetupView::UpdateJobData()
|
1013 | 1025 | JobSetupDlg::JobSetupDlg(JobData* jobData, PrinterData* printerData, |
1014 | 1026 | const PrinterCap* printerCap) |
1015 | 1027 | : |
1016 | | DialogWindow(BRect(100, 100, 200, 200), "PrintJob Setup", |
| 1028 | DialogWindow(BRect(100, 100, 200, 200), B_TRANSLATE("PrintJob Setup"), |
1017 | 1029 | B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, |
1018 | 1030 | B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE |
1019 | 1031 | | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS |
diff --git a/src/libs/print/libprint/MarginView.cpp b/src/libs/print/libprint/MarginView.cpp
index 3da3b42..390b407 100644
a
|
b
|
THE SOFTWARE.
|
37 | 37 | |
38 | 38 | |
39 | 39 | #include <AppKit.h> |
| 40 | #include <Catalog.h> |
40 | 41 | #include <GridView.h> |
41 | 42 | #include <GridLayout.h> |
42 | 43 | #include <GroupLayout.h> |
… |
… |
THE SOFTWARE.
|
48 | 49 | #include <stdio.h> |
49 | 50 | #include <stdlib.h> |
50 | 51 | |
| 52 | #undef B_TRANSLATION_CONTEXT |
| 53 | #define B_TRANSLATION_CONTEXT "libprint_MarginView" |
51 | 54 | |
52 | 55 | /*----------------- MarginView Private Constants --------------------*/ |
53 | 56 | |
… |
… |
const static float kMinFieldWidth = 100; // pixels
|
65 | 68 | const static float kMinUnitHeight = 30; // pixels |
66 | 69 | |
67 | 70 | const static float kUnitFormat[] = { kInchUnits, kCMUnits, kPointUnits }; |
68 | | const static char *kUnitNames[] = { "Inch", "cm", "Points", NULL }; |
| 71 | const static char *kUnitNames[] = { |
| 72 | B_TRANSLATE_MARK("Inch"), |
| 73 | B_TRANSLATE_MARK("cm"), |
| 74 | B_TRANSLATE_MARK("Points"), |
| 75 | NULL }; |
69 | 76 | const static MarginUnit kUnitMsg[] = { kUnitInch, kUnitCM, kUnitPoint }; |
70 | 77 | |
71 | 78 | const pattern kDots = {{ 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }}; |
… |
… |
MarginView::MarginView(int32 pageWidth, int32 pageHeight,
|
157 | 164 | fMarginUnit = units; |
158 | 165 | fUnitValue = kUnitFormat[units]; |
159 | 166 | |
160 | | SetLabel("Margins"); |
| 167 | SetLabel(B_TRANSLATE("Margins")); |
161 | 168 | |
162 | 169 | fMargins = margins; |
163 | 170 | |
… |
… |
MarginView::_ConstructGUI()
|
393 | 400 | |
394 | 401 | // top |
395 | 402 | str << fMargins.top/fUnitValue; |
396 | | fTop = new BTextControl("top", "Top:", str.String(), NULL); |
| 403 | fTop = new BTextControl("top", B_TRANSLATE("Top:"), str.String(), NULL); |
397 | 404 | |
398 | 405 | fTop->SetModificationMessage(new BMessage(TOP_MARGIN_CHANGED)); |
399 | 406 | fTop->SetTarget(this); |
… |
… |
MarginView::_ConstructGUI()
|
402 | 409 | //left |
403 | 410 | str = ""; |
404 | 411 | str << fMargins.left/fUnitValue; |
405 | | fLeft = new BTextControl("left", "Left:", str.String(), NULL); |
| 412 | fLeft = new BTextControl("left", B_TRANSLATE("Left:"), str.String(), NULL); |
406 | 413 | |
407 | 414 | fLeft->SetModificationMessage(new BMessage(LEFT_MARGIN_CHANGED)); |
408 | 415 | fLeft->SetTarget(this); |
… |
… |
MarginView::_ConstructGUI()
|
411 | 418 | //bottom |
412 | 419 | str = ""; |
413 | 420 | str << fMargins.bottom/fUnitValue; |
414 | | fBottom = new BTextControl("bottom", "Bottom:", str.String(), NULL); |
| 421 | fBottom = new BTextControl("bottom", B_TRANSLATE("Bottom:"), str.String(), NULL); |
415 | 422 | |
416 | 423 | fBottom->SetModificationMessage(new BMessage(BOTTOM_MARGIN_CHANGED)); |
417 | 424 | fBottom->SetTarget(this); |
… |
… |
MarginView::_ConstructGUI()
|
420 | 427 | //right |
421 | 428 | str = ""; |
422 | 429 | str << fMargins.right/fUnitValue; |
423 | | fRight = new BTextControl("right", "Right:", str.String(), NULL); |
| 430 | fRight = new BTextControl("right", B_TRANSLATE("Right:"), str.String(), NULL); |
424 | 431 | |
425 | 432 | fRight->SetModificationMessage(new BMessage(RIGHT_MARGIN_CHANGED)); |
426 | 433 | fRight->SetTarget(this); |
… |
… |
MarginView::_ConstructGUI()
|
429 | 436 | // Create Units popup |
430 | 437 | |
431 | 438 | BPopUpMenu *menu = new BPopUpMenu("units"); |
432 | | BMenuField *units = new BMenuField("units", "Units:", menu); |
| 439 | BMenuField *units = new BMenuField("units", B_TRANSLATE("Units:"), menu); |
433 | 440 | |
434 | 441 | BMenuItem *item; |
435 | 442 | // Construct menu items |
436 | 443 | for (int32 i = 0; kUnitNames[i] != NULL; i++) { |
437 | 444 | BMessage *msg = new BMessage(MARGIN_UNIT_CHANGED); |
438 | 445 | msg->AddInt32("marginUnit", kUnitMsg[i]); |
439 | | menu->AddItem(item = new BMenuItem(kUnitNames[i], msg)); |
| 446 | menu->AddItem(item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kUnitNames[i]), |
| 447 | msg)); |
440 | 448 | item->SetTarget(this); |
441 | 449 | if (fMarginUnit == kUnitMsg[i]) |
442 | 450 | item->SetMarked(true); |
diff --git a/src/libs/print/libprint/PageSetupDlg.cpp b/src/libs/print/libprint/PageSetupDlg.cpp
index a23f659..473e7e7 100644
a
|
b
|
|
14 | 14 | #include <Bitmap.h> |
15 | 15 | #include <Box.h> |
16 | 16 | #include <Button.h> |
| 17 | #include <Catalog.h> |
17 | 18 | #include <Debug.h> |
18 | 19 | #include <Font.h> |
19 | 20 | #include <GridView.h> |
… |
… |
|
43 | 44 | #include "PrinterCap.h" |
44 | 45 | #include "PrintUtils.h" |
45 | 46 | |
| 47 | #undef B_TRANSLATION_CONTEXT |
| 48 | #define B_TRANSLATION_CONTEXT "libprint_PageSetupDlg" |
46 | 49 | |
47 | 50 | using namespace std; |
48 | 51 | |
… |
… |
PageSetupView::AttachedToWindow()
|
127 | 130 | } |
128 | 131 | if (!marked) |
129 | 132 | item->SetMarked(true); |
130 | | BMenuField* paperSize = new BMenuField("paperSize", "Paper Size:", fPaper); |
| 133 | BMenuField* paperSize = new BMenuField("paperSize", |
| 134 | B_TRANSLATE("Paper Size:"), fPaper); |
131 | 135 | |
132 | 136 | // orientation |
133 | 137 | fOrientation = new BPopUpMenu("orientation"); |
134 | 138 | fOrientation->SetRadioMode(true); |
135 | 139 | |
136 | | BMenuField* orientation = new BMenuField("orientation", "Orientation:", fOrientation); |
| 140 | BMenuField* orientation = new BMenuField("orientation", |
| 141 | B_TRANSLATE("Orientation:"), fOrientation); |
137 | 142 | |
138 | 143 | count = fPrinterCap->CountCap(PrinterCap::kOrientation); |
139 | 144 | if (count == 0) { |
140 | | AddOrientationItem("Portrait", JobData::kPortrait); |
141 | | AddOrientationItem("Landscape", JobData::kLandscape); |
| 145 | AddOrientationItem(B_TRANSLATE("Portrait"), JobData::kPortrait); |
| 146 | AddOrientationItem(B_TRANSLATE("Landscape"), JobData::kLandscape); |
142 | 147 | } else { |
143 | 148 | OrientationCap **orientation_cap = (OrientationCap **)fPrinterCap->GetCaps(PrinterCap::kOrientation); |
144 | 149 | while (count--) { |
… |
… |
PageSetupView::AttachedToWindow()
|
167 | 172 | } |
168 | 173 | if (!marked) |
169 | 174 | item->SetMarked(true); |
170 | | BMenuField* resolution = new BMenuField("resolution", "Resolution:", fResolution); |
| 175 | BMenuField* resolution = new BMenuField("resolution", |
| 176 | B_TRANSLATE("Resolution:"), fResolution); |
171 | 177 | |
172 | 178 | // scale |
173 | 179 | BString scale; |
174 | 180 | scale << (int)fJobData->GetScaling(); |
175 | | fScaling = new BTextControl("scale", "Scale [%]:", |
| 181 | fScaling = new BTextControl("scale", B_TRANSLATE("Scale [%]:"), |
176 | 182 | scale.String(), |
177 | 183 | NULL); |
178 | 184 | int num; |
… |
… |
PageSetupView::AttachedToWindow()
|
185 | 191 | fScaling->TextView()->SetMaxBytes(3); |
186 | 192 | |
187 | 193 | // cancel and ok |
188 | | BButton* cancel = new BButton("cancel", "Cancel", new BMessage(kMsgCancel)); |
189 | | BButton* ok = new BButton("ok", "OK", new BMessage(kMsgOK)); |
| 194 | BButton* cancel = new BButton("cancel", B_TRANSLATE("Cancel"), |
| 195 | new BMessage(kMsgCancel)); |
| 196 | BButton* ok = new BButton("ok", B_TRANSLATE("OK"), new BMessage(kMsgOK)); |
190 | 197 | |
191 | 198 | ok->MakeDefault(true); |
192 | 199 | |
… |
… |
PageSetupView::MessageReceived(BMessage *msg)
|
348 | 355 | // TODO center window on screen |
349 | 356 | PageSetupDlg::PageSetupDlg(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap) |
350 | 357 | : DialogWindow(BRect(100, 100, 160, 160), |
351 | | "Page Setup", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, |
| 358 | B_TRANSLATE("Page Setup"), |
| 359 | B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, |
352 | 360 | B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE |
353 | 361 | | B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE) |
354 | 362 | { |
diff --git a/src/libs/print/libprint/Preview.cpp b/src/libs/print/libprint/Preview.cpp
index db4d9d5..c01c672 100644
a
|
b
|
|
20 | 20 | |
21 | 21 | #include <Application.h> |
22 | 22 | #include <Button.h> |
| 23 | #include <Catalog.h> |
23 | 24 | #include <Debug.h> |
24 | 25 | #include <Region.h> |
25 | 26 | #include <Screen.h> |
… |
… |
|
28 | 29 | #include <StringView.h> |
29 | 30 | #include <TextControl.h> |
30 | 31 | |
| 32 | #undef B_TRANSLATION_CONTEXT |
| 33 | #define B_TRANSLATION_CONTEXT "libprint_Preview" |
31 | 34 | |
32 | 35 | // #pragma mark - PreviewPage |
33 | 36 | |
… |
… |
int32 PreviewView::_GetPageNumber(int32 index) const
|
779 | 782 | |
780 | 783 | |
781 | 784 | PreviewWindow::PreviewWindow(BFile* jobFile, bool showOkAndCancelButtons) |
782 | | : BlockingWindow(BRect(20, 24, 400, 600), "Preview", B_TITLED_WINDOW, |
| 785 | : BlockingWindow(BRect(20, 24, 400, 600), B_TRANSLATE("Preview"), B_TITLED_WINDOW, |
783 | 786 | B_ASYNCHRONOUS_CONTROLS) |
784 | 787 | , fButtonBarHeight(0.0) |
785 | 788 | { |
… |
… |
PreviewWindow::PreviewWindow(BFile* jobFile, bool showOkAndCancelButtons)
|
792 | 795 | |
793 | 796 | bounds.OffsetBy(10.0, 10.0); |
794 | 797 | |
795 | | fFirst = new BButton(bounds, "first", "First Page", new BMessage(MSG_FIRST_PAGE)); |
| 798 | fFirst = new BButton(bounds, "first", B_TRANSLATE("First Page"), |
| 799 | new BMessage(MSG_FIRST_PAGE)); |
796 | 800 | panel->AddChild(fFirst); |
797 | 801 | fFirst->ResizeToPreferred(); |
798 | 802 | |
799 | 803 | bounds.OffsetBy(fFirst->Bounds().Width() + 10.0, 0.0); |
800 | | fPrev = new BButton(bounds, "previous", "Previous Page", new BMessage(MSG_PREV_PAGE)); |
| 804 | fPrev = new BButton(bounds, "previous", B_TRANSLATE("Previous Page"), |
| 805 | new BMessage(MSG_PREV_PAGE)); |
801 | 806 | panel->AddChild(fPrev); |
802 | 807 | fPrev->ResizeToPreferred(); |
803 | 808 | |
804 | 809 | bounds.OffsetBy(fPrev->Bounds().Width() + 10.0, 0.0); |
805 | | fNext = new BButton(bounds, "next", "Next Page", new BMessage(MSG_NEXT_PAGE)); |
| 810 | fNext = new BButton(bounds, "next", B_TRANSLATE("Next Page"), |
| 811 | new BMessage(MSG_NEXT_PAGE)); |
806 | 812 | panel->AddChild(fNext); |
807 | 813 | fNext->ResizeToPreferred(); |
808 | 814 | |
809 | 815 | bounds.OffsetBy(fNext->Bounds().Width() + 10.0, 0.0); |
810 | | fLast = new BButton(bounds, "last", "Last Page", new BMessage(MSG_LAST_PAGE)); |
| 816 | fLast = new BButton(bounds, "last", B_TRANSLATE("Last Page"), |
| 817 | new BMessage(MSG_LAST_PAGE)); |
811 | 818 | panel->AddChild(fLast); |
812 | 819 | fLast->ResizeToPreferred(); |
813 | 820 | |
… |
… |
PreviewWindow::PreviewWindow(BFile* jobFile, bool showOkAndCancelButtons)
|
832 | 839 | bounds.OffsetBy(fPageNumber->Bounds().Width() + 5.0, 0.0); |
833 | 840 | fPageText = new BStringView(bounds, "pageText", ""); |
834 | 841 | panel->AddChild(fPageText); |
835 | | fPageText->ResizeTo(fPageText->StringWidth("of 99999 Pages"), |
| 842 | fPageText->ResizeTo(fPageText->StringWidth(B_TRANSLATE("of 99999 Pages")), |
836 | 843 | fFirst->Bounds().Height()); |
837 | 844 | |
838 | 845 | bounds.OffsetBy(fPageText->Bounds().Width() + 10.0, 0.0); |
839 | | fZoomIn = new BButton(bounds, "zoomIn", "Zoom In", new BMessage(MSG_ZOOM_IN)); |
| 846 | fZoomIn = new BButton(bounds, "zoomIn", B_TRANSLATE("Zoom In"), |
| 847 | new BMessage(MSG_ZOOM_IN)); |
840 | 848 | panel->AddChild(fZoomIn); |
841 | 849 | fZoomIn->ResizeToPreferred(); |
842 | 850 | |
843 | 851 | bounds.OffsetBy(fZoomIn->Bounds().Width() + 10.0, 0.0); |
844 | | fZoomOut = new BButton(bounds, "ZoomOut", "Zoom Out", new BMessage(MSG_ZOOM_OUT)); |
| 852 | fZoomOut = new BButton(bounds, "ZoomOut", B_TRANSLATE("Zoom Out"), |
| 853 | new BMessage(MSG_ZOOM_OUT)); |
845 | 854 | panel->AddChild(fZoomOut); |
846 | 855 | fZoomOut->ResizeToPreferred(); |
847 | 856 | |
… |
… |
PreviewWindow::PreviewWindow(BFile* jobFile, bool showOkAndCancelButtons)
|
859 | 868 | // cancel printing if user closes the preview window |
860 | 869 | SetUserQuitResult(B_ERROR); |
861 | 870 | |
862 | | BButton *printJob = new BButton(BRect(), "printJob", "Print", |
| 871 | BButton *printJob = new BButton(BRect(), "printJob", B_TRANSLATE("Print"), |
863 | 872 | new BMessage(MSG_PRINT_JOB), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); |
864 | 873 | panel->AddChild(printJob); |
865 | 874 | printJob->ResizeToPreferred(); |
866 | 875 | printJob->MoveTo(bounds.right - (printJob->Bounds().Width() + 10.0), |
867 | 876 | bounds.bottom + 10.0); |
868 | 877 | |
869 | | BButton *cancelJob = new BButton(BRect(), "cancelJob", "Cancel", |
| 878 | BButton *cancelJob = new BButton(BRect(), "cancelJob", B_TRANSLATE("Cancel"), |
870 | 879 | new BMessage(MSG_CANCEL_JOB), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); |
871 | 880 | panel->AddChild(cancelJob); |
872 | 881 | cancelJob->ResizeToPreferred(); |
… |
… |
PreviewWindow::_UpdateControls()
|
1003 | 1012 | text << fPreview->CurrentPage(); |
1004 | 1013 | fPageNumber->SetText(text.String()); |
1005 | 1014 | |
1006 | | text.SetTo("of "); |
1007 | | text << fPreview->NumberOfPages() << " Page"; |
1008 | | if (fPreview->NumberOfPages() > 1) |
1009 | | text.Append("s"); |
| 1015 | if (fPreview->NumberOfPages() == 1){ |
| 1016 | text.SetTo(B_TRANSLATE("of 1 Page")); |
| 1017 | } else if (fPreview->NumberOfPages() > 1){ |
| 1018 | text.SetTo(B_TRANSLATE("of %Pages Pages")); |
| 1019 | BString pages; |
| 1020 | pages << fPreview->NumberOfPages(); |
| 1021 | text.ReplaceFirst("%Pages", pages); |
| 1022 | } |
1010 | 1023 | fPageText->SetText(text.String()); |
1011 | 1024 | } |
diff --git a/src/libs/print/libprint/StatusWindow.cpp b/src/libs/print/libprint/StatusWindow.cpp
index 450c32e..9911b33 100644
a
|
b
|
|
9 | 9 | #include "StatusWindow.h" |
10 | 10 | |
11 | 11 | #include <Button.h> |
| 12 | #include <Catalog.h> |
12 | 13 | #include <GroupLayout.h> |
13 | 14 | #include <GroupLayoutBuilder.h> |
14 | 15 | #include <Message.h> |
… |
… |
|
21 | 22 | #define CANCEL_MSG 'canM' |
22 | 23 | #define HIDE_MSG 'hidM' |
23 | 24 | |
| 25 | #undef B_TRANSLATION_CONTEXT |
| 26 | #define B_TRANSLATION_CONTEXT "libprint_StatusWindow" |
24 | 27 | |
25 | 28 | StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage, |
26 | 29 | uint32 numPages, uint32 numCopies, uint32 nup) |
27 | 30 | : |
28 | 31 | BWindow(BRect(200, 200, 250, 250), |
29 | | "Print Status", |
| 32 | B_TRANSLATE("Print Status"), |
30 | 33 | B_TITLED_WINDOW, |
31 | 34 | B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE |
32 | 35 | | B_AUTO_UPDATE_SIZE_LIMITS) |
… |
… |
StatusWindow::StatusWindow(bool oddPages, bool evenPages, uint32 firstPage,
|
39 | 42 | // numCopies - total number of document copies |
40 | 43 | |
41 | 44 | // the status bar |
42 | | fStatusBar = new BStatusBar("statusBar", "Page: "); |
| 45 | fStatusBar = new BStatusBar("statusBar", B_TRANSLATE("Page: ")); |
43 | 46 | |
44 | 47 | // the cancel button |
45 | | fHideButton = new BButton("hideButton", "Hide Status", |
| 48 | fHideButton = new BButton("hideButton", B_TRANSLATE("Hide Status"), |
46 | 49 | new BMessage(HIDE_MSG)); |
47 | 50 | |
48 | | fCancelButton = new BButton("cancelButton", "Cancel", |
| 51 | fCancelButton = new BButton("cancelButton", B_TRANSLATE("Cancel"), |
49 | 52 | new BMessage(CANCEL_MSG)); |
50 | 53 | |
51 | 54 | SetLayout(new BGroupLayout(B_VERTICAL)); |
… |
… |
void
|
113 | 116 | StatusWindow::ResetStatusBar(void) |
114 | 117 | { |
115 | 118 | Lock(); |
116 | | fStatusBar->Reset("Page: "); |
| 119 | fStatusBar->Reset(B_TRANSLATE("Page: ")); |
117 | 120 | InvalidateLayout(true); |
118 | 121 | Unlock(); |
119 | 122 | } |
… |
… |
StatusWindow::UpdateStatusBar(uint32 page, uint32 copy)
|
135 | 138 | string1.Append(BString(" / ")); |
136 | 139 | string1.Append(string2); |
137 | 140 | |
138 | | BString string3 = BString("Remaining Document Copies: "); |
| 141 | BString string3; |
139 | 142 | if (fDocumentCopy == true) { |
140 | | sprintf(buffer, "%d", (int)(fDocCopies)); |
141 | | BString string4(buffer); |
142 | | string3.Append(string4); |
| 143 | string3.SetToFormat(B_TRANSLATE("Remaining Document Copies: %d"), |
| 144 | (int)(fDocCopies)); |
143 | 145 | } else { |
144 | | string3 = BString("Remaining Page Copies: "); |
145 | | char buffer[20]; |
146 | | sprintf(buffer,"%d",(int)(fCopies - copy) ); |
147 | | BString string4(buffer); |
148 | | string3.Append(string4); |
| 146 | string3.SetToFormat(B_TRANSLATE("Remaining Page Copies: %d"), |
| 147 | (int)(fCopies - copy)); |
149 | 148 | } |
150 | 149 | |
151 | 150 | fStatusBar->Update(fStatusDelta * 100.0 / fNops, |
… |
… |
StatusWindow::MessageReceived(BMessage *message)
|
177 | 176 | case CANCEL_MSG: // 'CancelButton' is pressed... |
178 | 177 | fCancelled = true; |
179 | 178 | fCancelButton->SetEnabled(false); |
180 | | fCancelButton->SetLabel("Job cancelled"); |
| 179 | fCancelButton->SetLabel(B_TRANSLATE("Job cancelled")); |
181 | 180 | InvalidateLayout(true); |
182 | 181 | break; |
183 | 182 | |