VirtualBox

Changeset 11532 in vbox for trunk/src


Ignore:
Timestamp:
Aug 21, 2008 11:08:54 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
35099
Message:

Fe/Qt4: Right (values) column alignment changed to right-aligned.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMInformationDlg.h

    r9729 r11532  
    7070    void refreshStatistics();
    7171
     72    QString formatValue (const QString &aValueName, const QString &aValue, int aMaxSize);
    7273    QString formatHardDisk (KStorageBus aBus, LONG aChannel, LONG aDevice, const QString &aBelongsTo);
    7374    QString formatAdapter (ULONG aSlot, const QString &aBelongsTo);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r11471 r11532  
    14831483{
    14841484    static const char *sTableTpl =
    1485         "<table border=0 cellspacing=4 cellpadding=0>%1</table>";
     1485        "<table border=0 cellspacing=1 cellpadding=0>%1</table>";
    14861486    static const char *sSectionHrefTpl =
    14871487        "<tr><td width=22 rowspan=%1 align=left><img src='%2'></td>"
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp

    r11471 r11532  
    392392        return;
    393393
    394     QString table = "<table border=0 cellspacing=4 cellpadding=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>";
    398398    QString result;
    399399
     
    409409        if (bpp)
    410410            resolution += QString ("x%1").arg (bpp);
    411         QString virt = console.GetDebugger().GetHWVirtExEnabled() ?
     411        QString virtualization = console.GetDebugger().GetHWVirtExEnabled() ?
    412412            VBoxGlobal::tr ("Enabled", "details report (VT-x/AMD-V)") :
    413413            VBoxGlobal::tr ("Disabled", "details report (VT-x/AMD-V)");
     
    427427            osType = vboxGlobal().vmGuestOSTypeDescription (osType);
    428428
     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
    429437        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);
    435443        result += paragraph;
    436444    }
     
    517525        result += naStat;
    518526    }
     527
    519528    /* Show full composed page & save/restore scroll-bar position */
    520529    int vv = mStatisticText->verticalScrollBar()->value();
     
    523532}
    524533
     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 */
     541QString 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
    525552QString VBoxVMInformationDlg::formatHardDisk (KStorageBus aBus,
    526553                                              LONG aChannel,
     
    532559
    533560    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>";
    535562    QString name = vboxGlobal().toFullString (aBus, aChannel, aDevice);
    536563    QString result = hd.isNull() ? QString::null : header.arg (name);
     
    545572        return QString::null;
    546573
    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>";
    548575    QString name = VBoxGlobal::tr ("Adapter %1", "details report (network)").arg (aSlot);
    549576    QString result = header.arg (name);
     
    554581QString VBoxVMInformationDlg::composeArticle (const QString &aBelongsTo)
    555582{
    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>";
    558585    QString result;
    559586
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette