Changeset 41819 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 18, 2012 5:59:30 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78640
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r41689 r41819 145 145 VBOX_GUI_INC_DIRS = \ 146 146 ./src \ 147 ./src/converter \ 147 148 ./src/extensions \ 148 149 ./src/globals \ … … 275 276 src/globals/VBoxGlobal.h \ 276 277 src/globals/VBoxUtils.h \ 277 src/globals/COMEnumsWrapper.h \278 278 src/net/UINetworkManager.h \ 279 279 src/net/UINetworkManagerDialog.h \ … … 446 446 src/VBoxVMInformationDlg.cpp \ 447 447 src/UIVMLogViewer.cpp \ 448 src/converter/UIConverter.cpp \ 449 src/converter/UIConverterBackendCOM.cpp \ 450 src/converter/UIConverterBackendGlobal.cpp \ 448 451 src/extensions/QIAdvancedSlider.cpp \ 449 452 src/extensions/QIArrowButtonPress.cpp \ … … 479 482 src/globals/UIMessageCenter.cpp \ 480 483 src/globals/VBoxGlobal.cpp \ 481 src/globals/COMEnumsWrapper.cpp \482 484 src/medium/UIMediumDefs.cpp \ 483 485 src/medium/UIMedium.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.cpp
r41608 r41819 30 30 #include "QILabel.h" 31 31 #include "QIDialogButtonBox.h" 32 #include " COMEnumsWrapper.h"32 #include "UIConverter.h" 33 33 34 34 /* Constructor: */ … … 126 126 QList<QRadioButton*> buttons = findChildren<QRadioButton*>(); 127 127 for (int i = 0; i < buttons.size(); ++i) 128 buttons[i]->setText(g COMenum->toString(buttons[i]->property("mediumType").value<KMediumType>()));128 buttons[i]->setText(gpConverter->toString(buttons[i]->property("mediumType").value<KMediumType>())); 129 129 } 130 130 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
r41689 r41819 34 34 #include "VBoxGlobal.h" 35 35 #include "VBoxVMInformationDlg.h" 36 #include "UIConverter.h" 36 37 37 38 /* COM includes: */ … … 664 665 QString header = "<tr><td></td><td colspan=2><nobr> %1:</nobr></td></tr>"; 665 666 CStorageController ctr = mSession.GetMachine().GetStorageControllerByName (aCtrName); 666 QString name = vboxGlobal().toString (StorageSlot (ctr.GetBus(), aPort, aDevice));667 QString name = gpConverter->toString (StorageSlot (ctr.GetBus(), aPort, aDevice)); 667 668 return header.arg (name) + composeArticle (aBelongsTo, 2); 668 669 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r41695 r41819 23 23 #include <QEvent> 24 24 #include <QStringList> 25 26 /* COM includes: */ 27 #include "COMEnums.h" 25 28 26 29 /* Other VBox defines: */ … … 207 210 using namespace UIDefs /* globally */; 208 211 212 struct StorageSlot 213 { 214 StorageSlot() : bus(KStorageBus_Null), port(0), device(0) {} 215 StorageSlot(const StorageSlot &other) : bus(other.bus), port(other.port), device(other.device) {} 216 StorageSlot(KStorageBus otherBus, LONG iPort, LONG iDevice) : bus(otherBus), port(iPort), device(iDevice) {} 217 StorageSlot& operator=(const StorageSlot &other) { bus = other.bus; port = other.port; device = other.device; return *this; } 218 bool operator==(const StorageSlot &other) const { return bus == other.bus && port == other.port && device == other.device; } 219 bool operator!=(const StorageSlot &other) const { return bus != other.bus || port != other.port || device != other.device; } 220 bool operator<(const StorageSlot &other) const { return (bus < other.bus) || 221 (bus == other.bus && port < other.port) || 222 (bus == other.bus && port == other.port && device < other.device); } 223 bool operator>(const StorageSlot &other) const { return (bus > other.bus) || 224 (bus == other.bus && port > other.port) || 225 (bus == other.bus && port == other.port && device > other.device); } 226 bool isNull() const { return bus == KStorageBus_Null; } 227 KStorageBus bus; LONG port; LONG device; 228 }; 229 Q_DECLARE_METATYPE(StorageSlot); 230 209 231 #endif // __UIDefs_h__ 210 232 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r41689 r41819 36 36 #include "UINetworkManager.h" 37 37 #include "UINetworkManagerDialog.h" 38 #include " COMEnumsWrapper.h"38 #include "UIConverter.h" 39 39 #ifdef VBOX_OSE 40 40 # include "UIDownloaderUserManual.h" … … 1353 1353 message(pParent ? pParent : mainWindowShown(), Error, 1354 1354 tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>") 1355 .arg(g COMenum->toString(oldMediumType)).arg(gCOMenum->toString(newMediumType)),1355 .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)), 1356 1356 formatErrorInfo(medium)); 1357 1357 } … … 1541 1541 { 1542 1542 strMessage = tr("Failed to detach the hard disk (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.") 1543 .arg(strLocation).arg( vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());1543 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName()); 1544 1544 break; 1545 1545 } … … 1547 1547 { 1548 1548 strMessage = tr("Failed to detach the CD/DVD device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.") 1549 .arg(strLocation).arg( vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());1549 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName()); 1550 1550 break; 1551 1551 } … … 1553 1553 { 1554 1554 strMessage = tr("Failed to detach the floppy device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.") 1555 .arg(strLocation).arg( vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());1555 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName()); 1556 1556 break; 1557 1557 } … … 3082 3082 { 3083 3083 strMessage = tr("Failed to attach the hard disk (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.") 3084 .arg(strLocation).arg( vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());3084 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName()); 3085 3085 break; 3086 3086 } … … 3088 3088 { 3089 3089 strMessage = tr("Failed to attach the CD/DVD device (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.") 3090 .arg(strLocation).arg( vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());3090 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName()); 3091 3091 break; 3092 3092 } … … 3094 3094 { 3095 3095 strMessage = tr("Failed to attach the floppy device (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.") 3096 .arg(strLocation).arg( vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());3096 .arg(strLocation).arg(gpConverter->toString(storageSlot)).arg(CMachine(machine).GetName()); 3097 3097 break; 3098 3098 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r41691 r41819 65 65 #include "UIMachine.h" 66 66 #include "UISession.h" 67 #include " COMEnumsWrapper.h"67 #include "UIConverter.h" 68 68 69 69 #ifdef Q_WS_X11 … … 959 959 } 960 960 961 /**962 * Returns a full string representation of the given device of the given channel on the given storage bus.963 * This method does not uses any separate string tags related to bus, channel, device, it has own964 * separately translated string tags allowing to translate a full slot name into human readable format965 * to be consistent with i18n.966 * Complementary to #toStorageSlot (const QString &) const.967 */968 QString VBoxGlobal::toString (StorageSlot aSlot) const969 {970 switch (aSlot.bus)971 {972 case KStorageBus_IDE:973 case KStorageBus_SATA:974 case KStorageBus_SCSI:975 case KStorageBus_SAS:976 case KStorageBus_Floppy:977 break;978 979 default:980 {981 AssertMsgFailed (("Invalid bus type %d\n", aSlot.bus));982 break;983 }984 }985 986 int maxPort = virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus (aSlot.bus);987 int maxDevice = virtualBox().GetSystemProperties().GetMaxDevicesPerPortForStorageBus (aSlot.bus);988 if (aSlot.port < 0 || aSlot.port > maxPort)989 AssertMsgFailed (("Invalid port %d\n", aSlot.port));990 if (aSlot.device < 0 || aSlot.device > maxDevice)991 AssertMsgFailed (("Invalid device %d\n", aSlot.device));992 993 QString result;994 switch (aSlot.bus)995 {996 case KStorageBus_IDE:997 {998 result = mSlotTemplates [aSlot.port * maxDevice + aSlot.device];999 break;1000 }1001 case KStorageBus_SATA:1002 {1003 result = mSlotTemplates [4].arg (aSlot.port);1004 break;1005 }1006 case KStorageBus_SCSI:1007 {1008 result = mSlotTemplates [5].arg (aSlot.port);1009 break;1010 }1011 case KStorageBus_SAS:1012 {1013 result = mSlotTemplates [6].arg (aSlot.port);1014 break;1015 }1016 case KStorageBus_Floppy:1017 {1018 result = mSlotTemplates [7].arg (aSlot.device);1019 break;1020 }1021 default:1022 {1023 AssertMsgFailed (("Invalid bus type %d\n", aSlot.bus));1024 break;1025 }1026 }1027 return result;1028 }1029 1030 /**1031 * Returns a StorageSlot based on the given device of the given channel on the given storage bus.1032 * Complementary to #toFullString (StorageSlot) const.1033 */1034 StorageSlot VBoxGlobal::toStorageSlot (const QString &aSlot) const1035 {1036 int index = -1;1037 QRegExp regExp;1038 for (int i = 0; i < mSlotTemplates.size(); ++ i)1039 {1040 regExp = QRegExp (i >= 0 && i <= 3 ? mSlotTemplates [i] : mSlotTemplates [i].arg ("(\\d+)"));1041 if (regExp.indexIn (aSlot) != -1)1042 {1043 index = i;1044 break;1045 }1046 }1047 1048 StorageSlot result;1049 switch (index)1050 {1051 case 0:1052 case 1:1053 case 2:1054 case 3:1055 {1056 result.bus = KStorageBus_IDE;1057 int maxPort = virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus (result.bus);1058 result.port = index / maxPort;1059 result.device = index % maxPort;1060 break;1061 }1062 case 4:1063 {1064 result.bus = KStorageBus_SATA;1065 int maxPort = virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus (result.bus);1066 result.port = regExp.cap (1).toInt();1067 if (result.port < 0 || result.port > maxPort)1068 AssertMsgFailed (("Invalid port %d\n", result.port));1069 break;1070 }1071 case 5:1072 {1073 result.bus = KStorageBus_SCSI;1074 int maxPort = virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus (result.bus);1075 result.port = regExp.cap (1).toInt();1076 if (result.port < 0 || result.port > maxPort)1077 AssertMsgFailed (("Invalid port %d\n", result.port));1078 break;1079 }1080 case 6:1081 {1082 result.bus = KStorageBus_SAS;1083 int maxPort = virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus (result.bus);1084 result.port = regExp.cap (1).toInt();1085 if (result.port < 0 || result.port > maxPort)1086 AssertMsgFailed (("Invalid port %d\n", result.port));1087 break;1088 }1089 case 7:1090 {1091 result.bus = KStorageBus_Floppy;1092 int maxDevice = virtualBox().GetSystemProperties().GetMaxDevicesPerPortForStorageBus (result.bus);1093 result.device = regExp.cap (1).toInt();1094 if (result.device < 0 || result.device > maxDevice)1095 AssertMsgFailed (("Invalid device %d\n", result.device));1096 break;1097 }1098 default:1099 break;1100 }1101 return result;1102 }1103 1104 961 struct PortConfig 1105 962 { … … 1139 996 return mDiskTypes_Differencing; 1140 997 } 1141 return g COMenum->toString(medium.GetType());998 return gpConverter->toString(medium.GetType()); 1142 999 } 1143 1000 … … 1324 1181 { 1325 1182 tip += QString (tr ("<br><nobr>State: %1</nobr>", "USB device tooltip")) 1326 .arg (g COMenum->toString (hostDev.GetState()));1183 .arg (gpConverter->toString (hostDev.GetState())); 1327 1184 } 1328 1185 … … 1377 1234 { 1378 1235 tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>State: %1</nobr>", "USB filter tooltip") 1379 .arg (g COMenum->toString (hostDev.GetState()));1236 .arg (gpConverter->toString (hostDev.GetState())); 1380 1237 } 1381 1238 … … 1448 1305 if (!bootOrder.isEmpty()) 1449 1306 bootOrder += ", "; 1450 bootOrder += g COMenum->toString (device);1307 bootOrder += gpConverter->toString (device); 1451 1308 } 1452 1309 if (bootOrder.isEmpty()) 1453 bootOrder = g COMenum->toString (KDeviceType_Null);1310 bootOrder = gpConverter->toString (KDeviceType_Null); 1454 1311 1455 1312 iRowCount += 1; /* Boot-order row. */ … … 1617 1474 QString(sSectionItemTpl2) 1618 1475 .arg(QString(" ") + 1619 toString(StorageSlot(controller.GetBus(),1620 attachment.GetPort(),1621 attachment.GetDevice())) + strDeviceType)1476 gpConverter->toString(StorageSlot(controller.GetBus(), 1477 attachment.GetPort(), 1478 attachment.GetDevice())) + strDeviceType) 1622 1479 .arg(details(medium, false)); 1623 1480 /* Insert that attachment into map: */ … … 1661 1518 item = QString (sSectionItemTpl2) 1662 1519 .arg (tr ("Host Driver", "details report (audio)"), 1663 g COMenum->toString (audio.GetAudioDriver())) +1520 gpConverter->toString (audio.GetAudioDriver())) + 1664 1521 QString (sSectionItemTpl2) 1665 1522 .arg (tr ("Controller", "details report (audio)"), 1666 g COMenum->toString (audio.GetAudioController()));1523 gpConverter->toString (audio.GetAudioController())); 1667 1524 else 1668 1525 item = QString (sSectionItemTpl1) … … 1689 1546 { 1690 1547 KNetworkAttachmentType type = adapter.GetAttachmentType(); 1691 QString attType = g COMenum->toString (adapter.GetAdapterType())1548 QString attType = gpConverter->toString (adapter.GetAdapterType()) 1692 1549 .replace (QRegExp ("\\s\\(.+\\)"), " (%1)"); 1693 1550 /* don't use the adapter type string for types that have … … 1707 1564 "details report (network)").arg (adapter.GetGenericDriver())); 1708 1565 else 1709 attType = attType.arg (g COMenum->toString (type));1566 attType = attType.arg (gpConverter->toString (type)); 1710 1567 1711 1568 item += QString (sSectionItemTpl2) … … 1749 1606 mode == KPortMode_RawFile) 1750 1607 data += QString ("%1 (<nobr>%2</nobr>)") 1751 .arg (g COMenum->toString (mode))1608 .arg (gpConverter->toString (mode)) 1752 1609 .arg (QDir::toNativeSeparators (port.GetPath())); 1753 1610 else 1754 data += g COMenum->toString (mode);1611 data += gpConverter->toString (mode); 1755 1612 1756 1613 item += QString (sSectionItemTpl2) … … 2577 2434 void VBoxGlobal::retranslateUi() 2578 2435 { 2579 mSlotTemplates [0] = tr ("IDE Primary Master", "New Storage UI : Slot Name"); 2580 mSlotTemplates [1] = tr ("IDE Primary Slave", "New Storage UI : Slot Name"); 2581 mSlotTemplates [2] = tr ("IDE Secondary Master", "New Storage UI : Slot Name"); 2582 mSlotTemplates [3] = tr ("IDE Secondary Slave", "New Storage UI : Slot Name"); 2583 mSlotTemplates [4] = tr ("SATA Port %1", "New Storage UI : Slot Name"); 2584 mSlotTemplates [5] = tr ("SCSI Port %1", "New Storage UI : Slot Name"); 2585 mSlotTemplates [6] = tr ("SAS Port %1", "New Storage UI : Slot Name"); 2586 mSlotTemplates [7] = tr ("Floppy Device %1", "New Storage UI : Slot Name"); 2587 2588 mDiskTypes_Differencing = tr ("Differencing", "DiskType"); 2436 mDiskTypes_Differencing = tr ("Differencing", "DiskType"); 2589 2437 2590 2438 mUserDefinedPortName = tr ("User-defined", "serial port"); … … 4661 4509 mValid = true; 4662 4510 4663 /* Prepare COM enum extensions: */ 4664 COMEnumsWrapper::prepare(); 4511 UIConverter::prepare(); 4665 4512 4666 4513 /* Cache IMedium data. … … 4762 4609 delete m_pVirtualMachine; 4763 4610 4764 /* Cleanup COM enum extensions: */ 4765 COMEnumsWrapper::cleanup(); 4611 UIConverter::cleanup(); 4766 4612 4767 4613 /* ensure CGuestOSType objects are no longer used */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r41689 r41819 35 35 /* COM includes: */ 36 36 #include "VBox/com/Guid.h" 37 #include "COMEnums.h"38 37 #include "CHost.h" 39 38 #include "CVirtualBox.h" … … 50 49 class CUSBDevice; 51 50 52 struct StorageSlot53 {54 StorageSlot() : bus (KStorageBus_Null), port (0), device (0) {}55 StorageSlot (const StorageSlot &aOther) : bus (aOther.bus), port (aOther.port), device (aOther.device) {}56 StorageSlot (KStorageBus aBus, LONG aPort, LONG aDevice) : bus (aBus), port (aPort), device (aDevice) {}57 StorageSlot& operator= (const StorageSlot &aOther) { bus = aOther.bus; port = aOther.port; device = aOther.device; return *this; }58 bool operator== (const StorageSlot &aOther) const { return bus == aOther.bus && port == aOther.port && device == aOther.device; }59 bool operator!= (const StorageSlot &aOther) const { return bus != aOther.bus || port != aOther.port || device != aOther.device; }60 bool operator< (const StorageSlot &aOther) const { return (bus < aOther.bus) ||61 (bus == aOther.bus && port < aOther.port) ||62 (bus == aOther.bus && port == aOther.port && device < aOther.device); }63 bool operator> (const StorageSlot &aOther) const { return (bus > aOther.bus) ||64 (bus == aOther.bus && port > aOther.port) ||65 (bus == aOther.bus && port == aOther.port && device > aOther.device); }66 bool isNull() { return bus == KStorageBus_Null; }67 KStorageBus bus; LONG port; LONG device;68 };69 Q_DECLARE_METATYPE (StorageSlot);70 71 51 // VBoxGlobal class 72 52 //////////////////////////////////////////////////////////////////////////////// … … 81 61 82 62 public: 83 84 typedef QHash <ulong, QString> QULongStringHash;85 63 86 64 static VBoxGlobal &instance(); … … 208 186 return tr("%n second(s)", "", cVal); 209 187 } 210 211 QString toString (StorageSlot aSlot) const;212 StorageSlot toStorageSlot (const QString &aSlot) const;213 188 214 189 QString differencingMediumTypeName() const { return mDiskTypes_Differencing; } … … 548 523 QPixmap mOfflineSnapshotIcon, mOnlineSnapshotIcon; 549 524 550 QULongStringHash mSlotTemplates;551 552 525 QString mDiskTypes_Differencing; 553 526 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
r41774 r41819 29 29 #include "VBoxGlobal.h" 30 30 #include "UIMessageCenter.h" 31 #include " COMEnumsWrapper.h"31 #include "UIConverter.h" 32 32 33 33 /* COM includes: */ … … 142 142 mHardDiskFormat = mMedium.GetFormat(); 143 143 mHardDiskType = vboxGlobal().mediumTypeString (mMedium); 144 mStorageDetails = g COMenum->toString((KMediumVariant)mMedium.GetVariant());144 mStorageDetails = gpConverter->toString((KMediumVariant)mMedium.GetVariant()); 145 145 mIsReadOnly = mMedium.GetReadOnly(); 146 146 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r41615 r41819 26 26 #include "UIMachineDefs.h" 27 27 #include "QIWithRetranslateUI.h" 28 #include " COMEnumsWrapper.h"28 #include "UIConverter.h" 29 29 30 30 /* COM includes: */ … … 88 88 continue; 89 89 strAttData += QString("<br> <nobr>%1: %2</nobr>") 90 .arg( vboxGlobal().toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice())))90 .arg(gpConverter->toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 91 91 .arg(UIMedium(attachment.GetMedium(), UIMediumType_HardDisk).location()); 92 92 fAttachmentsPresent = true; … … 157 157 UIMedium vboxMedium(attachment.GetMedium(), UIMediumType_DVD); 158 158 strAttData += QString("<br> <nobr>%1: %2</nobr>") 159 .arg( vboxGlobal().toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice())))159 .arg(gpConverter->toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 160 160 .arg(vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location()); 161 161 fAttachmentsPresent = true; … … 228 228 UIMedium vboxMedium(attachment.GetMedium(), UIMediumType_Floppy); 229 229 strAttData += QString("<br> <nobr>%1: %2</nobr>") 230 .arg( vboxGlobal().toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice())))230 .arg(gpConverter->toString(StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()))) 231 231 .arg(vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location()); 232 232 fAttachmentsPresent = true; … … 328 328 "<br><nobr><b>Adapter %1 (%2)</b>: %3 cable %4</nobr>", "Network adapters tooltip") 329 329 .arg(uSlot + 1) 330 .arg(g COMenum->toString(adapter.GetAttachmentType()))330 .arg(gpConverter->toString(adapter.GetAttachmentType())) 331 331 .arg(strGuestIp.isEmpty() ? "" : "IP " + strGuestIp + ", ") 332 332 .arg(adapter.GetCableConnected() ? -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r41689 r41819 48 48 #include "UISettingsDialogSpecific.h" 49 49 #include "UIVMLogViewer.h" 50 #include "UIConverter.h" 50 51 #ifdef Q_WS_MAC 51 52 # include "DockIconPreview.h" … … 1153 1154 pAttachmentMenu = new QMenu(pMenu); 1154 1155 pAttachmentMenu->setTitle(QString("%1 (%2)").arg(controller.GetName()) 1155 .arg( vboxGlobal().toString(StorageSlot(controller.GetBus(),1156 .arg(gpConverter->toString(StorageSlot(controller.GetBus(), 1156 1157 attachment.GetPort(), 1157 1158 attachment.GetDevice())))); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r41689 r41819 37 37 #include "UISession.h" 38 38 #include "UIVMCloseDialog.h" 39 #include " COMEnumsWrapper.h"39 #include "UIConverter.h" 40 40 41 41 /* COM includes: */ … … 609 609 QString strMachineName = m.GetName() + strSnapshotName; 610 610 if (state != KMachineState_Null) 611 strMachineName += " [" + g COMenum->toString(state) + "]";611 strMachineName += " [" + gpConverter->toString(state) + "]"; 612 612 /* Unusual on the Mac. */ 613 613 #ifndef Q_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp
r41689 r41819 42 42 #include "UIToolBar.h" 43 43 #include "VBoxUtils.h" 44 #include " COMEnumsWrapper.h"44 #include "UIConverter.h" 45 45 46 46 /* COM includes: */ … … 755 755 if (device == KDeviceType_Null) 756 756 continue; 757 bootOrder << g COMenum->toString(device);757 bootOrder << gpConverter->toString(device); 758 758 } 759 759 if (bootOrder.isEmpty()) 760 bootOrder << g COMenum->toString(KDeviceType_Null);760 bootOrder << gpConverter->toString(KDeviceType_Null); 761 761 762 762 item += sSectionItemTpl2.arg(tr("Boot Order", "details report"), bootOrder.join(", ")); … … 929 929 QString(sSectionItemTpl2) 930 930 .arg(QString(" ") + 931 vboxGlobal().toString(StorageSlot(controller.GetBus(),931 gpConverter->toString(StorageSlot(controller.GetBus(), 932 932 attachment.GetPort(), 933 933 attachment.GetDevice())) + … … 981 981 if (audio.GetEnabled()) 982 982 item = QString(sSectionItemTpl2).arg(tr("Host Driver", "details report (audio)"), 983 g COMenum->toString(audio.GetAudioDriver())) +983 gpConverter->toString(audio.GetAudioDriver())) + 984 984 QString(sSectionItemTpl2).arg(tr("Controller", "details report (audio)"), 985 g COMenum->toString(audio.GetAudioController()));985 gpConverter->toString(audio.GetAudioController())); 986 986 else 987 987 item = QString(sSectionItemTpl1).arg(tr("Disabled", "details report (audio)")); … … 1020 1020 { 1021 1021 KNetworkAttachmentType type = adapter.GetAttachmentType(); 1022 QString attType = g COMenum->toString(adapter.GetAdapterType())1022 QString attType = gpConverter->toString(adapter.GetAdapterType()) 1023 1023 .replace(QRegExp("\\s\\(.+\\)"), " (%1)"); 1024 1024 /* Don't use the adapter type string for types that have … … 1040 1040 } 1041 1041 else 1042 attType = attType.arg(g COMenum->toString(type));1042 attType = attType.arg(gpConverter->toString(type)); 1043 1043 1044 1044 item += QString(sSectionItemTpl2).arg(tr("Adapter %1", "details report (network)").arg(adapter.GetSlot() + 1)) … … 1084 1084 QString data = vboxGlobal().toCOMPortName(port.GetIRQ(), port.GetIOBase()) + ", "; 1085 1085 if (mode == KPortMode_HostPipe || mode == KPortMode_HostDevice || mode == KPortMode_RawFile) 1086 data += QString("%1 (<nobr>%2</nobr>)").arg(g COMenum->toString(mode)).arg(QDir::toNativeSeparators(port.GetPath()));1086 data += QString("%1 (<nobr>%2</nobr>)").arg(gpConverter->toString(mode)).arg(QDir::toNativeSeparators(port.GetPath())); 1087 1087 else 1088 data += g COMenum->toString(mode);1088 data += gpConverter->toString(mode); 1089 1089 1090 1090 item += QString(sSectionItemTpl2).arg(tr("Port %1", "details report (serial ports)").arg(port.GetSlot() + 1)) -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp
r41689 r41819 29 29 #include "UIVMItem.h" 30 30 #include "VBoxGlobal.h" 31 #include " COMEnumsWrapper.h"31 #include "UIConverter.h" 32 32 #ifdef Q_WS_MAC 33 33 # include <ApplicationServices/ApplicationServices.h> … … 161 161 QString UIVMItem::machineStateName() const 162 162 { 163 return m_fAccessible ? g COMenum->toString(m_machineState) :163 return m_fAccessible ? gpConverter->toString(m_machineState) : 164 164 QApplication::translate("UIVMListView", "Inaccessible"); 165 165 } … … 167 167 QIcon UIVMItem::machineStateIcon() const 168 168 { 169 return m_fAccessible ? g COMenum->toIcon(m_machineState) :169 return m_fAccessible ? gpConverter->toPixmap(m_machineState) : 170 170 QPixmap(":/state_aborted_16px.png"); 171 171 } … … 173 173 QString UIVMItem::sessionStateName() const 174 174 { 175 return m_fAccessible ? g COMenum->toString(m_sessionState) :175 return m_fAccessible ? gpConverter->toString(m_sessionState) : 176 176 QApplication::translate("UIVMListView", "Inaccessible"); 177 177 } … … 196 196 "VM tooltip (name, last state change, session state)") 197 197 .arg(toolTip) 198 .arg(g COMenum->toString(m_machineState))198 .arg(gpConverter->toString(m_machineState)) 199 199 .arg(dateTime) 200 .arg(g COMenum->toString(m_sessionState));200 .arg(gpConverter->toString(m_sessionState)); 201 201 } 202 202 else -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r41608 r41819 39 39 #include "UIVirtualBoxEventHandler.h" 40 40 #include "UISelectorShortcuts.h" 41 #include " COMEnumsWrapper.h"41 #include "UIConverter.h" 42 42 43 43 /* COM includes: */ … … 190 190 return; 191 191 192 setIcon (0, g COMenum->toIcon(aState));192 setIcon (0, gpConverter->toPixmap (aState)); 193 193 mMachineState = aState; 194 194 mTimestamp.setTime_t (mMachine.GetLastStateChange() / 1000); … … 277 277 { 278 278 dateTime = VBoxSnapshotsWgt::tr ("%1 since %2", "Current State (time or date + time)") 279 .arg (g COMenum->toString (mMachineState)).arg (dateTime);279 .arg (gpConverter->toString (mMachineState)).arg (dateTime); 280 280 } 281 281 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp
r41608 r41819 20 20 /* GUI includes: */ 21 21 #include "UIMachineSettingsAudio.h" 22 #include " COMEnumsWrapper.h"22 #include "UIConverter.h" 23 23 24 24 /* COM includes: */ … … 72 72 /* Load audio data to page: */ 73 73 mGbAudio->setChecked(audioData.m_fAudioEnabled); 74 mCbAudioDriver->setCurrentIndex(mCbAudioDriver->findText(g COMenum->toString(audioData.m_audioDriverType)));75 mCbAudioController->setCurrentIndex(mCbAudioController->findText(g COMenum->toString(audioData.m_audioControllerType)));74 mCbAudioDriver->setCurrentIndex(mCbAudioDriver->findText(gpConverter->toString(audioData.m_audioDriverType))); 75 mCbAudioController->setCurrentIndex(mCbAudioController->findText(gpConverter->toString(audioData.m_audioControllerType))); 76 76 77 77 /* Polish page finally: */ … … 88 88 /* Gather audio data: */ 89 89 audioData.m_fAudioEnabled = mGbAudio->isChecked(); 90 audioData.m_audioDriverType = g COMenum->toAudioDriverType(mCbAudioDriver->currentText());91 audioData.m_audioControllerType = g COMenum->toAudioControllerType(mCbAudioController->currentText());90 audioData.m_audioDriverType = gpConverter->fromString<KAudioDriverType>(mCbAudioDriver->currentText()); 91 audioData.m_audioControllerType = gpConverter->fromString<KAudioControllerType>(mCbAudioController->currentText()); 92 92 93 93 /* Cache audio data: */ … … 148 148 mCbAudioDriver->clear(); 149 149 /* Refill them */ 150 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_Null));150 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_Null)); 151 151 #if defined Q_WS_WIN32 152 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_DirectSound));152 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_DirectSound)); 153 153 # ifdef VBOX_WITH_WINMM 154 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_WinMM));154 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_WinMM)); 155 155 # endif 156 156 #endif 157 157 #if defined Q_OS_SOLARIS 158 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_SolAudio));158 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_SolAudio)); 159 159 # if defined VBOX_WITH_SOLARIS_OSS 160 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_OSS));160 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_OSS)); 161 161 #endif 162 162 #endif 163 163 #if defined Q_OS_LINUX || defined Q_OS_FREEBSD 164 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_OSS));164 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_OSS)); 165 165 # ifdef VBOX_WITH_PULSE 166 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_Pulse));166 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_Pulse)); 167 167 # endif 168 168 #endif 169 169 #if defined Q_OS_LINUX 170 170 # ifdef VBOX_WITH_ALSA 171 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_ALSA));171 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_ALSA)); 172 172 # endif 173 173 #endif 174 174 #if defined Q_OS_MACX 175 mCbAudioDriver->addItem (g COMenum->toString (KAudioDriverType_CoreAudio));175 mCbAudioDriver->addItem (gpConverter->toString (KAudioDriverType_CoreAudio)); 176 176 #endif 177 177 /* Set the old value */ … … 184 184 /* Refill them */ 185 185 mCbAudioController->insertItem (mCbAudioController->count(), 186 g COMenum->toString (KAudioControllerType_HDA));186 gpConverter->toString (KAudioControllerType_HDA)); 187 187 mCbAudioController->insertItem (mCbAudioController->count(), 188 g COMenum->toString (KAudioControllerType_AC97));188 gpConverter->toString (KAudioControllerType_AC97)); 189 189 mCbAudioController->insertItem (mCbAudioController->count(), 190 g COMenum->toString (KAudioControllerType_SB16));190 gpConverter->toString (KAudioControllerType_SB16)); 191 191 /* Set the old value */ 192 192 mCbAudioController->setCurrentIndex (currentController); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r41689 r41819 26 26 #include "VBoxGlobal.h" 27 27 #include "UIMessageCenter.h" 28 #include " COMEnumsWrapper.h"28 #include "UIConverter.h" 29 29 30 30 /* COM includes: */ … … 222 222 mCbVRDE->setChecked(displayData.m_fVRDEServerEnabled); 223 223 mLeVRDEPort->setText(displayData.m_strVRDEPort); 224 mCbVRDEMethod->setCurrentIndex(mCbVRDEMethod->findText(g COMenum->toString(displayData.m_VRDEAuthType)));224 mCbVRDEMethod->setCurrentIndex(mCbVRDEMethod->findText(gpConverter->toString(displayData.m_VRDEAuthType))); 225 225 mLeVRDETimeout->setText(QString::number(displayData.m_uVRDETimeout)); 226 226 mCbMultipleConn->setChecked(displayData.m_fMultipleConnectionsAllowed); … … 253 253 displayData.m_fVRDEServerEnabled = mCbVRDE->isChecked(); 254 254 displayData.m_strVRDEPort = mLeVRDEPort->text(); 255 displayData.m_VRDEAuthType = g COMenum->toAuthType(mCbVRDEMethod->currentText());255 displayData.m_VRDEAuthType = gpConverter->fromString<KAuthType>(mCbVRDEMethod->currentText()); 256 256 displayData.m_uVRDETimeout = mLeVRDETimeout->text().toULong(); 257 257 displayData.m_fMultipleConnectionsAllowed = mCbMultipleConn->isChecked(); … … 436 436 437 437 mCbVRDEMethod->setItemText (0, 438 g COMenum->toString (KAuthType_Null));438 gpConverter->toString (KAuthType_Null)); 439 439 mCbVRDEMethod->setItemText (1, 440 g COMenum->toString (KAuthType_External));440 gpConverter->toString (KAuthType_External)); 441 441 mCbVRDEMethod->setItemText (2, 442 g COMenum->toString (KAuthType_Guest));442 gpConverter->toString (KAuthType_Guest)); 443 443 } 444 444 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r41689 r41819 26 26 #include "UIMessageCenter.h" 27 27 #include "QIWidgetValidator.h" 28 #include " COMEnumsWrapper.h"28 #include "UIConverter.h" 29 29 30 30 UIMachineSettingsGeneral::UIMachineSettingsGeneral() … … 241 241 242 242 /* Shared Clipboard mode */ 243 mCbClipboard->setItemText (0, g COMenum->toString (KClipboardMode_Disabled));244 mCbClipboard->setItemText (1, g COMenum->toString (KClipboardMode_HostToGuest));245 mCbClipboard->setItemText (2, g COMenum->toString (KClipboardMode_GuestToHost));246 mCbClipboard->setItemText (3, g COMenum->toString (KClipboardMode_Bidirectional));243 mCbClipboard->setItemText (0, gpConverter->toString (KClipboardMode_Disabled)); 244 mCbClipboard->setItemText (1, gpConverter->toString (KClipboardMode_HostToGuest)); 245 mCbClipboard->setItemText (2, gpConverter->toString (KClipboardMode_GuestToHost)); 246 mCbClipboard->setItemText (3, gpConverter->toString (KClipboardMode_Bidirectional)); 247 247 } 248 248 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r41608 r41819 24 24 #include "QITabWidget.h" 25 25 #include "VBoxGlobal.h" 26 #include " COMEnumsWrapper.h"26 #include "UIConverter.h" 27 27 28 28 /* COM includes: */ … … 509 509 /* Populate attachments: */ 510 510 int iAttachmentTypeIndex = 0; 511 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, g COMenum->toString(KNetworkAttachmentType_Null));511 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Null)); 512 512 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Null); 513 513 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 514 514 ++iAttachmentTypeIndex; 515 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, g COMenum->toString(KNetworkAttachmentType_NAT));515 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_NAT)); 516 516 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NAT); 517 517 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 518 518 ++iAttachmentTypeIndex; 519 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, g COMenum->toString(KNetworkAttachmentType_Bridged));519 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Bridged)); 520 520 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Bridged); 521 521 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 522 522 ++iAttachmentTypeIndex; 523 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, g COMenum->toString(KNetworkAttachmentType_Internal));523 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Internal)); 524 524 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Internal); 525 525 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 526 526 ++iAttachmentTypeIndex; 527 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, g COMenum->toString(KNetworkAttachmentType_HostOnly));527 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_HostOnly)); 528 528 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_HostOnly); 529 529 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); 530 530 ++iAttachmentTypeIndex; 531 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, g COMenum->toString(KNetworkAttachmentType_Generic));531 m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Generic)); 532 532 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Generic); 533 533 m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole); … … 548 548 /* Populate adapter types: */ 549 549 int iAdapterTypeIndex = 0; 550 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, g COMenum->toString(KNetworkAdapterType_Am79C970A));550 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_Am79C970A)); 551 551 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Am79C970A); 552 552 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 553 553 ++iAdapterTypeIndex; 554 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, g COMenum->toString(KNetworkAdapterType_Am79C973));554 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_Am79C973)); 555 555 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Am79C973); 556 556 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 557 557 ++iAdapterTypeIndex; 558 558 #ifdef VBOX_WITH_E1000 559 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, g COMenum->toString(KNetworkAdapterType_I82540EM));559 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_I82540EM)); 560 560 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82540EM); 561 561 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 562 562 ++iAdapterTypeIndex; 563 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, g COMenum->toString(KNetworkAdapterType_I82543GC));563 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_I82543GC)); 564 564 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82543GC); 565 565 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); 566 566 ++iAdapterTypeIndex; 567 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, g COMenum->toString(KNetworkAdapterType_I82545EM));567 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_I82545EM)); 568 568 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82545EM); 569 569 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); … … 571 571 #endif /* VBOX_WITH_E1000 */ 572 572 #ifdef VBOX_WITH_VIRTIO 573 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, g COMenum->toString(KNetworkAdapterType_Virtio));573 m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, gpConverter->toString(KNetworkAdapterType_Virtio)); 574 574 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Virtio); 575 575 m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole); … … 591 591 /* Populate promiscuous modes: */ 592 592 int iPromiscuousModeIndex = 0; 593 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, g COMenum->toString(KNetworkAdapterPromiscModePolicy_Deny));593 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, gpConverter->toString(KNetworkAdapterPromiscModePolicy_Deny)); 594 594 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_Deny); 595 595 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole); 596 596 ++iPromiscuousModeIndex; 597 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, g COMenum->toString(KNetworkAdapterPromiscModePolicy_AllowNetwork));597 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, gpConverter->toString(KNetworkAdapterPromiscModePolicy_AllowNetwork)); 598 598 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_AllowNetwork); 599 599 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole); 600 600 ++iPromiscuousModeIndex; 601 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, g COMenum->toString(KNetworkAdapterPromiscModePolicy_AllowAll));601 m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, gpConverter->toString(KNetworkAdapterPromiscModePolicy_AllowAll)); 602 602 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_AllowAll); 603 603 m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
r41608 r41819 38 38 #include "QIDialogButtonBox.h" 39 39 #include "UIIconPool.h" 40 #include " COMEnumsWrapper.h"40 #include "UIConverter.h" 41 41 42 42 /* Other VBox includes: */ … … 111 111 ProtocolEditor(QWidget *pParent = 0) : QComboBox(pParent) 112 112 { 113 addItem(g COMenum->toString(KNATProtocol_UDP), QVariant::fromValue(KNATProtocol_UDP));114 addItem(g COMenum->toString(KNATProtocol_TCP), QVariant::fromValue(KNATProtocol_TCP));113 addItem(gpConverter->toString(KNATProtocol_UDP), QVariant::fromValue(KNATProtocol_UDP)); 114 addItem(gpConverter->toString(KNATProtocol_TCP), QVariant::fromValue(KNATProtocol_TCP)); 115 115 } 116 116 … … 284 284 { 285 285 case UIPortForwardingDataType_Name: return m_dataList[index.row()].name; 286 case UIPortForwardingDataType_Protocol: return g COMenum->toString(m_dataList[index.row()].protocol);286 case UIPortForwardingDataType_Protocol: return gpConverter->toString(m_dataList[index.row()].protocol); 287 287 case UIPortForwardingDataType_HostIp: return m_dataList[index.row()].hostIp; 288 288 case UIPortForwardingDataType_HostPort: return m_dataList[index.row()].hostPort.value(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp
r41608 r41819 26 26 #include "VBoxGlobal.h" 27 27 #include "QITabWidget.h" 28 #include " COMEnumsWrapper.h"28 #include "UIConverter.h" 29 29 30 30 /* COM includes: */ … … 76 76 ulong uIRQ, uIOBase; 77 77 bool fStd = vboxGlobal().toCOMPortNumbers(mCbNumber->currentText(), uIRQ, uIOBase); 78 KPortMode mode = g COMenum->toPortMode(mCbMode->currentText());78 KPortMode mode = gpConverter->fromString<KPortMode>(mCbMode->currentText()); 79 79 80 80 mGbSerial->setEnabled(m_pParent->isMachineOffline()); … … 105 105 mLeIRQ->setText(QString::number(portData.m_uIRQ)); 106 106 mLeIOPort->setText("0x" + QString::number(portData.m_uIOBase, 16).toUpper()); 107 mCbMode->setCurrentIndex(mCbMode->findText(g COMenum->toString(portData.m_hostMode)));107 mCbMode->setCurrentIndex(mCbMode->findText(gpConverter->toString(portData.m_hostMode))); 108 108 mCbPipe->setChecked(portData.m_fServer); 109 109 mLePath->setText(portData.m_strPath); … … 123 123 portData.m_uIOBase = mLeIOPort->text().toULong (NULL, 0); 124 124 portData.m_fServer = mCbPipe->isChecked(); 125 portData.m_hostMode = g COMenum->toPortMode(mCbMode->currentText());125 portData.m_hostMode = gpConverter->fromString<KPortMode>(mCbMode->currentText()); 126 126 portData.m_strPath = QDir::toNativeSeparators(mLePath->text()); 127 127 … … 173 173 mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0)); 174 174 175 mCbMode->setItemText (3, g COMenum->toString (KPortMode_RawFile));176 mCbMode->setItemText (2, g COMenum->toString (KPortMode_HostDevice));177 mCbMode->setItemText (1, g COMenum->toString (KPortMode_HostPipe));178 mCbMode->setItemText (0, g COMenum->toString (KPortMode_Disconnected));175 mCbMode->setItemText (3, gpConverter->toString (KPortMode_RawFile)); 176 mCbMode->setItemText (2, gpConverter->toString (KPortMode_HostDevice)); 177 mCbMode->setItemText (1, gpConverter->toString (KPortMode_HostPipe)); 178 mCbMode->setItemText (0, gpConverter->toString (KPortMode_Disconnected)); 179 179 } 180 180 … … 206 206 void UIMachineSettingsSerial::mCbModeActivated (const QString &aText) 207 207 { 208 KPortMode mode = g COMenum->toPortMode(aText);208 KPortMode mode = gpConverter->fromString<KPortMode> (aText); 209 209 mCbPipe->setEnabled (mode == KPortMode_HostPipe); 210 210 mLePath->setEnabled (mode != KPortMode_Disconnected); … … 409 409 /* Check the port path emptiness & unicity */ 410 410 KPortMode mode = 411 g COMenum->toPortMode(page->mCbMode->currentText());411 gpConverter->fromString<KPortMode> (page->mCbMode->currentText()); 412 412 if (mode != KPortMode_Disconnected) 413 413 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r41689 r41819 36 36 #include "UIMessageCenter.h" 37 37 #include "UIMachineSettingsStorage.h" 38 #include " COMEnumsWrapper.h"38 #include "UIConverter.h" 39 39 40 40 /* COM includes: */ … … 550 550 "<nobr>Type: %3</nobr>") 551 551 .arg (mCtrName) 552 .arg (g COMenum->toString (mCtrType->busType()))553 .arg (g COMenum->toString (mCtrType->ctrType()));552 .arg (gpConverter->toString (mCtrType->busType())) 553 .arg (gpConverter->toString (mCtrType->ctrType())); 554 554 } 555 555 … … 2126 2126 KDeviceType attDevice = mStorageModel->data (attIndex, StorageModel::R_AttDevice).value <KDeviceType>(); 2127 2127 QString key (mStorageModel->data (attIndex, StorageModel::R_AttMediumId).toString()); 2128 QString value (QString ("%1 (%2)").arg (ctrName, vboxGlobal().toString (attSlot)));2128 QString value (QString ("%1 (%2)").arg (ctrName, gpConverter->toString (attSlot))); 2129 2129 /* Check for emptiness */ 2130 2130 if (vboxGlobal().findMedium (key).isNull() && attDevice == KDeviceType_HardDisk) … … 2153 2153 { 2154 2154 QString strExcessiveRecord = QString("%1 (%2)"); 2155 strExcessiveRecord = strExcessiveRecord.arg(QString("<b>%1</b>").arg(g COMenum->toString((KStorageBus)iStorageBusType)));2155 strExcessiveRecord = strExcessiveRecord.arg(QString("<b>%1</b>").arg(gpConverter->toString((KStorageBus)iStorageBusType))); 2156 2156 strExcessiveRecord = strExcessiveRecord.arg(maximumType[(KStorageBus)iStorageBusType] == 1 ? 2157 2157 tr("at most one supported", "controller") : … … 2165 2165 "Please change the chipset type on the System settings page or reduce the number " 2166 2166 "of the following storage controllers on the Storage settings page: %2.") 2167 .arg(g COMenum->toString(mStorageModel->chipsetType()))2167 .arg(gpConverter->toString(mStorageModel->chipsetType())) 2168 2168 .arg(excessiveList.join(", ")); 2169 2169 return false; … … 2431 2431 ControllerTypeList controllerTypeList (mStorageModel->data (index, StorageModel::R_CtrTypes).value <ControllerTypeList>()); 2432 2432 for (int i = 0; i < controllerTypeList.size(); ++ i) 2433 mCbType->insertItem (mCbType->count(), g COMenum->toString (controllerTypeList [i]));2433 mCbType->insertItem (mCbType->count(), gpConverter->toString (controllerTypeList [i])); 2434 2434 KStorageControllerType type = mStorageModel->data (index, StorageModel::R_CtrType).value <KStorageControllerType>(); 2435 int ctrPos = mCbType->findText (g COMenum->toString (type));2435 int ctrPos = mCbType->findText (gpConverter->toString (type)); 2436 2436 mCbType->setCurrentIndex (ctrPos == -1 ? 0 : ctrPos); 2437 2437 … … 2455 2455 SlotsList slotsList (mStorageModel->data (index, StorageModel::R_AttSlots).value <SlotsList>()); 2456 2456 for (int i = 0; i < slotsList.size(); ++ i) 2457 mCbSlot->insertItem (mCbSlot->count(), vboxGlobal().toString (slotsList [i]));2457 mCbSlot->insertItem (mCbSlot->count(), gpConverter->toString (slotsList [i])); 2458 2458 StorageSlot slt = mStorageModel->data (index, StorageModel::R_AttSlot).value <StorageSlot>(); 2459 int attSlotPos = mCbSlot->findText ( vboxGlobal().toString (slt));2459 int attSlotPos = mCbSlot->findText (gpConverter->toString (slt)); 2460 2460 mCbSlot->setCurrentIndex (attSlotPos == -1 ? 0 : attSlotPos); 2461 2461 mCbSlot->setToolTip (mCbSlot->itemText (mCbSlot->currentIndex())); … … 2551 2551 /* Setting Controller Sub-Type */ 2552 2552 else if (sdr == mCbType) 2553 mStorageModel->setData (index, QVariant::fromValue (g COMenum->toControllerType(mCbType->currentText())),2553 mStorageModel->setData (index, QVariant::fromValue (gpConverter->fromString<KStorageControllerType> (mCbType->currentText())), 2554 2554 StorageModel::R_CtrType); 2555 2555 else if (sdr == mSbPortCount) … … 2565 2565 { 2566 2566 QModelIndex controllerIndex = mStorageModel->parent(index); 2567 StorageSlot attachmentStorageSlot = vboxGlobal().toStorageSlot(mCbSlot->currentText());2567 StorageSlot attachmentStorageSlot = gpConverter->fromString<StorageSlot>(mCbSlot->currentText()); 2568 2568 mStorageModel->setData(index, QVariant::fromValue(attachmentStorageSlot), StorageModel::R_AttSlot); 2569 2569 QModelIndex theSameIndexAtNewPosition = mStorageModel->attachmentBySlot(controllerIndex, attachmentStorageSlot); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r41608 r41819 26 26 #include "VBoxGlobal.h" 27 27 #include "UIMachineSettingsSystem.h" 28 #include " COMEnumsWrapper.h"28 #include "UIConverter.h" 29 29 30 30 /* COM includes: */ … … 163 163 164 164 /* Populate chipset combo: */ 165 mCbChipset->insertItem(0, g COMenum->toString(KChipsetType_PIIX3), QVariant(KChipsetType_PIIX3));166 mCbChipset->insertItem(1, g COMenum->toString(KChipsetType_ICH9), QVariant(KChipsetType_ICH9));165 mCbChipset->insertItem(0, gpConverter->toString(KChipsetType_PIIX3), QVariant(KChipsetType_PIIX3)); 166 mCbChipset->insertItem(1, gpConverter->toString(KChipsetType_ICH9), QVariant(KChipsetType_ICH9)); 167 167 168 168 /* Install global event filter */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r41689 r41819 31 31 #include "UIMachineSettingsUSB.h" 32 32 #include "UIMachineSettingsUSBFilterDetails.h" 33 #include " COMEnumsWrapper.h"33 #include "UIConverter.h" 34 34 35 35 /* COM includes: */ … … 821 821 case UISettingsPageType_Global: 822 822 { 823 usbFilterData.m_action = g COMenum->toUSBDevFilterAction(dlgFilterDetails.mCbAction->currentText());823 usbFilterData.m_action = gpConverter->fromString<KUSBDeviceFilterAction>(dlgFilterDetails.mCbAction->currentText()); 824 824 break; 825 825 } … … 1020 1020 { 1021 1021 strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>State: %1</nobr>", "USB filter tooltip") 1022 .arg(g COMenum->toString(usbFilterData.m_hostUSBDeviceState));1022 .arg(gpConverter->toString(usbFilterData.m_hostUSBDeviceState)); 1023 1023 } 1024 1024 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp
r41608 r41819 20 20 /* GUI includes: */ 21 21 #include "UIMachineSettingsUSBFilterDetails.h" 22 #include " COMEnumsWrapper.h"22 #include "UIConverter.h" 23 23 24 24 UIMachineSettingsUSBFilterDetails::UIMachineSettingsUSBFilterDetails(UISettingsPageType type, QWidget *pParent /* = 0 */) … … 63 63 64 64 mCbAction->setItemText (0, 65 g COMenum->toString (KUSBDeviceFilterAction_Ignore));65 gpConverter->toString (KUSBDeviceFilterAction_Ignore)); 66 66 mCbAction->setItemText (1, 67 g COMenum->toString (KUSBDeviceFilterAction_Hold));67 gpConverter->toString (KUSBDeviceFilterAction_Hold)); 68 68 } 69 69 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r41608 r41819 33 33 #include "VBoxOSTypeSelectorButton.h" 34 34 #include "UILineTextEdit.h" 35 #include " COMEnumsWrapper.h"35 #include "UIConverter.h" 36 36 37 37 /* COM includes: */ … … 239 239 case KVirtualSystemDescriptionType_OS: v = vboxGlobal().vmGuestOSTypeDescription(m_strConfigValue); break; 240 240 case KVirtualSystemDescriptionType_Memory: v = m_strConfigValue + " " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes"); break; 241 case KVirtualSystemDescriptionType_SoundCard: v = g COMenum->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break;242 case KVirtualSystemDescriptionType_NetworkAdapter: v = g COMenum->toString(static_cast<KNetworkAdapterType>(m_strConfigValue.toInt())); break;241 case KVirtualSystemDescriptionType_SoundCard: v = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break; 242 case KVirtualSystemDescriptionType_NetworkAdapter: v = gpConverter->toString(static_cast<KNetworkAdapterType>(m_strConfigValue.toInt())); break; 243 243 default: v = m_strConfigValue; break; 244 244 } … … 436 436 { 437 437 QComboBox *e = new QComboBox(pParent); 438 e->addItem(g COMenum->toString(KAudioControllerType_AC97), KAudioControllerType_AC97);439 e->addItem(g COMenum->toString(KAudioControllerType_SB16), KAudioControllerType_SB16);440 e->addItem(g COMenum->toString(KAudioControllerType_HDA), KAudioControllerType_HDA);438 e->addItem(gpConverter->toString(KAudioControllerType_AC97), KAudioControllerType_AC97); 439 e->addItem(gpConverter->toString(KAudioControllerType_SB16), KAudioControllerType_SB16); 440 e->addItem(gpConverter->toString(KAudioControllerType_HDA), KAudioControllerType_HDA); 441 441 editor = e; 442 442 break; … … 445 445 { 446 446 QComboBox *e = new QComboBox(pParent); 447 e->addItem(g COMenum->toString(KNetworkAdapterType_Am79C970A), KNetworkAdapterType_Am79C970A);448 e->addItem(g COMenum->toString(KNetworkAdapterType_Am79C973), KNetworkAdapterType_Am79C973);447 e->addItem(gpConverter->toString(KNetworkAdapterType_Am79C970A), KNetworkAdapterType_Am79C970A); 448 e->addItem(gpConverter->toString(KNetworkAdapterType_Am79C973), KNetworkAdapterType_Am79C973); 449 449 #ifdef VBOX_WITH_E1000 450 e->addItem(g COMenum->toString(KNetworkAdapterType_I82540EM), KNetworkAdapterType_I82540EM);451 e->addItem(g COMenum->toString(KNetworkAdapterType_I82543GC), KNetworkAdapterType_I82543GC);452 e->addItem(g COMenum->toString(KNetworkAdapterType_I82545EM), KNetworkAdapterType_I82545EM);450 e->addItem(gpConverter->toString(KNetworkAdapterType_I82540EM), KNetworkAdapterType_I82540EM); 451 e->addItem(gpConverter->toString(KNetworkAdapterType_I82543GC), KNetworkAdapterType_I82543GC); 452 e->addItem(gpConverter->toString(KNetworkAdapterType_I82545EM), KNetworkAdapterType_I82545EM); 453 453 #endif /* VBOX_WITH_E1000 */ 454 454 #ifdef VBOX_WITH_VIRTIO 455 e->addItem(g COMenum->toString(KNetworkAdapterType_Virtio), KNetworkAdapterType_Virtio);455 e->addItem(gpConverter->toString(KNetworkAdapterType_Virtio), KNetworkAdapterType_Virtio); 456 456 #endif /* VBOX_WITH_VIRTIO */ 457 457 editor = e; … … 461 461 { 462 462 QComboBox *e = new QComboBox(pParent); 463 e->addItem(g COMenum->toString(KStorageControllerType_PIIX3), "PIIX3");464 e->addItem(g COMenum->toString(KStorageControllerType_PIIX4), "PIIX4");465 e->addItem(g COMenum->toString(KStorageControllerType_ICH6), "ICH6");463 e->addItem(gpConverter->toString(KStorageControllerType_PIIX3), "PIIX3"); 464 e->addItem(gpConverter->toString(KStorageControllerType_PIIX4), "PIIX4"); 465 e->addItem(gpConverter->toString(KStorageControllerType_ICH6), "ICH6"); 466 466 editor = e; 467 467 break; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIBootTable.cpp
r41608 r41819 23 23 /* Local includes */ 24 24 #include "UIBootTable.h" 25 #include " COMEnumsWrapper.h"25 #include "UIConverter.h" 26 26 27 27 UIBootTableItem::UIBootTableItem(KDeviceType type) … … 62 62 void UIBootTableItem::retranslateUi() 63 63 { 64 setText(g COMenum->toString(m_type));64 setText(gpConverter->toString(m_type)); 65 65 } 66 66
Note:
See TracChangeset
for help on using the changeset viewer.