Changeset 15304 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Dec 11, 2008 3:15:25 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40729
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/COMWrappers.xsl
r14514 r15304 134 134 <xsl:text>,
</xsl:text> 135 135 </xsl:for-each> 136 <xsl:text> </xsl:text>137 <xsl:value-of select="concat('K',@name,'_COUNT')"/>138 136 <xsl:text>
};

</xsl:text> 139 137 </xsl:for-each> -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r14977 r15304 496 496 public: 497 497 498 typedef QHash <ulong, QString> QULongStringHash; 499 typedef QHash <long, QString> QLongStringHash; 500 498 501 static VBoxGlobal &instance(); 499 502 500 503 bool isValid() { return mValid; } 501 504 502 QString versionString() { return verString; }505 QString versionString() { return mVerString; } 503 506 504 507 CVirtualBox virtualBox() const { return mVBox; } … … 545 548 QPixmap toIcon (KMachineState s) const 546 549 { 547 QPixmap *pm = m StateIcons.value (s);550 QPixmap *pm = mVMStateIcons.value (s); 548 551 AssertMsg (pm, ("Icon for VM state %d must be defined", s)); 549 552 return pm ? *pm : QPixmap(); … … 553 556 { 554 557 static const QColor none; 555 AssertMsg ( vm_state_color.value (s), ("No color for %d", s));556 return vm_state_color.value (s) ? *vm_state_color.value(s) : none;558 AssertMsg (mVMStateColors.value (s), ("No color for %d", s)); 559 return mVMStateColors.value (s) ? *mVMStateColors.value (s) : none; 557 560 } 558 561 559 562 QString toString (KMachineState s) const 560 563 { 561 AssertMsg (!m achineStates.value (s).isNull(), ("No text for %d", s));562 return m achineStates.value (s);564 AssertMsg (!mMachineStates.value (s).isNull(), ("No text for %d", s)); 565 return mMachineStates.value (s); 563 566 } 564 567 565 568 QString toString (KSessionState s) const 566 569 { 567 AssertMsg (! sessionStates.value (s).isNull(), ("No text for %d", s));568 return sessionStates.value (s);570 AssertMsg (!mSessionStates.value (s).isNull(), ("No text for %d", s)); 571 return mSessionStates.value (s); 569 572 } 570 573 … … 575 578 QString toString (KStorageBus aBus) const 576 579 { 577 AssertMsg (! storageBuses.value (aBus).isNull(), ("No text for %d", aBus));578 return storageBuses [aBus];580 AssertMsg (!mStorageBuses.value (aBus).isNull(), ("No text for %d", aBus)); 581 return mStorageBuses [aBus]; 579 582 } 580 583 … … 585 588 KStorageBus toStorageBusType (const QString &aBus) const 586 589 { 587 QStringVector::const_iterator it = 588 qFind (storageBuses.begin(), storageBuses.end(), aBus); 589 AssertMsg (it != storageBuses.end(), ("No value for {%s}", aBus.toLatin1().constData())); 590 return KStorageBus (it - storageBuses.begin()); 590 QULongStringHash::const_iterator it = 591 qFind (mStorageBuses.begin(), mStorageBuses.end(), aBus); 592 AssertMsg (it != mStorageBuses.end(), ("No value for {%s}", 593 aBus.toLatin1().constData())); 594 return KStorageBus (it.key()); 591 595 } 592 596 … … 601 605 QString toString (KHardDiskType t) const 602 606 { 603 AssertMsg (! diskTypes.value (t).isNull(), ("No text for %d", t));604 return diskTypes.value (t);607 AssertMsg (!mDiskTypes.value (t).isNull(), ("No text for %d", t)); 608 return mDiskTypes.value (t); 605 609 } 606 610 … … 614 618 { 615 619 Assert (aHD.GetType() == KHardDiskType_Normal); 616 return diskTypes_Differencing;620 return mDiskTypes_Differencing; 617 621 } 618 622 return toString (aHD.GetType()); … … 621 625 QString toString (KVRDPAuthType t) const 622 626 { 623 AssertMsg (! vrdpAuthTypes.value (t).isNull(), ("No text for %d", t));624 return vrdpAuthTypes.value (t);627 AssertMsg (!mVRDPAuthTypes.value (t).isNull(), ("No text for %d", t)); 628 return mVRDPAuthTypes.value (t); 625 629 } 626 630 627 631 QString toString (KPortMode t) const 628 632 { 629 AssertMsg (! portModeTypes.value (t).isNull(), ("No text for %d", t));630 return portModeTypes.value (t);633 AssertMsg (!mPortModeTypes.value (t).isNull(), ("No text for %d", t)); 634 return mPortModeTypes.value (t); 631 635 } 632 636 633 637 QString toString (KUSBDeviceFilterAction t) const 634 638 { 635 AssertMsg (! usbFilterActionTypes.value (t).isNull(), ("No text for %d", t));636 return usbFilterActionTypes.value (t);639 AssertMsg (!mUSBFilterActionTypes.value (t).isNull(), ("No text for %d", t)); 640 return mUSBFilterActionTypes.value (t); 637 641 } 638 642 639 643 QString toString (KClipboardMode t) const 640 644 { 641 AssertMsg (! clipboardTypes.value (t).isNull(), ("No text for %d", t));642 return clipboardTypes.value (t);645 AssertMsg (!mClipboardTypes.value (t).isNull(), ("No text for %d", t)); 646 return mClipboardTypes.value (t); 643 647 } 644 648 645 649 KClipboardMode toClipboardModeType (const QString &s) const 646 650 { 647 QStringVector::const_iterator it = 648 qFind (clipboardTypes.begin(), clipboardTypes.end(), s); 649 AssertMsg (it != clipboardTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 650 return KClipboardMode (it - clipboardTypes.begin()); 651 QULongStringHash::const_iterator it = 652 qFind (mClipboardTypes.begin(), mClipboardTypes.end(), s); 653 AssertMsg (it != mClipboardTypes.end(), ("No value for {%s}", 654 s.toLatin1().constData())); 655 return KClipboardMode (it.key()); 651 656 } 652 657 653 658 QString toString (KIDEControllerType t) const 654 659 { 655 AssertMsg (! ideControllerTypes.value (t).isNull(), ("No text for %d", t));656 return ideControllerTypes.value (t);660 AssertMsg (!mIDEControllerTypes.value (t).isNull(), ("No text for %d", t)); 661 return mIDEControllerTypes.value (t); 657 662 } 658 663 659 664 KIDEControllerType toIDEControllerType (const QString &s) const 660 665 { 661 QStringVector::const_iterator it = 662 qFind (ideControllerTypes.begin(), ideControllerTypes.end(), s); 663 AssertMsg (it != ideControllerTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 664 return KIDEControllerType (it - ideControllerTypes.begin()); 666 QULongStringHash::const_iterator it = 667 qFind (mIDEControllerTypes.begin(), mIDEControllerTypes.end(), s); 668 AssertMsg (it != mIDEControllerTypes.end(), ("No value for {%s}", 669 s.toLatin1().constData())); 670 return KIDEControllerType (it.key()); 665 671 } 666 672 667 673 KVRDPAuthType toVRDPAuthType (const QString &s) const 668 674 { 669 QStringVector::const_iterator it = 670 qFind (vrdpAuthTypes.begin(), vrdpAuthTypes.end(), s); 671 AssertMsg (it != vrdpAuthTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 672 return KVRDPAuthType (it - vrdpAuthTypes.begin()); 675 QULongStringHash::const_iterator it = 676 qFind (mVRDPAuthTypes.begin(), mVRDPAuthTypes.end(), s); 677 AssertMsg (it != mVRDPAuthTypes.end(), ("No value for {%s}", 678 s.toLatin1().constData())); 679 return KVRDPAuthType (it.key()); 673 680 } 674 681 675 682 KPortMode toPortMode (const QString &s) const 676 683 { 677 QStringVector::const_iterator it = 678 qFind (portModeTypes.begin(), portModeTypes.end(), s); 679 AssertMsg (it != portModeTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 680 return KPortMode (it - portModeTypes.begin()); 684 QULongStringHash::const_iterator it = 685 qFind (mPortModeTypes.begin(), mPortModeTypes.end(), s); 686 AssertMsg (it != mPortModeTypes.end(), ("No value for {%s}", 687 s.toLatin1().constData())); 688 return KPortMode (it.key()); 681 689 } 682 690 683 691 KUSBDeviceFilterAction toUSBDevFilterAction (const QString &s) const 684 692 { 685 QStringVector::const_iterator it = 686 qFind (usbFilterActionTypes.begin(), usbFilterActionTypes.end(), s); 687 AssertMsg (it != usbFilterActionTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 688 return KUSBDeviceFilterAction (it - usbFilterActionTypes.begin()); 693 QULongStringHash::const_iterator it = 694 qFind (mUSBFilterActionTypes.begin(), mUSBFilterActionTypes.end(), s); 695 AssertMsg (it != mUSBFilterActionTypes.end(), ("No value for {%s}", 696 s.toLatin1().constData())); 697 return KUSBDeviceFilterAction (it.key()); 689 698 } 690 699 691 700 QString toString (KDeviceType t) const 692 701 { 693 AssertMsg (! deviceTypes.value (t).isNull(), ("No text for %d", t));694 return deviceTypes.value (t);702 AssertMsg (!mDeviceTypes.value (t).isNull(), ("No text for %d", t)); 703 return mDeviceTypes.value (t); 695 704 } 696 705 697 706 KDeviceType toDeviceType (const QString &s) const 698 707 { 699 QStringVector::const_iterator it = 700 qFind (deviceTypes.begin(), deviceTypes.end(), s); 701 AssertMsg (it != deviceTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 702 return KDeviceType (it - deviceTypes.begin()); 708 QULongStringHash::const_iterator it = 709 qFind (mDeviceTypes.begin(), mDeviceTypes.end(), s); 710 AssertMsg (it != mDeviceTypes.end(), ("No value for {%s}", 711 s.toLatin1().constData())); 712 return KDeviceType (it.key()); 703 713 } 704 714 … … 707 717 QString toString (KAudioDriverType t) const 708 718 { 709 AssertMsg (! audioDriverTypes.value (t).isNull(), ("No text for %d", t));710 return audioDriverTypes.value (t);719 AssertMsg (!mAudioDriverTypes.value (t).isNull(), ("No text for %d", t)); 720 return mAudioDriverTypes.value (t); 711 721 } 712 722 713 723 KAudioDriverType toAudioDriverType (const QString &s) const 714 724 { 715 QStringVector::const_iterator it = 716 qFind (audioDriverTypes.begin(), audioDriverTypes.end(), s); 717 AssertMsg (it != audioDriverTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 718 return KAudioDriverType (it - audioDriverTypes.begin()); 725 QULongStringHash::const_iterator it = 726 qFind (mAudioDriverTypes.begin(), mAudioDriverTypes.end(), s); 727 AssertMsg (it != mAudioDriverTypes.end(), ("No value for {%s}", 728 s.toLatin1().constData())); 729 return KAudioDriverType (it.key()); 719 730 } 720 731 721 732 QString toString (KAudioControllerType t) const 722 733 { 723 AssertMsg (! audioControllerTypes.value (t).isNull(), ("No text for %d", t));724 return audioControllerTypes.value (t);734 AssertMsg (!mAudioControllerTypes.value (t).isNull(), ("No text for %d", t)); 735 return mAudioControllerTypes.value (t); 725 736 } 726 737 727 738 KAudioControllerType toAudioControllerType (const QString &s) const 728 739 { 729 QStringVector::const_iterator it = 730 qFind (audioControllerTypes.begin(), audioControllerTypes.end(), s); 731 AssertMsg (it != audioControllerTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 732 return KAudioControllerType (it - audioControllerTypes.begin()); 740 QULongStringHash::const_iterator it = 741 qFind (mAudioControllerTypes.begin(), mAudioControllerTypes.end(), s); 742 AssertMsg (it != mAudioControllerTypes.end(), ("No value for {%s}", 743 s.toLatin1().constData())); 744 return KAudioControllerType (it.key()); 733 745 } 734 746 735 747 QString toString (KNetworkAdapterType t) const 736 748 { 737 AssertMsg (! networkAdapterTypes.value (t).isNull(), ("No text for %d", t));738 return networkAdapterTypes.value (t);749 AssertMsg (!mNetworkAdapterTypes.value (t).isNull(), ("No text for %d", t)); 750 return mNetworkAdapterTypes.value (t); 739 751 } 740 752 741 753 KNetworkAdapterType toNetworkAdapterType (const QString &s) const 742 754 { 743 QStringVector::const_iterator it = 744 qFind (networkAdapterTypes.begin(), networkAdapterTypes.end(), s); 745 AssertMsg (it != networkAdapterTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 746 return KNetworkAdapterType (it - networkAdapterTypes.begin()); 755 QULongStringHash::const_iterator it = 756 qFind (mNetworkAdapterTypes.begin(), mNetworkAdapterTypes.end(), s); 757 AssertMsg (it != mNetworkAdapterTypes.end(), ("No value for {%s}", 758 s.toLatin1().constData())); 759 return KNetworkAdapterType (it.key()); 747 760 } 748 761 749 762 QString toString (KNetworkAttachmentType t) const 750 763 { 751 AssertMsg (! networkAttachmentTypes.value (t).isNull(), ("No text for %d", t));752 return networkAttachmentTypes.value (t);764 AssertMsg (!mNetworkAttachmentTypes.value (t).isNull(), ("No text for %d", t)); 765 return mNetworkAttachmentTypes.value (t); 753 766 } 754 767 755 768 KNetworkAttachmentType toNetworkAttachmentType (const QString &s) const 756 769 { 757 QStringVector::const_iterator it = 758 qFind (networkAttachmentTypes.begin(), networkAttachmentTypes.end(), s); 759 AssertMsg (it != networkAttachmentTypes.end(), ("No value for {%s}", s.toLatin1().constData())); 760 return KNetworkAttachmentType (it - networkAttachmentTypes.begin()); 770 QULongStringHash::const_iterator it = 771 qFind (mNetworkAttachmentTypes.begin(), mNetworkAttachmentTypes.end(), s); 772 AssertMsg (it != mNetworkAttachmentTypes.end(), ("No value for {%s}", 773 s.toLatin1().constData())); 774 return KNetworkAttachmentType (it.key()); 761 775 } 762 776 763 777 QString toString (KUSBDeviceState aState) const 764 778 { 765 AssertMsg (! USBDeviceStates.value (aState).isNull(), ("No text for %d", aState));766 return USBDeviceStates.value (aState);779 AssertMsg (!mUSBDeviceStates.value (aState).isNull(), ("No text for %d", aState)); 780 return mUSBDeviceStates.value (aState); 767 781 } 768 782 … … 1063 1077 CVirtualBoxCallback callback; 1064 1078 1065 typedef QVector <QString> QStringVector; 1066 1067 QString verString; 1079 QString mVerString; 1068 1080 1069 1081 QList <QString> mFamilyIDs; 1070 1082 QList <QList <CGuestOSType> > mTypes; 1071 1083 QHash <QString, QPixmap *> mOsTypeIcons; 1072 QVector <QColor *> vm_state_color; 1073 1074 QHash <long int, QPixmap *> mStateIcons; 1084 1085 QHash <ulong, QPixmap *> mVMStateIcons; 1086 QHash <ulong, QColor *> mVMStateColors; 1087 1075 1088 QPixmap mOfflineSnapshotIcon, mOnlineSnapshotIcon; 1076 1089 1077 Q StringVector machineStates;1078 Q StringVector sessionStates;1079 Q StringVector deviceTypes;1080 1081 Q StringVector storageBuses;1082 Q StringVector storageBusDevices;1083 Q StringVector storageBusChannels;1084 1085 Q StringVector diskTypes;1086 QString diskTypes_Differencing;1087 1088 Q StringVector vrdpAuthTypes;1089 Q StringVector portModeTypes;1090 Q StringVector usbFilterActionTypes;1091 Q StringVector audioDriverTypes;1092 Q StringVector audioControllerTypes;1093 Q StringVector networkAdapterTypes;1094 Q StringVector networkAttachmentTypes;1095 Q StringVector clipboardTypes;1096 Q StringVector ideControllerTypes;1097 Q StringVectorUSBDeviceStates;1090 QULongStringHash mMachineStates; 1091 QULongStringHash mSessionStates; 1092 QULongStringHash mDeviceTypes; 1093 1094 QULongStringHash mStorageBuses; 1095 QLongStringHash mStorageBusChannels; 1096 QLongStringHash mStorageBusDevices; 1097 1098 QULongStringHash mDiskTypes; 1099 QString mDiskTypes_Differencing; 1100 1101 QULongStringHash mVRDPAuthTypes; 1102 QULongStringHash mPortModeTypes; 1103 QULongStringHash mUSBFilterActionTypes; 1104 QULongStringHash mAudioDriverTypes; 1105 QULongStringHash mAudioControllerTypes; 1106 QULongStringHash mNetworkAdapterTypes; 1107 QULongStringHash mNetworkAttachmentTypes; 1108 QULongStringHash mClipboardTypes; 1109 QULongStringHash mIDEControllerTypes; 1110 QULongStringHash mUSBDeviceStates; 1098 1111 1099 1112 QString mUserDefinedPortName; … … 1101 1114 QPixmap mWarningIcon, mErrorIcon; 1102 1115 1103 mutable bool detailReportTemplatesReady;1116 mutable bool mDetailReportTemplatesReady; 1104 1117 1105 1118 friend VBoxGlobal &vboxGlobal(); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r15185 r15304 1253 1253 #endif 1254 1254 , mMediaEnumThread (NULL) 1255 , verString ("1.0") 1256 , vm_state_color (KMachineState_COUNT) 1257 , machineStates (KMachineState_COUNT) 1258 , sessionStates (KSessionState_COUNT) 1259 , deviceTypes (KDeviceType_COUNT) 1260 , storageBuses (KStorageBus_COUNT) 1261 , storageBusDevices (2) 1262 , storageBusChannels (3) 1263 , diskTypes (KHardDiskType_COUNT) 1264 , vrdpAuthTypes (KVRDPAuthType_COUNT) 1265 , portModeTypes (KPortMode_COUNT) 1266 , usbFilterActionTypes (KUSBDeviceFilterAction_COUNT) 1267 , audioDriverTypes (KAudioDriverType_COUNT) 1268 , audioControllerTypes (KAudioControllerType_COUNT) 1269 , networkAdapterTypes (KNetworkAdapterType_COUNT) 1270 , networkAttachmentTypes (KNetworkAttachmentType_COUNT) 1271 , clipboardTypes (KClipboardMode_COUNT) 1272 , ideControllerTypes (KIDEControllerType_COUNT) 1273 , USBDeviceStates (KUSBDeviceState_COUNT) 1274 , detailReportTemplatesReady (false) 1255 , mVerString ("1.0") 1256 , mDetailReportTemplatesReady (false) 1275 1257 { 1276 1258 } … … 1331 1313 { 1332 1314 qDeleteAll (mOsTypeIcons); 1333 qDeleteAll (m StateIcons);1334 qDeleteAll ( vm_state_color);1315 qDeleteAll (mVMStateIcons); 1316 qDeleteAll (mVMStateColors); 1335 1317 } 1336 1318 … … 1620 1602 QString VBoxGlobal::toString (KStorageBus aBus, LONG aChannel) const 1621 1603 { 1622 Assert (storageBusChannels.count() == 3);1623 1604 QString channel; 1624 1605 … … 1629 1610 if (aChannel == 0 || aChannel == 1) 1630 1611 { 1631 channel = storageBusChannels [aChannel];1612 channel = mStorageBusChannels [aChannel]; 1632 1613 break; 1633 1614 } … … 1637 1618 case KStorageBus_SATA: 1638 1619 { 1639 channel = storageBusChannels [2].arg (aChannel);1620 channel = mStorageBusChannels [2].arg (aChannel); 1640 1621 break; 1641 1622 } … … 1644 1625 } 1645 1626 1627 Assert (!channel.isNull()); 1646 1628 return channel; 1647 1629 } … … 1659 1641 case KStorageBus_IDE: 1660 1642 { 1661 Q StringVector::const_iterator it =1662 qFind ( storageBusChannels.begin(), storageBusChannels.end(),1643 QLongStringHash::const_iterator it = 1644 qFind (mStorageBusChannels.begin(), mStorageBusChannels.end(), 1663 1645 aChannel); 1664 AssertMsgBreak (it != storageBusChannels.end(),1646 AssertMsgBreak (it != mStorageBusChannels.end(), 1665 1647 ("No value for {%s}\n", aChannel.toLatin1().constData())); 1666 channel = (LONG) (it - storageBusChannels.begin());1648 channel = it.key(); 1667 1649 break; 1668 1650 } … … 1670 1652 { 1671 1653 /// @todo use regexp to properly extract the %1 text 1672 QString tpl = storageBusChannels [2].arg ("");1654 QString tpl = mStorageBusChannels [2].arg (""); 1673 1655 if (aChannel.startsWith (tpl)) 1674 1656 { … … 1696 1678 NOREF (aChannel); 1697 1679 1698 Assert (storageBusDevices.count() == 2);1699 1680 QString device; 1700 1681 … … 1705 1686 if (aDevice == 0 || aDevice == 1) 1706 1687 { 1707 device = storageBusDevices [aDevice];1688 device = mStorageBusDevices [aDevice]; 1708 1689 break; 1709 1690 } … … 1721 1702 } 1722 1703 1704 Assert (!device.isNull()); 1723 1705 return device; 1724 1706 } … … 1740 1722 case KStorageBus_IDE: 1741 1723 { 1742 Q StringVector::const_iterator it =1743 qFind ( storageBusDevices.begin(), storageBusDevices.end(),1724 QLongStringHash::const_iterator it = 1725 qFind (mStorageBusDevices.begin(), mStorageBusDevices.end(), 1744 1726 aDevice); 1745 AssertMsg (it != storageBusDevices.end(),1727 AssertMsg (it != mStorageBusDevices.end(), 1746 1728 ("No value for {%s}", aDevice.toLatin1().constData())); 1747 device = (LONG) (it - storageBusDevices.begin());1729 device = it.key(); 1748 1730 break; 1749 1731 } … … 1797 1779 1798 1780 /** 1799 * 1781 * Returns the list of all device types (VirtualBox::DeviceType COM enum). 1800 1782 */ 1801 1783 QStringList VBoxGlobal::deviceTypeStrings() const … … 1803 1785 static QStringList list; 1804 1786 if (list.empty()) 1805 for (int i = 0; i < deviceTypes.count() - 1 /* usb=n/a */; i++) 1806 list += deviceTypes [i]; 1787 for (QULongStringHash::const_iterator it = mDeviceTypes.begin(); 1788 it != mDeviceTypes.end(); ++ it) 1789 list += it.value(); 1807 1790 return list; 1808 1791 } … … 1815 1798 }; 1816 1799 1817 static const PortConfig comKnownPorts[] =1800 static const PortConfig kComKnownPorts[] = 1818 1801 { 1819 1802 { "COM1", 4, 0x3F8 }, … … 1825 1808 }; 1826 1809 1827 static const PortConfig lptKnownPorts[] =1810 static const PortConfig kLptKnownPorts[] = 1828 1811 { 1829 1812 { "LPT1", 7, 0x3BC }, … … 1840 1823 { 1841 1824 QStringList list; 1842 for (size_t i = 0; i < RT_ELEMENTS ( comKnownPorts); ++ i)1843 list << comKnownPorts [i].name;1825 for (size_t i = 0; i < RT_ELEMENTS (kComKnownPorts); ++ i) 1826 list << kComKnownPorts [i].name; 1844 1827 1845 1828 return list; … … 1852 1835 { 1853 1836 QStringList list; 1854 for (size_t i = 0; i < RT_ELEMENTS ( lptKnownPorts); ++ i)1855 list << lptKnownPorts [i].name;1837 for (size_t i = 0; i < RT_ELEMENTS (kLptKnownPorts); ++ i) 1838 list << kLptKnownPorts [i].name; 1856 1839 1857 1840 return list; … … 1865 1848 QString VBoxGlobal::toCOMPortName (ulong aIRQ, ulong aIOBase) const 1866 1849 { 1867 for (size_t i = 0; i < RT_ELEMENTS ( comKnownPorts); ++ i)1868 if ( comKnownPorts [i].IRQ == aIRQ &&1869 comKnownPorts [i].IOBase == aIOBase)1870 return comKnownPorts [i].name;1850 for (size_t i = 0; i < RT_ELEMENTS (kComKnownPorts); ++ i) 1851 if (kComKnownPorts [i].IRQ == aIRQ && 1852 kComKnownPorts [i].IOBase == aIOBase) 1853 return kComKnownPorts [i].name; 1871 1854 1872 1855 return mUserDefinedPortName; … … 1880 1863 QString VBoxGlobal::toLPTPortName (ulong aIRQ, ulong aIOBase) const 1881 1864 { 1882 for (size_t i = 0; i < RT_ELEMENTS ( lptKnownPorts); ++ i)1883 if ( lptKnownPorts [i].IRQ == aIRQ &&1884 lptKnownPorts [i].IOBase == aIOBase)1885 return lptKnownPorts [i].name;1865 for (size_t i = 0; i < RT_ELEMENTS (kLptKnownPorts); ++ i) 1866 if (kLptKnownPorts [i].IRQ == aIRQ && 1867 kLptKnownPorts [i].IOBase == aIOBase) 1868 return kLptKnownPorts [i].name; 1886 1869 1887 1870 return mUserDefinedPortName; … … 1896 1879 ulong &aIOBase) const 1897 1880 { 1898 for (size_t i = 0; i < RT_ELEMENTS ( comKnownPorts); ++ i)1899 if (strcmp ( comKnownPorts [i].name, aName.toUtf8().data()) == 0)1900 { 1901 aIRQ = comKnownPorts [i].IRQ;1902 aIOBase = comKnownPorts [i].IOBase;1881 for (size_t i = 0; i < RT_ELEMENTS (kComKnownPorts); ++ i) 1882 if (strcmp (kComKnownPorts [i].name, aName.toUtf8().data()) == 0) 1883 { 1884 aIRQ = kComKnownPorts [i].IRQ; 1885 aIOBase = kComKnownPorts [i].IOBase; 1903 1886 return true; 1904 1887 } … … 1915 1898 ulong &aIOBase) const 1916 1899 { 1917 for (size_t i = 0; i < RT_ELEMENTS ( lptKnownPorts); ++ i)1918 if (strcmp ( lptKnownPorts [i].name, aName.toUtf8().data()) == 0)1919 { 1920 aIRQ = lptKnownPorts [i].IRQ;1921 aIOBase = lptKnownPorts [i].IOBase;1900 for (size_t i = 0; i < RT_ELEMENTS (kLptKnownPorts); ++ i) 1901 if (strcmp (kLptKnownPorts [i].name, aName.toUtf8().data()) == 0) 1902 { 1903 aIRQ = kLptKnownPorts [i].IRQ; 1904 aIOBase = kLptKnownPorts [i].IOBase; 1922 1905 return true; 1923 1906 } … … 2105 2088 /* generate templates after every language change */ 2106 2089 2107 if (! detailReportTemplatesReady)2108 { 2109 detailReportTemplatesReady = true;2090 if (!mDetailReportTemplatesReady) 2091 { 2092 mDetailReportTemplatesReady = true; 2110 2093 2111 2094 QString generalItems … … 3305 3288 void VBoxGlobal::retranslateUi() 3306 3289 { 3307 machineStates [KMachineState_PoweredOff] = tr ("Powered Off", "MachineState"); 3308 machineStates [KMachineState_Saved] = tr ("Saved", "MachineState"); 3309 machineStates [KMachineState_Aborted] = tr ("Aborted", "MachineState"); 3310 machineStates [KMachineState_Running] = tr ("Running", "MachineState"); 3311 machineStates [KMachineState_Paused] = tr ("Paused", "MachineState"); 3312 machineStates [KMachineState_Stuck] = tr ("Stuck", "MachineState"); 3313 machineStates [KMachineState_Starting] = tr ("Starting", "MachineState"); 3314 machineStates [KMachineState_Stopping] = tr ("Stopping", "MachineState"); 3315 machineStates [KMachineState_Saving] = tr ("Saving", "MachineState"); 3316 machineStates [KMachineState_Restoring] = tr ("Restoring", "MachineState"); 3317 machineStates [KMachineState_Discarding] = tr ("Discarding", "MachineState"); 3318 machineStates [KMachineState_SettingUp] = tr ("Setting Up", "MachineState"); 3319 3320 sessionStates [KSessionState_Closed] = tr ("Closed", "SessionState"); 3321 sessionStates [KSessionState_Open] = tr ("Open", "SessionState"); 3322 sessionStates [KSessionState_Spawning] = tr ("Spawning", "SessionState"); 3323 sessionStates [KSessionState_Closing] = tr ("Closing", "SessionState"); 3324 3325 deviceTypes [KDeviceType_Null] = tr ("None", "DeviceType"); 3326 deviceTypes [KDeviceType_Floppy] = tr ("Floppy", "DeviceType"); 3327 deviceTypes [KDeviceType_DVD] = tr ("CD/DVD-ROM", "DeviceType"); 3328 deviceTypes [KDeviceType_HardDisk] = tr ("Hard Disk", "DeviceType"); 3329 deviceTypes [KDeviceType_Network] = tr ("Network", "DeviceType"); 3330 deviceTypes [KDeviceType_USB] = tr ("USB", "DeviceType"); 3331 deviceTypes [KDeviceType_SharedFolder] = tr ("Shared Folder", "DeviceType"); 3332 3333 storageBuses [KStorageBus_IDE] = 3334 tr ("IDE", "StorageBus"); 3335 storageBuses [KStorageBus_SATA] = 3336 tr ("SATA", "StorageBus"); 3337 3338 Assert (storageBusChannels.count() == 3); 3339 storageBusChannels [0] = 3340 tr ("Primary", "StorageBusChannel"); 3341 storageBusChannels [1] = 3342 tr ("Secondary", "StorageBusChannel"); 3343 storageBusChannels [2] = 3344 tr ("Port %1", "StorageBusChannel"); 3345 3346 Assert (storageBusDevices.count() == 2); 3347 storageBusDevices [0] = tr ("Master", "StorageBusDevice"); 3348 storageBusDevices [1] = tr ("Slave", "StorageBusDevice"); 3349 3350 diskTypes [KHardDiskType_Normal] = 3351 tr ("Normal", "DiskType"); 3352 diskTypes [KHardDiskType_Immutable] = 3353 tr ("Immutable", "DiskType"); 3354 diskTypes [KHardDiskType_Writethrough] = 3355 tr ("Writethrough", "DiskType"); 3356 diskTypes_Differencing = 3357 tr ("Differencing", "DiskType"); 3358 3359 vrdpAuthTypes [KVRDPAuthType_Null] = 3360 tr ("Null", "VRDPAuthType"); 3361 vrdpAuthTypes [KVRDPAuthType_External] = 3362 tr ("External", "VRDPAuthType"); 3363 vrdpAuthTypes [KVRDPAuthType_Guest] = 3364 tr ("Guest", "VRDPAuthType"); 3365 3366 portModeTypes [KPortMode_Disconnected] = 3367 tr ("Disconnected", "PortMode"); 3368 portModeTypes [KPortMode_HostPipe] = 3369 tr ("Host Pipe", "PortMode"); 3370 portModeTypes [KPortMode_HostDevice] = 3371 tr ("Host Device", "PortMode"); 3372 3373 usbFilterActionTypes [KUSBDeviceFilterAction_Ignore] = 3290 mMachineStates [KMachineState_PoweredOff] = tr ("Powered Off", "MachineState"); 3291 mMachineStates [KMachineState_Saved] = tr ("Saved", "MachineState"); 3292 mMachineStates [KMachineState_Aborted] = tr ("Aborted", "MachineState"); 3293 mMachineStates [KMachineState_Running] = tr ("Running", "MachineState"); 3294 mMachineStates [KMachineState_Paused] = tr ("Paused", "MachineState"); 3295 mMachineStates [KMachineState_Stuck] = tr ("Stuck", "MachineState"); 3296 mMachineStates [KMachineState_Starting] = tr ("Starting", "MachineState"); 3297 mMachineStates [KMachineState_Stopping] = tr ("Stopping", "MachineState"); 3298 mMachineStates [KMachineState_Saving] = tr ("Saving", "MachineState"); 3299 mMachineStates [KMachineState_Restoring] = tr ("Restoring", "MachineState"); 3300 mMachineStates [KMachineState_Discarding] = tr ("Discarding", "MachineState"); 3301 mMachineStates [KMachineState_SettingUp] = tr ("Setting Up", "MachineState"); 3302 3303 mSessionStates [KSessionState_Closed] = tr ("Closed", "SessionState"); 3304 mSessionStates [KSessionState_Open] = tr ("Open", "SessionState"); 3305 mSessionStates [KSessionState_Spawning] = tr ("Spawning", "SessionState"); 3306 mSessionStates [KSessionState_Closing] = tr ("Closing", "SessionState"); 3307 3308 mDeviceTypes [KDeviceType_Null] = tr ("None", "DeviceType"); 3309 mDeviceTypes [KDeviceType_Floppy] = tr ("Floppy", "DeviceType"); 3310 mDeviceTypes [KDeviceType_DVD] = tr ("CD/DVD-ROM", "DeviceType"); 3311 mDeviceTypes [KDeviceType_HardDisk] = tr ("Hard Disk", "DeviceType"); 3312 mDeviceTypes [KDeviceType_Network] = tr ("Network", "DeviceType"); 3313 mDeviceTypes [KDeviceType_USB] = tr ("USB", "DeviceType"); 3314 mDeviceTypes [KDeviceType_SharedFolder] = tr ("Shared Folder", "DeviceType"); 3315 3316 mStorageBuses [KStorageBus_IDE] = tr ("IDE", "StorageBus"); 3317 mStorageBuses [KStorageBus_SATA] = tr ("SATA", "StorageBus"); 3318 3319 mStorageBusChannels [0] = tr ("Primary", "StorageBusChannel"); 3320 mStorageBusChannels [1] = tr ("Secondary", "StorageBusChannel"); 3321 mStorageBusChannels [2] = tr ("Port %1", "StorageBusChannel"); 3322 3323 mStorageBusDevices [0] = tr ("Master", "StorageBusDevice"); 3324 mStorageBusDevices [1] = tr ("Slave", "StorageBusDevice"); 3325 3326 mDiskTypes [KHardDiskType_Normal] = tr ("Normal", "DiskType"); 3327 mDiskTypes [KHardDiskType_Immutable] = tr ("Immutable", "DiskType"); 3328 mDiskTypes [KHardDiskType_Writethrough] = tr ("Writethrough", "DiskType"); 3329 mDiskTypes_Differencing = tr ("Differencing", "DiskType"); 3330 3331 mVRDPAuthTypes [KVRDPAuthType_Null] = tr ("Null", "VRDPAuthType"); 3332 mVRDPAuthTypes [KVRDPAuthType_External] = tr ("External", "VRDPAuthType"); 3333 mVRDPAuthTypes [KVRDPAuthType_Guest] = tr ("Guest", "VRDPAuthType"); 3334 3335 mPortModeTypes [KPortMode_Disconnected] = tr ("Disconnected", "PortMode"); 3336 mPortModeTypes [KPortMode_HostPipe] = tr ("Host Pipe", "PortMode"); 3337 mPortModeTypes [KPortMode_HostDevice] = tr ("Host Device", "PortMode"); 3338 3339 mUSBFilterActionTypes [KUSBDeviceFilterAction_Ignore] = 3374 3340 tr ("Ignore", "USBFilterActionType"); 3375 usbFilterActionTypes [KUSBDeviceFilterAction_Hold] =3341 mUSBFilterActionTypes [KUSBDeviceFilterAction_Hold] = 3376 3342 tr ("Hold", "USBFilterActionType"); 3377 3343 3378 audioDriverTypes [KAudioDriverType_Null] =3344 mAudioDriverTypes [KAudioDriverType_Null] = 3379 3345 tr ("Null Audio Driver", "AudioDriverType"); 3380 audioDriverTypes [KAudioDriverType_WinMM] =3346 mAudioDriverTypes [KAudioDriverType_WinMM] = 3381 3347 tr ("Windows Multimedia", "AudioDriverType"); 3382 audioDriverTypes [KAudioDriverType_SolAudio] =3348 mAudioDriverTypes [KAudioDriverType_SolAudio] = 3383 3349 tr ("Solaris Audio", "AudioDriverType"); 3384 audioDriverTypes [KAudioDriverType_OSS] =3350 mAudioDriverTypes [KAudioDriverType_OSS] = 3385 3351 tr ("OSS Audio Driver", "AudioDriverType"); 3386 audioDriverTypes [KAudioDriverType_ALSA] =3352 mAudioDriverTypes [KAudioDriverType_ALSA] = 3387 3353 tr ("ALSA Audio Driver", "AudioDriverType"); 3388 audioDriverTypes [KAudioDriverType_DirectSound] =3354 mAudioDriverTypes [KAudioDriverType_DirectSound] = 3389 3355 tr ("Windows DirectSound", "AudioDriverType"); 3390 audioDriverTypes [KAudioDriverType_CoreAudio] =3356 mAudioDriverTypes [KAudioDriverType_CoreAudio] = 3391 3357 tr ("CoreAudio", "AudioDriverType"); 3392 audioDriverTypes [KAudioDriverType_Pulse] =3358 mAudioDriverTypes [KAudioDriverType_Pulse] = 3393 3359 tr ("PulseAudio", "AudioDriverType"); 3394 3360 3395 audioControllerTypes [KAudioControllerType_AC97] =3361 mAudioControllerTypes [KAudioControllerType_AC97] = 3396 3362 tr ("ICH AC97", "AudioControllerType"); 3397 audioControllerTypes [KAudioControllerType_SB16] =3363 mAudioControllerTypes [KAudioControllerType_SB16] = 3398 3364 tr ("SoundBlaster 16", "AudioControllerType"); 3399 3365 3400 networkAdapterTypes [KNetworkAdapterType_Am79C970A] =3366 mNetworkAdapterTypes [KNetworkAdapterType_Am79C970A] = 3401 3367 tr ("PCnet-PCI II (Am79C970A)", "NetworkAdapterType"); 3402 networkAdapterTypes [KNetworkAdapterType_Am79C973] =3368 mNetworkAdapterTypes [KNetworkAdapterType_Am79C973] = 3403 3369 tr ("PCnet-FAST III (Am79C973)", "NetworkAdapterType"); 3404 networkAdapterTypes [KNetworkAdapterType_I82540EM] =3370 mNetworkAdapterTypes [KNetworkAdapterType_I82540EM] = 3405 3371 tr ("Intel PRO/1000 MT Desktop (82540EM)", "NetworkAdapterType"); 3406 networkAdapterTypes [KNetworkAdapterType_I82543GC] =3372 mNetworkAdapterTypes [KNetworkAdapterType_I82543GC] = 3407 3373 tr ("Intel PRO/1000 T Server (82543GC)", "NetworkAdapterType"); 3408 3374 3409 networkAttachmentTypes [KNetworkAttachmentType_Null] =3375 mNetworkAttachmentTypes [KNetworkAttachmentType_Null] = 3410 3376 tr ("Not attached", "NetworkAttachmentType"); 3411 networkAttachmentTypes [KNetworkAttachmentType_NAT] =3377 mNetworkAttachmentTypes [KNetworkAttachmentType_NAT] = 3412 3378 tr ("NAT", "NetworkAttachmentType"); 3413 networkAttachmentTypes [KNetworkAttachmentType_HostInterface] =3379 mNetworkAttachmentTypes [KNetworkAttachmentType_HostInterface] = 3414 3380 tr ("Host Interface", "NetworkAttachmentType"); 3415 networkAttachmentTypes [KNetworkAttachmentType_Internal] =3381 mNetworkAttachmentTypes [KNetworkAttachmentType_Internal] = 3416 3382 tr ("Internal Network", "NetworkAttachmentType"); 3417 3383 3418 clipboardTypes [KClipboardMode_Disabled] =3384 mClipboardTypes [KClipboardMode_Disabled] = 3419 3385 tr ("Disabled", "ClipboardType"); 3420 clipboardTypes [KClipboardMode_HostToGuest] =3386 mClipboardTypes [KClipboardMode_HostToGuest] = 3421 3387 tr ("Host To Guest", "ClipboardType"); 3422 clipboardTypes [KClipboardMode_GuestToHost] =3388 mClipboardTypes [KClipboardMode_GuestToHost] = 3423 3389 tr ("Guest To Host", "ClipboardType"); 3424 clipboardTypes [KClipboardMode_Bidirectional] =3390 mClipboardTypes [KClipboardMode_Bidirectional] = 3425 3391 tr ("Bidirectional", "ClipboardType"); 3426 3392 3427 ideControllerTypes [KIDEControllerType_PIIX3] =3393 mIDEControllerTypes [KIDEControllerType_PIIX3] = 3428 3394 tr ("PIIX3", "IDEControllerType"); 3429 ideControllerTypes [KIDEControllerType_PIIX4] =3395 mIDEControllerTypes [KIDEControllerType_PIIX4] = 3430 3396 tr ("PIIX4", "IDEControllerType"); 3431 3397 3432 USBDeviceStates [KUSBDeviceState_NotSupported] =3398 mUSBDeviceStates [KUSBDeviceState_NotSupported] = 3433 3399 tr ("Not supported", "USBDeviceState"); 3434 USBDeviceStates [KUSBDeviceState_Unavailable] =3400 mUSBDeviceStates [KUSBDeviceState_Unavailable] = 3435 3401 tr ("Unavailable", "USBDeviceState"); 3436 USBDeviceStates [KUSBDeviceState_Busy] =3402 mUSBDeviceStates [KUSBDeviceState_Busy] = 3437 3403 tr ("Busy", "USBDeviceState"); 3438 USBDeviceStates [KUSBDeviceState_Available] =3404 mUSBDeviceStates [KUSBDeviceState_Available] = 3439 3405 tr ("Available", "USBDeviceState"); 3440 USBDeviceStates [KUSBDeviceState_Held] =3406 mUSBDeviceStates [KUSBDeviceState_Held] = 3441 3407 tr ("Held", "USBDeviceState"); 3442 USBDeviceStates [KUSBDeviceState_Captured] =3408 mUSBDeviceStates [KUSBDeviceState_Captured] = 3443 3409 tr ("Captured", "USBDeviceState"); 3444 3410 … … 3451 3417 Assert (!mErrorIcon.isNull()); 3452 3418 3453 detailReportTemplatesReady = false;3419 mDetailReportTemplatesReady = false; 3454 3420 3455 3421 #if defined (Q_WS_PM) || defined (Q_WS_X11) … … 5308 5274 { 5309 5275 #ifdef DEBUG 5310 verString += " [DEBUG]";5276 mVerString += " [DEBUG]"; 5311 5277 #endif 5312 5278 … … 5442 5408 } 5443 5409 5444 /* fill in VM state icon dictionary*/5445 static struct5410 /* fill in VM state icon map */ 5411 static const struct 5446 5412 { 5447 5413 KMachineState state; 5448 5414 const char *name; 5449 5415 } 5450 vmStateIcons[] =5416 kVMStateIcons[] = 5451 5417 { 5452 5418 {KMachineState_Null, NULL}, … … 5464 5430 {KMachineState_SettingUp, ":/settings_16px.png"}, 5465 5431 }; 5466 for (uint n = 0; n < SIZEOF_ARRAY (vmStateIcons); n ++) 5467 { 5468 mStateIcons.insert (vmStateIcons [n].state, 5469 new QPixmap (vmStateIcons [n].name)); 5470 } 5432 for (uint n = 0; n < SIZEOF_ARRAY (kVMStateIcons); n ++) 5433 { 5434 mVMStateIcons.insert (kVMStateIcons [n].state, 5435 new QPixmap (kVMStateIcons [n].name)); 5436 } 5437 5438 /* initialize state colors map */ 5439 mVMStateColors.insert (KMachineState_Null, new QColor (Qt::red)); 5440 mVMStateColors.insert (KMachineState_PoweredOff, new QColor (Qt::gray)); 5441 mVMStateColors.insert (KMachineState_Saved, new QColor (Qt::yellow)); 5442 mVMStateColors.insert (KMachineState_Aborted, new QColor (Qt::darkRed)); 5443 mVMStateColors.insert (KMachineState_Running, new QColor (Qt::green)); 5444 mVMStateColors.insert (KMachineState_Paused, new QColor (Qt::darkGreen)); 5445 mVMStateColors.insert (KMachineState_Stuck, new QColor (Qt::darkMagenta)); 5446 mVMStateColors.insert (KMachineState_Starting, new QColor (Qt::green)); 5447 mVMStateColors.insert (KMachineState_Stopping, new QColor (Qt::green)); 5448 mVMStateColors.insert (KMachineState_Saving, new QColor (Qt::green)); 5449 mVMStateColors.insert (KMachineState_Restoring, new QColor (Qt::green)); 5450 mVMStateColors.insert (KMachineState_Discarding, new QColor (Qt::green)); 5451 mVMStateColors.insert (KMachineState_SettingUp, new QColor (Qt::green)); 5471 5452 5472 5453 /* online/offline snapshot icons */ 5473 5454 mOfflineSnapshotIcon = QPixmap (":/offline_snapshot_16px.png"); 5474 5455 mOnlineSnapshotIcon = QPixmap (":/online_snapshot_16px.png"); 5475 5476 /* initialize state colors vector */5477 vm_state_color.insert (KMachineState_Null, new QColor(Qt::red));5478 vm_state_color.insert (KMachineState_PoweredOff, new QColor(Qt::gray));5479 vm_state_color.insert (KMachineState_Saved, new QColor(Qt::yellow));5480 vm_state_color.insert (KMachineState_Aborted, new QColor(Qt::darkRed));5481 vm_state_color.insert (KMachineState_Running, new QColor(Qt::green));5482 vm_state_color.insert (KMachineState_Paused, new QColor(Qt::darkGreen));5483 vm_state_color.insert (KMachineState_Stuck, new QColor(Qt::darkMagenta));5484 vm_state_color.insert (KMachineState_Starting, new QColor(Qt::green));5485 vm_state_color.insert (KMachineState_Stopping, new QColor(Qt::green));5486 vm_state_color.insert (KMachineState_Saving, new QColor(Qt::green));5487 vm_state_color.insert (KMachineState_Restoring, new QColor(Qt::green));5488 vm_state_color.insert (KMachineState_Discarding, new QColor(Qt::green));5489 vm_state_color.insert (KMachineState_SettingUp, new QColor(Qt::green));5490 5456 5491 5457 qApp->installEventFilter (this);
Note:
See TracChangeset
for help on using the changeset viewer.