Ticket #5747: FileTypesUpdate.patch
File FileTypesUpdate.patch, 12.6 KB (added by , 14 years ago) |
---|
-
src/preferences/filetypes/FileTypes.cpp
221 221 ref.name, strerror(status)); 222 222 223 223 (new BAlert(TR("FileTypes request"), 224 buffer, "Ok", NULL, NULL,224 buffer, TR("Ok"), NULL, NULL, 225 225 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); 226 226 227 227 message->RemoveData("refs", --index); … … 366 366 if (message->FindMessenger("target", &target) != B_OK) 367 367 target = be_app_messenger; 368 368 369 BString title = "FileTypes";369 BString title = TR("FileTypes"); 370 370 if (subTitle != NULL && subTitle[0]) { 371 371 title.Append(": "); 372 372 title.Append(subTitle); -
src/preferences/filetypes/FileTypeWindow.cpp
96 96 fSameTypeAsButton->ResizeToPreferred(); 97 97 box->AddChild(fSameTypeAsButton); 98 98 99 width = font.StringWidth( "Icon") + 16.0f;99 width = font.StringWidth(TR("Icon")) + 16.0f; 100 100 if (width < B_LARGE_ICON + 16.0f) 101 101 width = B_LARGE_ICON + 16.0f; 102 102 … … 112 112 rect.right += width + 8.0f; 113 113 float iconBoxWidth = rect.Width(); 114 114 box = new BBox(rect, NULL, B_FOLLOW_RIGHT | B_FOLLOW_TOP); 115 box->SetLabel( "Icon");115 box->SetLabel(TR("Icon")); 116 116 topView->AddChild(box); 117 117 118 118 rect = BRect(8.0f, 0.0f, 7.0f + B_LARGE_ICON, B_LARGE_ICON - 1.0f); … … 221 221 } else if (refs.FindRef("refs", 0, &ref) == B_OK) 222 222 title = ref.name; 223 223 224 title.Append( " file type");224 title.Append(TR(" file type")); 225 225 return title; 226 226 } 227 227 -
src/preferences/filetypes/AttributeListView.cpp
6 6 7 7 #include "AttributeListView.h" 8 8 9 #include <Catalog.h> 10 #include <Locale.h> 11 9 12 #include <stdio.h> 10 13 14 #undef TR_CONTEXT 15 #define TR_CONTEXT "Attribute List View" 11 16 12 17 const struct type_map kTypeMap[] = { 13 { "String", B_STRING_TYPE},14 { "Boolean", B_BOOL_TYPE},15 { "Integer 8 bit", B_INT8_TYPE},16 { "Integer 16 bit", B_INT16_TYPE},17 { "Integer 32 bit", B_INT32_TYPE},18 { "Integer 64 bit", B_INT64_TYPE},19 { "Float", B_FLOAT_TYPE},20 { "Double", B_DOUBLE_TYPE},21 { "Time", B_TIME_TYPE},18 {TR("String"), B_STRING_TYPE}, 19 {TR("Boolean"), B_BOOL_TYPE}, 20 {TR("Integer 8 bit"), B_INT8_TYPE}, 21 {TR("Integer 16 bit"), B_INT16_TYPE}, 22 {TR("Integer 32 bit"), B_INT32_TYPE}, 23 {TR("Integer 64 bit"), B_INT64_TYPE}, 24 {TR("Float"), B_FLOAT_TYPE}, 25 {TR("Double"), B_DOUBLE_TYPE}, 26 {TR("Time"), B_TIME_TYPE}, 22 27 {NULL, 0} 23 28 }; 24 29 25 30 // TODO: in the future, have a (private) Tracker API that exports these 26 31 // as well as a nice GUI for them. 27 32 const struct display_as_map kDisplayAsMap[] = { 28 { "Default", NULL, {}},29 { "Rating", "rating", {B_INT32_TYPE, B_INT8_TYPE, B_INT16_TYPE}},33 {TR("Default"), NULL, {}}, 34 {TR("Rating"), "rating", {B_INT32_TYPE, B_INT8_TYPE, B_INT16_TYPE}}, 30 35 {NULL, NULL, {}} 31 36 }; 32 37 -
src/preferences/filetypes/PreferredAppMenu.cpp
287 287 "Are you sure you want to set it anyway?"), 288 288 description[0] ? description : preferred); 289 289 290 BAlert* alert = new BAlert( "FileTypes Request", warning,291 TR("Set Preferred Application"), "Cancel", NULL, B_WIDTH_AS_USUAL,292 B_WARNING_ALERT);290 BAlert* alert = new BAlert(TR("FileTypes Request"), warning, 291 TR("Set Preferred Application"), TR("Cancel"), NULL, 292 B_WIDTH_AS_USUAL, B_WARNING_ALERT); 293 293 if (alert->Go() == 1) 294 294 return B_ERROR; 295 295 } -
src/preferences/filetypes/ApplicationTypesWindow.cpp
187 187 rect.left = 10.0f; 188 188 rect.right = 170; 189 189 190 fTypeListView = new MimeTypeListView(rect, "listview", "application", true, true,191 B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM);190 fTypeListView = new MimeTypeListView(rect, "listview", "application", 191 true, true, B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM); 192 192 fTypeListView->SetSelectionMessage(new BMessage(kMsgTypeSelected)); 193 193 fTypeListView->SetInvocationMessage(new BMessage(kMsgTypeInvoked)); 194 194 195 195 BScrollView* scrollView = new BScrollView("scrollview", fTypeListView, 196 B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, B_FRAME_EVENTS | B_WILL_DRAW, false, true); 196 B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, B_FRAME_EVENTS | B_WILL_DRAW, 197 false, true); 197 198 topView->AddChild(scrollView); 198 199 199 200 // "Information" group … … 215 216 216 217 innerRect.right = box->Bounds().Width() - 8.0f; 217 218 innerRect.top += ceilf(fontHeight.ascent); 218 fNameView = new StringView(innerRect, "name", TR("Name:"), NULL, B_FOLLOW_LEFT_RIGHT); 219 fNameView = new StringView(innerRect, "name", TR("Name:"), NULL, 220 B_FOLLOW_LEFT_RIGHT); 219 221 fNameView->SetDivider(labelWidth); 220 222 float width, height; 221 223 fNameView->GetPreferredSize(&width, &height); … … 225 227 226 228 innerRect.OffsetBy(0, fNameView->Bounds().Height() + 5.0f); 227 229 innerRect.bottom = innerRect.top + height; 228 fSignatureView = new StringView(innerRect, "signature", TR("Signature:"), NULL,229 B_FOLLOW_LEFT_RIGHT);230 fSignatureView = new StringView(innerRect, "signature", TR("Signature:"), 231 NULL, B_FOLLOW_LEFT_RIGHT); 230 232 fSignatureView->SetDivider(labelWidth); 231 233 box->AddChild(fSignatureView); 232 234 … … 253 255 254 256 innerRect.OffsetBy(0, fNameView->Bounds().Height() + 5.0f); 255 257 innerRect.right = innerRect.left + labelWidth; 256 fDescriptionLabel = new StringView(innerRect, "description", TR("Description:"), NULL); 258 fDescriptionLabel = new StringView(innerRect, "description", 259 TR("Description:"), NULL); 257 260 fDescriptionLabel->SetDivider(labelWidth); 258 261 box->AddChild(fDescriptionLabel); 259 262 … … 274 277 rect = box->Frame(); 275 278 rect.top = rect.bottom + 8.0f; 276 279 rect.bottom = rect.top + 20.0f; 277 fTrackerButton = new BButton(rect, "tracker", TR("Show in Tracker" B_UTF8_ELLIPSIS), NULL,278 B_FOLLOW_RIGHT);280 fTrackerButton = new BButton(rect, "tracker", 281 TR("Show in Tracker" B_UTF8_ELLIPSIS), NULL, B_FOLLOW_RIGHT); 279 282 fTrackerButton->ResizeToPreferred(); 280 fTrackerButton->MoveTo(rect.right - fTrackerButton->Bounds().Width(), rect.top); 283 fTrackerButton->MoveTo(rect.right - fTrackerButton->Bounds().Width(), 284 rect.top); 281 285 topView->AddChild(fTrackerButton); 282 286 283 287 fLaunchButton = new BButton(rect, "launch", TR("Launch"), NULL, … … 287 291 - fLaunchButton->Bounds().Width(), rect.top); 288 292 topView->AddChild(fLaunchButton); 289 293 290 fEditButton = new BButton(rect, "edit", TR("Edit" B_UTF8_ELLIPSIS), new BMessage(kMsgEdit),291 B_FOLLOW_RIGHT);294 fEditButton = new BButton(rect, "edit", TR("Edit" B_UTF8_ELLIPSIS), 295 new BMessage(kMsgEdit), B_FOLLOW_RIGHT); 292 296 fEditButton->ResizeToPreferred(); 293 297 fEditButton->MoveTo(fLaunchButton->Frame().left - 6.0f 294 298 - fEditButton->Bounds().Width(), rect.top); 295 299 topView->AddChild(fEditButton); 296 300 297 SetSizeLimits(scrollView->Frame().right + 22.0f + fTrackerButton->Frame().Width() 298 + fLaunchButton->Frame().Width() + 6 + fEditButton->Frame().Width(), 32767.0f, 301 SetSizeLimits(scrollView->Frame().right + 22.0f 302 + fTrackerButton->Frame().Width() + fLaunchButton->Frame().Width() 303 + 6 + fEditButton->Frame().Width(), 32767.0f, 299 304 fTrackerButton->Frame().bottom + 8.0f, 32767.0f); 300 305 301 306 BMimeType::StartWatching(this); … … 328 333 int32 removed = 0; 329 334 volatile bool quit = false; 330 335 331 BWindow* progressWindow = new ProgressWindow(TR("Removing uninstalled application types"), 336 BWindow* progressWindow = 337 new ProgressWindow(TR("Removing uninstalled application types"), 332 338 fTypeListView->FullListCountItems(), &quit); 333 339 progressWindow->AddToSubset(this); 334 340 progressWindow->Show(); 335 341 336 342 for (int32 i = fTypeListView->FullListCountItems(); i-- > 0 && !quit;) { 337 MimeTypeItem* item = dynamic_cast<MimeTypeItem*>(fTypeListView->FullListItemAt(i)); 343 MimeTypeItem* item 344 = dynamic_cast<MimeTypeItem*>(fTypeListView->FullListItemAt(i)); 338 345 progressWindow->PostMessage(B_UPDATE_STATUS_BAR); 339 346 340 347 if (item == NULL) … … 382 389 383 390 char message[512]; 384 391 // TODO : use ICU to properly format this 385 snprintf(message, sizeof(message), TR("%ld Application type%s could be removed."), 386 removed, removed == 1 ? "" : "s"); 392 snprintf(message, sizeof(message), 393 (removed == 1 394 ? TR("%ld Application type could be removed.") 395 : TR("%ld Application types could be removed.")), 396 removed); 387 397 error_alert(message, B_OK, B_INFO_ALERT); 388 398 } 389 399 -
src/preferences/filetypes/FileTypesWindow.cpp
277 277 278 278 279 279 FileTypesWindow::FileTypesWindow(const BMessage& settings) 280 : BWindow(_Frame(settings), "FileTypes", B_TITLED_WINDOW,280 : BWindow(_Frame(settings), TR("FileTypes"), B_TITLED_WINDOW, 281 281 B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS), 282 282 fNewTypeWindow(NULL) 283 283 { … … 395 395 396 396 innerRect.left = 8.0f; 397 397 innerRect.top = plainHeight.ascent + 3.0f 398 + (rect.Height() - boldHeight.ascent - fIconView->Bounds().Height()) / 2.0f; 399 if (innerRect.top + fIconView->Bounds().Height() > fIconBox->Bounds().Height() - 6.0f) 400 innerRect.top = fIconBox->Bounds().Height() - 6.0f - fIconView->Bounds().Height(); 398 + (rect.Height() - boldHeight.ascent - fIconView->Bounds().Height()) 399 / 2.0f; 400 if (innerRect.top + fIconView->Bounds().Height() 401 > fIconBox->Bounds().Height() - 6.0f) 402 innerRect.top = fIconBox->Bounds().Height() - 6.0f 403 - fIconView->Bounds().Height(); 401 404 fIconView->MoveTo(innerRect.LeftTop()); 402 405 fIconBox->AddChild(fIconView); 403 406 … … 412 415 413 416 innerRect = fRecognitionBox->Bounds().InsetByCopy(8.0f, 4.0f); 414 417 innerRect.top += ceilf(boldHeight.ascent); 415 fExtensionLabel = new StringView(innerRect, "extension", TR("Extensions:"), NULL); 418 fExtensionLabel = new StringView(innerRect, "extension", 419 TR("Extensions:"), NULL); 416 420 fExtensionLabel->SetAlignment(B_ALIGN_LEFT, B_ALIGN_LEFT); 417 421 fExtensionLabel->ResizeToPreferred(); 418 422 fRecognitionBox->AddChild(fExtensionLabel); … … 420 424 innerRect.top += fExtensionLabel->Bounds().Height() + 2.0f; 421 425 innerRect.left = innerRect.right - button->StringWidth(TR("Remove")) - 16.0f; 422 426 innerRect.bottom = innerRect.top + button->Bounds().Height(); 423 fAddExtensionButton = new BButton(innerRect, "add ext", TR("Add" B_UTF8_ELLIPSIS), 424 new BMessage(kMsgAddExtension), B_FOLLOW_RIGHT); 427 fAddExtensionButton = new BButton(innerRect, "add ext", 428 TR("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddExtension), 429 B_FOLLOW_RIGHT); 425 430 fRecognitionBox->AddChild(fAddExtensionButton); 426 431 427 432 innerRect.OffsetBy(0, innerRect.Height() + 4.0f); … … 466 471 innerRect = fDescriptionBox->Bounds().InsetByCopy(8.0f, 6.0f); 467 472 innerRect.top += ceilf(boldHeight.ascent); 468 473 innerRect.bottom = innerRect.top + button->Bounds().Height(); 469 fInternalNameView = new StringView(innerRect, "internal", TR("Internal name:"), "",470 B_FOLLOW_LEFT_RIGHT);474 fInternalNameView = new StringView(innerRect, "internal", 475 TR("Internal name:"), "", B_FOLLOW_LEFT_RIGHT); 471 476 labelWidth = fInternalNameView->StringWidth(fInternalNameView->Label()) + 2.0f; 472 477 fInternalNameView->SetDivider(labelWidth); 473 478 fInternalNameView->SetEnabled(false); … … 484 489 fDescriptionBox->AddChild(fTypeNameControl); 485 490 486 491 innerRect.OffsetBy(0, fTypeNameControl->Bounds().Height() + 5.0f); 487 fDescriptionControl = new BTextControl(innerRect, "description", TR("Description:"), "", 488 new BMessage(kMsgDescriptionEntered), B_FOLLOW_LEFT_RIGHT); 492 fDescriptionControl = new BTextControl(innerRect, "description", 493 TR("Description:"), "", new BMessage(kMsgDescriptionEntered), 494 B_FOLLOW_LEFT_RIGHT); 489 495 fDescriptionControl->SetDivider(labelWidth); 490 496 fDescriptionControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); 491 497 fDescriptionBox->AddChild(fDescriptionControl); -
src/preferences/filetypes/ApplicationTypeWindow.cpp
576 576 strcpy(name, "\"-\""); 577 577 578 578 BString title(name); 579 title.Append( " application type");579 title.Append(TR(" application type")); 580 580 return title; 581 581 } 582 582