Changeset 11950 in vbox
- Timestamp:
- Sep 1, 2008 9:24:52 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 35835
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp
r11616 r11950 614 614 } 615 615 616 617 /* Old qt3 code for two columns support */618 #if 0619 void VBoxVMInformationDlg::refreshStatistics()620 {621 QString table = "<p><table border=0 cellspacing=0 cellpadding=0 width=100%>%1</table></p>";622 QString hdrRow = "<tr><td align=left><img src='%1'></td><td colspan=4><b>%2</b></td></tr>";623 QString subRow = "<tr><td></td><td colspan=2><nobr><u>%1</u></nobr></td>"624 "<td colspan=2><nobr><u>%2</u></nobr></td></tr>";625 QString bdyRow = "<tr><td></td><td><nobr>%1</nobr></td><td width=50%><nobr>%2</nobr></td>"626 "<td><nobr>%3</nobr></td><td width=50%><nobr>%4</nobr></td></tr>";627 QString paragraph = "<tr><td colspan=5></td></tr>";628 QString interline = "<tr><td colspan=5><font size=1> </font></td></tr>";629 QString result;630 631 /* Screen & VT-X Runtime Parameters */632 if (!mSession.isNull())633 {634 CConsole console = mSession.GetConsole();635 ULONG bpp = console.GetDisplay().GetBitsPerPixel();636 QString resolution = QString ("%1x%2")637 .arg (console.GetDisplay().GetWidth())638 .arg (console.GetDisplay().GetHeight());639 if (bpp)640 resolution += QString ("x%1").arg (bpp);641 QString virt = console.GetDebugger().GetHWVirtExEnabled() ?642 tr ("Enabled") : tr ("Disabled");643 644 result += hdrRow.arg (":/state_running_16px.png").arg (tr ("Runtime Attributes"));645 result += bdyRow.arg (tr ("Screen Resolution")) .arg (resolution)646 .arg (tr ("Hardware Virtualization")).arg (virt);647 result += paragraph;648 }649 650 /* Hard Disk Statistics. */651 result += hdrRow.arg (":/hd_16px.png").arg (tr ("Hard Disks Statistics"));652 653 result += subRow.arg (tr ("Primary Master")).arg (tr ("Primary Slave"));654 result += composeArticle (QString::null, 0, 1, 4, 5);655 result += composeArticle ("B", 2, 3, 6, 7);656 result += interline;657 658 result += subRow.arg (tr ("Secondary Master")).arg (tr ("Secondary Slave"));659 result += composeArticle (QString::null, 8, 9, 12, 13);660 result += composeArticle ("B", 10, 11, 14, 15);661 result += paragraph;662 663 /* Network Adapters Statistics. Counters are currently missed. */664 result += hdrRow.arg (":/nw_16px.png").arg (tr ("Network Adapter Statistics"));665 result += subRow.arg (tr ("Adapter 1")).arg (tr ("Adapter 2"));666 result += composeArticle ("B", 16, 17, 18, 19);667 668 /* Show full composed page. */669 mStatisticText->setText (table.arg (result));670 }671 672 673 QString VBoxVMInformationDlg::composeArticle (const QString &aUnits,674 int aStart1, int aFinish1,675 int aStart2, int aFinish2)676 {677 QString bdyRow = "<tr><td></td><td><nobr>%1</nobr></td><td width=50%><nobr>%2</nobr></td>"678 "<td><nobr>%3</nobr></td><td width=50%><nobr>%4</nobr></td></tr>";679 680 QString result;681 682 int id1 = aStart1, id2 = aStart2;683 while (id1 <= aFinish1 || id2 <= aFinish2)684 {685 QString line = bdyRow;686 /* Processing first column */687 if (id1 > aFinish1)688 {689 line = line.arg (QString::null).arg (QString::null)690 .arg (QString::null).arg (QString::null);691 }692 else if (mValuesMap.contains (mNamesMap.keys() [id1]))693 {694 line = line.arg (mNamesMap.values() [id1]);695 ULONG64 value = mValuesMap.values() [id1].toULongLong();696 line = aUnits.isNull() ?697 line.arg (QString ("%L1").arg (value)) :698 line.arg (QString ("%L1 %2").arg (value).arg (aUnits));699 }700 /* Processing second column */701 if (id2 > aFinish2)702 {703 line = line.arg (QString::null).arg (QString::null)704 .arg (QString::null).arg (QString::null);705 }706 else if (mValuesMap.contains (mNamesMap.keys() [id2]))707 {708 line = line.arg (mNamesMap.values() [id2]);709 ULONG64 value = mValuesMap.values() [id2].toULongLong();710 line = aUnits.isNull() ?711 line.arg (QString ("%L1").arg (value)) :712 line.arg (QString ("%L1 %2").arg (value).arg (aUnits));713 }714 result += line;715 ++ id1; ++ id2;716 }717 718 return result;719 }720 #endif721
Note:
See TracChangeset
for help on using the changeset viewer.