Rework a bit displayed info: now transport "address" is shown too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39717 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -301,6 +301,7 @@ PrinterItem::PrinterItem(PrintersWindow* window, const BDirectory& node,
|
|||||||
_GetStringProperty(PSRV_PRINTER_ATTR_PRT_NAME, fName);
|
_GetStringProperty(PSRV_PRINTER_ATTR_PRT_NAME, fName);
|
||||||
_GetStringProperty(PSRV_PRINTER_ATTR_COMMENTS, fComments);
|
_GetStringProperty(PSRV_PRINTER_ATTR_COMMENTS, fComments);
|
||||||
_GetStringProperty(PSRV_PRINTER_ATTR_TRANSPORT, fTransport);
|
_GetStringProperty(PSRV_PRINTER_ATTR_TRANSPORT, fTransport);
|
||||||
|
_GetStringProperty(PSRV_PRINTER_ATTR_TRANSPORT_ADDR, fTransportAddress);
|
||||||
_GetStringProperty(PSRV_PRINTER_ATTR_DRV_NAME, fDriverName);
|
_GetStringProperty(PSRV_PRINTER_ATTR_DRV_NAME, fDriverName);
|
||||||
|
|
||||||
BPath path;
|
BPath path;
|
||||||
@@ -405,6 +406,7 @@ PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
|||||||
BPoint namePt(iconPt + BPoint(x, fntheight));
|
BPoint namePt(iconPt + BPoint(x, fntheight));
|
||||||
BPoint driverPt(iconPt + BPoint(x, fntheight * 2.0));
|
BPoint driverPt(iconPt + BPoint(x, fntheight * 2.0));
|
||||||
BPoint defaultPt(iconPt + BPoint(x, fntheight * 3.0));
|
BPoint defaultPt(iconPt + BPoint(x, fntheight * 3.0));
|
||||||
|
BPoint transportPt(iconPt + BPoint(x, fntheight * 3.0));
|
||||||
|
|
||||||
float totalWidth = bounds.Width() - iconColumnWidth;
|
float totalWidth = bounds.Width() - iconColumnWidth;
|
||||||
float maximumWidth = fLayoutData.fLeftColumnMaximumWidth +
|
float maximumWidth = fLayoutData.fLeftColumnMaximumWidth +
|
||||||
@@ -418,8 +420,7 @@ PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BPoint pendingPt(bounds.right - width - 8.0, namePt.y);
|
BPoint pendingPt(bounds.right - width - 8.0, namePt.y);
|
||||||
BPoint transportPt(bounds.right - width - 8.0, driverPt.y);
|
BPoint commentPt(bounds.right - width - 8.0, driverPt.y);
|
||||||
BPoint commentPt(bounds.right - width - 8.0, defaultPt.y);
|
|
||||||
|
|
||||||
|
|
||||||
drawing_mode mode = owner->DrawingMode();
|
drawing_mode mode = owner->DrawingMode();
|
||||||
@@ -443,18 +444,30 @@ PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
|||||||
// left of item
|
// left of item
|
||||||
BString s = fName;
|
BString s = fName;
|
||||||
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, pendingPt.x - namePt.x);
|
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, pendingPt.x - namePt.x);
|
||||||
|
|
||||||
|
owner->SetFont(be_bold_font);
|
||||||
owner->DrawString(s.String(), s.Length(), namePt);
|
owner->DrawString(s.String(), s.Length(), namePt);
|
||||||
s = fDriverName.String();
|
owner->SetFont(&font);
|
||||||
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, pendingPt.x - driverPt.x);
|
|
||||||
|
s = B_TRANSLATE("Driver: %driver%");
|
||||||
|
s.ReplaceFirst("%driver%", fDriverName);
|
||||||
|
owner->TruncateString(&s, B_TRUNCATE_END, bounds.Width() - commentPt.x);
|
||||||
owner->DrawString(s.String(), s.Length(), driverPt);
|
owner->DrawString(s.String(), s.Length(), driverPt);
|
||||||
|
|
||||||
|
|
||||||
|
if (fTransport.Length() > 0) {
|
||||||
|
s = B_TRANSLATE("Transport: %transport% %transport_address%");
|
||||||
|
s.ReplaceFirst("%transport%", fTransport);
|
||||||
|
s.ReplaceFirst("%transport_address%", fTransportAddress);
|
||||||
|
owner->TruncateString(&s, B_TRUNCATE_BEGINNING, totalWidth);
|
||||||
|
owner->DrawString(s.String(), s.Length(), transportPt);
|
||||||
|
}
|
||||||
|
|
||||||
// right of item
|
// right of item
|
||||||
s = fPendingJobs;
|
s = fPendingJobs;
|
||||||
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, bounds.Width() - pendingPt.x);
|
owner->TruncateString(&s, B_TRUNCATE_END, bounds.Width() - pendingPt.x);
|
||||||
owner->DrawString(s.String(), s.Length(), pendingPt);
|
owner->DrawString(s.String(), s.Length(), pendingPt);
|
||||||
s = fTransport;
|
|
||||||
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, bounds.Width() - transportPt.x);
|
|
||||||
owner->DrawString(s.String(), s.Length(), transportPt);
|
|
||||||
s = fComments;
|
s = fComments;
|
||||||
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, bounds.Width() - commentPt.x);
|
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, bounds.Width() - commentPt.x);
|
||||||
owner->DrawString(s.String(), s.Length(), commentPt);
|
owner->DrawString(s.String(), s.Length(), commentPt);
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ private:
|
|||||||
BDirectory fNode;
|
BDirectory fNode;
|
||||||
BString fComments;
|
BString fComments;
|
||||||
BString fTransport;
|
BString fTransport;
|
||||||
|
BString fTransportAddress;
|
||||||
BString fDriverName;
|
BString fDriverName;
|
||||||
BString fName;
|
BString fName;
|
||||||
BString fPendingJobs;
|
BString fPendingJobs;
|
||||||
|
|||||||
Reference in New Issue
Block a user