Changeset 15304 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 11, 2008 3:15:25 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl
r14187 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/VirtualBox/include/VBoxGlobal.h
r13601 r15304 386 386 public: 387 387 388 typedef QMap <ulong, QString> QULongStringMap; 389 typedef QMap <long, QString> QLongStringMap; 390 388 391 static VBoxGlobal &instance(); 389 392 … … 429 432 { 430 433 static const QColor none; 431 AssertMsg (vm_state_color [s], ("No color for %d", s));432 return vm_state_color [s]? *vm_state_color [s] : none;434 AssertMsg (vm_state_color.find (s), ("No color for %d", s)); 435 return vm_state_color.find (s) ? *vm_state_color [s] : none; 433 436 } 434 437 … … 461 464 KStorageBus toStorageBusType (const QString &aBus) const 462 465 { 463 Q StringVector::const_iterator it =466 QULongStringMap::const_iterator it = 464 467 qFind (storageBuses.begin(), storageBuses.end(), aBus); 465 468 AssertMsg (it != storageBuses.end(), ("No value for {%s}", aBus.latin1())); 466 return KStorageBus (it - storageBuses.begin());469 return KStorageBus (it.key()); 467 470 } 468 471 … … 521 524 KClipboardMode toClipboardModeType (const QString &s) const 522 525 { 523 Q StringVector::const_iterator it =526 QULongStringMap::const_iterator it = 524 527 qFind (clipboardTypes.begin(), clipboardTypes.end(), s); 525 528 AssertMsg (it != clipboardTypes.end(), ("No value for {%s}", s.latin1())); 526 return KClipboardMode (it - clipboardTypes.begin());529 return KClipboardMode (it.key()); 527 530 } 528 531 … … 535 538 KIDEControllerType toIDEControllerType (const QString &s) const 536 539 { 537 Q StringVector::const_iterator it =540 QULongStringMap::const_iterator it = 538 541 qFind (ideControllerTypes.begin(), ideControllerTypes.end(), s); 539 542 AssertMsg (it != ideControllerTypes.end(), ("No value for {%s}", s.latin1())); 540 return KIDEControllerType (it - ideControllerTypes.begin());543 return KIDEControllerType (it.key()); 541 544 } 542 545 543 546 KVRDPAuthType toVRDPAuthType (const QString &s) const 544 547 { 545 Q StringVector::const_iterator it =548 QULongStringMap::const_iterator it = 546 549 qFind (vrdpAuthTypes.begin(), vrdpAuthTypes.end(), s); 547 550 AssertMsg (it != vrdpAuthTypes.end(), ("No value for {%s}", s.latin1())); 548 return KVRDPAuthType (it - vrdpAuthTypes.begin());551 return KVRDPAuthType (it.key()); 549 552 } 550 553 551 554 KPortMode toPortMode (const QString &s) const 552 555 { 553 Q StringVector::const_iterator it =556 QULongStringMap::const_iterator it = 554 557 qFind (portModeTypes.begin(), portModeTypes.end(), s); 555 558 AssertMsg (it != portModeTypes.end(), ("No value for {%s}", s.latin1())); 556 return KPortMode (it - portModeTypes.begin());559 return KPortMode (it.key()); 557 560 } 558 561 559 562 KUSBDeviceFilterAction toUSBDevFilterAction (const QString &s) const 560 563 { 561 Q StringVector::const_iterator it =564 QULongStringMap::const_iterator it = 562 565 qFind (usbFilterActionTypes.begin(), usbFilterActionTypes.end(), s); 563 566 AssertMsg (it != usbFilterActionTypes.end(), ("No value for {%s}", s.latin1())); 564 return KUSBDeviceFilterAction (it - usbFilterActionTypes.begin());567 return KUSBDeviceFilterAction (it.key()); 565 568 } 566 569 … … 573 576 KDeviceType toDeviceType (const QString &s) const 574 577 { 575 Q StringVector::const_iterator it =578 QULongStringMap::const_iterator it = 576 579 qFind (deviceTypes.begin(), deviceTypes.end(), s); 577 580 AssertMsg (it != deviceTypes.end(), ("No value for {%s}", s.latin1())); 578 return KDeviceType (it - deviceTypes.begin());581 return KDeviceType (it.key()); 579 582 } 580 583 … … 589 592 KAudioDriverType toAudioDriverType (const QString &s) const 590 593 { 591 Q StringVector::const_iterator it =594 QULongStringMap::const_iterator it = 592 595 qFind (audioDriverTypes.begin(), audioDriverTypes.end(), s); 593 596 AssertMsg (it != audioDriverTypes.end(), ("No value for {%s}", s.latin1())); 594 return KAudioDriverType (it - audioDriverTypes.begin());597 return KAudioDriverType (it.key()); 595 598 } 596 599 … … 603 606 KAudioControllerType toAudioControllerType (const QString &s) const 604 607 { 605 Q StringVector::const_iterator it =608 QULongStringMap::const_iterator it = 606 609 qFind (audioControllerTypes.begin(), audioControllerTypes.end(), s); 607 610 AssertMsg (it != audioControllerTypes.end(), ("No value for {%s}", s.latin1())); 608 return KAudioControllerType (it - audioControllerTypes.begin());611 return KAudioControllerType (it.key()); 609 612 } 610 613 … … 617 620 KNetworkAdapterType toNetworkAdapterType (const QString &s) const 618 621 { 619 Q StringVector::const_iterator it =622 QULongStringMap::const_iterator it = 620 623 qFind (networkAdapterTypes.begin(), networkAdapterTypes.end(), s); 621 624 AssertMsg (it != networkAdapterTypes.end(), ("No value for {%s}", s.latin1())); 622 return KNetworkAdapterType (it - networkAdapterTypes.begin());625 return KNetworkAdapterType (it.key()); 623 626 } 624 627 … … 631 634 KNetworkAttachmentType toNetworkAttachmentType (const QString &s) const 632 635 { 633 Q StringVector::const_iterator it =636 QULongStringMap::const_iterator it = 634 637 qFind (networkAttachmentTypes.begin(), networkAttachmentTypes.end(), s); 635 638 AssertMsg (it != networkAttachmentTypes.end(), ("No value for {%s}", s.latin1())); 636 return KNetworkAttachmentType (it - networkAttachmentTypes.begin());639 return KNetworkAttachmentType (it.key()); 637 640 } 638 641 … … 879 882 CVirtualBoxCallback callback; 880 883 881 typedef QValueVector <QString> QStringVector;882 883 884 QString verString; 884 885 885 886 QValueVector <CGuestOSType> vm_os_types; 886 887 QDict <QPixmap> vm_os_type_icons; 887 Q PtrVector<QColor> vm_state_color;888 QIntDict <QColor> vm_state_color; 888 889 889 890 QIntDict <QPixmap> mStateIcons; 890 891 QPixmap mOfflineSnapshotIcon, mOnlineSnapshotIcon; 891 892 892 Q StringVectormachineStates;893 Q StringVectorsessionStates;894 Q StringVectordeviceTypes;895 896 Q StringVectorstorageBuses;897 Q StringVectorstorageBusDevices;898 Q StringVectorstorageBusChannels;899 900 Q StringVectordiskTypes;893 QULongStringMap machineStates; 894 QULongStringMap sessionStates; 895 QULongStringMap deviceTypes; 896 897 QULongStringMap storageBuses; 898 QLongStringMap storageBusDevices; 899 QLongStringMap storageBusChannels; 900 901 QULongStringMap diskTypes; 901 902 QString diskTypes_Differencing; 902 903 903 Q StringVectorvrdpAuthTypes;904 Q StringVectorportModeTypes;905 Q StringVectorusbFilterActionTypes;906 Q StringVectoraudioDriverTypes;907 Q StringVectoraudioControllerTypes;908 Q StringVectornetworkAdapterTypes;909 Q StringVectornetworkAttachmentTypes;910 Q StringVectorclipboardTypes;911 Q StringVectorideControllerTypes;912 Q StringVectorUSBDeviceStates;904 QULongStringMap vrdpAuthTypes; 905 QULongStringMap portModeTypes; 906 QULongStringMap usbFilterActionTypes; 907 QULongStringMap audioDriverTypes; 908 QULongStringMap audioControllerTypes; 909 QULongStringMap networkAdapterTypes; 910 QULongStringMap networkAttachmentTypes; 911 QULongStringMap clipboardTypes; 912 QULongStringMap ideControllerTypes; 913 QULongStringMap USBDeviceStates; 913 914 914 915 QString mUserDefinedPortName; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r15132 r15304 1251 1251 , mMediaEnumThread (NULL) 1252 1252 , verString ("1.0") 1253 , vm_state_color (KMachineState_COUNT)1254 , machineStates (KMachineState_COUNT)1255 , sessionStates (KSessionState_COUNT)1256 , deviceTypes (KDeviceType_COUNT)1257 , storageBuses (KStorageBus_COUNT)1258 , storageBusDevices (2)1259 , storageBusChannels (3)1260 , diskTypes (KHardDiskType_COUNT)1261 , vrdpAuthTypes (KVRDPAuthType_COUNT)1262 , portModeTypes (KPortMode_COUNT)1263 , usbFilterActionTypes (KUSBDeviceFilterAction_COUNT)1264 , audioDriverTypes (KAudioDriverType_COUNT)1265 , audioControllerTypes (KAudioControllerType_COUNT)1266 , networkAdapterTypes (KNetworkAdapterType_COUNT)1267 , networkAttachmentTypes (KNetworkAttachmentType_COUNT)1268 , clipboardTypes (KClipboardMode_COUNT)1269 , ideControllerTypes (KIDEControllerType_COUNT)1270 , USBDeviceStates (KUSBDeviceState_COUNT)1271 1253 , detailReportTemplatesReady (false) 1272 1254 { … … 1484 1466 QString VBoxGlobal::toString (KStorageBus aBus, LONG aChannel) const 1485 1467 { 1486 Assert (storageBusChannels.count() == 3);1487 1468 QString channel; 1488 1469 … … 1508 1489 } 1509 1490 1491 Assert (!channel.isNull()); 1510 1492 return channel; 1511 1493 } … … 1523 1505 case KStorageBus_IDE: 1524 1506 { 1525 Q StringVector::const_iterator it =1507 QLongStringMap::const_iterator it = 1526 1508 qFind (storageBusChannels.begin(), storageBusChannels.end(), 1527 1509 aChannel); 1528 1510 AssertMsgBreak (it != storageBusChannels.end(), 1529 1511 ("No value for {%s}\n", aChannel.latin1())); 1530 channel = (LONG) (it - storageBusChannels.begin());1512 channel = it.key(); 1531 1513 break; 1532 1514 } … … 1560 1542 NOREF (aChannel); 1561 1543 1562 Assert (storageBusDevices.count() == 2);1563 1544 QString device; 1564 1545 … … 1585 1566 } 1586 1567 1568 Assert (!device.isNull()); 1587 1569 return device; 1588 1570 } … … 1604 1586 case KStorageBus_IDE: 1605 1587 { 1606 Q StringVector::const_iterator it =1588 QLongStringMap::const_iterator it = 1607 1589 qFind (storageBusDevices.begin(), storageBusDevices.end(), 1608 1590 aDevice); 1609 1591 AssertMsg (it != storageBusDevices.end(), 1610 1592 ("No value for {%s}", aDevice.latin1())); 1611 device = (LONG) (it - storageBusDevices.begin());1593 device = it.key(); 1612 1594 break; 1613 1595 } … … 1667 1649 static QStringList list; 1668 1650 if (list.empty()) 1669 for (uint i = 0; i < deviceTypes.count() - 1 /* usb=n/a */; i++) 1670 list += deviceTypes [i]; 1651 for (QULongStringMap::const_iterator it = deviceTypes.begin(); 1652 it != deviceTypes.end(); ++ it) 1653 list += it.data(); 1671 1654 return list; 1672 1655 } … … 3011 2994 tr ("SATA", "StorageBus"); 3012 2995 3013 Assert (storageBusChannels.count() == 3);3014 2996 storageBusChannels [0] = 3015 2997 tr ("Primary", "StorageBusChannel"); … … 3019 3001 tr ("Port %1", "StorageBusChannel"); 3020 3002 3021 Assert (storageBusDevices.count() == 2);3022 3003 storageBusDevices [0] = tr ("Master", "StorageBusDevice"); 3023 3004 storageBusDevices [1] = tr ("Slave", "StorageBusDevice"); … … 4706 4687 static const char *kOSTypeIcons [][2] = 4707 4688 { 4708 {"unknown", "os_unknown.png"}, 4709 {"dos", "os_dos.png"}, 4710 {"win31", "os_win31.png"}, 4711 {"win95", "os_win95.png"}, 4712 {"win98", "os_win98.png"}, 4713 {"winme", "os_winme.png"}, 4714 {"winnt4", "os_winnt4.png"}, 4715 {"win2k", "os_win2k.png"}, 4716 {"winxp", "os_winxp.png"}, 4717 {"win2k3", "os_win2k3.png"}, 4718 {"winvista", "os_winvista.png"}, 4719 {"win2k8", "os_win2k8.png"}, 4720 {"os2warp3", "os_os2warp3.png"}, 4721 {"os2warp4", "os_os2warp4.png"}, 4722 {"os2warp45", "os_os2warp45.png"}, 4723 {"ecs", "os_ecs.png"}, 4724 {"linux22", "os_linux22.png"}, 4725 {"linux24", "os_linux24.png"}, 4726 {"linux26", "os_linux26.png"}, 4727 {"archlinux", "os_archlinux.png"}, 4728 {"debian", "os_debian.png"}, 4729 {"opensolaris", "os_opensolaris.png"}, 4730 {"opensuse", "os_opensuse.png"}, 4731 {"fedoracore" ,"os_fedoracore.png"}, 4732 {"gentoo", "os_gentoo.png"}, 4733 {"mandriva", "os_mandriva.png"}, 4734 {"redhat", "os_redhat.png"}, 4735 {"ubuntu", "os_ubuntu.png"}, 4736 {"xandros", "os_xandros.png"}, 4737 {"freebsd", "os_freebsd.png"}, 4738 {"openbsd", "os_openbsd.png"}, 4739 {"netbsd", "os_netbsd.png"}, 4740 {"netware", "os_netware.png"}, 4741 {"solaris", "os_solaris.png"}, 4742 {"l4", "os_l4.png"}, 4689 {"Other", "os_other.png"}, 4690 {"DOS", "os_dos.png"}, 4691 {"Netware", "os_netware.png"}, 4692 {"L4", "os_l4.png"}, 4693 {"Windows31", "os_win31.png"}, 4694 {"Windows95", "os_win95.png"}, 4695 {"Windows98", "os_win98.png"}, 4696 {"WindowsMe", "os_winme.png"}, 4697 {"WindowsNT4", "os_winnt4.png"}, 4698 {"Windows2000", "os_win2k.png"}, 4699 {"WindowsXP", "os_winxp.png"}, 4700 {"WindowsXP_64", "os_winxp_64.png"}, 4701 {"Windows2003", "os_win2k3.png"}, 4702 {"Windows2003_64", "os_win2k3_64.png"}, 4703 {"WindowsVista", "os_winvista.png"}, 4704 {"WindowsVista_64", "os_winvista_64.png"}, 4705 {"Windows2008", "os_win2k8.png"}, 4706 {"Windows2008_64", "os_win2k8_64.png"}, 4707 {"WindowsNT", "os_win_other.png"}, 4708 {"OS2Warp3", "os_os2warp3.png"}, 4709 {"OS2Warp4", "os_os2warp4.png"}, 4710 {"OS2Warp45", "os_os2warp45.png"}, 4711 {"OS2eCS", "os_os2ecs.png"}, 4712 {"OS2", "os_os2_other.png"}, 4713 {"Linux22", "os_linux22.png"}, 4714 {"Linux24", "os_linux24.png"}, 4715 {"Linux24_64", "os_linux24_64.png"}, 4716 {"Linux26", "os_linux26.png"}, 4717 {"Linux26_64", "os_linux26_64.png"}, 4718 {"ArchLinux", "os_archlinux.png"}, 4719 {"ArchLinux_64", "os_archlinux_64.png"}, 4720 {"Debian", "os_debian.png"}, 4721 {"Debian_64", "os_debian_64.png"}, 4722 {"OpenSUSE", "os_opensuse.png"}, 4723 {"OpenSUSE_64", "os_opensuse_64.png"}, 4724 {"Fedora", "os_fedora.png"}, 4725 {"Fedora_64", "os_fedora_64.png"}, 4726 {"Gentoo", "os_gentoo.png"}, 4727 {"Gentoo_64", "os_gentoo_64.png"}, 4728 {"Mandriva", "os_mandriva.png"}, 4729 {"Mandriva_64", "os_mandriva_64.png"}, 4730 {"RedHat", "os_redhat.png"}, 4731 {"RedHat_64", "os_redhat_64.png"}, 4732 {"Ubuntu", "os_ubuntu.png"}, 4733 {"Ubuntu_64", "os_ubuntu_64.png"}, 4734 {"Xandros", "os_xandros.png"}, 4735 {"Xandros_64", "os_xandros_64.png"}, 4736 {"Linux", "os_linux_other.png"}, 4737 {"FreeBSD", "os_freebsd.png"}, 4738 {"FreeBSD_64", "os_freebsd_64.png"}, 4739 {"OpenBSD", "os_openbsd.png"}, 4740 {"OpenBSD_64", "os_openbsd_64.png"}, 4741 {"NetBSD", "os_netbsd.png"}, 4742 {"NetBSD_64", "os_netbsd_64.png"}, 4743 {"Solaris", "os_solaris.png"}, 4744 {"Solaris_64", "os_solaris_64.png"}, 4745 {"OpenSolaris", "os_opensolaris.png"}, 4746 {"OpenSolaris_64", "os_opensolaris_64.png"}, 4747 {"QNX", "os_other.png"}, 4743 4748 }; 4744 4749 vm_os_type_icons.setAutoDelete (true); /* takes ownership of elements */ -
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.