Code cleanup (ellipsis) no functional changes

* Replace instances of hardcoded "..." with B_UTF8_ELLIPSIS

 * Removal of trailing whitespaces

Change-Id: I82d26fb3e599daa2931c69c3bda3b9a5ab719d00
Reviewed-on: https://review.haiku-os.org/c/1012
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Rob Gill
2019-02-06 16:37:51 +00:00
committed by Jérôme Duval
parent 1d0064be8b
commit e4803b2c61
7 changed files with 91 additions and 84 deletions
@@ -72,7 +72,7 @@ RuleFilterConfig::RuleFilterConfig(const BMailAddOnSettings& addOnSettings)
fAttributeControl = new BTextControl("attr", B_TRANSLATE("If"), NULL, NULL); fAttributeControl = new BTextControl("attr", B_TRANSLATE("If"), NULL, NULL);
fAttributeControl->SetToolTip( fAttributeControl->SetToolTip(
B_TRANSLATE("Header field (e.g. Subject, From, ...)")); B_TRANSLATE("Header field (e.g. Subject, From, " B_UTF8_ELLIPSIS ")"));
fAttributeControl->SetText(settings.Attribute()); fAttributeControl->SetText(settings.Attribute());
fRegexControl = new BTextControl("regex", B_TRANSLATE("has"), NULL, NULL); fRegexControl = new BTextControl("regex", B_TRANSLATE("has"), NULL, NULL);
@@ -310,7 +310,7 @@ void
FolderConfigWindow::_LoadFolders() FolderConfigWindow::_LoadFolders()
{ {
StatusWindow* statusWindow = new StatusWindow(this, StatusWindow* statusWindow = new StatusWindow(this,
B_TRANSLATE("Fetching IMAP folders, have patience...")); B_TRANSLATE("Fetching IMAP folders, have patience" B_UTF8_ELLIPSIS));
statusWindow->Show(); statusWindow->Show();
status_t status = fProtocol.Connect(fSettings.ServerAddress(), status_t status = fProtocol.Connect(fSettings.ServerAddress(),
@@ -374,7 +374,8 @@ FolderConfigWindow::_ApplyChanges()
return; return;
StatusWindow* status = new StatusWindow(this, StatusWindow* status = new StatusWindow(this,
B_TRANSLATE("Update subcription of IMAP folders, have patience...")); B_TRANSLATE("Update subcription of IMAP folders, have patience"
B_UTF8_ELLIPSIS));
status->Show(); status->Show();
for (size_t i = 0; i < fFolderList.size(); i++) { for (size_t i = 0; i < fFolderList.size(); i++) {
@@ -456,7 +456,8 @@ ProcessController::MessageReceived(BMessage *message)
} }
if (last) { if (last) {
alert = new BAlert(B_TRANSLATE("Info"), alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("This is the last active processor...\n" B_TRANSLATE("This is the last active processor"
B_UTF8_ELLIPSIS "\n"
"You can't turn it off!"), "You can't turn it off!"),
B_TRANSLATE("That's no Fun!"), NULL, NULL, B_TRANSLATE("That's no Fun!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
@@ -71,7 +71,7 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
fDetailView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); fDetailView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
fStatusBar = new BStatusBar("progress"); fStatusBar = new BStatusBar("progress");
fStatusBar->SetMaxValue(100); fStatusBar->SetMaxValue(100);
fListView = new PackageListView(); fListView = new PackageListView();
fScrollView = new BScrollView("scrollview", fListView, B_WILL_DRAW, fScrollView = new BScrollView("scrollview", fListView, B_WILL_DRAW,
false, true); false, true);
@@ -86,7 +86,7 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
font.SetSize(font.Size() * 1.5); font.SetSize(font.Size() * 1.5);
fHeaderView->SetFont(&font, fHeaderView->SetFont(&font,
B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE | B_FONT_FLAGS); B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE | B_FONT_FLAGS);
BLayoutBuilder::Group<>(this, B_HORIZONTAL, B_USE_ITEM_SPACING) BLayoutBuilder::Group<>(this, B_HORIZONTAL, B_USE_ITEM_SPACING)
.Add(fStripeView) .Add(fStripeView)
.AddGroup(B_VERTICAL, 0) .AddGroup(B_VERTICAL, 0)
@@ -107,23 +107,23 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
.End() .End()
.End() .End()
.End(); .End();
fDetailsLayoutItem = layout_item_for(fDetailView); fDetailsLayoutItem = layout_item_for(fDetailView);
fProgressLayoutItem = layout_item_for(fStatusBar); fProgressLayoutItem = layout_item_for(fStatusBar);
fPackagesLayoutItem = layout_item_for(fScrollView); fPackagesLayoutItem = layout_item_for(fScrollView);
fCancelButtonLayoutItem = layout_item_for(fCancelButton); fCancelButtonLayoutItem = layout_item_for(fCancelButton);
fUpdateButtonLayoutItem = layout_item_for(fUpdateButton); fUpdateButtonLayoutItem = layout_item_for(fUpdateButton);
fDetailsCheckboxLayoutItem = layout_item_for(fDetailsCheckbox); fDetailsCheckboxLayoutItem = layout_item_for(fDetailsCheckbox);
_SetState(STATE_DISPLAY_STATUS); _SetState(STATE_DISPLAY_STATUS);
CenterOnScreen(); CenterOnScreen();
SetFlags(Flags() ^ B_AUTO_UPDATE_SIZE_LIMITS); SetFlags(Flags() ^ B_AUTO_UPDATE_SIZE_LIMITS);
// Prevent resizing for now // Prevent resizing for now
fDefaultRect = Bounds(); fDefaultRect = Bounds();
SetSizeLimits(fDefaultRect.Width(), fDefaultRect.Width(), SetSizeLimits(fDefaultRect.Width(), fDefaultRect.Width(),
fDefaultRect.Height(), fDefaultRect.Height()); fDefaultRect.Height(), fDefaultRect.Height());
// Read settings file // Read settings file
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &fSettingsPath); status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &fSettingsPath);
if (status == B_OK) { if (status == B_OK) {
@@ -141,16 +141,16 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
} }
} }
Show(); Show();
BMessage registerMessage(kMsgRegister); BMessage registerMessage(kMsgRegister);
registerMessage.AddMessenger(kKeyMessenger, BMessenger(this)); registerMessage.AddMessenger(kKeyMessenger, BMessenger(this));
be_app->PostMessage(&registerMessage); be_app->PostMessage(&registerMessage);
fCancelAlertResponse.SetMessage(new BMessage(kMsgCancelResponse)); fCancelAlertResponse.SetMessage(new BMessage(kMsgCancelResponse));
fCancelAlertResponse.SetTarget(this); fCancelAlertResponse.SetTarget(this);
fWarningAlertDismissed.SetMessage(new BMessage(kMsgWarningDismissed)); fWarningAlertDismissed.SetMessage(new BMessage(kMsgWarningDismissed));
fWarningAlertDismissed.SetTarget(this); fWarningAlertDismissed.SetTarget(this);
// Common elements used for the zoom height and width calculations // Common elements used for the zoom height and width calculations
fZoomHeightBaseline = 6 fZoomHeightBaseline = 6
+ be_control_look->ComposeSpacing(B_USE_SMALL_SPACING) + be_control_look->ComposeSpacing(B_USE_SMALL_SPACING)
@@ -217,14 +217,14 @@ void
SoftwareUpdaterWindow::MessageReceived(BMessage* message) SoftwareUpdaterWindow::MessageReceived(BMessage* message)
{ {
switch (message->what) { switch (message->what) {
case kMsgTextUpdate: case kMsgTextUpdate:
{ {
if (fCurrentState == STATE_DISPLAY_PROGRESS) if (fCurrentState == STATE_DISPLAY_PROGRESS)
_SetState(STATE_DISPLAY_STATUS); _SetState(STATE_DISPLAY_STATUS);
else if (fCurrentState != STATE_DISPLAY_STATUS) else if (fCurrentState != STATE_DISPLAY_STATUS)
break; break;
BString header; BString header;
BString detail; BString detail;
Lock(); Lock();
@@ -237,14 +237,14 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
Unlock(); Unlock();
break; break;
} }
case kMsgProgressUpdate: case kMsgProgressUpdate:
{ {
if (fCurrentState == STATE_DISPLAY_STATUS) if (fCurrentState == STATE_DISPLAY_STATUS)
_SetState(STATE_DISPLAY_PROGRESS); _SetState(STATE_DISPLAY_PROGRESS);
else if (fCurrentState != STATE_DISPLAY_PROGRESS) else if (fCurrentState != STATE_DISPLAY_PROGRESS)
break; break;
BString packageName; BString packageName;
status_t result = message->FindString(kKeyPackageName, status_t result = message->FindString(kKeyPackageName,
&packageName); &packageName);
@@ -258,7 +258,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
result = message->FindFloat(kKeyPercentage, &percent); result = message->FindFloat(kKeyPercentage, &percent);
if (result != B_OK) if (result != B_OK)
break; break;
BString header; BString header;
Lock(); Lock();
result = message->FindString(kKeyHeader, &header); result = message->FindString(kKeyHeader, &header);
@@ -267,11 +267,11 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
fStatusBar->SetTo(percent, packageName.String(), fStatusBar->SetTo(percent, packageName.String(),
packageCount.String()); packageCount.String());
Unlock(); Unlock();
fListView->UpdatePackageProgress(packageName.String(), percent); fListView->UpdatePackageProgress(packageName.String(), percent);
break; break;
} }
case kMsgCancel: case kMsgCancel:
{ {
if (_GetState() == STATE_FINAL_MESSAGE) { if (_GetState() == STATE_FINAL_MESSAGE) {
@@ -284,10 +284,11 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
Lock(); Lock();
fHeaderView->SetText(B_TRANSLATE("Cancelling updates")); fHeaderView->SetText(B_TRANSLATE("Cancelling updates"));
fDetailView->SetText( fDetailView->SetText(
B_TRANSLATE("Attempting to cancel the updates...")); B_TRANSLATE("Attempting to cancel the updates"
B_UTF8_ELLIPSIS));
Unlock(); Unlock();
fUserCancelRequested = true; fUserCancelRequested = true;
if (fWaitingForButton) { if (fWaitingForButton) {
fButtonResult = message->what; fButtonResult = message->what;
delete_sem(fWaitingSem); delete_sem(fWaitingSem);
@@ -295,7 +296,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
} }
break; break;
} }
// Confirm with the user to cancel // Confirm with the user to cancel
BAlert* alert = new BAlert("cancel request", B_TRANSLATE("Updates" BAlert* alert = new BAlert("cancel request", B_TRANSLATE("Updates"
" have not been completed, are you sure you want to quit?"), " have not been completed, are you sure you want to quit?"),
@@ -305,7 +306,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
alert->Go(&fCancelAlertResponse); alert->Go(&fCancelAlertResponse);
break; break;
} }
case kMsgCancelResponse: case kMsgCancelResponse:
{ {
// Verify whether the cancel alert was confirmed // Verify whether the cancel alert was confirmed
@@ -313,14 +314,15 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
message->FindInt32("which", &selection); message->FindInt32("which", &selection);
if (selection != 0) if (selection != 0)
break; break;
Lock(); Lock();
fHeaderView->SetText(B_TRANSLATE("Cancelling updates")); fHeaderView->SetText(B_TRANSLATE("Cancelling updates"));
fDetailView->SetText( fDetailView->SetText(
B_TRANSLATE("Attempting to cancel the updates...")); B_TRANSLATE("Attempting to cancel the updates"
B_UTF8_ELLIPSIS));
Unlock(); Unlock();
fUserCancelRequested = true; fUserCancelRequested = true;
if (fWaitingForButton) { if (fWaitingForButton) {
fButtonResult = message->what; fButtonResult = message->what;
delete_sem(fWaitingSem); delete_sem(fWaitingSem);
@@ -328,7 +330,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
} }
break; break;
} }
case kMsgUpdateConfirmed: case kMsgUpdateConfirmed:
{ {
if (fWaitingForButton) { if (fWaitingForButton) {
@@ -339,7 +341,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
} }
break; break;
} }
case kMsgMoreDetailsToggle: case kMsgMoreDetailsToggle:
fListView->SetMoreDetails(fDetailsCheckbox->Value() != 0); fListView->SetMoreDetails(fDetailsCheckbox->Value() != 0);
PostMessage(kMsgSetZoomLimits); PostMessage(kMsgSetZoomLimits);
@@ -367,17 +369,17 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
SetZoomLimits(zoomWidth, zoomHeight); SetZoomLimits(zoomWidth, zoomHeight);
break; break;
} }
case kMsgWarningDismissed: case kMsgWarningDismissed:
fWarningAlertCount--; fWarningAlertCount--;
break; break;
case kMsgWindowFrameChanged: case kMsgWindowFrameChanged:
delete fMessageRunner; delete fMessageRunner;
fMessageRunner = NULL; fMessageRunner = NULL;
_WriteSettings(); _WriteSettings();
break; break;
case kMsgGetUpdateType: case kMsgGetUpdateType:
{ {
BString text( BString text(
@@ -399,11 +401,11 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
case 0: case 0:
action = CANCEL_UPDATE; action = CANCEL_UPDATE;
break; break;
case 1: case 1:
action = FULLSYNC; action = FULLSYNC;
break; break;
case 2: case 2:
action = UPDATE; action = UPDATE;
break; break;
@@ -413,7 +415,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
message->SendReply(&reply); message->SendReply(&reply);
break; break;
} }
case kMsgNoRepositories: case kMsgNoRepositories:
{ {
BString text( BString text(
@@ -431,7 +433,7 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
message->SendReply(&reply); message->SendReply(&reply);
break; break;
} }
default: default:
BWindow::MessageReceived(message); BWindow::MessageReceived(message);
} }
@@ -446,10 +448,10 @@ SoftwareUpdaterWindow::ConfirmUpdates()
fDetailView->SetText(B_TRANSLATE("The following changes will be made:")); fDetailView->SetText(B_TRANSLATE("The following changes will be made:"));
fListView->SortItems(); fListView->SortItems();
Unlock(); Unlock();
uint32 priorState = _GetState(); uint32 priorState = _GetState();
_SetState(STATE_GET_CONFIRMATION); _SetState(STATE_GET_CONFIRMATION);
_WaitForButtonClick(); _WaitForButtonClick();
_SetState(priorState); _SetState(priorState);
return fButtonResult == kMsgUpdateConfirmed; return fButtonResult == kMsgUpdateConfirmed;
@@ -472,7 +474,7 @@ SoftwareUpdaterWindow::UserCancelRequested()
{ {
if (_GetState() > STATE_GET_CONFIRMATION) if (_GetState() > STATE_GET_CONFIRMATION)
return false; return false;
return fUserCancelRequested; return fUserCancelRequested;
} }
@@ -520,7 +522,7 @@ SoftwareUpdaterWindow::FinalUpdate(const char* header, const char* detail)
{ {
if (_GetState() == STATE_FINAL_MESSAGE) if (_GetState() == STATE_FINAL_MESSAGE)
return; return;
_SetState(STATE_FINAL_MESSAGE); _SetState(STATE_FINAL_MESSAGE);
Lock(); Lock();
fHeaderView->SetText(header); fHeaderView->SetText(header);
@@ -556,9 +558,9 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
{ {
if (state <= STATE_HEAD || state >= STATE_MAX) if (state <= STATE_HEAD || state >= STATE_MAX)
return; return;
Lock(); Lock();
// Initial settings // Initial settings
if (fCurrentState == STATE_HEAD) { if (fCurrentState == STATE_HEAD) {
fProgressLayoutItem->SetVisible(false); fProgressLayoutItem->SetVisible(false);
@@ -567,14 +569,14 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
fCancelButtonLayoutItem->SetVisible(false); fCancelButtonLayoutItem->SetVisible(false);
} }
fCurrentState = state; fCurrentState = state;
// Update confirmation button // Update confirmation button
// Show only when asking for confirmation to update // Show only when asking for confirmation to update
if (fCurrentState == STATE_GET_CONFIRMATION) if (fCurrentState == STATE_GET_CONFIRMATION)
fUpdateButtonLayoutItem->SetVisible(true); fUpdateButtonLayoutItem->SetVisible(true);
else else
fUpdateButtonLayoutItem->SetVisible(false); fUpdateButtonLayoutItem->SetVisible(false);
// View package info view and checkbox // View package info view and checkbox
// Show at confirmation prompt, hide at final update // Show at confirmation prompt, hide at final update
if (fCurrentState == STATE_GET_CONFIRMATION) { if (fCurrentState == STATE_GET_CONFIRMATION) {
@@ -593,7 +595,7 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
fPackagesLayoutItem->SetVisible(false); fPackagesLayoutItem->SetVisible(false);
fDetailsCheckboxLayoutItem->SetVisible(false); fDetailsCheckboxLayoutItem->SetVisible(false);
} }
// Progress bar and string view // Progress bar and string view
// Hide detail text while showing status bar // Hide detail text while showing status bar
if (fCurrentState == STATE_DISPLAY_PROGRESS) { if (fCurrentState == STATE_DISPLAY_PROGRESS) {
@@ -603,7 +605,7 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
fProgressLayoutItem->SetVisible(false); fProgressLayoutItem->SetVisible(false);
fDetailsLayoutItem->SetVisible(true); fDetailsLayoutItem->SetVisible(true);
} }
// Resizing and zooming // Resizing and zooming
if (fCurrentState == STATE_GET_CONFIRMATION) { if (fCurrentState == STATE_GET_CONFIRMATION) {
// Enable resizing and zooming // Enable resizing and zooming
@@ -648,14 +650,14 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
SetFlags(Flags() | B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_RESIZABLE SetFlags(Flags() | B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_RESIZABLE
| B_NOT_ZOOMABLE); | B_NOT_ZOOMABLE);
} }
// Quit button // Quit button
if (fCurrentState == STATE_FINAL_MESSAGE) { if (fCurrentState == STATE_FINAL_MESSAGE) {
fCancelButtonLayoutItem->SetVisible(true); fCancelButtonLayoutItem->SetVisible(true);
fCancelButton->SetLabel(B_TRANSLATE_COMMENT("Quit", "Button label")); fCancelButton->SetLabel(B_TRANSLATE_COMMENT("Quit", "Button label"));
fCancelButton->MakeDefault(true); fCancelButton->MakeDefault(true);
} }
Unlock(); Unlock();
} }
@@ -729,7 +731,7 @@ void
SuperItem::DrawItem(BView* owner, BRect item_rect, bool complete) SuperItem::DrawItem(BView* owner, BRect item_rect, bool complete)
{ {
owner->PushState(); owner->PushState();
float width; float width;
owner->GetPreferredSize(&width, NULL); owner->GetPreferredSize(&width, NULL);
BString text(fItemText); BString text(fItemText);
@@ -738,7 +740,7 @@ SuperItem::DrawItem(BView* owner, BRect item_rect, bool complete)
owner->TruncateString(&text, B_TRUNCATE_END, width); owner->TruncateString(&text, B_TRUNCATE_END, width);
owner->DrawString(text.String(), BPoint(item_rect.left, owner->DrawString(text.String(), BPoint(item_rect.left,
item_rect.bottom - fBoldFontHeight.descent)); item_rect.bottom - fBoldFontHeight.descent));
owner->PopState(); owner->PopState();
} }
@@ -861,12 +863,12 @@ void
PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete) PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
{ {
owner->PushState(); owner->PushState();
float width = owner->Frame().Width(); float width = owner->Frame().Width();
float nameWidth = width / 2.0; float nameWidth = width / 2.0;
float offsetWidth = 0; float offsetWidth = 0;
bool showMoreDetails = fSuperItem->GetDetailLevel(); bool showMoreDetails = fSuperItem->GetDetailLevel();
BBitmap* icon = fSuperItem->GetIcon(showMoreDetails); BBitmap* icon = fSuperItem->GetIcon(showMoreDetails);
if (icon != NULL && icon->IsValid()) { if (icon != NULL && icon->IsValid()) {
float iconSize = icon->Bounds().Height(); float iconSize = icon->Bounds().Height();
@@ -877,14 +879,14 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
owner->DrawBitmap(icon, location); owner->DrawBitmap(icon, location);
owner->SetDrawingMode(B_OP_COPY); owner->SetDrawingMode(B_OP_COPY);
offsetWidth = iconSize + fLabelOffset; offsetWidth = iconSize + fLabelOffset;
if (fDrawBarFlag) if (fDrawBarFlag)
_DrawBar(location, owner, icon_size(iconSize)); _DrawBar(location, owner, icon_size(iconSize));
} }
owner->SetFont(be_plain_font); owner->SetFont(be_plain_font);
owner->SetHighColor(ui_color(B_LIST_ITEM_TEXT_COLOR)); owner->SetHighColor(ui_color(B_LIST_ITEM_TEXT_COLOR));
// Package name // Package name
BString name(fName); BString name(fName);
owner->TruncateString(&name, B_TRUNCATE_END, nameWidth); owner->TruncateString(&name, B_TRUNCATE_END, nameWidth);
@@ -894,11 +896,11 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
cursor.y -= fSmallTotalHeight + 1; cursor.y -= fSmallTotalHeight + 1;
owner->DrawString(name.String(), cursor); owner->DrawString(name.String(), cursor);
cursor.x += owner->StringWidth(name.String()) + fLabelOffset; cursor.x += owner->StringWidth(name.String()) + fLabelOffset;
// Change font and color // Change font and color
owner->SetFont(&fSmallFont); owner->SetFont(&fSmallFont);
owner->SetHighColor(tint_color(ui_color(B_LIST_ITEM_TEXT_COLOR), 0.7)); owner->SetHighColor(tint_color(ui_color(B_LIST_ITEM_TEXT_COLOR), 0.7));
// Simple version or repository // Simple version or repository
BString versionOrRepo; BString versionOrRepo;
if (showMoreDetails) if (showMoreDetails)
@@ -907,14 +909,14 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
versionOrRepo.SetTo(fSimpleVersion); versionOrRepo.SetTo(fSimpleVersion);
owner->TruncateString(&versionOrRepo, B_TRUNCATE_END, width - cursor.x); owner->TruncateString(&versionOrRepo, B_TRUNCATE_END, width - cursor.x);
owner->DrawString(versionOrRepo.String(), cursor); owner->DrawString(versionOrRepo.String(), cursor);
// Summary // Summary
BString summary(fSummary); BString summary(fSummary);
cursor.x = item_rect.left + offsetWidth; cursor.x = item_rect.left + offsetWidth;
cursor.y += fSmallTotalHeight; cursor.y += fSmallTotalHeight;
owner->TruncateString(&summary, B_TRUNCATE_END, width - cursor.x); owner->TruncateString(&summary, B_TRUNCATE_END, width - cursor.x);
owner->DrawString(summary.String(), cursor); owner->DrawString(summary.String(), cursor);
// Detailed version // Detailed version
if (showMoreDetails) { if (showMoreDetails) {
BString version(fDetailedVersion); BString version(fDetailedVersion);
@@ -922,7 +924,7 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
owner->TruncateString(&version, B_TRUNCATE_END, width - cursor.x); owner->TruncateString(&version, B_TRUNCATE_END, width - cursor.x);
owner->DrawString(version.String(), cursor); owner->DrawString(version.String(), cursor);
} }
owner->PopState(); owner->PopState();
} }
@@ -940,7 +942,7 @@ PackageItem::_DrawBar(BPoint where, BView* view, icon_size which)
} else } else
yOffset = 2; yOffset = 2;
int32 barHeight = size - 3 - 2 * yOffset; int32 barHeight = size - 3 - 2 * yOffset;
// the black shadowed line // the black shadowed line
view->SetHighColor(32, 32, 32, 92); view->SetHighColor(32, 32, 32, 92);
@@ -993,7 +995,7 @@ void
PackageItem::CalculateZoomWidths(BView *owner) PackageItem::CalculateZoomWidths(BView *owner)
{ {
owner->PushState(); owner->PushState();
// More details // More details
float offsetWidth = 2 * be_control_look->DefaultItemSpacing() float offsetWidth = 2 * be_control_look->DefaultItemSpacing()
+ be_plain_font->Size() + be_plain_font->Size()
@@ -1012,7 +1014,7 @@ PackageItem::CalculateZoomWidths(BView *owner)
if (versionWidth > stringWidth) if (versionWidth > stringWidth)
stringWidth = versionWidth; stringWidth = versionWidth;
fMoreDetailsWidth = offsetWidth + stringWidth; fMoreDetailsWidth = offsetWidth + stringWidth;
// Less details // Less details
offsetWidth = 2 * be_control_look->DefaultItemSpacing() offsetWidth = 2 * be_control_look->DefaultItemSpacing()
+ be_plain_font->Size() + be_plain_font->Size()
@@ -1026,7 +1028,7 @@ PackageItem::CalculateZoomWidths(BView *owner)
if (summaryWidth > stringWidth) if (summaryWidth > stringWidth)
stringWidth = summaryWidth; stringWidth = summaryWidth;
fLessDetailsWidth = offsetWidth + stringWidth; fLessDetailsWidth = offsetWidth + stringWidth;
owner->PopState(); owner->PopState();
} }
@@ -1097,7 +1099,7 @@ PackageListView::AddPackage(uint32 install_type, const char* name,
BString repositoryText(B_TRANSLATE_COMMENT("from repository", BString repositoryText(B_TRANSLATE_COMMENT("from repository",
"List item text")); "List item text"));
repositoryText.Append(" ").Append(repository); repositoryText.Append(" ").Append(repository);
switch (install_type) { switch (install_type) {
case PACKAGE_UPDATE: case PACKAGE_UPDATE:
{ {
@@ -1107,7 +1109,7 @@ PackageListView::AddPackage(uint32 install_type, const char* name,
AddItem(fSuperUpdateItem); AddItem(fSuperUpdateItem);
} }
super = fSuperUpdateItem; super = fSuperUpdateItem;
simpleVersion.SetTo(new_ver); simpleVersion.SetTo(new_ver);
detailedVersion.Append(B_TRANSLATE_COMMENT("Updating version", detailedVersion.Append(B_TRANSLATE_COMMENT("Updating version",
"List item text")) "List item text"))
@@ -1117,7 +1119,7 @@ PackageListView::AddPackage(uint32 install_type, const char* name,
.Append(" ").Append(new_ver); .Append(" ").Append(new_ver);
break; break;
} }
case PACKAGE_INSTALL: case PACKAGE_INSTALL:
{ {
if (fSuperInstallItem == NULL) { if (fSuperInstallItem == NULL) {
@@ -1126,14 +1128,14 @@ PackageListView::AddPackage(uint32 install_type, const char* name,
AddItem(fSuperInstallItem); AddItem(fSuperInstallItem);
} }
super = fSuperInstallItem; super = fSuperInstallItem;
simpleVersion.SetTo(new_ver); simpleVersion.SetTo(new_ver);
detailedVersion.Append(B_TRANSLATE_COMMENT("Installing version", detailedVersion.Append(B_TRANSLATE_COMMENT("Installing version",
"List item text")) "List item text"))
.Append(" ").Append(new_ver); .Append(" ").Append(new_ver);
break; break;
} }
case PACKAGE_UNINSTALL: case PACKAGE_UNINSTALL:
{ {
if (fSuperUninstallItem == NULL) { if (fSuperUninstallItem == NULL) {
@@ -1142,17 +1144,17 @@ PackageListView::AddPackage(uint32 install_type, const char* name,
AddItem(fSuperUninstallItem); AddItem(fSuperUninstallItem);
} }
super = fSuperUninstallItem; super = fSuperUninstallItem;
simpleVersion.SetTo(""); simpleVersion.SetTo("");
detailedVersion.Append(B_TRANSLATE_COMMENT("Uninstalling version", detailedVersion.Append(B_TRANSLATE_COMMENT("Uninstalling version",
"List item text")) "List item text"))
.Append(" ").Append(cur_ver); .Append(" ").Append(cur_ver);
break; break;
} }
default: default:
return; return;
} }
PackageItem* item = new PackageItem(name, simpleVersion.String(), PackageItem* item = new PackageItem(name, simpleVersion.String(),
detailedVersion.String(), repositoryText.String(), summary, file_name, detailedVersion.String(), repositoryText.String(), summary, file_name,
@@ -1171,7 +1173,7 @@ PackageListView::UpdatePackageProgress(const char* packageName, float percent)
if (wholePercent == fLastProgressValue) if (wholePercent == fLastProgressValue)
return; return;
fLastProgressValue = wholePercent; fLastProgressValue = wholePercent;
// A new package started downloading, find the PackageItem by name // A new package started downloading, find the PackageItem by name
if (percent == 0) { if (percent == 0) {
fLastProgressItem = NULL; fLastProgressItem = NULL;
@@ -1185,14 +1187,14 @@ PackageListView::UpdatePackageProgress(const char* packageName, float percent)
} }
} }
} }
if (fLastProgressItem != NULL) { if (fLastProgressItem != NULL) {
fLastProgressItem->SetDownloadProgress(percent); fLastProgressItem->SetDownloadProgress(percent);
Invalidate(); Invalidate();
} }
} }
void void
PackageListView::SortItems() PackageListView::SortItems()
{ {
@@ -1280,7 +1282,7 @@ PackageListView::_SetItemHeights()
item = ItemUnderAt(fSuperInstallItem, true, i); item = ItemUnderAt(fSuperInstallItem, true, i);
item->SetHeight(itemHeight); item->SetHeight(itemHeight);
} }
} }
if (fSuperUninstallItem != NULL) { if (fSuperUninstallItem != NULL) {
fSuperUninstallItem->SetDetailLevel(fShowMoreDetails); fSuperUninstallItem->SetDetailLevel(fShowMoreDetails);
@@ -1290,6 +1292,6 @@ PackageListView::_SetItemHeights()
item = ItemUnderAt(fSuperUninstallItem, true, i); item = ItemUnderAt(fSuperUninstallItem, true, i);
item->SetHeight(itemHeight); item->SetHeight(itemHeight);
} }
} }
} }
+1 -1
View File
@@ -100,7 +100,7 @@ BluetoothApplication::AboutRequested()
" - Mika Lindqvist\n" " - Mika Lindqvist\n"
" - Adrien Destugues\n" " - Adrien Destugues\n"
" - Maksym Yevmenkin\n\n" " - Maksym Yevmenkin\n\n"
"Thanks to the individuals who helped...\n\n" "Thanks to the individuals who helped" B_UTF8_ELLIPSIS "\n\n"
"Shipping/donating hardware:\n" "Shipping/donating hardware:\n"
" - Henry Jair Abril Florez (el Colombian)\n" " - Henry Jair Abril Florez (el Colombian)\n"
" & Stefanie Bartolich\n" " & Stefanie Bartolich\n"
@@ -213,7 +213,7 @@ BluetoothSettingsView::_BuildConnectionPolicy()
BMessage* message = NULL; BMessage* message = NULL;
BMenuItem* item = NULL; BMenuItem* item = NULL;
fPolicyMenu = new BPopUpMenu(B_TRANSLATE("Policy...")); fPolicyMenu = new BPopUpMenu(B_TRANSLATE("Policy" B_UTF8_ELLIPSIS));
message = new BMessage(kMsgSetConnectionPolicy); message = new BMessage(kMsgSetConnectionPolicy);
message->AddInt8("Policy", 1); message->AddInt8("Policy", 1);
@@ -237,7 +237,7 @@ BluetoothSettingsView::_BuildClassMenu()
BMessage* message = NULL; BMessage* message = NULL;
BMenuItem* item = NULL; BMenuItem* item = NULL;
fClassMenu = new BPopUpMenu(B_TRANSLATE("Identify us as...")); fClassMenu = new BPopUpMenu(B_TRANSLATE("Identify us as" B_UTF8_ELLIPSIS));
message = new BMessage(kMsgSetDeviceClass); message = new BMessage(kMsgSetDeviceClass);
message->AddInt8("DeviceClass", 1); message->AddInt8("DeviceClass", 1);
@@ -292,7 +292,8 @@ BluetoothSettingsView::_BuildLocalDevicesMenu()
LocalDevice* lDevice; LocalDevice* lDevice;
if (!fLocalDevicesMenu) if (!fLocalDevicesMenu)
fLocalDevicesMenu = new BPopUpMenu(B_TRANSLATE("Pick device...")); fLocalDevicesMenu = new BPopUpMenu(B_TRANSLATE("Pick device"
B_UTF8_ELLIPSIS));
while (fLocalDevicesMenu->CountItems() > 0) { while (fLocalDevicesMenu->CountItems() > 0) {
BMenuItem* item = fLocalDevicesMenu->RemoveItem((int32)0); BMenuItem* item = fLocalDevicesMenu->RemoveItem((int32)0);
+4 -2
View File
@@ -214,7 +214,8 @@ InquiryPanel::MessageReceived(BMessage* message)
fRemoteList->MakeEmpty(); fRemoteList->MakeEmpty();
fScanProgress->Reset(); fScanProgress->Reset();
fScanProgress->SetTo(1); fScanProgress->SetTo(1);
fScanProgress->SetTrailingText(B_TRANSLATE("Starting scan...")); fScanProgress->SetTrailingText(B_TRANSLATE("Starting scan"
B_UTF8_ELLIPSIS));
fScanProgress->SetBarColor(activeColor); fScanProgress->SetBarColor(activeColor);
fAddButton->SetEnabled(false); fAddButton->SetEnabled(false);
@@ -234,7 +235,8 @@ InquiryPanel::MessageReceived(BMessage* message)
fRetrieving = true; fRetrieving = true;
labelPlaced = false; labelPlaced = false;
fScanProgress->SetTo(100); fScanProgress->SetTo(100);
fScanProgress->SetTrailingText(B_TRANSLATE("Retrieving names...")); fScanProgress->SetTrailingText(B_TRANSLATE("Retrieving names"
B_UTF8_ELLIPSIS));
BMessageRunner::StartSending(fMessenger, fRetrieveMessage, 1000000, 1); BMessageRunner::StartSending(fMessenger, fRetrieveMessage, 1000000, 1);
break; break;