- Timestamp:
- Aug 21, 2008 11:08:54 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 35099
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMInformationDlg.h
r9729 r11532 70 70 void refreshStatistics(); 71 71 72 QString formatValue (const QString &aValueName, const QString &aValue, int aMaxSize); 72 73 QString formatHardDisk (KStorageBus aBus, LONG aChannel, LONG aDevice, const QString &aBelongsTo); 73 74 QString formatAdapter (ULONG aSlot, const QString &aBelongsTo); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r11471 r11532 1483 1483 { 1484 1484 static const char *sTableTpl = 1485 "<table border=0 cellspacing= 4cellpadding=0>%1</table>";1485 "<table border=0 cellspacing=1 cellpadding=0>%1</table>"; 1486 1486 static const char *sSectionHrefTpl = 1487 1487 "<tr><td width=22 rowspan=%1 align=left><img src='%2'></td>" -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp
r11471 r11532 392 392 return; 393 393 394 QString table = "<table border=0 cellspacing=4cellpadding=0>%1</table>";395 QString hdrRow = "<tr><td width=22 align=left><img src='%1'></td><td colspan=3><nobr><b>%2</b></nobr></td></tr>";396 QString bdyRow = "<tr><td></td><td width=50%><nobr>%1</nobr></td><td colspan=2><nobr>%2</nobr></td></tr>";397 QString paragraph = "<tr><td colspan= 4></td></tr>";394 QString table = "<table width=100% cellspacing=1 cellpadding=0>%1</table>"; 395 QString hdrRow = "<tr><td width=22><img src='%1'></td>" 396 "<td colspan=2><nobr><b>%2</b></nobr></td></tr>"; 397 QString paragraph = "<tr><td colspan=3></td></tr>"; 398 398 QString result; 399 399 … … 409 409 if (bpp) 410 410 resolution += QString ("x%1").arg (bpp); 411 QString virt = console.GetDebugger().GetHWVirtExEnabled() ?411 QString virtualization = console.GetDebugger().GetHWVirtExEnabled() ? 412 412 VBoxGlobal::tr ("Enabled", "details report (VT-x/AMD-V)") : 413 413 VBoxGlobal::tr ("Disabled", "details report (VT-x/AMD-V)"); … … 427 427 osType = vboxGlobal().vmGuestOSTypeDescription (osType); 428 428 429 /* Searching for longest string */ 430 QStringList valuesList; 431 valuesList << resolution << virtualization << nested << addVerisonStr << osType; 432 int maxLength = 0; 433 foreach (QString value, valuesList) 434 maxLength = maxLength < fontMetrics().width (value) ? 435 fontMetrics().width (value) : maxLength; 436 429 437 result += hdrRow.arg (":/state_running_16px.png").arg (tr ("Runtime Attributes")); 430 result += bdyRow.arg (tr ("Screen Resolution")).arg (resolution);431 result += bdyRow.arg (VBoxGlobal::tr ("VT-x/AMD-V", "details report")).arg (virt);432 result += bdyRow.arg (VBoxGlobal::tr ("Nested Paging", "details report")).arg (nested);433 result += bdyRow.arg (tr ("Guest Additions")).arg (addVerisonStr);434 result += bdyRow.arg (tr ("Guest OS Type")).arg (osType);438 result += formatValue (tr ("Screen Resolution"), resolution, maxLength); 439 result += formatValue (VBoxGlobal::tr ("VT-x/AMD-V", "details report"), virtualization, maxLength); 440 result += formatValue (VBoxGlobal::tr ("Nested Paging", "details report"), nested, maxLength); 441 result += formatValue (tr ("Guest Additions"), addVerisonStr, maxLength); 442 result += formatValue (tr ("Guest OS Type"), osType, maxLength); 435 443 result += paragraph; 436 444 } … … 517 525 result += naStat; 518 526 } 527 519 528 /* Show full composed page & save/restore scroll-bar position */ 520 529 int vv = mStatisticText->verticalScrollBar()->value(); … … 523 532 } 524 533 534 /** 535 * Allows left-aligned values formatting in right column. 536 * 537 * aValueName - the name of value in the left column. 538 * aValue - left-aligned value itself in the right column. 539 * aMaxSize - maximum width (in pixels) of value in right column. 540 */ 541 QString VBoxVMInformationDlg::formatValue (const QString &aValueName, 542 const QString &aValue, int aMaxSize) 543 { 544 QString bdyRow = "<tr><td></td><td width=50%><nobr>%1</nobr></td>" 545 "<td align=right><nobr>%2" 546 "<img src=:/tpixel.png width=%3 height=1></nobr></td></tr>"; 547 548 int size = aMaxSize - fontMetrics().width (aValue); 549 return bdyRow.arg (aValueName).arg (aValue).arg (size); 550 } 551 525 552 QString VBoxVMInformationDlg::formatHardDisk (KStorageBus aBus, 526 553 LONG aChannel, … … 532 559 533 560 CHardDisk hd = mSession.GetMachine().GetHardDisk (aBus, aChannel, aDevice); 534 QString header = "<tr><td></td><td colspan= 3><nobr><u>%1</u></nobr></td></tr>";561 QString header = "<tr><td></td><td colspan=2><nobr><u>%1</u></nobr></td></tr>"; 535 562 QString name = vboxGlobal().toFullString (aBus, aChannel, aDevice); 536 563 QString result = hd.isNull() ? QString::null : header.arg (name); … … 545 572 return QString::null; 546 573 547 QString header = "<tr><td></td><td colspan= 3><nobr><u>%1</u></nobr></td></tr>";574 QString header = "<tr><td></td><td colspan=2><nobr><u>%1</u></nobr></td></tr>"; 548 575 QString name = VBoxGlobal::tr ("Adapter %1", "details report (network)").arg (aSlot); 549 576 QString result = header.arg (name); … … 554 581 QString VBoxVMInformationDlg::composeArticle (const QString &aBelongsTo) 555 582 { 556 QString body = "<tr><td></td><td width=50%><nobr>%1</nobr></td> <td colspan=2 align=right>"557 "< nobr>%2%3</nobr></td></tr>";583 QString body = "<tr><td></td><td width=50%><nobr>%1</nobr></td>" 584 "<td align=right><nobr>%2%3</nobr></td></tr>"; 558 585 QString result; 559 586
Note:
See TracChangeset
for help on using the changeset viewer.