Changeset 15304 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include
- Timestamp:
- Dec 11, 2008 3:15:25 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40729
- Location:
- trunk/src/VBox/Frontends/VirtualBox4/include
- Files:
-
- 2 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();
Note:
See TracChangeset
for help on using the changeset viewer.