VirtualBox

Ignore:
Timestamp:
Apr 30, 2008 7:15:52 AM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: Support runtime statistics for the E1000 network adapter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMInformationDlg.ui.h

    r8155 r8490  
    105105    //                     QString::null);
    106106
    107     /* applying language settings */
    108     languageChangeImp();
    109 
    110107    /* show statistics page and make it focused */
    111108    connect (mInfoStack, SIGNAL (currentChanged (QWidget*)),
     
    174171void VBoxVMInformationDlg::languageChangeImp()
    175172{
     173    AssertReturnVoid (!mSession.isNull());
     174
     175    CMachine machine = mSession.GetMachine();
     176    AssertReturnVoid (!machine.isNull());
     177
    176178    /* Setup a dialog caption. */
    177     if (!mSession.isNull() && !mSession.GetMachine().isNull())
    178         setCaption (tr ("%1 - Session Information")
    179         .arg (mSession.GetMachine().GetName()));
     179    setCaption (tr ("%1 - Session Information").arg (machine.GetName()));
    180180
    181181    /* Setup a tabwidget page names. */
     
    208208    mNamesMap ["/Devices/ATA1/Unit1/WrittenBytes"] = tr ("Data Written");
    209209
    210     mNamesMap ["/Devices/PCNet0/TransmitBytes"] = tr ("Data Transmitted");
    211     mNamesMap ["/Devices/PCNet0/ReceiveBytes"] = tr ("Data Received");
    212 
    213     mNamesMap ["/Devices/PCNet1/TransmitBytes"] = tr ("Data Transmitted");
    214     mNamesMap ["/Devices/PCNet1/ReceiveBytes"] = tr ("Data Received");
    215 
    216     mNamesMap ["/Devices/PCNet2/TransmitBytes"] = tr ("Data Transmitted");
    217     mNamesMap ["/Devices/PCNet2/ReceiveBytes"] = tr ("Data Received");
    218 
    219     mNamesMap ["/Devices/PCNet3/TransmitBytes"] = tr ("Data Transmitted");
    220     mNamesMap ["/Devices/PCNet3/ReceiveBytes"] = tr ("Data Received");
     210    for (int i = 0; i < 4; i++)
     211    {
     212        CNetworkAdapter na = machine.GetNetworkAdapter (i);
     213        KNetworkAdapterType ty = na.GetAdapterType();
     214        const char *name;
     215
     216        switch (ty)
     217        {
     218            case KNetworkAdapterType_I82540EM:
     219                name = "E1k";
     220                break;
     221            default:
     222                name = "PCNet";
     223                break;
     224        }
     225        mNamesMap [QString("/Devices/%1%2/TransmitBytes")
     226                     .arg(name) .arg(i)] = tr ("Data Transmitted");
     227        mNamesMap [QString("/Devices/%1%2/ReceiveBytes")
     228                     .arg(name) .arg(i)] = tr ("Data Received");
     229    }
    221230
    222231    /* Statistics page update. */
     
    282291        case QEvent::LanguageChange:
    283292        {
    284             languageChangeImp();
     293            if (!mSession.isNull())
     294                languageChangeImp();
    285295            break;
    286296        }
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