- Timestamp:
- Oct 17, 2018 1:34:24 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 136 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r72057 r74878 5800 5800 void VBoxVHWASettings::init(CSession &session) 5801 5801 { 5802 const Q String strMachineID = session.GetMachine().GetId();5803 5804 mStretchLinearEnabled = gEDataManager->useLinearStretch( strMachineID);5802 const QUuid uMachineID = session.GetMachine().GetId(); 5803 5804 mStretchLinearEnabled = gEDataManager->useLinearStretch(uMachineID); 5805 5805 5806 5806 uint32_t aFourccs[VBOXVHWA_NUMFOURCC]; 5807 5807 int num = 0; 5808 if (gEDataManager->usePixelFormatAYUV( strMachineID))5808 if (gEDataManager->usePixelFormatAYUV(uMachineID)) 5809 5809 aFourccs[num++] = FOURCC_AYUV; 5810 if (gEDataManager->usePixelFormatUYVY( strMachineID))5810 if (gEDataManager->usePixelFormatUYVY(uMachineID)) 5811 5811 aFourccs[num++] = FOURCC_UYVY; 5812 if (gEDataManager->usePixelFormatYUY2( strMachineID))5812 if (gEDataManager->usePixelFormatYUY2(uMachineID)) 5813 5813 aFourccs[num++] = FOURCC_YUY2; 5814 if (gEDataManager->usePixelFormatYV12( strMachineID))5814 if (gEDataManager->usePixelFormatYV12(uMachineID)) 5815 5815 aFourccs[num++] = FOURCC_YV12; 5816 5816 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r74872 r74878 93 93 94 94 /** Notifies about 'extra-data change' event: */ 95 void sigExtraDataChange( QString strMachineID, QString strKey, QStringstrValue);95 void sigExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue); 96 96 97 97 public: … … 105 105 106 106 /** Preprocess 'extra-data can change' event: */ 107 void sltPreprocessExtraDataCanChange( QString strMachineID, QString strKey, QStringstrValue, bool &fVeto, QString &strVetoReason);107 void sltPreprocessExtraDataCanChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue, bool &fVeto, QString &strVetoReason); 108 108 /** Preprocess 'extra-data change' event: */ 109 void sltPreprocessExtraDataChange( QString strMachineID, QString strKey, QStringstrValue);109 void sltPreprocessExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue); 110 110 111 111 protected: … … 244 244 } 245 245 246 void UIExtraDataEventHandler::sltPreprocessExtraDataCanChange( QString strMachineID, QString strKey, QString/* strValue */, bool & /* fVeto */, QString & /* strVetoReason */)246 void UIExtraDataEventHandler::sltPreprocessExtraDataCanChange(const QUuid &aMachineID, const QString &strKey, const QString &/* strValue */, bool & /* fVeto */, QString & /* strVetoReason */) 247 247 { 248 248 /* Preprocess global 'extra-data can change' event: */ 249 if ( QUuid(strMachineID).isNull())249 if (aMachineID.isNull()) 250 250 { 251 251 if (strKey.startsWith("GUI/")) … … 259 259 } 260 260 261 void UIExtraDataEventHandler::sltPreprocessExtraDataChange( QString strMachineID, QString strKey, QStringstrValue)261 void UIExtraDataEventHandler::sltPreprocessExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue) 262 262 { 263 263 /* Preprocess global 'extra-data change' event: */ 264 if ( QUuid(strMachineID).isNull())264 if (aMachineID.isNull()) 265 265 { 266 266 if (strKey.startsWith("GUI/")) … … 275 275 276 276 /* Motify listener about 'extra-data change' event: */ 277 emit sigExtraDataChange( strMachineID, strKey, strValue);277 emit sigExtraDataChange(aMachineID, strKey, strValue); 278 278 } 279 279 … … 424 424 { 425 425 /* If proper machine ID passed => return corresponding pixmap/size: */ 426 if (index.data(Field_ID).to String() != UIExtraDataManager::GlobalID)426 if (index.data(Field_ID).toUuid() != UIExtraDataManager::GlobalID) 427 427 pixmap = vboxGlobal().vmGuestOSTypePixmapDefault(index.data(Field_OsTypeID).toString(), &pixmapSize); 428 428 else … … 455 455 { 456 456 /* Compare by ID first: */ 457 const Q String strID1 = leftIdx.data(Field_ID).toString();458 const Q String strID2 = rightIdx.data(Field_ID).toString();457 const QUuid strID1 = leftIdx.data(Field_ID).toUuid(); 458 const QUuid strID2 = rightIdx.data(Field_ID).toUuid(); 459 459 if (strID1 == UIExtraDataManager::GlobalID) 460 460 return true; … … 494 494 * @{ */ 495 495 /** Handles extra-data map acknowledging. */ 496 void sltExtraDataMapAcknowledging( QString strID);496 void sltExtraDataMapAcknowledging(const QUuid &aID); 497 497 /** Handles extra-data change. */ 498 void sltExtraDataChange( QString strID, QString strKey, QStringstrValue);498 void sltExtraDataChange(const QUuid &aID, const QString &strKey, const QString &strValue); 499 499 /** @} */ 500 500 … … 504 504 * @{ */ 505 505 /** Handles machine (un)registration. */ 506 void sltMachineRegistered( QString strID, bool fAdded);506 void sltMachineRegistered(const QUuid &aID, bool fAdded); 507 507 /** @} */ 508 508 … … 604 604 605 605 /** Returns chooser ID for @a iRow. */ 606 Q StringchooserID(int iRow) const;606 QUuid chooserID(int iRow) const; 607 607 /** Returns current chooser ID. */ 608 Q StringcurrentChooserID() const;608 QUuid currentChooserID() const; 609 609 610 610 /** Returns chooser Name for @a iRow. */ … … 614 614 615 615 /** Adds chooser item. */ 616 void addChooserItem(const Q String &strID,616 void addChooserItem(const QUuid &aID, 617 617 const QString &strName, 618 618 const QString &strOsTypeID, … … 622 622 const int iPosition = -1); 623 623 /** Adds chooser item by ID. */ 624 void addChooserItemByID(const Q String &strID,624 void addChooserItemByID(const QUuid &aID, 625 625 const int iPosition = -1); 626 626 … … 752 752 } 753 753 754 void UIExtraDataManagerWindow::sltMachineRegistered( QString strID, bool fRegistered)754 void UIExtraDataManagerWindow::sltMachineRegistered(const QUuid &aID, bool fRegistered) 755 755 { 756 756 /* Machine registered: */ … … 758 758 { 759 759 /* Gather list of 'known IDs': */ 760 Q StringListknownIDs;760 QList<QUuid> knownIDs; 761 761 for (int iRow = 0; iRow < m_pModelSourceOfChooser->rowCount(); ++iRow) 762 knownIDs << chooserID(iRow);762 knownIDs.append(chooserID(iRow)); 763 763 764 764 /* Get machine items: */ 765 765 const CMachineVector machines = vboxGlobal().virtualBox().GetMachines(); 766 766 /* Look for the proper place to insert new machine item: */ 767 Q String strPositionID = UIExtraDataManager::GlobalID;767 QUuid uPositionID = UIExtraDataManager::GlobalID; 768 768 foreach (const CMachine &machine, machines) 769 769 { 770 770 /* Get iterated machine ID: */ 771 const Q String strIteratedID = machine.GetId();771 const QUuid uIteratedID = machine.GetId(); 772 772 /* If 'iterated ID' equal to 'added ID' => break now: */ 773 if ( strIteratedID == strID)773 if (uIteratedID == aID) 774 774 break; 775 775 /* If 'iterated ID' is 'known ID' => remember it: */ 776 if (knownIDs.contains( strIteratedID))777 strPositionID = strIteratedID;776 if (knownIDs.contains(uIteratedID)) 777 uPositionID = uIteratedID; 778 778 } 779 779 780 780 /* Add new chooser item into source-model: */ 781 addChooserItemByID( strID, knownIDs.indexOf(strPositionID) + 1);781 addChooserItemByID(aID, knownIDs.indexOf(uPositionID) + 1); 782 782 /* And sort proxy-model: */ 783 783 m_pModelProxyOfChooser->sort(0, Qt::AscendingOrder); … … 790 790 /* Remove chooser item with 'removed ID' if it is among 'known IDs': */ 791 791 for (int iRow = 0; iRow < m_pModelSourceOfChooser->rowCount(); ++iRow) 792 if (chooserID(iRow) == strID)792 if (chooserID(iRow) == aID) 793 793 m_pModelSourceOfChooser->removeRow(iRow); 794 794 } 795 795 } 796 796 797 void UIExtraDataManagerWindow::sltExtraDataMapAcknowledging( QString strID)797 void UIExtraDataManagerWindow::sltExtraDataMapAcknowledging(const QUuid &aID) 798 798 { 799 799 /* Update item with 'changed ID' if it is among 'known IDs': */ 800 800 for (int iRow = 0; iRow < m_pModelSourceOfChooser->rowCount(); ++iRow) 801 if (chooserID(iRow) == strID)801 if (chooserID(iRow) == aID) 802 802 m_pModelSourceOfChooser->itemFromIndex(chooserIndex(iRow))->setData(true, Field_Known); 803 803 } 804 804 805 void UIExtraDataManagerWindow::sltExtraDataChange( QString strID, QString strKey, QStringstrValue)805 void UIExtraDataManagerWindow::sltExtraDataChange(const QUuid &aID, const QString &strKey, const QString &strValue) 806 806 { 807 807 /* Skip unrelated IDs: */ 808 if (currentChooserID() != strID)808 if (currentChooserID() != aID) 809 809 return; 810 810 … … 834 834 /* Look for the proper place for 'changed key': */ 835 835 QString strPositionKey; 836 foreach (const QString &strIteratedKey, gEDataManager->map( strID).keys())836 foreach (const QString &strIteratedKey, gEDataManager->map(aID).keys()) 837 837 { 838 838 /* If 'iterated key' equal to 'changed key' => break now: */ … … 871 871 872 872 /* Add all the new items finally: */ 873 const Q String strID = index.data(Field_ID).toString();874 if (!gEDataManager->contains( strID))875 gEDataManager->hotloadMachineExtraDataMap( strID);876 const ExtraDataMap data = gEDataManager->map( strID);873 const QUuid uID = index.data(Field_ID).toUuid(); 874 if (!gEDataManager->contains(uID)) 875 gEDataManager->hotloadMachineExtraDataMap(uID); 876 const ExtraDataMap data = gEDataManager->map(uID); 877 877 foreach (const QString &strKey, data.keys()) 878 878 addDataItem(strKey, data.value(strKey)); … … 1206 1206 stream.writeStartElement("VirtualBox"); 1207 1207 { 1208 const Q String strID = currentChooserID();1209 bool fIsMachine = strID != UIExtraDataManager::GlobalID;1208 const QUuid uID = currentChooserID(); 1209 bool fIsMachine = uID != UIExtraDataManager::GlobalID; 1210 1210 const QString strType = fIsMachine ? "Machine" : "Global"; 1211 1211 stream.writeStartElement(strType); 1212 1212 { 1213 1213 if (fIsMachine) 1214 stream.writeAttribute("uuid", QString("{%1}").arg( strID));1214 stream.writeAttribute("uuid", QString("{%1}").arg(uID.toString())); 1215 1215 stream.writeStartElement("ExtraData"); 1216 1216 { … … 1298 1298 1299 1299 /* Search for the scope ID: */ 1300 Q String strLoadingID;1300 QUuid uLoadingID; 1301 1301 if (strElementName == "Global") 1302 strLoadingID = UIExtraDataManager::GlobalID;1302 uLoadingID = UIExtraDataManager::GlobalID; 1303 1303 else if (strElementName == "Machine") 1304 1304 { … … 1307 1307 { 1308 1308 const QString strUuid = attributes.value("uuid").toString(); 1309 const QUuid uuid = strUuid; 1310 if (!uuid.isNull()) 1311 strLoadingID = uuid.toString().remove(QRegExp("[{}]")); 1312 else 1309 const QUuid uLoadingID = strUuid; 1310 if (uLoadingID.isNull()) 1313 1311 msgCenter().alert(this, MessageType_Warning, 1314 1312 QString("<p>Invalid extra-data ID:</p>" … … 1329 1327 1330 1328 /* Check extra-data ID: */ 1331 if (! strLoadingID.isNull() && strLoadingID != currentChooserID() &&1329 if (!uLoadingID.isNull() && uLoadingID != currentChooserID() && 1332 1330 !msgCenter().questionBinary(this, MessageType_Question, 1333 1331 QString("<p>Inconsistent extra-data ID:</p>" … … 1335 1333 "<p>Loading: {%2}</p>" 1336 1334 "<p>Continue with loading?</p>") 1337 .arg(currentChooserID() , strLoadingID)))1335 .arg(currentChooserID().toString(), uLoadingID.toString()))) 1338 1336 break; 1339 1337 } … … 1803 1801 } 1804 1802 1805 Q StringUIExtraDataManagerWindow::chooserID(int iRow) const1806 { 1807 return chooserIndex(iRow).data(Field_ID).to String();1808 } 1809 1810 Q StringUIExtraDataManagerWindow::currentChooserID() const1811 { 1812 return currentChooserIndex().data(Field_ID).to String();1803 QUuid UIExtraDataManagerWindow::chooserID(int iRow) const 1804 { 1805 return chooserIndex(iRow).data(Field_ID).toUuid(); 1806 } 1807 1808 QUuid UIExtraDataManagerWindow::currentChooserID() const 1809 { 1810 return currentChooserIndex().data(Field_ID).toUuid(); 1813 1811 } 1814 1812 … … 1823 1821 } 1824 1822 1825 void UIExtraDataManagerWindow::addChooserItem(const Q String &strID,1823 void UIExtraDataManagerWindow::addChooserItem(const QUuid &aID, 1826 1824 const QString &strName, 1827 1825 const QString &strOsTypeID, … … 1835 1833 pItem->setEditable(false); 1836 1834 /* Contains passed ID: */ 1837 pItem->setData( strID, Field_ID);1835 pItem->setData(aID, Field_ID); 1838 1836 /* Contains passed name: */ 1839 1837 pItem->setData(strName, Field_Name); … … 1841 1839 pItem->setData(strOsTypeID, Field_OsTypeID); 1842 1840 /* And designated as known/unknown depending on extra-data manager status: */ 1843 pItem->setData(gEDataManager->contains( strID), Field_Known);1841 pItem->setData(gEDataManager->contains(aID), Field_Known); 1844 1842 /* If insert position defined: */ 1845 1843 if (iPosition != -1) … … 1865 1863 } 1866 1864 1867 void UIExtraDataManagerWindow::addChooserItemByID(const Q String &strID,1865 void UIExtraDataManagerWindow::addChooserItemByID(const QUuid &aID, 1868 1866 const int iPosition /* = -1 */) 1869 1867 { 1870 1868 /* Global ID? */ 1871 if ( strID == UIExtraDataManager::GlobalID)1872 return addChooserItem( strID, QString("Global"), QString(), iPosition);1869 if (aID == UIExtraDataManager::GlobalID) 1870 return addChooserItem(aID, QString("Global"), QString(), iPosition); 1873 1871 1874 1872 /* Search for the corresponding machine by ID: */ 1875 1873 CVirtualBox vbox = vboxGlobal().virtualBox(); 1876 const CMachine machine = vbox.FindMachine( strID);1874 const CMachine machine = vbox.FindMachine(aID.toString()); 1877 1875 /* Make sure VM is accessible: */ 1878 1876 if (vbox.isOk() && !machine.isNull() && machine.GetAccessible()) 1879 return addChooserItem( strID, machine.GetName(), machine.GetOSTypeId(), iPosition);1877 return addChooserItem(aID, machine.GetName(), machine.GetOSTypeId(), iPosition); 1880 1878 } 1881 1879 … … 2053 2051 /* static */ 2054 2052 UIExtraDataManager *UIExtraDataManager::s_pInstance = 0; 2055 const Q String UIExtraDataManager::GlobalID = QUuid().toString().remove(QRegExp("[{}]"));2053 const QUuid UIExtraDataManager::GlobalID; 2056 2054 2057 2055 /* static */ … … 2088 2086 #endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */ 2089 2087 2090 void UIExtraDataManager::hotloadMachineExtraDataMap(const Q String &strID)2088 void UIExtraDataManager::hotloadMachineExtraDataMap(const QUuid &aID) 2091 2089 { 2092 2090 /* Make sure it is valid ID: */ 2093 AssertMsgReturnVoid(! strID.isNull() && strID != GlobalID,2094 ("Invalid VM ID = {%s}\n", strID.toUtf8().constData()));2091 AssertMsgReturnVoid(!aID.isNull() && aID != GlobalID, 2092 ("Invalid VM ID = {%s}\n", aID.toString().toUtf8().constData())); 2095 2093 /* Which is not loaded yet: */ 2096 AssertReturnVoid(!m_data.contains( strID));2094 AssertReturnVoid(!m_data.contains(aID)); 2097 2095 2098 2096 /* Search for corresponding machine: */ 2099 2097 CVirtualBox vbox = vboxGlobal().virtualBox(); 2100 CMachine machine = vbox.FindMachine( strID);2098 CMachine machine = vbox.FindMachine(aID.toString()); 2101 2099 AssertReturnVoid(vbox.isOk() && !machine.isNull()); 2102 2100 2103 2101 /* Make sure at least empty map is created: */ 2104 m_data[ strID] = ExtraDataMap();2102 m_data[aID] = ExtraDataMap(); 2105 2103 2106 2104 /* Do not handle inaccessible machine: */ … … 2110 2108 /* Load machine extra-data map: */ 2111 2109 foreach (const QString &strKey, machine.GetExtraDataKeys()) 2112 m_data[ strID][strKey] = machine.GetExtraData(strKey);2110 m_data[aID][strKey] = machine.GetExtraData(strKey); 2113 2111 2114 2112 /* Notifies about extra-data map acknowledged: */ 2115 emit sigExtraDataMapAcknowledging( strID);2116 } 2117 2118 QString UIExtraDataManager::extraDataString(const QString &strKey, const Q String &strID /* = GlobalID */)2113 emit sigExtraDataMapAcknowledging(aID); 2114 } 2115 2116 QString UIExtraDataManager::extraDataString(const QString &strKey, const QUuid &aID /* = GlobalID */) 2119 2117 { 2120 2118 /* Get the value. Return 'QString()' if not found: */ 2121 const QString strValue = extraDataStringUnion(strKey, strID);2119 const QString strValue = extraDataStringUnion(strKey, aID); 2122 2120 if (strValue.isNull()) 2123 2121 return QString(); … … 2127 2125 } 2128 2126 2129 void UIExtraDataManager::setExtraDataString(const QString &strKey, const QString &strValue, const Q String &strID /* = GlobalID */)2127 void UIExtraDataManager::setExtraDataString(const QString &strKey, const QString &strValue, const QUuid &aID /* = GlobalID */) 2130 2128 { 2131 2129 /* Make sure VBoxSVC is available: */ … … 2134 2132 2135 2133 /* Hot-load machine extra-data map if necessary: */ 2136 if ( strID != GlobalID && !m_data.contains(strID))2137 hotloadMachineExtraDataMap( strID);2134 if (aID != GlobalID && !m_data.contains(aID)) 2135 hotloadMachineExtraDataMap(aID); 2138 2136 2139 2137 /* Access corresponding map: */ 2140 ExtraDataMap &data = m_data[ strID];2138 ExtraDataMap &data = m_data[aID]; 2141 2139 2142 2140 /* [Re]cache passed value: */ … … 2144 2142 2145 2143 /* Global extra-data: */ 2146 if ( strID == GlobalID)2144 if (aID == GlobalID) 2147 2145 { 2148 2146 /* Get global object: */ … … 2158 2156 /* Search for corresponding machine: */ 2159 2157 CVirtualBox vbox = vboxGlobal().virtualBox(); 2160 const CMachine machine = vbox.FindMachine( strID);2158 const CMachine machine = vbox.FindMachine(aID.toString()); 2161 2159 AssertReturnVoid(vbox.isOk() && !machine.isNull()); 2162 2160 /* Check the configuration access-level: */ … … 2167 2165 CSession session; 2168 2166 if (cLevel == ConfigurationAccessLevel_Full) 2169 session = vboxGlobal().openSession( strID);2167 session = vboxGlobal().openSession(aID); 2170 2168 else 2171 session = vboxGlobal().openExistingSession( strID);2169 session = vboxGlobal().openExistingSession(aID); 2172 2170 AssertReturnVoid(!session.isNull()); 2173 2171 /* Get machine from that session: */ … … 2181 2179 } 2182 2180 2183 QStringList UIExtraDataManager::extraDataStringList(const QString &strKey, const Q String &strID /* = GlobalID */)2181 QStringList UIExtraDataManager::extraDataStringList(const QString &strKey, const QUuid &aID /* = GlobalID */) 2184 2182 { 2185 2183 /* Get the value. Return 'QStringList()' if not found: */ 2186 const QString strValue = extraDataStringUnion(strKey, strID);2184 const QString strValue = extraDataStringUnion(strKey, aID); 2187 2185 if (strValue.isNull()) 2188 2186 return QStringList(); … … 2193 2191 } 2194 2192 2195 void UIExtraDataManager::setExtraDataStringList(const QString &strKey, const QStringList &value, const Q String &strID /* = GlobalID */)2193 void UIExtraDataManager::setExtraDataStringList(const QString &strKey, const QStringList &value, const QUuid &aID /* = GlobalID */) 2196 2194 { 2197 2195 /* Make sure VBoxSVC is available: */ … … 2200 2198 2201 2199 /* Hot-load machine extra-data map if necessary: */ 2202 if ( strID != GlobalID && !m_data.contains(strID))2203 hotloadMachineExtraDataMap( strID);2200 if (aID != GlobalID && !m_data.contains(aID)) 2201 hotloadMachineExtraDataMap(aID); 2204 2202 2205 2203 /* Access corresponding map: */ 2206 ExtraDataMap &data = m_data[ strID];2204 ExtraDataMap &data = m_data[aID]; 2207 2205 2208 2206 /* [Re]cache passed value: */ … … 2210 2208 2211 2209 /* Global extra-data: */ 2212 if ( strID == GlobalID)2210 if (aID == GlobalID) 2213 2211 { 2214 2212 /* Get global object: */ … … 2224 2222 /* Search for corresponding machine: */ 2225 2223 CVirtualBox vbox = vboxGlobal().virtualBox(); 2226 const CMachine machine = vbox.FindMachine( strID);2224 const CMachine machine = vbox.FindMachine(aID.toString()); 2227 2225 AssertReturnVoid(vbox.isOk() && !machine.isNull()); 2228 2226 /* Check the configuration access-level: */ … … 2233 2231 CSession session; 2234 2232 if (cLevel == ConfigurationAccessLevel_Full) 2235 session = vboxGlobal().openSession( strID);2233 session = vboxGlobal().openSession(aID); 2236 2234 else 2237 session = vboxGlobal().openExistingSession( strID);2235 session = vboxGlobal().openExistingSession(aID); 2238 2236 AssertReturnVoid(!session.isNull()); 2239 2237 /* Get machine from that session: */ … … 2265 2263 } 2266 2264 2267 QStringList UIExtraDataManager::suppressedMessages(const Q String &strID /* = GlobalID */)2268 { 2269 return extraDataStringList(GUI_SuppressMessages, strID);2265 QStringList UIExtraDataManager::suppressedMessages(const QUuid &aID /* = GlobalID */) 2266 { 2267 return extraDataStringList(GUI_SuppressMessages, aID); 2270 2268 } 2271 2269 … … 2357 2355 } 2358 2356 2359 QList<MachineSettingsPageType> UIExtraDataManager::restrictedMachineSettingsPages(const Q String &strID)2357 QList<MachineSettingsPageType> UIExtraDataManager::restrictedMachineSettingsPages(const QUuid &aID) 2360 2358 { 2361 2359 /* Prepare result: */ 2362 2360 QList<MachineSettingsPageType> result; 2363 2361 /* Get restricted machine-settings-pages: */ 2364 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedMachineSettingsPages, strID))2362 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedMachineSettingsPages, aID)) 2365 2363 { 2366 2364 MachineSettingsPageType value = gpConverter->fromInternalString<MachineSettingsPageType>(strValue); … … 2979 2977 } 2980 2978 2981 bool UIExtraDataManager::showMachineInSelectorChooser(const Q String &strID)2979 bool UIExtraDataManager::showMachineInSelectorChooser(const QUuid &aID) 2982 2980 { 2983 2981 /* 'True' unless 'restriction' feature allowed: */ 2984 return !isFeatureAllowed(GUI_HideFromManager, strID);2985 } 2986 2987 bool UIExtraDataManager::showMachineInSelectorDetails(const Q String &strID)2982 return !isFeatureAllowed(GUI_HideFromManager, aID); 2983 } 2984 2985 bool UIExtraDataManager::showMachineInSelectorDetails(const QUuid &aID) 2988 2986 { 2989 2987 /* 'True' unless 'restriction' feature allowed: */ 2990 return !isFeatureAllowed(GUI_HideDetails, strID);2991 } 2992 2993 bool UIExtraDataManager::machineReconfigurationEnabled(const Q String &strID)2988 return !isFeatureAllowed(GUI_HideDetails, aID); 2989 } 2990 2991 bool UIExtraDataManager::machineReconfigurationEnabled(const QUuid &aID) 2994 2992 { 2995 2993 /* 'True' unless 'restriction' feature allowed: */ 2996 return !isFeatureAllowed(GUI_PreventReconfiguration, strID);2997 } 2998 2999 bool UIExtraDataManager::machineSnapshotOperationsEnabled(const Q String &strID)2994 return !isFeatureAllowed(GUI_PreventReconfiguration, aID); 2995 } 2996 2997 bool UIExtraDataManager::machineSnapshotOperationsEnabled(const QUuid &aID) 3000 2998 { 3001 2999 /* 'True' unless 'restriction' feature allowed: */ 3002 return !isFeatureAllowed(GUI_PreventSnapshotOperations, strID);3003 } 3004 3005 bool UIExtraDataManager::machineFirstTimeStarted(const Q String &strID)3000 return !isFeatureAllowed(GUI_PreventSnapshotOperations, aID); 3001 } 3002 3003 bool UIExtraDataManager::machineFirstTimeStarted(const QUuid &aID) 3006 3004 { 3007 3005 /* 'True' only if feature is allowed: */ 3008 return isFeatureAllowed(GUI_FirstRun, strID);3009 } 3010 3011 void UIExtraDataManager::setMachineFirstTimeStarted(bool fFirstTimeStarted, const Q String &strID)3006 return isFeatureAllowed(GUI_FirstRun, aID); 3007 } 3008 3009 void UIExtraDataManager::setMachineFirstTimeStarted(bool fFirstTimeStarted, const QUuid &aID) 3012 3010 { 3013 3011 /* 'True' if feature allowed, null-string otherwise: */ 3014 setExtraDataString(GUI_FirstRun, toFeatureAllowed(fFirstTimeStarted), strID);3015 } 3016 3017 QStringList UIExtraDataManager::machineWindowIconNames(const Q String &strID)3018 { 3019 return extraDataStringList(GUI_MachineWindowIcons, strID);3012 setExtraDataString(GUI_FirstRun, toFeatureAllowed(fFirstTimeStarted), aID); 3013 } 3014 3015 QStringList UIExtraDataManager::machineWindowIconNames(const QUuid &aID) 3016 { 3017 return extraDataStringList(GUI_MachineWindowIcons, aID); 3020 3018 } 3021 3019 3022 3020 #ifndef VBOX_WS_MAC 3023 QString UIExtraDataManager::machineWindowNamePostfix(const Q String &strID)3024 { 3025 return extraDataString(GUI_MachineWindowNamePostfix, strID);3021 QString UIExtraDataManager::machineWindowNamePostfix(const QUuid &aID) 3022 { 3023 return extraDataString(GUI_MachineWindowNamePostfix, aID); 3026 3024 } 3027 3025 #endif /* !VBOX_WS_MAC */ 3028 3026 3029 QRect UIExtraDataManager::machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const Q String &strID)3027 QRect UIExtraDataManager::machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &aID) 3030 3028 { 3031 3029 /* Choose corresponding key: */ … … 3039 3037 3040 3038 /* Get corresponding extra-data: */ 3041 const QStringList data = extraDataStringList(strKey, strID);3039 const QStringList data = extraDataStringList(strKey, aID); 3042 3040 3043 3041 /* Parse loaded data: */ … … 3061 3059 } 3062 3060 3063 bool UIExtraDataManager::machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const Q String &strID)3061 bool UIExtraDataManager::machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &aID) 3064 3062 { 3065 3063 /* Choose corresponding key: */ … … 3073 3071 3074 3072 /* Get corresponding extra-data: */ 3075 const QStringList data = extraDataStringList(strKey, strID);3073 const QStringList data = extraDataStringList(strKey, aID); 3076 3074 3077 3075 /* Make sure 5th item has required value: */ … … 3079 3077 } 3080 3078 3081 void UIExtraDataManager::setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const Q String &strID)3079 void UIExtraDataManager::setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QUuid &aID) 3082 3080 { 3083 3081 /* Choose corresponding key: */ … … 3100 3098 3101 3099 /* Re-cache corresponding extra-data: */ 3102 setExtraDataStringList(strKey, data, strID);3100 setExtraDataStringList(strKey, data, aID); 3103 3101 } 3104 3102 3105 3103 #ifndef VBOX_WS_MAC 3106 bool UIExtraDataManager::menuBarEnabled(const Q String &strID)3104 bool UIExtraDataManager::menuBarEnabled(const QUuid &aID) 3107 3105 { 3108 3106 /* 'True' unless feature restricted: */ 3109 return !isFeatureRestricted(GUI_MenuBar_Enabled, strID);3110 } 3111 3112 void UIExtraDataManager::setMenuBarEnabled(bool fEnabled, const Q String &strID)3107 return !isFeatureRestricted(GUI_MenuBar_Enabled, aID); 3108 } 3109 3110 void UIExtraDataManager::setMenuBarEnabled(bool fEnabled, const QUuid &aID) 3113 3111 { 3114 3112 /* 'False' if feature restricted, null-string otherwise: */ 3115 setExtraDataString(GUI_MenuBar_Enabled, toFeatureRestricted(!fEnabled), strID);3113 setExtraDataString(GUI_MenuBar_Enabled, toFeatureRestricted(!fEnabled), aID); 3116 3114 } 3117 3115 #endif /* !VBOX_WS_MAC */ 3118 3116 3119 bool UIExtraDataManager::menuBarContextMenuEnabled(const Q String &strID)3117 bool UIExtraDataManager::menuBarContextMenuEnabled(const QUuid &aID) 3120 3118 { 3121 3119 /* 'True' unless feature restricted: */ 3122 return !isFeatureRestricted(GUI_MenuBar_ContextMenu_Enabled, strID);3123 } 3124 3125 void UIExtraDataManager::setMenuBarContextMenuEnabled(bool fEnabled, const Q String &strID)3120 return !isFeatureRestricted(GUI_MenuBar_ContextMenu_Enabled, aID); 3121 } 3122 3123 void UIExtraDataManager::setMenuBarContextMenuEnabled(bool fEnabled, const QUuid &aID) 3126 3124 { 3127 3125 /* 'False' if feature restricted, null-string otherwise: */ 3128 setExtraDataString(GUI_MenuBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), strID);3129 } 3130 3131 UIExtraDataMetaDefs::MenuType UIExtraDataManager::restrictedRuntimeMenuTypes(const Q String &strID)3126 setExtraDataString(GUI_MenuBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), aID); 3127 } 3128 3129 UIExtraDataMetaDefs::MenuType UIExtraDataManager::restrictedRuntimeMenuTypes(const QUuid &aID) 3132 3130 { 3133 3131 /* Prepare result: */ 3134 3132 UIExtraDataMetaDefs::MenuType result = UIExtraDataMetaDefs::MenuType_Invalid; 3135 3133 /* Get restricted runtime-menu-types: */ 3136 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMenus, strID))3134 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMenus, aID)) 3137 3135 { 3138 3136 UIExtraDataMetaDefs::MenuType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuType>(strValue); … … 3144 3142 } 3145 3143 3146 void UIExtraDataManager::setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const Q String &strID)3144 void UIExtraDataManager::setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QUuid &aID) 3147 3145 { 3148 3146 /* We have MenuType enum registered, so we can enumerate it: */ … … 3173 3171 } 3174 3172 /* Save result: */ 3175 setExtraDataStringList(GUI_RestrictedRuntimeMenus, result, strID);3176 } 3177 3178 UIExtraDataMetaDefs::MenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const Q String &strID)3173 setExtraDataStringList(GUI_RestrictedRuntimeMenus, result, aID); 3174 } 3175 3176 UIExtraDataMetaDefs::MenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const QUuid &aID) 3179 3177 { 3180 3178 /* Prepare result: */ 3181 3179 UIExtraDataMetaDefs::MenuApplicationActionType result = UIExtraDataMetaDefs::MenuApplicationActionType_Invalid; 3182 3180 /* Get restricted runtime-application-menu action-types: */ 3183 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, strID))3181 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, aID)) 3184 3182 { 3185 3183 UIExtraDataMetaDefs::MenuApplicationActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(strValue); … … 3191 3189 } 3192 3190 3193 void UIExtraDataManager::setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const Q String &strID)3191 void UIExtraDataManager::setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QUuid &aID) 3194 3192 { 3195 3193 /* We have MenuApplicationActionType enum registered, so we can enumerate it: */ … … 3220 3218 } 3221 3219 /* Save result: */ 3222 setExtraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, result, strID);3223 } 3224 3225 UIExtraDataMetaDefs::RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const Q String &strID)3220 setExtraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, result, aID); 3221 } 3222 3223 UIExtraDataMetaDefs::RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const QUuid &aID) 3226 3224 { 3227 3225 /* Prepare result: */ 3228 3226 UIExtraDataMetaDefs::RuntimeMenuMachineActionType result = UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid; 3229 3227 /* Get restricted runtime-machine-menu action-types: */ 3230 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, strID))3228 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, aID)) 3231 3229 { 3232 3230 UIExtraDataMetaDefs::RuntimeMenuMachineActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(strValue); … … 3250 3248 } 3251 3249 3252 void UIExtraDataManager::setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const Q String &strID)3250 void UIExtraDataManager::setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QUuid &aID) 3253 3251 { 3254 3252 /* We have RuntimeMenuMachineActionType enum registered, so we can enumerate it: */ … … 3283 3281 result << gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing); 3284 3282 /* Save result: */ 3285 setExtraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, result, strID);3286 } 3287 3288 UIExtraDataMetaDefs::RuntimeMenuViewActionType UIExtraDataManager::restrictedRuntimeMenuViewActionTypes(const Q String &strID)3283 setExtraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, result, aID); 3284 } 3285 3286 UIExtraDataMetaDefs::RuntimeMenuViewActionType UIExtraDataManager::restrictedRuntimeMenuViewActionTypes(const QUuid &aID) 3289 3287 { 3290 3288 /* Prepare result: */ 3291 3289 UIExtraDataMetaDefs::RuntimeMenuViewActionType result = UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid; 3292 3290 /* Get restricted runtime-view-menu action-types: */ 3293 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeViewMenuActions, strID))3291 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeViewMenuActions, aID)) 3294 3292 { 3295 3293 UIExtraDataMetaDefs::RuntimeMenuViewActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(strValue); … … 3301 3299 } 3302 3300 3303 void UIExtraDataManager::setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const Q String &strID)3301 void UIExtraDataManager::setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QUuid &aID) 3304 3302 { 3305 3303 /* We have RuntimeMenuViewActionType enum registered, so we can enumerate it: */ … … 3330 3328 } 3331 3329 /* Save result: */ 3332 setExtraDataStringList(GUI_RestrictedRuntimeViewMenuActions, result, strID);3333 } 3334 3335 UIExtraDataMetaDefs::RuntimeMenuInputActionType UIExtraDataManager::restrictedRuntimeMenuInputActionTypes(const Q String &strID)3330 setExtraDataStringList(GUI_RestrictedRuntimeViewMenuActions, result, aID); 3331 } 3332 3333 UIExtraDataMetaDefs::RuntimeMenuInputActionType UIExtraDataManager::restrictedRuntimeMenuInputActionTypes(const QUuid &aID) 3336 3334 { 3337 3335 /* Prepare result: */ 3338 3336 UIExtraDataMetaDefs::RuntimeMenuInputActionType result = UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid; 3339 3337 /* Get restricted runtime-machine-menu action-types: */ 3340 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeInputMenuActions, strID))3338 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeInputMenuActions, aID)) 3341 3339 { 3342 3340 UIExtraDataMetaDefs::RuntimeMenuInputActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(strValue); … … 3348 3346 } 3349 3347 3350 void UIExtraDataManager::setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const Q String &strID)3348 void UIExtraDataManager::setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QUuid &aID) 3351 3349 { 3352 3350 /* We have RuntimeMenuInputActionType enum registered, so we can enumerate it: */ … … 3377 3375 } 3378 3376 /* Save result: */ 3379 setExtraDataStringList(GUI_RestrictedRuntimeInputMenuActions, result, strID);3380 } 3381 3382 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType UIExtraDataManager::restrictedRuntimeMenuDevicesActionTypes(const Q String &strID)3377 setExtraDataStringList(GUI_RestrictedRuntimeInputMenuActions, result, aID); 3378 } 3379 3380 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType UIExtraDataManager::restrictedRuntimeMenuDevicesActionTypes(const QUuid &aID) 3383 3381 { 3384 3382 /* Prepare result: */ 3385 3383 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType result = UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid; 3386 3384 /* Get restricted runtime-devices-menu action-types: */ 3387 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, strID))3385 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, aID)) 3388 3386 { 3389 3387 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(strValue); … … 3406 3404 } 3407 3405 3408 void UIExtraDataManager::setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const Q String &strID)3406 void UIExtraDataManager::setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QUuid &aID) 3409 3407 { 3410 3408 /* We have RuntimeMenuDevicesActionType enum registered, so we can enumerate it: */ … … 3439 3437 result << gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Nothing); 3440 3438 /* Save result: */ 3441 setExtraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, result, strID);3439 setExtraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, result, aID); 3442 3440 } 3443 3441 3444 3442 #ifdef VBOX_WITH_DEBUGGER_GUI 3445 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType UIExtraDataManager::restrictedRuntimeMenuDebuggerActionTypes(const Q String &strID)3443 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType UIExtraDataManager::restrictedRuntimeMenuDebuggerActionTypes(const QUuid &aID) 3446 3444 { 3447 3445 /* Prepare result: */ 3448 3446 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType result = UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid; 3449 3447 /* Get restricted runtime-debugger-menu action-types: */ 3450 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, strID))3448 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, aID)) 3451 3449 { 3452 3450 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(strValue); … … 3458 3456 } 3459 3457 3460 void UIExtraDataManager::setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const Q String &strID)3458 void UIExtraDataManager::setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QUuid &aID) 3461 3459 { 3462 3460 /* We have RuntimeMenuDebuggerActionType enum registered, so we can enumerate it: */ … … 3487 3485 } 3488 3486 /* Save result: */ 3489 setExtraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, result, strID);3487 setExtraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, result, aID); 3490 3488 } 3491 3489 #endif /* VBOX_WITH_DEBUGGER_GUI */ 3492 3490 3493 3491 #ifdef VBOX_WS_MAC 3494 UIExtraDataMetaDefs::MenuWindowActionType UIExtraDataManager::restrictedRuntimeMenuWindowActionTypes(const Q String &strID)3492 UIExtraDataMetaDefs::MenuWindowActionType UIExtraDataManager::restrictedRuntimeMenuWindowActionTypes(const QUuid &aID) 3495 3493 { 3496 3494 /* Prepare result: */ 3497 3495 UIExtraDataMetaDefs::MenuWindowActionType result = UIExtraDataMetaDefs::MenuWindowActionType_Invalid; 3498 3496 /* Get restricted runtime-window-menu action-types: */ 3499 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeWindowMenuActions, strID))3497 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeWindowMenuActions, aID)) 3500 3498 { 3501 3499 UIExtraDataMetaDefs::MenuWindowActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuWindowActionType>(strValue); … … 3507 3505 } 3508 3506 3509 void UIExtraDataManager::setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const Q String &strID)3507 void UIExtraDataManager::setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QUuid &aID) 3510 3508 { 3511 3509 /* We have MenuWindowActionType enum registered, so we can enumerate it: */ … … 3536 3534 } 3537 3535 /* Save result: */ 3538 setExtraDataStringList(GUI_RestrictedRuntimeWindowMenuActions, result, strID);3536 setExtraDataStringList(GUI_RestrictedRuntimeWindowMenuActions, result, aID); 3539 3537 } 3540 3538 #endif /* VBOX_WS_MAC */ 3541 3539 3542 UIExtraDataMetaDefs::MenuHelpActionType UIExtraDataManager::restrictedRuntimeMenuHelpActionTypes(const Q String &strID)3540 UIExtraDataMetaDefs::MenuHelpActionType UIExtraDataManager::restrictedRuntimeMenuHelpActionTypes(const QUuid &aID) 3543 3541 { 3544 3542 /* Prepare result: */ 3545 3543 UIExtraDataMetaDefs::MenuHelpActionType result = UIExtraDataMetaDefs::MenuHelpActionType_Invalid; 3546 3544 /* Get restricted runtime-help-menu action-types: */ 3547 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, strID))3545 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, aID)) 3548 3546 { 3549 3547 UIExtraDataMetaDefs::MenuHelpActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(strValue); … … 3555 3553 } 3556 3554 3557 void UIExtraDataManager::setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const Q String &strID)3555 void UIExtraDataManager::setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QUuid &aID) 3558 3556 { 3559 3557 /* We have MenuHelpActionType enum registered, so we can enumerate it: */ … … 3584 3582 } 3585 3583 /* Save result: */ 3586 setExtraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, result, strID);3587 } 3588 3589 UIVisualStateType UIExtraDataManager::restrictedVisualStates(const Q String &strID)3584 setExtraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, result, aID); 3585 } 3586 3587 UIVisualStateType UIExtraDataManager::restrictedVisualStates(const QUuid &aID) 3590 3588 { 3591 3589 /* Prepare result: */ 3592 3590 UIVisualStateType result = UIVisualStateType_Invalid; 3593 3591 /* Get restricted visual-state-types: */ 3594 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedVisualStates, strID))3592 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedVisualStates, aID)) 3595 3593 { 3596 3594 UIVisualStateType value = gpConverter->fromInternalString<UIVisualStateType>(strValue); … … 3602 3600 } 3603 3601 3604 UIVisualStateType UIExtraDataManager::requestedVisualState(const Q String &strID)3605 { 3606 if (isFeatureAllowed(GUI_Fullscreen, strID)) return UIVisualStateType_Fullscreen;3607 if (isFeatureAllowed(GUI_Seamless, strID)) return UIVisualStateType_Seamless;3608 if (isFeatureAllowed(GUI_Scale, strID)) return UIVisualStateType_Scale;3602 UIVisualStateType UIExtraDataManager::requestedVisualState(const QUuid &aID) 3603 { 3604 if (isFeatureAllowed(GUI_Fullscreen, aID)) return UIVisualStateType_Fullscreen; 3605 if (isFeatureAllowed(GUI_Seamless, aID)) return UIVisualStateType_Seamless; 3606 if (isFeatureAllowed(GUI_Scale, aID)) return UIVisualStateType_Scale; 3609 3607 return UIVisualStateType_Normal; 3610 3608 } 3611 3609 3612 void UIExtraDataManager::setRequestedVisualState(UIVisualStateType visualState, const Q String &strID)3613 { 3614 setExtraDataString(GUI_Fullscreen, toFeatureAllowed(visualState == UIVisualStateType_Fullscreen), strID);3615 setExtraDataString(GUI_Seamless, toFeatureAllowed(visualState == UIVisualStateType_Seamless), strID);3616 setExtraDataString(GUI_Scale, toFeatureAllowed(visualState == UIVisualStateType_Scale), strID);3610 void UIExtraDataManager::setRequestedVisualState(UIVisualStateType visualState, const QUuid &aID) 3611 { 3612 setExtraDataString(GUI_Fullscreen, toFeatureAllowed(visualState == UIVisualStateType_Fullscreen), aID); 3613 setExtraDataString(GUI_Seamless, toFeatureAllowed(visualState == UIVisualStateType_Seamless), aID); 3614 setExtraDataString(GUI_Scale, toFeatureAllowed(visualState == UIVisualStateType_Scale), aID); 3617 3615 } 3618 3616 … … 3624 3622 } 3625 3623 3626 bool UIExtraDataManager::distinguishMachineWindowGroups(const Q String &strID)3624 bool UIExtraDataManager::distinguishMachineWindowGroups(const QUuid &aID) 3627 3625 { 3628 3626 /* 'False' unless feature allowed: */ 3629 return isFeatureAllowed(GUI_DistinguishMachineWindowGroups, strID);3630 } 3631 3632 void UIExtraDataManager::setDistinguishMachineWindowGroups(const Q String &strID, bool fEnabled)3627 return isFeatureAllowed(GUI_DistinguishMachineWindowGroups, aID); 3628 } 3629 3630 void UIExtraDataManager::setDistinguishMachineWindowGroups(const QUuid &aID, bool fEnabled) 3633 3631 { 3634 3632 /* 'True' if feature allowed, null-string otherwise: */ 3635 setExtraDataString(GUI_DistinguishMachineWindowGroups, toFeatureAllowed(fEnabled), strID);3633 setExtraDataString(GUI_DistinguishMachineWindowGroups, toFeatureAllowed(fEnabled), aID); 3636 3634 } 3637 3635 #endif /* VBOX_WS_X11 */ 3638 3636 3639 bool UIExtraDataManager::guestScreenAutoResizeEnabled(const Q String &strID)3637 bool UIExtraDataManager::guestScreenAutoResizeEnabled(const QUuid &aID) 3640 3638 { 3641 3639 /* 'True' unless feature restricted: */ 3642 return !isFeatureRestricted(GUI_AutoresizeGuest, strID);3643 } 3644 3645 void UIExtraDataManager::setGuestScreenAutoResizeEnabled(bool fEnabled, const Q String &strID)3640 return !isFeatureRestricted(GUI_AutoresizeGuest, aID); 3641 } 3642 3643 void UIExtraDataManager::setGuestScreenAutoResizeEnabled(bool fEnabled, const QUuid &aID) 3646 3644 { 3647 3645 /* 'False' if feature restricted, null-string otherwise: */ 3648 setExtraDataString(GUI_AutoresizeGuest, toFeatureRestricted(!fEnabled), strID);3649 } 3650 3651 bool UIExtraDataManager::lastGuestScreenVisibilityStatus(ulong uScreenIndex, const Q String &strID)3646 setExtraDataString(GUI_AutoresizeGuest, toFeatureRestricted(!fEnabled), aID); 3647 } 3648 3649 bool UIExtraDataManager::lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QUuid &aID) 3652 3650 { 3653 3651 /* Not for primary screen: */ … … 3658 3656 3659 3657 /* 'False' unless feature allowed: */ 3660 return isFeatureAllowed(strKey, strID);3661 } 3662 3663 void UIExtraDataManager::setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const Q String &strID)3658 return isFeatureAllowed(strKey, aID); 3659 } 3660 3661 void UIExtraDataManager::setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QUuid &aID) 3664 3662 { 3665 3663 /* Not for primary screen: */ … … 3670 3668 3671 3669 /* 'True' if feature allowed, null-string otherwise: */ 3672 return setExtraDataString(strKey, toFeatureAllowed(fEnabled), strID);3673 } 3674 3675 QSize UIExtraDataManager::lastGuestScreenSizeHint(ulong uScreenIndex, const Q String &strID)3670 return setExtraDataString(strKey, toFeatureAllowed(fEnabled), aID); 3671 } 3672 3673 QSize UIExtraDataManager::lastGuestScreenSizeHint(ulong uScreenIndex, const QUuid &aID) 3676 3674 { 3677 3675 /* Choose corresponding key: */ … … 3679 3677 3680 3678 /* Get corresponding extra-data: */ 3681 const QStringList data = extraDataStringList(strKey, strID);3679 const QStringList data = extraDataStringList(strKey, aID); 3682 3680 3683 3681 /* Parse loaded data: */ … … 3697 3695 } 3698 3696 3699 void UIExtraDataManager::setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const Q String &strID)3697 void UIExtraDataManager::setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QUuid &aID) 3700 3698 { 3701 3699 /* Choose corresponding key: */ … … 3708 3706 3709 3707 /* Re-cache corresponding extra-data: */ 3710 setExtraDataStringList(strKey, data, strID);3711 } 3712 3713 int UIExtraDataManager::hostScreenForPassedGuestScreen(int iGuestScreenIndex, const Q String &strID)3708 setExtraDataStringList(strKey, data, aID); 3709 } 3710 3711 int UIExtraDataManager::hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QUuid &aID) 3714 3712 { 3715 3713 /* Choose corresponding key: */ … … 3717 3715 3718 3716 /* Get value and convert it to index: */ 3719 const QString strValue = extraDataString(strKey, strID);3717 const QString strValue = extraDataString(strKey, aID); 3720 3718 bool fOk = false; 3721 3719 const int iHostScreenIndex = strValue.toULong(&fOk); … … 3725 3723 } 3726 3724 3727 void UIExtraDataManager::setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const Q String &strID)3725 void UIExtraDataManager::setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QUuid &aID) 3728 3726 { 3729 3727 /* Choose corresponding key: */ … … 3731 3729 3732 3730 /* Save passed index under corresponding value: */ 3733 setExtraDataString(strKey, iHostScreenIndex != -1 ? QString::number(iHostScreenIndex) : QString(), strID);3734 } 3735 3736 bool UIExtraDataManager::autoMountGuestScreensEnabled(const Q String &strID)3731 setExtraDataString(strKey, iHostScreenIndex != -1 ? QString::number(iHostScreenIndex) : QString(), aID); 3732 } 3733 3734 bool UIExtraDataManager::autoMountGuestScreensEnabled(const QUuid &aID) 3737 3735 { 3738 3736 /* Show only if 'allowed' flag is set: */ 3739 return isFeatureAllowed(GUI_AutomountGuestScreens, strID);3737 return isFeatureAllowed(GUI_AutomountGuestScreens, aID); 3740 3738 } 3741 3739 3742 3740 #ifdef VBOX_WITH_VIDEOHWACCEL 3743 bool UIExtraDataManager::useLinearStretch(const Q String &strID)3741 bool UIExtraDataManager::useLinearStretch(const QUuid &aID) 3744 3742 { 3745 3743 /* 'True' unless feature restricted: */ 3746 return !isFeatureRestricted(GUI_Accelerate2D_StretchLinear, strID);3747 } 3748 3749 bool UIExtraDataManager::usePixelFormatYV12(const Q String &strID)3744 return !isFeatureRestricted(GUI_Accelerate2D_StretchLinear, aID); 3745 } 3746 3747 bool UIExtraDataManager::usePixelFormatYV12(const QUuid &aID) 3750 3748 { 3751 3749 /* 'True' unless feature restricted: */ 3752 return !isFeatureRestricted(GUI_Accelerate2D_PixformatYV12, strID);3753 } 3754 3755 bool UIExtraDataManager::usePixelFormatUYVY(const Q String &strID)3750 return !isFeatureRestricted(GUI_Accelerate2D_PixformatYV12, aID); 3751 } 3752 3753 bool UIExtraDataManager::usePixelFormatUYVY(const QUuid &aID) 3756 3754 { 3757 3755 /* 'True' unless feature restricted: */ 3758 return !isFeatureRestricted(GUI_Accelerate2D_PixformatUYVY, strID);3759 } 3760 3761 bool UIExtraDataManager::usePixelFormatYUY2(const Q String &strID)3756 return !isFeatureRestricted(GUI_Accelerate2D_PixformatUYVY, aID); 3757 } 3758 3759 bool UIExtraDataManager::usePixelFormatYUY2(const QUuid &aID) 3762 3760 { 3763 3761 /* 'True' unless feature restricted: */ 3764 return !isFeatureRestricted(GUI_Accelerate2D_PixformatYUY2, strID);3765 } 3766 3767 bool UIExtraDataManager::usePixelFormatAYUV(const Q String &strID)3762 return !isFeatureRestricted(GUI_Accelerate2D_PixformatYUY2, aID); 3763 } 3764 3765 bool UIExtraDataManager::usePixelFormatAYUV(const QUuid &aID) 3768 3766 { 3769 3767 /* 'True' unless feature restricted: */ 3770 return !isFeatureRestricted(GUI_Accelerate2D_PixformatAYUV, strID);3768 return !isFeatureRestricted(GUI_Accelerate2D_PixformatAYUV, aID); 3771 3769 } 3772 3770 #endif /* VBOX_WITH_VIDEOHWACCEL */ 3773 3771 3774 3772 #ifndef VBOX_WS_MAC 3775 bool UIExtraDataManager::miniToolbarEnabled(const Q String &strID)3773 bool UIExtraDataManager::miniToolbarEnabled(const QUuid &aID) 3776 3774 { 3777 3775 /* 'True' unless feature restricted: */ 3778 return !isFeatureRestricted(GUI_ShowMiniToolBar, strID);3779 } 3780 3781 void UIExtraDataManager::setMiniToolbarEnabled(bool fEnabled, const Q String &strID)3776 return !isFeatureRestricted(GUI_ShowMiniToolBar, aID); 3777 } 3778 3779 void UIExtraDataManager::setMiniToolbarEnabled(bool fEnabled, const QUuid &aID) 3782 3780 { 3783 3781 /* 'False' if feature restricted, null-string otherwise: */ 3784 setExtraDataString(GUI_ShowMiniToolBar, toFeatureRestricted(!fEnabled), strID);3785 } 3786 3787 bool UIExtraDataManager::autoHideMiniToolbar(const Q String &strID)3782 setExtraDataString(GUI_ShowMiniToolBar, toFeatureRestricted(!fEnabled), aID); 3783 } 3784 3785 bool UIExtraDataManager::autoHideMiniToolbar(const QUuid &aID) 3788 3786 { 3789 3787 /* 'True' unless feature restricted: */ 3790 return !isFeatureRestricted(GUI_MiniToolBarAutoHide, strID);3791 } 3792 3793 void UIExtraDataManager::setAutoHideMiniToolbar(bool fAutoHide, const Q String &strID)3788 return !isFeatureRestricted(GUI_MiniToolBarAutoHide, aID); 3789 } 3790 3791 void UIExtraDataManager::setAutoHideMiniToolbar(bool fAutoHide, const QUuid &aID) 3794 3792 { 3795 3793 /* 'False' if feature restricted, null-string otherwise: */ 3796 setExtraDataString(GUI_MiniToolBarAutoHide, toFeatureRestricted(!fAutoHide), strID);3797 } 3798 3799 Qt::AlignmentFlag UIExtraDataManager::miniToolbarAlignment(const Q String &strID)3794 setExtraDataString(GUI_MiniToolBarAutoHide, toFeatureRestricted(!fAutoHide), aID); 3795 } 3796 3797 Qt::AlignmentFlag UIExtraDataManager::miniToolbarAlignment(const QUuid &aID) 3800 3798 { 3801 3799 /* Return Qt::AlignBottom unless MiniToolbarAlignment_Top specified separately: */ 3802 switch (gpConverter->fromInternalString<MiniToolbarAlignment>(extraDataString(GUI_MiniToolBarAlignment, strID)))3800 switch (gpConverter->fromInternalString<MiniToolbarAlignment>(extraDataString(GUI_MiniToolBarAlignment, aID))) 3803 3801 { 3804 3802 case MiniToolbarAlignment_Top: return Qt::AlignTop; … … 3808 3806 } 3809 3807 3810 void UIExtraDataManager::setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const Q String &strID)3808 void UIExtraDataManager::setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QUuid &aID) 3811 3809 { 3812 3810 /* Remove record unless Qt::AlignTop specified separately: */ 3813 3811 switch (alignment) 3814 3812 { 3815 case Qt::AlignTop: setExtraDataString(GUI_MiniToolBarAlignment, gpConverter->toInternalString(MiniToolbarAlignment_Top), strID); return;3813 case Qt::AlignTop: setExtraDataString(GUI_MiniToolBarAlignment, gpConverter->toInternalString(MiniToolbarAlignment_Top), aID); return; 3816 3814 default: break; 3817 3815 } 3818 setExtraDataString(GUI_MiniToolBarAlignment, QString(), strID);3816 setExtraDataString(GUI_MiniToolBarAlignment, QString(), aID); 3819 3817 } 3820 3818 #endif /* VBOX_WS_MAC */ 3821 3819 3822 bool UIExtraDataManager::statusBarEnabled(const Q String &strID)3820 bool UIExtraDataManager::statusBarEnabled(const QUuid &aID) 3823 3821 { 3824 3822 /* 'True' unless feature restricted: */ 3825 return !isFeatureRestricted(GUI_StatusBar_Enabled, strID);3826 } 3827 3828 void UIExtraDataManager::setStatusBarEnabled(bool fEnabled, const Q String &strID)3823 return !isFeatureRestricted(GUI_StatusBar_Enabled, aID); 3824 } 3825 3826 void UIExtraDataManager::setStatusBarEnabled(bool fEnabled, const QUuid &aID) 3829 3827 { 3830 3828 /* 'False' if feature restricted, null-string otherwise: */ 3831 setExtraDataString(GUI_StatusBar_Enabled, toFeatureRestricted(!fEnabled), strID);3832 } 3833 3834 bool UIExtraDataManager::statusBarContextMenuEnabled(const Q String &strID)3829 setExtraDataString(GUI_StatusBar_Enabled, toFeatureRestricted(!fEnabled), aID); 3830 } 3831 3832 bool UIExtraDataManager::statusBarContextMenuEnabled(const QUuid &aID) 3835 3833 { 3836 3834 /* 'True' unless feature restricted: */ 3837 return !isFeatureRestricted(GUI_StatusBar_ContextMenu_Enabled, strID);3838 } 3839 3840 void UIExtraDataManager::setStatusBarContextMenuEnabled(bool fEnabled, const Q String &strID)3835 return !isFeatureRestricted(GUI_StatusBar_ContextMenu_Enabled, aID); 3836 } 3837 3838 void UIExtraDataManager::setStatusBarContextMenuEnabled(bool fEnabled, const QUuid &aID) 3841 3839 { 3842 3840 /* 'False' if feature restricted, null-string otherwise: */ 3843 setExtraDataString(GUI_StatusBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), strID);3844 } 3845 3846 QList<IndicatorType> UIExtraDataManager::restrictedStatusBarIndicators(const Q String &strID)3841 setExtraDataString(GUI_StatusBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), aID); 3842 } 3843 3844 QList<IndicatorType> UIExtraDataManager::restrictedStatusBarIndicators(const QUuid &aID) 3847 3845 { 3848 3846 /* Prepare result: */ 3849 3847 QList<IndicatorType> result; 3850 3848 /* Get restricted status-bar indicators: */ 3851 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedStatusBarIndicators, strID))3849 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedStatusBarIndicators, aID)) 3852 3850 { 3853 3851 const IndicatorType value = gpConverter->fromInternalString<IndicatorType>(strValue); … … 3859 3857 } 3860 3858 3861 void UIExtraDataManager::setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const Q String &strID)3859 void UIExtraDataManager::setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QUuid &aID) 3862 3860 { 3863 3861 /* Parse passed list: */ … … 3867 3865 3868 3866 /* Re-cache corresponding extra-data: */ 3869 setExtraDataStringList(GUI_RestrictedStatusBarIndicators, data, strID);3870 } 3871 3872 QList<IndicatorType> UIExtraDataManager::statusBarIndicatorOrder(const Q String &strID)3867 setExtraDataStringList(GUI_RestrictedStatusBarIndicators, data, aID); 3868 } 3869 3870 QList<IndicatorType> UIExtraDataManager::statusBarIndicatorOrder(const QUuid &aID) 3873 3871 { 3874 3872 /* Prepare result: */ 3875 3873 QList<IndicatorType> result; 3876 3874 /* Get status-bar indicator order: */ 3877 foreach (const QString &strValue, extraDataStringList(GUI_StatusBar_IndicatorOrder, strID))3875 foreach (const QString &strValue, extraDataStringList(GUI_StatusBar_IndicatorOrder, aID)) 3878 3876 { 3879 3877 const IndicatorType value = gpConverter->fromInternalString<IndicatorType>(strValue); … … 3917 3915 } 3918 3916 3919 void UIExtraDataManager::setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const Q String &strID)3917 void UIExtraDataManager::setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QUuid &aID) 3920 3918 { 3921 3919 /* Parse passed list: */ … … 3925 3923 3926 3924 /* Re-cache corresponding extra-data: */ 3927 setExtraDataStringList(GUI_StatusBar_IndicatorOrder, data, strID);3925 setExtraDataStringList(GUI_StatusBar_IndicatorOrder, data, aID); 3928 3926 } 3929 3927 3930 3928 #ifdef VBOX_WS_MAC 3931 bool UIExtraDataManager::realtimeDockIconUpdateEnabled(const Q String &strID)3929 bool UIExtraDataManager::realtimeDockIconUpdateEnabled(const QUuid &aID) 3932 3930 { 3933 3931 /* 'True' unless feature restricted: */ 3934 return !isFeatureRestricted(GUI_RealtimeDockIconUpdateEnabled, strID);3935 } 3936 3937 void UIExtraDataManager::setRealtimeDockIconUpdateEnabled(bool fEnabled, const Q String &strID)3932 return !isFeatureRestricted(GUI_RealtimeDockIconUpdateEnabled, aID); 3933 } 3934 3935 void UIExtraDataManager::setRealtimeDockIconUpdateEnabled(bool fEnabled, const QUuid &aID) 3938 3936 { 3939 3937 /* 'False' if feature restricted, null-string otherwise: */ 3940 setExtraDataString(GUI_RealtimeDockIconUpdateEnabled, toFeatureRestricted(!fEnabled), strID);3941 } 3942 3943 int UIExtraDataManager::realtimeDockIconUpdateMonitor(const Q String &strID)3944 { 3945 return extraDataString(GUI_RealtimeDockIconUpdateMonitor, strID).toInt();3946 } 3947 3948 void UIExtraDataManager::setRealtimeDockIconUpdateMonitor(int iIndex, const Q String &strID)3949 { 3950 setExtraDataString(GUI_RealtimeDockIconUpdateMonitor, iIndex ? QString::number(iIndex) : QString(), strID);3951 } 3952 3953 bool UIExtraDataManager::dockIconDisableOverlay(const Q String &strID)3938 setExtraDataString(GUI_RealtimeDockIconUpdateEnabled, toFeatureRestricted(!fEnabled), aID); 3939 } 3940 3941 int UIExtraDataManager::realtimeDockIconUpdateMonitor(const QUuid &aID) 3942 { 3943 return extraDataString(GUI_RealtimeDockIconUpdateMonitor, aID).toInt(); 3944 } 3945 3946 void UIExtraDataManager::setRealtimeDockIconUpdateMonitor(int iIndex, const QUuid &aID) 3947 { 3948 setExtraDataString(GUI_RealtimeDockIconUpdateMonitor, iIndex ? QString::number(iIndex) : QString(), aID); 3949 } 3950 3951 bool UIExtraDataManager::dockIconDisableOverlay(const QUuid &aID) 3954 3952 { 3955 3953 /* 'False' unless feature allowed: */ 3956 return isFeatureAllowed(GUI_DockIconDisableOverlay, strID);3957 } 3958 3959 void UIExtraDataManager::setDockIconDisableOverlay(bool fDisabled, const Q String &strID)3954 return isFeatureAllowed(GUI_DockIconDisableOverlay, aID); 3955 } 3956 3957 void UIExtraDataManager::setDockIconDisableOverlay(bool fDisabled, const QUuid &aID) 3960 3958 { 3961 3959 /* 'True' if feature allowed, null-string otherwise: */ 3962 setExtraDataString(GUI_DockIconDisableOverlay, toFeatureAllowed(fDisabled), strID);3960 setExtraDataString(GUI_DockIconDisableOverlay, toFeatureAllowed(fDisabled), aID); 3963 3961 } 3964 3962 #endif /* VBOX_WS_MAC */ 3965 3963 3966 bool UIExtraDataManager::passCADtoGuest(const Q String &strID)3964 bool UIExtraDataManager::passCADtoGuest(const QUuid &aID) 3967 3965 { 3968 3966 /* 'False' unless feature allowed: */ 3969 return isFeatureAllowed(GUI_PassCAD, strID);3970 } 3971 3972 MouseCapturePolicy UIExtraDataManager::mouseCapturePolicy(const Q String &strID)3973 { 3974 return gpConverter->fromInternalString<MouseCapturePolicy>(extraDataString(GUI_MouseCapturePolicy, strID));3975 } 3976 3977 GuruMeditationHandlerType UIExtraDataManager::guruMeditationHandlerType(const Q String &strID)3978 { 3979 return gpConverter->fromInternalString<GuruMeditationHandlerType>(extraDataString(GUI_GuruMeditationHandler, strID));3980 } 3981 3982 bool UIExtraDataManager::hidLedsSyncState(const Q String &strID)3967 return isFeatureAllowed(GUI_PassCAD, aID); 3968 } 3969 3970 MouseCapturePolicy UIExtraDataManager::mouseCapturePolicy(const QUuid &aID) 3971 { 3972 return gpConverter->fromInternalString<MouseCapturePolicy>(extraDataString(GUI_MouseCapturePolicy, aID)); 3973 } 3974 3975 GuruMeditationHandlerType UIExtraDataManager::guruMeditationHandlerType(const QUuid &aID) 3976 { 3977 return gpConverter->fromInternalString<GuruMeditationHandlerType>(extraDataString(GUI_GuruMeditationHandler, aID)); 3978 } 3979 3980 bool UIExtraDataManager::hidLedsSyncState(const QUuid &aID) 3983 3981 { 3984 3982 /* 'True' unless feature restricted: */ 3985 return !isFeatureRestricted(GUI_HidLedsSync, strID);3986 } 3987 3988 double UIExtraDataManager::scaleFactor(const int uScreenIndex, const Q String &strID /* = GlobalID */)3983 return !isFeatureRestricted(GUI_HidLedsSync, aID); 3984 } 3985 3986 double UIExtraDataManager::scaleFactor(const int uScreenIndex, const QUuid &aID /* = GlobalID */) 3989 3987 { 3990 3988 /* Get corresponding extra-data for this machine: */ 3991 QStringList data = extraDataStringList(GUI_ScaleFactor, strID);3989 QStringList data = extraDataStringList(GUI_ScaleFactor, aID); 3992 3990 3993 3991 /* If that fails check the global scale factor: */ … … 4011 4009 } 4012 4010 4013 QList<double> UIExtraDataManager::scaleFactors(const Q String &strID /* = GlobalID */)4011 QList<double> UIExtraDataManager::scaleFactors(const QUuid &aID /* = GlobalID */) 4014 4012 { 4015 4013 /* Look for the scale factor for this machine first: */ 4016 QStringList data = extraDataStringList(GUI_ScaleFactor, strID);4014 QStringList data = extraDataStringList(GUI_ScaleFactor, aID); 4017 4015 4018 4016 /* then looks for the global scale factors: */ … … 4040 4038 } 4041 4039 4042 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const int uScreenIndex, const Q String &strID /* = GlobalID */)4043 { 4044 QStringList data = extraDataStringList(GUI_ScaleFactor, strID);4040 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const int uScreenIndex, const QUuid &aID /* = GlobalID */) 4041 { 4042 QStringList data = extraDataStringList(GUI_ScaleFactor, aID); 4045 4043 4046 4044 /* Just make sure that we have corresponding data item: */ … … 4054 4052 data[uScreenIndex] = QString::number(dScaleFactor); 4055 4053 4056 setExtraDataStringList(GUI_ScaleFactor, data, strID);4057 } 4058 4059 void UIExtraDataManager::setScaleFactors(const QList<double> &scaleFactors, const Q String &strID /* = GlobalID */)4054 setExtraDataStringList(GUI_ScaleFactor, data, aID); 4055 } 4056 4057 void UIExtraDataManager::setScaleFactors(const QList<double> &scaleFactors, const QUuid &aID /* = GlobalID */) 4060 4058 { 4061 4059 QStringList data; 4062 4060 for (int i = 0; i < scaleFactors.size(); ++i) 4063 4061 data.append(QString::number(scaleFactors[i])); 4064 setExtraDataStringList(GUI_ScaleFactor, data, strID);4065 } 4066 4067 ScalingOptimizationType UIExtraDataManager::scalingOptimizationType(const Q String &strID)4068 { 4069 return gpConverter->fromInternalString<ScalingOptimizationType>(extraDataString(GUI_Scaling_Optimization, strID));4070 } 4071 4072 QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const Q String &strID)4062 setExtraDataStringList(GUI_ScaleFactor, data, aID); 4063 } 4064 4065 ScalingOptimizationType UIExtraDataManager::scalingOptimizationType(const QUuid &aID) 4066 { 4067 return gpConverter->fromInternalString<ScalingOptimizationType>(extraDataString(GUI_Scaling_Optimization, aID)); 4068 } 4069 4070 QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QUuid &aID) 4073 4071 { 4074 4072 /* Get corresponding extra-data: */ 4075 const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, strID);4073 const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, aID); 4076 4074 4077 4075 /* Parse loaded data: */ … … 4120 4118 } 4121 4119 4122 bool UIExtraDataManager::informationWindowShouldBeMaximized(const Q String &strID)4120 bool UIExtraDataManager::informationWindowShouldBeMaximized(const QUuid &aID) 4123 4121 { 4124 4122 /* Get corresponding extra-data: */ 4125 const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, strID);4123 const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, aID); 4126 4124 4127 4125 /* Make sure 5th item has required value: */ … … 4129 4127 } 4130 4128 4131 void UIExtraDataManager::setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const Q String &strID)4129 void UIExtraDataManager::setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QUuid &aID) 4132 4130 { 4133 4131 /* Serialize passed values: */ … … 4141 4139 4142 4140 /* Re-cache corresponding extra-data: */ 4143 setExtraDataStringList(GUI_InformationWindowGeometry, data, strID);4141 setExtraDataStringList(GUI_InformationWindowGeometry, data, aID); 4144 4142 } 4145 4143 … … 4235 4233 } 4236 4234 4237 MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const Q String &strID)4238 { 4239 return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_DefaultCloseAction, strID));4240 } 4241 4242 MachineCloseAction UIExtraDataManager::restrictedMachineCloseActions(const Q String &strID)4235 MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QUuid &aID) 4236 { 4237 return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_DefaultCloseAction, aID)); 4238 } 4239 4240 MachineCloseAction UIExtraDataManager::restrictedMachineCloseActions(const QUuid &aID) 4243 4241 { 4244 4242 /* Prepare result: */ 4245 4243 MachineCloseAction result = MachineCloseAction_Invalid; 4246 4244 /* Get restricted machine-close-actions: */ 4247 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedCloseActions, strID))4245 foreach (const QString &strValue, extraDataStringList(GUI_RestrictedCloseActions, aID)) 4248 4246 { 4249 4247 MachineCloseAction value = gpConverter->fromInternalString<MachineCloseAction>(strValue); … … 4255 4253 } 4256 4254 4257 MachineCloseAction UIExtraDataManager::lastMachineCloseAction(const Q String &strID)4258 { 4259 return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_LastCloseAction, strID));4260 } 4261 4262 void UIExtraDataManager::setLastMachineCloseAction(MachineCloseAction machineCloseAction, const Q String &strID)4263 { 4264 setExtraDataString(GUI_LastCloseAction, gpConverter->toInternalString(machineCloseAction), strID);4265 } 4266 4267 QString UIExtraDataManager::machineCloseHookScript(const Q String &strID)4268 { 4269 return extraDataString(GUI_CloseActionHook, strID);4255 MachineCloseAction UIExtraDataManager::lastMachineCloseAction(const QUuid &aID) 4256 { 4257 return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_LastCloseAction, aID)); 4258 } 4259 4260 void UIExtraDataManager::setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QUuid &aID) 4261 { 4262 setExtraDataString(GUI_LastCloseAction, gpConverter->toInternalString(machineCloseAction), aID); 4263 } 4264 4265 QString UIExtraDataManager::machineCloseHookScript(const QUuid &aID) 4266 { 4267 return extraDataString(GUI_CloseActionHook, aID); 4270 4268 } 4271 4269 … … 4523 4521 } 4524 4522 4525 void UIExtraDataManager::sltExtraDataChange( QString strMachineID, QString strKey, QStringstrValue)4523 void UIExtraDataManager::sltExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue) 4526 4524 { 4527 4525 /* Re-cache value only if strMachineID known already: */ 4528 if (m_data.contains( strMachineID))4526 if (m_data.contains(aMachineID)) 4529 4527 { 4530 4528 if (!strValue.isEmpty()) 4531 m_data[ strMachineID][strKey] = strValue;4529 m_data[aMachineID][strKey] = strValue; 4532 4530 else 4533 m_data[ strMachineID].remove(strKey);4531 m_data[aMachineID].remove(strKey); 4534 4532 } 4535 4533 4536 4534 /* Global extra-data 'change' event: */ 4537 if ( strMachineID == GlobalID)4535 if (aMachineID == GlobalID) 4538 4536 { 4539 4537 if (strKey.startsWith("GUI/")) … … 4558 4556 /* Current VM only: */ 4559 4557 if ( vboxGlobal().isVMConsoleProcess() 4560 && strMachineID == vboxGlobal().managedVMUuid())4558 && aMachineID == vboxGlobal().managedVMUuid()) 4561 4559 { 4562 4560 /* HID LEDs sync state changed (allowed if not restricted)? */ 4563 4561 if (strKey == GUI_HidLedsSync) 4564 emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, strMachineID));4562 emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, aMachineID)); 4565 4563 #ifdef VBOX_WS_MAC 4566 4564 /* 'Dock icon' appearance changed (allowed if not restricted)? */ 4567 4565 else if (strKey == GUI_RealtimeDockIconUpdateEnabled || 4568 4566 strKey == GUI_RealtimeDockIconUpdateMonitor) 4569 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID));4567 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, aMachineID)); 4570 4568 /* 'Dock icon overlay' appearance changed (restricted if not allowed)? */ 4571 4569 else if (strKey == GUI_DockIconDisableOverlay) 4572 emit sigDockIconOverlayAppearanceChange(isFeatureAllowed(strKey, strMachineID));4570 emit sigDockIconOverlayAppearanceChange(isFeatureAllowed(strKey, aMachineID)); 4573 4571 #endif /* VBOX_WS_MAC */ 4574 4572 } … … 4592 4590 #endif /* VBOX_WS_MAC */ 4593 4591 strKey == GUI_RestrictedRuntimeHelpMenuActions) 4594 emit sigMenuBarConfigurationChange( strMachineID);4592 emit sigMenuBarConfigurationChange(aMachineID); 4595 4593 /* Status-bar configuration change: */ 4596 4594 else if (strKey == GUI_StatusBar_Enabled || 4597 4595 strKey == GUI_RestrictedStatusBarIndicators || 4598 4596 strKey == GUI_StatusBar_IndicatorOrder) 4599 emit sigStatusBarConfigurationChange( strMachineID);4597 emit sigStatusBarConfigurationChange(aMachineID); 4600 4598 /* Scale-factor change: */ 4601 4599 else if (strKey ==GUI_ScaleFactor) 4602 emit sigScaleFactorChange( strMachineID);4600 emit sigScaleFactorChange(aMachineID); 4603 4601 /* Scaling optimization type change: */ 4604 4602 else if (strKey == GUI_Scaling_Optimization) 4605 emit sigScalingOptimizationTypeChange( strMachineID);4603 emit sigScalingOptimizationTypeChange(aMachineID); 4606 4604 } 4607 4605 4608 4606 /* Notify listeners: */ 4609 emit sigExtraDataChange( strMachineID, strKey, strValue);4607 emit sigExtraDataChange(aMachineID, strKey, strValue); 4610 4608 } 4611 4609 … … 4688 4686 #endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */ 4689 4687 4690 QString UIExtraDataManager::extraDataStringUnion(const QString &strKey, const Q String &strID)4688 QString UIExtraDataManager::extraDataStringUnion(const QString &strKey, const QUuid &aID) 4691 4689 { 4692 4690 /* If passed strID differs from the GlobalID: */ 4693 if ( strID != GlobalID)4691 if (aID != GlobalID) 4694 4692 { 4695 4693 /* Search through the machine extra-data first: */ 4696 MapOfExtraDataMaps::const_iterator itMap = m_data.constFind( strID);4694 MapOfExtraDataMaps::const_iterator itMap = m_data.constFind(aID); 4697 4695 /* Hot-load machine extra-data map if necessary: */ 4698 4696 if (itMap == m_data.constEnd()) 4699 4697 { 4700 hotloadMachineExtraDataMap( strID);4701 itMap = m_data.constFind( strID);4698 hotloadMachineExtraDataMap(aID); 4699 itMap = m_data.constFind(aID); 4702 4700 } 4703 4701 if (itMap != m_data.constEnd()) … … 4724 4722 } 4725 4723 4726 bool UIExtraDataManager::isFeatureAllowed(const QString &strKey, const Q String &strID /* = GlobalID */)4724 bool UIExtraDataManager::isFeatureAllowed(const QString &strKey, const QUuid &aID /* = GlobalID */) 4727 4725 { 4728 4726 /* Get the value. Return 'false' if not found: */ 4729 const QString strValue = extraDataStringUnion(strKey, strID);4727 const QString strValue = extraDataStringUnion(strKey, aID); 4730 4728 if (strValue.isNull()) 4731 4729 return false; … … 4738 4736 } 4739 4737 4740 bool UIExtraDataManager::isFeatureRestricted(const QString &strKey, const Q String &strID /* = GlobalID */)4738 bool UIExtraDataManager::isFeatureRestricted(const QString &strKey, const QUuid &aID /* = GlobalID */) 4741 4739 { 4742 4740 /* Get the value. Return 'false' if not found: */ 4743 const QString strValue = extraDataStringUnion(strKey, strID);4741 const QString strValue = extraDataStringUnion(strKey, aID); 4744 4742 if (strValue.isNull()) 4745 4743 return false; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r74872 r74878 23 23 #include <QObject> 24 24 #include <QSize> 25 #include <QUuid> 25 26 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 26 27 # include <QPointer> … … 38 39 /** Defines the map of extra data values. The index is an extra-data key. */ 39 40 typedef QMap<QString, QString> ExtraDataMap; 40 /** Defines the map of extra data maps. The index is a UUID string.*/41 typedef QMap<Q String, ExtraDataMap> MapOfExtraDataMaps;41 /** Defines the map of extra data maps. */ 42 typedef QMap<QUuid, ExtraDataMap> MapOfExtraDataMaps; 42 43 43 44 /** Singleton QObject extension … … 56 57 57 58 /** Notifies about extra-data map acknowledging. */ 58 void sigExtraDataMapAcknowledging( QString strID);59 void sigExtraDataMapAcknowledging(const QUuid &aID); 59 60 60 61 /** Notifies about extra-data change. */ 61 void sigExtraDataChange( QString strID, QString strKey, QStringstrValue);62 void sigExtraDataChange(const QUuid &aID, const QString &strKey, const QString &strValue); 62 63 63 64 /** Notifies about GUI language change. */ … … 72 73 73 74 /** Notifies about menu-bar configuration change. */ 74 void sigMenuBarConfigurationChange(const Q String &strMachineID);75 void sigMenuBarConfigurationChange(const QUuid &aMachineID); 75 76 /** Notifies about status-bar configuration change. */ 76 void sigStatusBarConfigurationChange(const Q String &strMachineID);77 void sigStatusBarConfigurationChange(const QUuid &aMachineID); 77 78 78 79 /** Notifies about HID LEDs synchronization state change. */ … … 80 81 81 82 /** Notifies about the scale-factor change. */ 82 void sigScaleFactorChange(const Q String &strMachineID);83 void sigScaleFactorChange(const QUuid &aMachineID); 83 84 84 85 /** Notifies about the scaling optimization type change. */ 85 void sigScalingOptimizationTypeChange(const Q String &strMachineID);86 void sigScalingOptimizationTypeChange(const QUuid &aMachineID); 86 87 87 88 #ifdef VBOX_WS_MAC 88 89 /** Notifies about the HiDPI optimization type change. */ 89 void sigHiDPIOptimizationTypeChange(const Q String &strMachineID);90 void sigHiDPIOptimizationTypeChange(const QUuid &aMachineID); 90 91 91 92 /** Mac OS X: Notifies about 'dock icon' appearance change. */ … … 98 99 99 100 /** Global extra-data ID. */ 100 static const Q StringGlobalID;101 static const QUuid GlobalID; 101 102 102 103 /** Static Extra-data Manager instance/constructor. */ … … 113 114 * @{ */ 114 115 /** Returns whether Extra-data Manager cached the map with passed @a strID. */ 115 bool contains(const Q String &strID) const { return m_data.contains(strID); }116 bool contains(const QUuid &aID) const { return m_data.contains(aID); } 116 117 /** Returns read-only extra-data map for passed @a strID. */ 117 const ExtraDataMap map(const Q String &strID) const { return m_data.value(strID); }118 const ExtraDataMap map(const QUuid &aID) const { return m_data.value(aID); } 118 119 119 120 /** Hot-load machine extra-data map. */ 120 void hotloadMachineExtraDataMap(const Q String &strID);121 void hotloadMachineExtraDataMap(const QUuid &aID); 121 122 122 123 /** Returns extra-data value corresponding to passed @a strKey as QString. 123 124 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */ 124 QString extraDataString(const QString &strKey, const Q String &strID = GlobalID);125 QString extraDataString(const QString &strKey, const QUuid &aID = GlobalID); 125 126 /** Defines extra-data value corresponding to passed @a strKey as strValue. 126 127 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */ 127 void setExtraDataString(const QString &strKey, const QString &strValue, const Q String &strID = GlobalID);128 void setExtraDataString(const QString &strKey, const QString &strValue, const QUuid &aID = GlobalID); 128 129 129 130 /** Returns extra-data value corresponding to passed @a strKey as QStringList. 130 131 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */ 131 QStringList extraDataStringList(const QString &strKey, const Q String &strID = GlobalID);132 QStringList extraDataStringList(const QString &strKey, const QUuid &aID = GlobalID); 132 133 /** Defines extra-data value corresponding to passed @a strKey as value. 133 134 * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */ 134 void setExtraDataStringList(const QString &strKey, const QStringList &value, const Q String &strID = GlobalID);135 void setExtraDataStringList(const QString &strKey, const QStringList &value, const QUuid &aID = GlobalID); 135 136 /** @} */ 136 137 … … 144 145 * @{ */ 145 146 /** Returns the list of supressed messages for the Message/Popup center frameworks. */ 146 QStringList suppressedMessages(const Q String &strID = GlobalID);147 QStringList suppressedMessages(const QUuid &aID = GlobalID); 147 148 /** Defines the @a list of supressed messages for the Message/Popup center frameworks. */ 148 149 void setSuppressedMessages(const QStringList &list); … … 189 190 QList<GlobalSettingsPageType> restrictedGlobalSettingsPages(); 190 191 /** Returns restricted machine settings pages. */ 191 QList<MachineSettingsPageType> restrictedMachineSettingsPages(const Q String &strID);192 QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QUuid &aID); 192 193 /** @} */ 193 194 … … 395 396 * @{ */ 396 397 /** Returns whether machine should be shown in selector-window chooser-pane. */ 397 bool showMachineInSelectorChooser(const Q String &strID);398 bool showMachineInSelectorChooser(const QUuid &aID); 398 399 /** Returns whether machine should be shown in selector-window details-pane. */ 399 bool showMachineInSelectorDetails(const Q String &strID);400 bool showMachineInSelectorDetails(const QUuid &aID); 400 401 401 402 /** Returns whether machine reconfiguration enabled. */ 402 bool machineReconfigurationEnabled(const Q String &strID);403 bool machineReconfigurationEnabled(const QUuid &aID); 403 404 /** Returns whether machine snapshot operations enabled. */ 404 bool machineSnapshotOperationsEnabled(const Q String &strID);405 bool machineSnapshotOperationsEnabled(const QUuid &aID); 405 406 406 407 /** Returns whether this machine is first time started. */ 407 bool machineFirstTimeStarted(const Q String &strID);408 bool machineFirstTimeStarted(const QUuid &aID); 408 409 /** Returns whether this machine is fFirstTimeStarted. */ 409 void setMachineFirstTimeStarted(bool fFirstTimeStarted, const Q String &strID);410 void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QUuid &aID); 410 411 411 412 /** Except Mac OS X: Returns redefined machine-window icon names. */ 412 QStringList machineWindowIconNames(const Q String &strID);413 QStringList machineWindowIconNames(const QUuid &aID); 413 414 #ifndef VBOX_WS_MAC 414 415 /** Except Mac OS X: Returns redefined machine-window name postfix. */ 415 QString machineWindowNamePostfix(const Q String &strID);416 QString machineWindowNamePostfix(const QUuid &aID); 416 417 #endif 417 418 418 419 /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */ 419 QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const Q String &strID);420 QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &sID); 420 421 /** Returns whether machine-window with @a uScreenIndex in @a visualStateType should be maximized. */ 421 bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const Q String &strID);422 bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &aID); 422 423 /** Defines @a geometry and @a fMaximized state for machine-window with @a uScreenIndex in @a visualStateType. */ 423 void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const Q String &strID);424 void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QUuid &aID); 424 425 425 426 #ifndef VBOX_WS_MAC 426 427 /** Returns whether Runtime UI menu-bar is enabled. */ 427 bool menuBarEnabled(const Q String &strID);428 bool menuBarEnabled(const QUuid &aID); 428 429 /** Defines whether Runtime UI menu-bar is @a fEnabled. */ 429 void setMenuBarEnabled(bool fEnabled, const Q String &strID);430 void setMenuBarEnabled(bool fEnabled, const QUuid &aID); 430 431 #endif /* !VBOX_WS_MAC */ 431 432 432 433 /** Returns whether Runtime UI menu-bar context-menu is enabled. */ 433 bool menuBarContextMenuEnabled(const Q String &strID);434 bool menuBarContextMenuEnabled(const QUuid &aID); 434 435 /** Defines whether Runtime UI menu-bar context-menu is @a fEnabled. */ 435 void setMenuBarContextMenuEnabled(bool fEnabled, const Q String &strID);436 void setMenuBarContextMenuEnabled(bool fEnabled, const QUuid &aID); 436 437 437 438 /** Returns restricted Runtime UI menu types. */ 438 UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const Q String &strID);439 UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QUuid &aID); 439 440 /** Defines restricted Runtime UI menu types. */ 440 void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const Q String &strID);441 void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QUuid &aID); 441 442 442 443 /** Returns restricted Runtime UI action types for Application menu. */ 443 UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const Q String &strID);444 UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QUuid &aID); 444 445 /** Defines restricted Runtime UI action types for Application menu. */ 445 void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const Q String &strID);446 void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QUuid &aID); 446 447 447 448 /** Returns restricted Runtime UI action types for Machine menu. */ 448 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const Q String &strID);449 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QUuid &aID); 449 450 /** Defines restricted Runtime UI action types for Machine menu. */ 450 void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const Q String &strID);451 void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QUuid &aID); 451 452 452 453 /** Returns restricted Runtime UI action types for View menu. */ 453 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const Q String &strID);454 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QUuid &aID); 454 455 /** Defines restricted Runtime UI action types for View menu. */ 455 void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const Q String &strID);456 void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QUuid &aID); 456 457 457 458 /** Returns restricted Runtime UI action types for Input menu. */ 458 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const Q String &strID);459 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QUuid &aID); 459 460 /** Defines restricted Runtime UI action types for Input menu. */ 460 void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const Q String &strID);461 void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QUuid &aID); 461 462 462 463 /** Returns restricted Runtime UI action types for Devices menu. */ 463 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const Q String &strID);464 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QUuid &aID); 464 465 /** Defines restricted Runtime UI action types for Devices menu. */ 465 void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const Q String &strID);466 void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QUuid &aID); 466 467 467 468 #ifdef VBOX_WITH_DEBUGGER_GUI 468 469 /** Returns restricted Runtime UI action types for Debugger menu. */ 469 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const Q String &strID);470 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QUuid &aID); 470 471 /** Defines restricted Runtime UI action types for Debugger menu. */ 471 void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const Q String &strID);472 void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QUuid &aID); 472 473 #endif /* VBOX_WITH_DEBUGGER_GUI */ 473 474 474 475 #ifdef VBOX_WS_MAC 475 476 /** Mac OS X: Returns restricted Runtime UI action types for Window menu. */ 476 UIExtraDataMetaDefs::MenuWindowActionType restrictedRuntimeMenuWindowActionTypes(const Q String &strID);477 UIExtraDataMetaDefs::MenuWindowActionType restrictedRuntimeMenuWindowActionTypes(const QUuid &aID); 477 478 /** Mac OS X: Defines restricted Runtime UI action types for Window menu. */ 478 void setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const Q String &strID);479 void setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QUuid &aID); 479 480 #endif /* VBOX_WS_MAC */ 480 481 481 482 /** Returns restricted Runtime UI action types for Help menu. */ 482 UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const Q String &strID);483 UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QUuid &aID); 483 484 /** Defines restricted Runtime UI action types for Help menu. */ 484 void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const Q String &strID);485 void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QUuid &aID); 485 486 486 487 /** Returns restricted Runtime UI visual-states. */ 487 UIVisualStateType restrictedVisualStates(const Q String &strID);488 UIVisualStateType restrictedVisualStates(const QUuid &aID); 488 489 489 490 /** Returns requested Runtime UI visual-state. */ 490 UIVisualStateType requestedVisualState(const Q String &strID);491 UIVisualStateType requestedVisualState(const QUuid &aID); 491 492 /** Defines requested Runtime UI visual-state as @a visualState. */ 492 void setRequestedVisualState(UIVisualStateType visualState, const Q String &strID);493 void setRequestedVisualState(UIVisualStateType visualState, const QUuid &aID); 493 494 494 495 #ifdef VBOX_WS_X11 … … 497 498 498 499 /** Returns whether internal machine-window name should be unique. */ 499 bool distinguishMachineWindowGroups(const Q String &strID);500 bool distinguishMachineWindowGroups(const QUuid &aID); 500 501 /** Defines whether internal machine-window name should be unique. */ 501 void setDistinguishMachineWindowGroups(const Q String &strID, bool fEnabled);502 void setDistinguishMachineWindowGroups(const QUuid &aID, bool fEnabled); 502 503 #endif /* VBOX_WS_X11 */ 503 504 504 505 /** Returns whether guest-screen auto-resize according machine-window size is enabled. */ 505 bool guestScreenAutoResizeEnabled(const Q String &strID);506 bool guestScreenAutoResizeEnabled(const QUuid &aID); 506 507 /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */ 507 void setGuestScreenAutoResizeEnabled(bool fEnabled, const Q String &strID);508 void setGuestScreenAutoResizeEnabled(bool fEnabled, const QUuid &aID); 508 509 509 510 /** Returns last guest-screen visibility status for screen with @a uScreenIndex. */ 510 bool lastGuestScreenVisibilityStatus(ulong uScreenIndex, const Q String &strID);511 bool lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QUuid &aID); 511 512 /** Defines whether last guest-screen visibility status was @a fEnabled for screen with @a uScreenIndex. */ 512 void setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const Q String &strID);513 void setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QUuid &aID); 513 514 514 515 /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */ 515 QSize lastGuestScreenSizeHint(ulong uScreenIndex, const Q String &strID);516 QSize lastGuestScreenSizeHint(ulong uScreenIndex, const QUuid &aID); 516 517 /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */ 517 void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const Q String &strID);518 void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QUuid &aID); 518 519 519 520 /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */ 520 int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const Q String &strID);521 int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QUuid &aID); 521 522 /** Defines @a iHostScreenIndex corresponding to passed guest-screen @a iGuestScreenIndex. */ 522 void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const Q String &strID);523 void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QUuid &aID); 523 524 524 525 /** Returns whether automatic mounting/unmounting of guest-screens enabled. */ 525 bool autoMountGuestScreensEnabled(const Q String &strID);526 bool autoMountGuestScreensEnabled(const QUuid &aID); 526 527 527 528 #ifdef VBOX_WITH_VIDEOHWACCEL 528 529 /** Returns whether 2D acceleration should use linear sretch. */ 529 bool useLinearStretch(const Q String &strID);530 bool useLinearStretch(const QUuid &aID); 530 531 /** Returns whether 2D acceleration should use YV12 pixel format. */ 531 bool usePixelFormatYV12(const Q String &strID);532 bool usePixelFormatYV12(const QUuid &aID); 532 533 /** Returns whether 2D acceleration should use UYVY pixel format. */ 533 bool usePixelFormatUYVY(const Q String &strID);534 bool usePixelFormatUYVY(const QUuid &aID); 534 535 /** Returns whether 2D acceleration should use YUY2 pixel format. */ 535 bool usePixelFormatYUY2(const Q String &strID);536 bool usePixelFormatYUY2(const QUuid &aID); 536 537 /** Returns whether 2D acceleration should use AYUV pixel format. */ 537 bool usePixelFormatAYUV(const Q String &strID);538 bool usePixelFormatAYUV(const QUuid &aID); 538 539 #endif /* VBOX_WITH_VIDEOHWACCEL */ 539 540 540 541 #ifndef VBOX_WS_MAC 541 542 /** Returns whether mini-toolbar is enabled for full and seamless screens. */ 542 bool miniToolbarEnabled(const Q String &strID);543 bool miniToolbarEnabled(const QUuid &aID); 543 544 /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */ 544 void setMiniToolbarEnabled(bool fEnabled, const Q String &strID);545 void setMiniToolbarEnabled(bool fEnabled, const QUuid &aID); 545 546 546 547 /** Returns whether mini-toolbar should auto-hide itself. */ 547 bool autoHideMiniToolbar(const Q String &strID);548 bool autoHideMiniToolbar(const QUuid &aID); 548 549 /** Defines whether mini-toolbar should @a fAutoHide itself. */ 549 void setAutoHideMiniToolbar(bool fAutoHide, const Q String &strID);550 void setAutoHideMiniToolbar(bool fAutoHide, const QUuid &aID); 550 551 551 552 /** Returns mini-toolbar alignment. */ 552 Qt::AlignmentFlag miniToolbarAlignment(const Q String &strID);553 Qt::AlignmentFlag miniToolbarAlignment(const QUuid &aID); 553 554 /** Returns mini-toolbar @a alignment. */ 554 void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const Q String &strID);555 void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QUuid &aID); 555 556 #endif /* VBOX_WS_MAC */ 556 557 557 558 /** Returns whether Runtime UI status-bar is enabled. */ 558 bool statusBarEnabled(const Q String &strID);559 bool statusBarEnabled(const QUuid &aID); 559 560 /** Defines whether Runtime UI status-bar is @a fEnabled. */ 560 void setStatusBarEnabled(bool fEnabled, const Q String &strID);561 void setStatusBarEnabled(bool fEnabled, const QUuid &aID); 561 562 562 563 /** Returns whether Runtime UI status-bar context-menu is enabled. */ 563 bool statusBarContextMenuEnabled(const Q String &strID);564 bool statusBarContextMenuEnabled(const QUuid &aID); 564 565 /** Defines whether Runtime UI status-bar context-menu is @a fEnabled. */ 565 void setStatusBarContextMenuEnabled(bool fEnabled, const Q String &strID);566 void setStatusBarContextMenuEnabled(bool fEnabled, const QUuid &aID); 566 567 567 568 /** Returns restricted Runtime UI status-bar indicator list. */ 568 QList<IndicatorType> restrictedStatusBarIndicators(const Q String &strID);569 QList<IndicatorType> restrictedStatusBarIndicators(const QUuid &aID); 569 570 /** Defines restricted Runtime UI status-bar indicator @a list. */ 570 void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const Q String &strID);571 void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QUuid &aID); 571 572 572 573 /** Returns Runtime UI status-bar indicator order list. */ 573 QList<IndicatorType> statusBarIndicatorOrder(const Q String &strID);574 QList<IndicatorType> statusBarIndicatorOrder(const QUuid &aID); 574 575 /** Defines Runtime UI status-bar indicator order @a list. */ 575 void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const Q String &strID);576 void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QUuid &aID); 576 577 577 578 #ifdef VBOX_WS_MAC 578 579 /** Mac OS X: Returns whether Dock icon should be updated at runtime. */ 579 bool realtimeDockIconUpdateEnabled(const Q String &strID);580 bool realtimeDockIconUpdateEnabled(const QUuid &aID); 580 581 /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */ 581 void setRealtimeDockIconUpdateEnabled(bool fEnabled, const Q String &strID);582 void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QUuid &aID); 582 583 583 584 /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */ 584 int realtimeDockIconUpdateMonitor(const Q String &strID);585 int realtimeDockIconUpdateMonitor(const QUuid &aID); 585 586 /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */ 586 void setRealtimeDockIconUpdateMonitor(int iIndex, const Q String &strID);587 void setRealtimeDockIconUpdateMonitor(int iIndex, const QUuid &aID); 587 588 588 589 /** Mac OS X: Returns whether Dock icon overlay is disabled. */ 589 bool dockIconDisableOverlay(const Q String &strID);590 bool dockIconDisableOverlay(const QUuid &aID); 590 591 /** Mac OS X: Defines whether Dock icon overlay is @a fDisabled. */ 591 void setDockIconDisableOverlay(bool fDisabled, const Q String &strID);592 void setDockIconDisableOverlay(bool fDisabled, const QUuid &aID); 592 593 #endif /* VBOX_WS_MAC */ 593 594 594 595 /** Returns whether machine should pass CAD to guest. */ 595 bool passCADtoGuest(const Q String &strID);596 bool passCADtoGuest(const QUuid &aID); 596 597 597 598 /** Returns the mouse-capture policy. */ 598 MouseCapturePolicy mouseCapturePolicy(const Q String &strID);599 MouseCapturePolicy mouseCapturePolicy(const QUuid &aID); 599 600 600 601 /** Returns redefined guru-meditation handler type. */ 601 GuruMeditationHandlerType guruMeditationHandlerType(const Q String &strID);602 GuruMeditationHandlerType guruMeditationHandlerType(const QUuid &aID); 602 603 603 604 /** Returns whether machine should perform HID LEDs synchronization. */ 604 bool hidLedsSyncState(const Q String &strID);605 bool hidLedsSyncState(const QUuid &aID); 605 606 606 607 /** Returns the scale-factor. */ 607 double scaleFactor(const int uScreenIndex, const Q String &strID = GlobalID);608 QList<double> scaleFactors(const Q String &strID = GlobalID);608 double scaleFactor(const int uScreenIndex, const QUuid &aID = GlobalID); 609 QList<double> scaleFactors(const QUuid &aID = GlobalID); 609 610 /** Defines the @a dScaleFactor. */ 610 void setScaleFactor(double dScaleFactor, const int uScreenIndex, const Q String &strID = GlobalID);611 void setScaleFactors(const QList<double> &scaleFactors, const Q String &strID = GlobalID);611 void setScaleFactor(double dScaleFactor, const int uScreenIndex, const QUuid &aID = GlobalID); 612 void setScaleFactors(const QList<double> &scaleFactors, const QUuid &aID = GlobalID); 612 613 613 614 /** Returns the scaling optimization type. */ 614 ScalingOptimizationType scalingOptimizationType(const Q String &strID);615 ScalingOptimizationType scalingOptimizationType(const QUuid &aID); 615 616 /** @} */ 616 617 … … 618 619 * @{ */ 619 620 /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */ 620 QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const Q String &strID);621 QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QUuid &aID); 621 622 /** Returns whether information-window should be maximized or not. */ 622 bool informationWindowShouldBeMaximized(const Q String &strID);623 bool informationWindowShouldBeMaximized(const QUuid &aID); 623 624 /** Defines information-window @a geometry and @a fMaximized state. */ 624 void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const Q String &strID);625 void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QUuid &aID); 625 626 626 627 /** Returns information-window elements. */ … … 637 638 * @{ */ 638 639 /** Returns default machine close action. */ 639 MachineCloseAction defaultMachineCloseAction(const Q String &strID);640 MachineCloseAction defaultMachineCloseAction(const QUuid &aID); 640 641 /** Returns restricted machine close actions. */ 641 MachineCloseAction restrictedMachineCloseActions(const Q String &strID);642 MachineCloseAction restrictedMachineCloseActions(const QUuid &aID); 642 643 643 644 /** Returns last machine close action. */ 644 MachineCloseAction lastMachineCloseAction(const Q String &strID);645 MachineCloseAction lastMachineCloseAction(const QUuid &aID); 645 646 /** Defines last @a machineCloseAction. */ 646 void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const Q String &strID);647 void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QUuid &aID); 647 648 648 649 /** Returns machine close hook script name as simple string. */ 649 QString machineCloseHookScript(const Q String &strID);650 QString machineCloseHookScript(const QUuid &aID); 650 651 /** @} */ 651 652 … … 699 700 700 701 /** Handles 'extra-data change' event: */ 701 void sltExtraDataChange( QString strMachineID, QString strKey, QStringstrValue);702 void sltExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue); 702 703 703 704 private: … … 735 736 * @returns String value if found, null string if not. 736 737 * @param strKey The extra-data key to get. 737 * @param strIDMachine UUID or #GlobalID.738 * @param aID Machine UUID or #GlobalID. 738 739 * @param strValue Where to return the value when found. */ 739 QString extraDataStringUnion(const QString &strKey, const Q String &strID);740 QString extraDataStringUnion(const QString &strKey, const QUuid &aID); 740 741 /** Determines whether feature corresponding to passed @a strKey is allowed. 741 * If valid @a strID is set => applies to machine and global extra-data,742 * If valid @a aID is set => applies to machine and global extra-data, 742 743 * otherwise => only to global one. */ 743 bool isFeatureAllowed(const QString &strKey, const Q String &strID = GlobalID);744 bool isFeatureAllowed(const QString &strKey, const QUuid &aID = GlobalID); 744 745 /** Determines whether feature corresponding to passed @a strKey is restricted. 745 * If valid @a strID is set => applies to machine and global extra-data,746 * If valid @a aID is set => applies to machine and global extra-data, 746 747 * otherwise => only to global one. */ 747 bool isFeatureRestricted(const QString &strKey, const Q String &strID = GlobalID);748 bool isFeatureRestricted(const QString &strKey, const QUuid &aID = GlobalID); 748 749 749 750 /** Translates bool flag into QString value. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.cpp
r69500 r74878 238 238 } 239 239 240 /* static */ 241 void COMBase::ToSafeArray (const QVector <QUuid> &aVec, 242 com::SafeArray <BSTR> &aArr) 243 { 244 aArr.reset (aVec.size()); 245 for (int i = 0; i < aVec.size(); ++ i) 246 aArr [i] = SysAllocString ((const OLECHAR *) 247 (aVec.at (i).isNull() ? 0 : aVec.at(i).toString().utf16())); 248 } 249 250 /* static */ 251 void COMBase::FromSafeArray (const com::SafeArray <BSTR> &aArr, 252 QVector <QUuid> &aVec) 253 { 254 aVec.resize (static_cast <int> (aArr.size())); 255 for (int i = 0; i < aVec.size(); ++ i) 256 aVec [i] = QUuid(QString::fromUtf16 (aArr [i])); 257 } 258 240 259 //////////////////////////////////////////////////////////////////////////////// 241 260 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h
r71791 r74878 291 291 QVector<QUuid> &aVec); 292 292 293 /* Arrays of GUID as BSTR */ 294 295 static void ToSafeArray(const QVector<QUuid> &aVec, 296 com::SafeArray<BSTR> &aArr); 297 static void FromSafeArray(const com::SafeArray<BSTR> &aArr, 298 QVector<QUuid> &aVec); 299 293 300 /* Arrays of enums. Does a cast similar to what ENUMOut does. */ 294 301 … … 392 399 393 400 QString &str; 401 BSTR bstr; 402 }; 403 404 /** Adapter to pass QUuid as input BSTR params */ 405 class GuidAsBStrIn 406 { 407 public: 408 409 GuidAsBStrIn(const QUuid &s) : bstr(SysAllocString((const OLECHAR *) 410 (s.isNull() ? 0 : s.toString().utf16()))) {} 411 412 ~GuidAsBStrIn() 413 { 414 if (bstr) 415 SysFreeString(bstr); 416 } 417 418 operator BSTR() const { return bstr; } 419 420 private: 421 422 BSTR bstr; 423 }; 424 425 /** Adapter to pass QUuid as output BSTR params */ 426 class GuidAsBStrOut 427 { 428 public: 429 430 GuidAsBStrOut(QUuid &s) : uuid(s), bstr(0) {} 431 432 ~GuidAsBStrOut() 433 { 434 if (bstr) { 435 uuid = QUuid(QString::fromUtf16(bstr)); 436 SysFreeString(bstr); 437 } 438 } 439 440 operator BSTR *() { return &bstr; } 441 442 private: 443 444 QUuid &uuid; 394 445 BSTR bstr; 395 446 }; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMWrappers.xsl
r71795 r74878 1402 1402 </xsl:when> 1403 1403 <!-- string types --> 1404 <xsl:when test="@type = 'wstring' or @type = 'uuid'">1404 <xsl:when test="@type = 'wstring'"> 1405 1405 <xsl:choose> 1406 1406 <xsl:when test="$isIn"> … … 1413 1413 <xsl:when test="$isOut"> 1414 1414 <xsl:text>BSTROut(a</xsl:text> 1415 <xsl:call-template name="capitalize"> 1416 <xsl:with-param name="str" select="@name"/> 1417 </xsl:call-template> 1418 <xsl:text>)</xsl:text> 1419 </xsl:when> 1420 </xsl:choose> 1421 </xsl:when> 1422 <!-- uuid is represented as string in the com --> 1423 <xsl:when test="@type = 'uuid'"> 1424 <xsl:choose> 1425 <xsl:when test="$isIn"> 1426 <xsl:text>GuidAsBStrIn(a</xsl:text> 1427 <xsl:call-template name="capitalize"> 1428 <xsl:with-param name="str" select="@name"/> 1429 </xsl:call-template> 1430 <xsl:text>)</xsl:text> 1431 </xsl:when> 1432 <xsl:when test="$isOut"> 1433 <xsl:text>GuidAsBStrOut(a</xsl:text> 1415 1434 <xsl:call-template name="capitalize"> 1416 1435 <xsl:with-param name="str" select="@name"/> … … 1532 1551 <!-- standard types --> 1533 1552 <!--xsl:when test=".='result'">??</xsl:when--> 1534 <xsl:when test=".='uuid'">Q String</xsl:when>1553 <xsl:when test=".='uuid'">QUuid</xsl:when> 1535 1554 <xsl:otherwise> 1536 1555 <xsl:message terminate="yes"> -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp
r74872 r74878 3140 3140 #endif /* VBOX_WITH_DEBUGGER_GUI */ 3141 3141 3142 void UIActionPoolRuntime::sltHandleConfigurationChange(const Q String &strMachineID)3142 void UIActionPoolRuntime::sltHandleConfigurationChange(const QUuid &aMachineID) 3143 3143 { 3144 3144 /* Skip unrelated machine IDs: */ 3145 if (vboxGlobal().managedVMUuid() != strMachineID)3145 if (vboxGlobal().managedVMUuid() != aMachineID) 3146 3146 return; 3147 3147 … … 3338 3338 connect(gShortcutPool, SIGNAL(sigSelectorShortcutsReloaded()), this, SLOT(sltApplyShortcuts())); 3339 3339 connect(gShortcutPool, SIGNAL(sigMachineShortcutsReloaded()), this, SLOT(sltApplyShortcuts())); 3340 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const Q String&)),3341 this, SLOT(sltHandleConfigurationChange(const Q String&)));3340 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QUuid &)), 3341 this, SLOT(sltHandleConfigurationChange(const QUuid &))); 3342 3342 3343 3343 /* Call to base-class: */ … … 3348 3348 { 3349 3349 /* Get machine ID: */ 3350 const Q String strMachineID = vboxGlobal().managedVMUuid();3351 if ( strMachineID.isNull())3350 const QUuid aMachineID = vboxGlobal().managedVMUuid(); 3351 if (aMachineID.isNull()) 3352 3352 return; 3353 3353 3354 3354 /* Recache common action restrictions: */ 3355 m_restrictedMenus[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuTypes( strMachineID);3356 m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuApplicationActionTypes( strMachineID);3357 m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuMachineActionTypes( strMachineID);3358 m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuViewActionTypes( strMachineID);3359 m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuInputActionTypes( strMachineID);3360 m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuDevicesActionTypes( strMachineID);3355 m_restrictedMenus[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuTypes(aMachineID); 3356 m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(aMachineID); 3357 m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuMachineActionTypes(aMachineID); 3358 m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuViewActionTypes(aMachineID); 3359 m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuInputActionTypes(aMachineID); 3360 m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(aMachineID); 3361 3361 #ifdef VBOX_WITH_DEBUGGER_GUI 3362 m_restrictedActionsMenuDebug[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes( strMachineID);3362 m_restrictedActionsMenuDebug[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(aMachineID); 3363 3363 #endif /* VBOX_WITH_DEBUGGER_GUI */ 3364 3364 #ifdef VBOX_WS_MAC 3365 m_restrictedActionsMenuWindow[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuWindowActionTypes( strMachineID);3365 m_restrictedActionsMenuWindow[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuWindowActionTypes(aMachineID); 3366 3366 #endif /* VBOX_WS_MAC */ 3367 m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuHelpActionTypes( strMachineID);3367 m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuHelpActionTypes(aMachineID); 3368 3368 3369 3369 /* Recache visual state action restrictions: */ 3370 UIVisualStateType restrictedVisualStates = gEDataManager->restrictedVisualStates( strMachineID);3370 UIVisualStateType restrictedVisualStates = gEDataManager->restrictedVisualStates(aMachineID); 3371 3371 { 3372 3372 if (restrictedVisualStates & UIVisualStateType_Fullscreen) … … 3382 3382 3383 3383 /* Recache reconfiguration action restrictions: */ 3384 bool fReconfigurationAllowed = gEDataManager->machineReconfigurationEnabled( strMachineID);3384 bool fReconfigurationAllowed = gEDataManager->machineReconfigurationEnabled(aMachineID); 3385 3385 if (!fReconfigurationAllowed) 3386 3386 { … … 3402 3402 3403 3403 /* Recache snapshot related action restrictions: */ 3404 bool fSnapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled( strMachineID);3404 bool fSnapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(aMachineID); 3405 3405 if (!fSnapshotOperationsAllowed) 3406 3406 { … … 3423 3423 3424 3424 /* Recache close related action restrictions: */ 3425 MachineCloseAction restrictedCloseActions = gEDataManager->restrictedMachineCloseActions( strMachineID);3425 MachineCloseAction restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(aMachineID); 3426 3426 bool fAllCloseActionsRestricted = (!vboxGlobal().isSeparateProcess() || (restrictedCloseActions & MachineCloseAction_Detach)) 3427 3427 && (restrictedCloseActions & MachineCloseAction_SaveState) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h
r73841 r74878 201 201 202 202 /** Handles configuration-change. */ 203 void sltHandleConfigurationChange(const Q String &strMachineID);203 void sltHandleConfigurationChange(const QUuid &aMachineID); 204 204 205 205 /** Handles 'View' : 'Scale Factor' menu : @a pAction trigger. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp
r74815 r74878 376 376 { 377 377 /* Get machine ID: */ 378 const Q String strMachineId = comMachine.GetId();378 const QUuid uMachineId = comMachine.GetId(); 379 379 AssertReturn(comMachine.isOk(), QPixmap()); 380 380 … … 384 384 /* 1. First, load icon from IMachine extra-data: */ 385 385 if (icon.isNull()) 386 foreach (const QString &strIconName, gEDataManager->machineWindowIconNames( strMachineId))386 foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(uMachineId)) 387 387 if (!strIconName.isEmpty() && QFile::exists(strIconName)) 388 388 icon.addFile(strIconName); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r71630 r74878 76 76 * @{ */ 77 77 /** Notifies about @a state change event for the machine with @a strId. */ 78 void sigMachineStateChange( QString strId,KMachineState state);78 void sigMachineStateChange(const QUuid &aId, const KMachineState state); 79 79 /** Notifies about data change event for the machine with @a strId. */ 80 void sigMachineDataChange( QString strId);80 void sigMachineDataChange(const QUuid &aId); 81 81 /** Notifies about machine with @a strId was @a fRegistered. */ 82 void sigMachineRegistered( QString strId,bool fRegistered);82 void sigMachineRegistered(const QUuid &aId, const bool fRegistered); 83 83 /** Notifies about @a state change event for the session of the machine with @a strId. */ 84 void sigSessionStateChange( QString strId,KSessionState state);84 void sigSessionStateChange(const QUuid &aId, const KSessionState state); 85 85 /** Notifies about snapshot with @a strSnapshotId was taken for the machine with @a strId. */ 86 void sigSnapshotTake( QString strId, QString strSnapshotId);86 void sigSnapshotTake(const QUuid &aId, const QUuid &aSnapshotId); 87 87 /** Notifies about snapshot with @a strSnapshotId was deleted for the machine with @a strId. */ 88 void sigSnapshotDelete( QString strId, QString strSnapshotId);88 void sigSnapshotDelete(const QUuid &aId, const QUuid &aSnapshotId); 89 89 /** Notifies about snapshot with @a strSnapshotId was changed for the machine with @a strId. */ 90 void sigSnapshotChange( QString strId, QString strSnapshotId);90 void sigSnapshotChange(const QUuid &aId, const QUuid &aSnapshotId); 91 91 /** Notifies about snapshot with @a strSnapshotId was restored for the machine with @a strId. */ 92 void sigSnapshotRestore( QString strId, QString strSnapshotId);92 void sigSnapshotRestore(const QUuid &aId, const QUuid &aSnapshotId); 93 93 /** @} */ 94 94 … … 96 96 * @{ */ 97 97 /** Notifies about extra-data of the machine with @a strId can be changed for the key @a strKey to value @a strValue. */ 98 void sigExtraDataCanChange( QString strId, QString strKey, QStringstrValue, bool &fVeto, QString &strVetoReason); /* use Qt::DirectConnection */98 void sigExtraDataCanChange(const QUuid &aId, const QString &strKey, const QString &strValue, bool &fVeto, QString &strVetoReason); /* use Qt::DirectConnection */ 99 99 /** Notifies about extra-data of the machine with @a strId changed for the key @a strKey to value @a strValue. */ 100 void sigExtraDataChange( QString strId, QString strKey, QStringstrValue);100 void sigExtraDataChange(const QUuid &aId, const QString &strKey, const QString &strValue); 101 101 /** @} */ 102 102 … … 149 149 * @{ */ 150 150 /** Notifies about @a iPercent change for progress with @a strProgressId. */ 151 void sigProgressPercentageChange( QString strProgressId,int iPercent);151 void sigProgressPercentageChange(const QUuid &aProgressId, const int iPercent); 152 152 /** Notifies about task complete for progress with @a strProgressId. */ 153 void sigProgressTaskComplete( QString strProgressId);153 void sigProgressTaskComplete(const QUuid &aProgressId); 154 154 /** @} */ 155 155 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r74553 r74878 519 519 } 520 520 521 void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const Q String &strId) const521 void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QUuid &aId) const 522 522 { 523 523 error(0, MessageType_Error, 524 524 tr("There is no virtual machine with the identifier <b>%1</b>.") 525 .arg( strId),525 .arg(aId.toString()), 526 526 UIErrorString::formatErrorInfo(vbox)); 527 527 } … … 672 672 /* Check if that hard disk isn't shared. 673 673 * If hard disk is shared, it will *never* be deleted: */ 674 QVector<Q String> usedMachineList = attachment.GetMedium().GetMachineIds();674 QVector<QUuid> usedMachineList = attachment.GetMedium().GetMachineIds(); 675 675 if (usedMachineList.size() == 1) 676 676 { … … 1018 1018 1019 1019 void UIMessageCenter::cannotFindSnapshotById(const CMachine &comMachine, 1020 const Q String &strId,1020 const QUuid &aId, 1021 1021 QWidget *pParent /* = 0 */) const 1022 1022 { 1023 1023 error(pParent, MessageType_Error, 1024 1024 tr("Can't find snapshot with ID=<b>%1</b>.") 1025 .arg( strId),1025 .arg(aId.toString()), 1026 1026 UIErrorString::formatErrorInfo(comMachine)); 1027 1027 } … … 1276 1276 QStringList usage; 1277 1277 CVirtualBox vbox = vboxGlobal().virtualBox(); 1278 foreach (const Q String &strMachineID, medium.curStateMachineIds())1278 foreach (const QUuid &uMachineID, medium.curStateMachineIds()) 1279 1279 { 1280 CMachine machine = vbox.FindMachine( strMachineID);1280 CMachine machine = vbox.FindMachine(uMachineID.toString()); 1281 1281 if (!vbox.isOk() || machine.isNull()) 1282 1282 continue; … … 2797 2797 if (!strAutoConfirmId.isEmpty()) 2798 2798 { 2799 const Q String strID = vboxGlobal().isVMConsoleProcess() ? vboxGlobal().managedVMUuid() : UIExtraDataManager::GlobalID;2800 confirmedMessageList = gEDataManager->suppressedMessages( strID);2799 const QUuid uID = vboxGlobal().isVMConsoleProcess() ? vboxGlobal().managedVMUuid() : UIExtraDataManager::GlobalID; 2800 confirmedMessageList = gEDataManager->suppressedMessages(uID); 2801 2801 if ( confirmedMessageList.contains(strAutoConfirmId) 2802 2802 || confirmedMessageList.contains("allMessageBoxes") -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r73953 r74878 251 251 void cannotLoadLanguage(const QString &strLangFile) const; 252 252 void cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const; 253 void cannotFindMachineById(const CVirtualBox &vbox, const Q String &strId) const;253 void cannotFindMachineById(const CVirtualBox &vbox, const QUuid &aId) const; 254 254 void cannotOpenSession(const CSession &session) const; 255 255 void cannotOpenSession(const CMachine &machine) const; … … 301 301 void cannotChangeSnapshot(const CSnapshot &comSnapshot, const QString &strSnapshotName, const QString &strMachineName) const; 302 302 void cannotFindSnapshotByName(const CMachine &comMachine, const QString &strName, QWidget *pParent = 0) const; 303 void cannotFindSnapshotById(const CMachine &comMachine, const Q String &strId, QWidget *pParent = 0) const;303 void cannotFindSnapshotById(const CMachine &comMachine, const QUuid &aId, QWidget *pParent = 0) const; 304 304 void cannotAcquireSnapshotAttributes(const CSnapshot &comSnapshot, QWidget *pParent = 0); 305 305 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp
r73385 r74878 47 47 48 48 /** Notifies about @a state change event for the machine with @a strId. */ 49 void sigMachineStateChange( QString strId,KMachineState state);49 void sigMachineStateChange(const QUuid &aId, const KMachineState state); 50 50 /** Notifies about data change event for the machine with @a strId. */ 51 void sigMachineDataChange( QString strId);51 void sigMachineDataChange(const QUuid &aId); 52 52 /** Notifies about machine with @a strId was @a fRegistered. */ 53 void sigMachineRegistered( QString strId,bool fRegistered);53 void sigMachineRegistered(const QUuid &aId, const bool fRegistered); 54 54 /** Notifies about @a state change event for the session of the machine with @a strId. */ 55 void sigSessionStateChange( QString strId,KSessionState state);55 void sigSessionStateChange(const QUuid &aId, const KSessionState state); 56 56 /** Notifies about snapshot with @a strSnapshotId was taken for the machine with @a strId. */ 57 void sigSnapshotTake( QString strId, QString strSnapshotId);57 void sigSnapshotTake(const QUuid &aId, const QUuid &aSnapshotId); 58 58 /** Notifies about snapshot with @a strSnapshotId was deleted for the machine with @a strId. */ 59 void sigSnapshotDelete( QString strId, QString strSnapshotId);59 void sigSnapshotDelete(const QUuid &aId, const QUuid &aSnapshotId); 60 60 /** Notifies about snapshot with @a strSnapshotId was changed for the machine with @a strId. */ 61 void sigSnapshotChange( QString strId, QString strSnapshotId);61 void sigSnapshotChange(const QUuid &aId, const QUuid &aSnapshotId); 62 62 /** Notifies about snapshot with @a strSnapshotId was restored for the machine with @a strId. */ 63 void sigSnapshotRestore( QString strId, QString strSnapshotId);63 void sigSnapshotRestore(const QUuid &aId, const QUuid &aSnapshotId); 64 64 65 65 public: … … 185 185 this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)), 186 186 Qt::DirectConnection); 187 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineStateChange(Q String, KMachineState)),188 this, SIGNAL(sigMachineStateChange(Q String, KMachineState)),189 Qt::DirectConnection); 190 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineDataChange(Q String)),191 this, SIGNAL(sigMachineDataChange(Q String)),192 Qt::DirectConnection); 193 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineRegistered(Q String, bool)),194 this, SIGNAL(sigMachineRegistered(Q String, bool)),195 Qt::DirectConnection); 196 connect(m_pQtListener->getWrapped(), SIGNAL(sigSessionStateChange(Q String, KSessionState)),197 this, SIGNAL(sigSessionStateChange(Q String, KSessionState)),198 Qt::DirectConnection); 199 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotTake(Q String, QString)),200 this, SIGNAL(sigSnapshotTake(Q String, QString)),201 Qt::DirectConnection); 202 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotDelete(Q String, QString)),203 this, SIGNAL(sigSnapshotDelete(Q String, QString)),204 Qt::DirectConnection); 205 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotChange(Q String, QString)),206 this, SIGNAL(sigSnapshotChange(Q String, QString)),207 Qt::DirectConnection); 208 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotRestore(Q String, QString)),209 this, SIGNAL(sigSnapshotRestore(Q String, QString)),187 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 188 this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 189 Qt::DirectConnection); 190 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineDataChange(QUuid)), 191 this, SIGNAL(sigMachineDataChange(QUuid)), 192 Qt::DirectConnection); 193 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineRegistered(QUuid, bool)), 194 this, SIGNAL(sigMachineRegistered(QUuid, bool)), 195 Qt::DirectConnection); 196 connect(m_pQtListener->getWrapped(), SIGNAL(sigSessionStateChange(QUuid, KSessionState)), 197 this, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), 198 Qt::DirectConnection); 199 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotTake(QUuid, QUuid)), 200 this, SIGNAL(sigSnapshotTake(QUuid, QUuid)), 201 Qt::DirectConnection); 202 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotDelete(QUuid, QUuid)), 203 this, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), 204 Qt::DirectConnection); 205 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotChange(QUuid, QUuid)), 206 this, SIGNAL(sigSnapshotChange(QUuid, QUuid)), 207 Qt::DirectConnection); 208 connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotRestore(QUuid, QUuid)), 209 this, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), 210 210 Qt::DirectConnection); 211 211 } … … 282 282 this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)), 283 283 Qt::QueuedConnection); 284 connect(m_pProxy, SIGNAL(sigMachineStateChange(Q String, KMachineState)),285 this, SIGNAL(sigMachineStateChange(Q String, KMachineState)),286 Qt::QueuedConnection); 287 connect(m_pProxy, SIGNAL(sigMachineDataChange(Q String)),288 this, SIGNAL(sigMachineDataChange(Q String)),289 Qt::QueuedConnection); 290 connect(m_pProxy, SIGNAL(sigMachineRegistered(Q String, bool)),291 this, SIGNAL(sigMachineRegistered(Q String, bool)),292 Qt::QueuedConnection); 293 connect(m_pProxy, SIGNAL(sigSessionStateChange(Q String, KSessionState)),294 this, SIGNAL(sigSessionStateChange(Q String, KSessionState)),295 Qt::QueuedConnection); 296 connect(m_pProxy, SIGNAL(sigSnapshotTake(Q String, QString)),297 this, SIGNAL(sigSnapshotTake(Q String, QString)),298 Qt::QueuedConnection); 299 connect(m_pProxy, SIGNAL(sigSnapshotDelete(Q String, QString)),300 this, SIGNAL(sigSnapshotDelete(Q String, QString)),301 Qt::QueuedConnection); 302 connect(m_pProxy, SIGNAL(sigSnapshotChange(Q String, QString)),303 this, SIGNAL(sigSnapshotChange(Q String, QString)),304 Qt::QueuedConnection); 305 connect(m_pProxy, SIGNAL(sigSnapshotRestore(Q String, QString)),306 this, SIGNAL(sigSnapshotRestore(Q String, QString)),284 connect(m_pProxy, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 285 this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 286 Qt::QueuedConnection); 287 connect(m_pProxy, SIGNAL(sigMachineDataChange(QUuid)), 288 this, SIGNAL(sigMachineDataChange(QUuid)), 289 Qt::QueuedConnection); 290 connect(m_pProxy, SIGNAL(sigMachineRegistered(QUuid, bool)), 291 this, SIGNAL(sigMachineRegistered(QUuid, bool)), 292 Qt::QueuedConnection); 293 connect(m_pProxy, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), 294 this, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), 295 Qt::QueuedConnection); 296 connect(m_pProxy, SIGNAL(sigSnapshotTake(QUuid, QUuid)), 297 this, SIGNAL(sigSnapshotTake(QUuid, QUuid)), 298 Qt::QueuedConnection); 299 connect(m_pProxy, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), 300 this, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), 301 Qt::QueuedConnection); 302 connect(m_pProxy, SIGNAL(sigSnapshotChange(QUuid, QUuid)), 303 this, SIGNAL(sigSnapshotChange(QUuid, QUuid)), 304 Qt::QueuedConnection); 305 connect(m_pProxy, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), 306 this, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), 307 307 Qt::QueuedConnection); 308 308 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.h
r73385 r74878 43 43 44 44 /** Notifies about @a state change event for the machine with @a strId. */ 45 void sigMachineStateChange( QString strId,KMachineState state);45 void sigMachineStateChange(const QUuid &aId, const KMachineState state); 46 46 /** Notifies about data change event for the machine with @a strId. */ 47 void sigMachineDataChange( QString strId);47 void sigMachineDataChange(const QUuid &aId); 48 48 /** Notifies about machine with @a strId was @a fRegistered. */ 49 void sigMachineRegistered( QString strId,bool fRegistered);49 void sigMachineRegistered(const QUuid &aId, const bool fRegistered); 50 50 /** Notifies about @a state change event for the session of the machine with @a strId. */ 51 void sigSessionStateChange( QString strId,KSessionState state);51 void sigSessionStateChange(const QUuid &aId, const KSessionState state); 52 52 /** Notifies about snapshot with @a strSnapshotId was taken for the machine with @a strId. */ 53 void sigSnapshotTake( QString strId, QString strSnapshotId);53 void sigSnapshotTake(const QUuid &sId, const QUuid &aSnapshotId); 54 54 /** Notifies about snapshot with @a strSnapshotId was deleted for the machine with @a strId. */ 55 void sigSnapshotDelete( QString strId, QString strSnapshotId);55 void sigSnapshotDelete(const QUuid &aId, const QUuid &aSnapshotId); 56 56 /** Notifies about snapshot with @a strSnapshotId was changed for the machine with @a strId. */ 57 void sigSnapshotChange( QString strId, QString strSnapshotId);57 void sigSnapshotChange(const QUuid &aId, const QUuid &aSnapshotId); 58 58 /** Notifies about snapshot with @a strSnapshotId was restored for the machine with @a strId. */ 59 void sigSnapshotRestore( QString strId, QString strSnapshotId);59 void sigSnapshotRestore(const QUuid &aId, const QUuid &aSnapshotId); 60 60 61 61 public: -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r74305 r74878 2362 2362 } 2363 2363 2364 CSession VBoxGlobal::openSession(const Q String &strId, KLockType lockType /* = KLockType_Shared */)2364 CSession VBoxGlobal::openSession(const QUuid &aId, KLockType lockType /* = KLockType_Shared */) 2365 2365 { 2366 2366 /* Prepare session: */ … … 2380 2380 2381 2381 /* Search for the corresponding machine: */ 2382 CMachine comMachine = m_comVBox.FindMachine( strId);2382 CMachine comMachine = m_comVBox.FindMachine(aId.toString()); 2383 2383 if (comMachine.isNull()) 2384 2384 { 2385 msgCenter().cannotFindMachineById(m_comVBox, strId);2385 msgCenter().cannotFindMachineById(m_comVBox, aId); 2386 2386 break; 2387 2387 } … … 2486 2486 } 2487 2487 2488 UIMedium VBoxGlobal::medium(const Q String &strMediumID) const2488 UIMedium VBoxGlobal::medium(const QUuid &aMediumID) const 2489 2489 { 2490 2490 if (m_meCleanupProtectionToken.tryLockForRead()) … … 2493 2493 UIMedium guiMedium; 2494 2494 if (m_pMediumEnumerator) 2495 guiMedium = m_pMediumEnumerator->medium( strMediumID);2495 guiMedium = m_pMediumEnumerator->medium(aMediumID); 2496 2496 m_meCleanupProtectionToken.unlock(); 2497 2497 return guiMedium; … … 2500 2500 } 2501 2501 2502 QList<Q String> VBoxGlobal::mediumIDs() const2502 QList<QUuid> VBoxGlobal::mediumIDs() const 2503 2503 { 2504 2504 if (m_meCleanupProtectionToken.tryLockForRead()) 2505 2505 { 2506 2506 /* Redirect call to medium-enumerator: */ 2507 QList<Q String> listOfMedia;2507 QList<QUuid> listOfMedia; 2508 2508 if (m_pMediumEnumerator) 2509 2509 listOfMedia = m_pMediumEnumerator->mediumIDs(); … … 2511 2511 return listOfMedia; 2512 2512 } 2513 return QList<Q String>();2513 return QList<QUuid>(); 2514 2514 } 2515 2515 … … 2525 2525 } 2526 2526 2527 void VBoxGlobal::deleteMedium(const Q String &strMediumID)2527 void VBoxGlobal::deleteMedium(const QUuid &aMediumID) 2528 2528 { 2529 2529 if (m_meCleanupProtectionToken.tryLockForRead()) … … 2531 2531 /* Delete medium from medium-enumerator: */ 2532 2532 if (m_pMediumEnumerator) 2533 m_pMediumEnumerator->deleteMedium( strMediumID);2533 m_pMediumEnumerator->deleteMedium(aMediumID); 2534 2534 m_meCleanupProtectionToken.unlock(); 2535 2535 } 2536 2536 } 2537 2537 2538 Q StringVBoxGlobal::openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent /* = 0 */)2538 QUuid VBoxGlobal::openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent /* = 0 */) 2539 2539 { 2540 2540 /* Convert to native separators: */ … … 2568 2568 msgCenter().cannotOpenMedium(comVBox, enmMediumType, strMediumLocation, pParent); 2569 2569 2570 return Q String();2571 } 2572 2573 Q StringVBoxGlobal::openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent,2570 return QUuid(); 2571 } 2572 2573 QUuid VBoxGlobal::openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent, 2574 2574 const QString &strDefaultFolder /* = QString() */, 2575 2575 bool fUseLastFolder /* = false */) … … 2649 2649 return openMedium(enmMediumType, files[0], pParent); 2650 2650 2651 return Q String();2652 } 2653 2654 Q StringVBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder)2651 return QUuid(); 2652 } 2653 2654 QUuid VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder) 2655 2655 { 2656 2656 AssertReturn(!strFolder.isEmpty(), QString()); … … 2672 2672 /* Return if no result. */ 2673 2673 if (files.empty() || files[0].isEmpty()) 2674 return Q String();2674 return QUuid(); 2675 2675 2676 2676 /* Remember folder for the next time. */ … … 2721 2721 2722 2722 /** @todo error message. */ 2723 return Q String();2724 } 2725 2726 Q StringVBoxGlobal::showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder)2723 return QUuid(); 2724 } 2725 2726 QUuid VBoxGlobal::showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder) 2727 2727 { 2728 2728 UIFDCreationDialog *pDialog = new UIFDCreationDialog(pParent, strMachineName, strMachineFolder); … … 2732 2732 } 2733 2733 delete pDialog; 2734 return Q String();2734 return QUuid(); 2735 2735 } 2736 2736 … … 2744 2744 storageSlot.device); 2745 2745 const CMedium comCurrentMedium = comCurrentAttachment.GetMedium(); 2746 const Q String strCurrentID = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetId();2746 const QUuid uCurrentID = comCurrentMedium.isNull() ? QUuid() : comCurrentMedium.GetId(); 2747 2747 const QString strCurrentLocation = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetLocation(); 2748 2748 … … 2818 2818 QAction *pActionChooseHostDrive = menu.addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName); 2819 2819 pActionChooseHostDrive->setCheckable(true); 2820 pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == strCurrentID);2820 pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == uCurrentID); 2821 2821 pActionChooseHostDrive->setData(QVariant::fromValue(UIMediumTarget(strControllerName, 2822 2822 comCurrentAttachment.GetPort(), … … 2824 2824 enmMediumType, 2825 2825 UIMediumTarget::UIMediumTargetType_WithID, 2826 comMedium.GetId() )));2826 comMedium.GetId().toString()))); 2827 2827 } 2828 2828 } … … 2908 2908 CMedium comMedium; 2909 2909 /* With null ID (by default): */ 2910 Q String strActualID;2910 QUuid uActualID; 2911 2911 2912 2912 /* Current mount-target attributes: */ … … 2915 2915 const CMediumAttachment comCurrentAttachment = comConstMachine.GetMediumAttachment(target.name, target.port, target.device); 2916 2916 const CMedium comCurrentMedium = comCurrentAttachment.GetMedium(); 2917 const Q String strCurrentID = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetId();2917 const QUuid uCurrentID = comCurrentMedium.isNull() ? QUuid() : comCurrentMedium.GetId(); 2918 2918 const QString strCurrentLocation = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetLocation(); 2919 2919 … … 2927 2927 { 2928 2928 /* New mount-target attributes: */ 2929 Q String strNewID;2929 QUuid uNewID; 2930 2930 2931 2931 /* Invoke file-open dialog to choose medium ID: */ … … 2943 2943 /* Call for file-open dialog: */ 2944 2944 const QString strMachineFolder(QFileInfo(comConstMachine.GetSettingsFilePath()).absolutePath()); 2945 Q String strMediumID;2945 QUuid uMediumID; 2946 2946 if (target.type == UIMediumTarget::UIMediumTargetType_WithID) 2947 strMediumID = openMediumWithFileOpenDialog(target.mediumType, windowManager().mainWindowShown(), strMachineFolder);2947 uMediumID = openMediumWithFileOpenDialog(target.mediumType, windowManager().mainWindowShown(), strMachineFolder); 2948 2948 else if(target.type == UIMediumTarget::UIMediumTargetType_CreateAdHocVISO) 2949 strMediumID = createVisoMediumWithFileOpenDialog(windowManager().mainWindowShown(), strMachineFolder);2949 uMediumID = createVisoMediumWithFileOpenDialog(windowManager().mainWindowShown(), strMachineFolder); 2950 2950 else if(target.type == UIMediumTarget::UIMediumTargetType_CreateFloppyDisk) 2951 strMediumID = showCreateFloppyDiskDialog(windowManager().mainWindowShown(), comConstMachine.GetName(), strMachineFolder);2951 uMediumID = showCreateFloppyDiskDialog(windowManager().mainWindowShown(), comConstMachine.GetName(), strMachineFolder); 2952 2952 2953 2953 /* Return focus back: */ … … 2955 2955 pLastFocusedWidget->setFocus(); 2956 2956 /* Accept new medium ID: */ 2957 if (! strMediumID.isNull())2958 strNewID = strMediumID;2957 if (!uMediumID.isNull()) 2958 uNewID = uMediumID; 2959 2959 /* Else just exit: */ 2960 2960 else return; 2961 2961 } 2962 2962 /* Use medium ID which was passed: */ 2963 else if (!target.data.isNull() && target.data != strCurrentID)2964 strNewID = target.data;2963 else if (!target.data.isNull() && target.data != uCurrentID.toString()) 2964 uNewID = target.data; 2965 2965 2966 2966 /* Should we mount or unmount? */ 2967 fMount = ! strNewID.isEmpty();2967 fMount = !uNewID.isNull(); 2968 2968 2969 2969 /* Prepare target medium: */ 2970 const UIMedium guiMedium = medium( strNewID);2970 const UIMedium guiMedium = medium(uNewID); 2971 2971 comMedium = guiMedium.medium(); 2972 strActualID = fMount ? strNewID : strCurrentID;2972 uActualID = fMount ? uNewID : uCurrentID; 2973 2973 break; 2974 2974 } … … 2977 2977 { 2978 2978 /* Open medium by location and get new medium ID if any: */ 2979 const Q String strNewID = openMedium(target.mediumType, target.data);2979 const QUuid uNewID = openMedium(target.mediumType, target.data); 2980 2980 /* Else just exit: */ 2981 if ( strNewID.isEmpty())2981 if (uNewID.isNull()) 2982 2982 return; 2983 2983 2984 2984 /* Should we mount or unmount? */ 2985 fMount = strNewID != strCurrentID;2985 fMount = uNewID != uCurrentID; 2986 2986 2987 2987 /* Prepare target medium: */ 2988 const UIMedium guiMedium = fMount ? medium( strNewID) : UIMedium();2988 const UIMedium guiMedium = fMount ? medium(uNewID) : UIMedium(); 2989 2989 comMedium = fMount ? guiMedium.medium() : CMedium(); 2990 strActualID = fMount ? strNewID : strCurrentID;2990 uActualID = fMount ? uNewID : uCurrentID; 2991 2991 break; 2992 2992 } … … 3050 3050 { 3051 3051 /* Ask for force remounting: */ 3052 if (msgCenter().cannotRemountMedium(comMachine, medium( strActualID),3052 if (msgCenter().cannotRemountMedium(comMachine, medium(uActualID), 3053 3053 fMount, true /* retry? */)) 3054 3054 { … … 3057 3057 fWasMounted = comMachine.isOk(); 3058 3058 if (!fWasMounted) 3059 msgCenter().cannotRemountMedium(comMachine, medium( strActualID),3059 msgCenter().cannotRemountMedium(comMachine, medium(uActualID), 3060 3060 fMount, false /* retry? */); 3061 3061 } … … 3086 3086 { 3087 3087 /* Search for corresponding UI medium: */ 3088 const Q String strMediumID = comMedium.isNull() ? UIMedium::nullID() : comMedium.GetId();3089 UIMedium guiMedium = medium( strMediumID);3088 const QUuid uMediumID = comMedium.isNull() ? UIMedium::nullID() : comMedium.GetId(); 3089 UIMedium guiMedium = medium(uMediumID); 3090 3090 if (!comMedium.isNull() && guiMedium.isNull()) 3091 3091 { … … 3094 3094 3095 3095 /* Search for corresponding UI medium again: */ 3096 guiMedium = medium( strMediumID);3096 guiMedium = medium(uMediumID); 3097 3097 if (guiMedium.isNull()) 3098 3098 { … … 4149 4149 m_comVBox.SetSettingsSecret(m_astrSettingsPw); 4150 4150 4151 if (visualStateType != UIVisualStateType_Invalid && !m_strManagedVMId.is Empty())4151 if (visualStateType != UIVisualStateType_Invalid && !m_strManagedVMId.isNull()) 4152 4152 gEDataManager->setRequestedVisualState(visualStateType, m_strManagedVMId); 4153 4153 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r74743 r74878 91 91 * @{ */ 92 92 /** Notifies listeners about medium with certain @a strMediumID created. */ 93 void sigMediumCreated(const Q String &strMediumID);93 void sigMediumCreated(const QUuid &aMediumID); 94 94 /** Notifies listeners about medium with certain @a strMediumID deleted. */ 95 void sigMediumDeleted(const Q String &strMediumID);95 void sigMediumDeleted(const QUuid &aMediumID); 96 96 97 97 /** Notifies listeners about medium enumeration started. */ 98 98 void sigMediumEnumerationStarted(); 99 99 /** Notifies listeners about medium with certain @a strMediumID enumerated. */ 100 void sigMediumEnumerated(const Q String &strMediumID);100 void sigMediumEnumerated(const QUuid &aMediumID); 101 101 /** Notifies listeners about medium enumeration finished. */ 102 102 void sigMediumEnumerationFinished(); … … 211 211 212 212 /** Returns the --startvm option value (managed VM id). */ 213 Q StringmanagedVMUuid() const { return m_strManagedVMId; }213 QUuid managedVMUuid() const { return m_strManagedVMId; } 214 214 /** Returns whether this is VM console process. */ 215 215 bool isVMConsoleProcess() const { return !m_strManagedVMId.isNull(); } … … 228 228 229 229 /** Returns the --fda option value (whether we have floppy image). */ 230 bool hasFloppyImageToMount() const { return !m_strFloppyImage.is Empty(); }230 bool hasFloppyImageToMount() const { return !m_strFloppyImage.isNull(); } 231 231 /** Returns the --dvd | --cdrom option value (whether we have DVD image). */ 232 bool hasDvdImageToMount() const { return !m_strDvdImage.is Empty(); }232 bool hasDvdImageToMount() const { return !m_strDvdImage.isNull(); } 233 233 /** Returns floppy image name. */ 234 Q Stringconst &getFloppyImage() const { return m_strFloppyImage; }234 QUuid const &getFloppyImage() const { return m_strFloppyImage; } 235 235 /** Returns DVD image name. */ 236 Q Stringconst &getDvdImage() const { return m_strDvdImage; }236 QUuid const &getDvdImage() const { return m_strDvdImage; } 237 237 238 238 /** Returns the --disable-patm option value. */ … … 474 474 475 475 /** Opens session of certain @a enmLockType for VM with certain @a strId. */ 476 CSession openSession(const Q String &strId, KLockType enmLockType = KLockType_Write);476 CSession openSession(const QUuid &aId, KLockType enmLockType = KLockType_Write); 477 477 /** Opens session of KLockType_Shared type for VM with certain @a strId. */ 478 CSession openExistingSession(const Q String &strId) { return openSession(strId, KLockType_Shared); }478 CSession openExistingSession(const QUuid &aId) { return openSession(aId, KLockType_Shared); } 479 479 /** @} */ 480 480 … … 488 488 bool isMediumEnumerationInProgress() const; 489 489 /** Returns enumerated medium with certain @a strMediumID. */ 490 UIMedium medium(const Q String &strMediumID) const;490 UIMedium medium(const QUuid &aMediumID) const; 491 491 /** Returns enumerated medium IDs. */ 492 QList<Q String> mediumIDs() const;492 QList<QUuid> mediumIDs() const; 493 493 /** Creates medium on the basis of passed @a guiMedium description. */ 494 494 void createMedium(const UIMedium &guiMedium); 495 495 /** Deletes medium with certain @a strMediumID. */ 496 void deleteMedium(const Q String &strMediumID);496 void deleteMedium(const QUuid &aMediumID); 497 497 498 498 /** Opens external medium by passed @a strMediumLocation. … … 501 501 * @param strMediumLocation Brings the file path to load medium from. 502 502 * @param pParent Brings the dialog parent. */ 503 Q StringopenMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent = 0);503 QUuid openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent = 0); 504 504 505 505 /** Opens external medium using file-open dialog. … … 508 508 * @param strDefaultFolder Brings the folder to browse for medium. 509 509 * @param fUseLastFolder Brings whether we should propose to use last used folder. */ 510 Q StringopenMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent = 0,510 QUuid openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent = 0, 511 511 const QString &strDefaultFolder = QString(), bool fUseLastFolder = true); 512 512 … … 514 514 * @param pParent Brings the dialog parent. 515 515 * @param strFolder Brings the folder to browse for VISO file contents. */ 516 Q StringcreateVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder);516 QUuid createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder); 517 517 518 518 /** Creates and shows a dialog thru which user can create a new floppy disk a VISO using the file-open dialog. … … 521 521 * @param strMachineFolder Passes the machine folder, 522 522 * returns the ID of the newly created medium if successful, an empty string otherwise.*/ 523 Q StringshowCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder);523 QUuid showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder); 524 524 525 525 /** Prepares storage menu according passed parameters. … … 763 763 764 764 /** Holds the --startvm option value (managed VM id). */ 765 Q Stringm_strManagedVMId;765 QUuid m_strManagedVMId; 766 766 /** Holds the --separate option value (whether GUI process is separate from VM process). */ 767 767 bool m_fSeparateProcess; … … 776 776 777 777 /** Holds the --fda option value (floppy image). */ 778 Q Stringm_strFloppyImage;778 QUuid m_strFloppyImage; 779 779 /** Holds the --dvd | --cdrom option value (DVD image). */ 780 Q Stringm_strDvdImage;780 QUuid m_strDvdImage; 781 781 782 782 /** Holds the --disable-patm option value. */ -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp
r73783 r74878 461 461 strNetworkName = comInterface.GetNetworkName(); 462 462 /* Get interface id for further activities: */ 463 Q String strInterfaceId;463 QUuid uInterfaceId; 464 464 if (comInterface.isOk()) 465 strInterfaceId = comInterface.GetId();465 uInterfaceId = comInterface.GetId(); 466 466 467 467 /* Show error message if necessary: */ … … 486 486 487 487 /* Remove interface finally: */ 488 CProgress progress = comHost.RemoveHostOnlyNetworkInterface( strInterfaceId);488 CProgress progress = comHost.RemoveHostOnlyNetworkInterface(uInterfaceId); 489 489 490 490 /* Show error message if necessary: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r74557 r74878 52 52 void sigToggleFinished(); 53 53 /** Redirects signal from UIDetails to UIVirtualBoxManager. */ 54 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);54 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 55 55 56 56 public: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r74870 r74878 295 295 /* Look for at least one inaccessible medium: */ 296 296 bool fIsThereAnyInaccessibleMedium = false; 297 foreach (const Q String &strMediumID, vboxGlobal().mediumIDs())298 { 299 if (vboxGlobal().medium( strMediumID).state() == KMediumState_Inaccessible)297 foreach (const QUuid &uMediumID, vboxGlobal().mediumIDs()) 298 { 299 if (vboxGlobal().medium(uMediumID).state() == KMediumState_Inaccessible) 300 300 { 301 301 fIsThereAnyInaccessibleMedium = true; … … 383 383 } 384 384 385 void UIVirtualBoxManager::sltHandleStateChange(const Q String&)385 void UIVirtualBoxManager::sltHandleStateChange(const QUuid &) 386 386 { 387 387 updateActionsAppearance(); … … 598 598 599 599 /* Make sure this machine was NOT registered already: */ 600 CMachine comMachineOld = comVBox.FindMachine(comMachineNew.GetId() );600 CMachine comMachineOld = comVBox.FindMachine(comMachineNew.GetId().toString()); 601 601 if (!comMachineOld.isNull()) 602 602 { … … 611 611 void UIVirtualBoxManager::sltOpenMachineSettingsDialog(QString strCategory /* = QString() */, 612 612 QString strControl /* = QString() */, 613 const Q String &strID /* = QString() */)613 const QUuid &aID /* = QString() */) 614 614 { 615 615 /* Get current item: */ … … 644 644 /* Create and execute corresponding VM settings window: */ 645 645 QPointer<UISettingsDialogMachine> pDlg = new UISettingsDialogMachine(this, 646 QUuid(strID).isNull() ? pItem->id() : strID,646 aID.isNull() ? pItem->id() : aID, 647 647 strCategory, strControl); 648 648 pDlg->execute(); … … 1066 1066 QIManagerDialog *pLogViewerDialog = 0; 1067 1067 /* Create and Show VM Log Viewer: */ 1068 if (!m_logViewers[pItem->machine().GetHardwareUUID() ])1068 if (!m_logViewers[pItem->machine().GetHardwareUUID().toString()]) 1069 1069 { 1070 1070 UIVMLogViewerDialogFactory dialogFactory(actionPool(), pItem->machine()); … … 1072 1072 if (pLogViewerDialog) 1073 1073 { 1074 m_logViewers[pItem->machine().GetHardwareUUID() ] = pLogViewerDialog;1074 m_logViewers[pItem->machine().GetHardwareUUID().toString()] = pLogViewerDialog; 1075 1075 connect(pLogViewerDialog, &QIManagerDialog::sigClose, 1076 1076 this, &UIVirtualBoxManager::sltCloseLogViewerWindow); … … 1079 1079 else 1080 1080 { 1081 pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID() ];1081 pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID().toString()]; 1082 1082 } 1083 1083 if (pLogViewerDialog) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r74868 r74878 120 120 * @{ */ 121 121 /** Handles CVirtualBox event about state change for machine with @a strID. */ 122 void sltHandleStateChange(const Q String &strID);122 void sltHandleStateChange(const QUuid &aID); 123 123 /** @} */ 124 124 … … 177 177 void sltOpenMachineSettingsDialog(QString strCategory = QString(), 178 178 QString strControl = QString(), 179 const Q String &strID = QString());179 const QUuid &aID = QUuid()); 180 180 /** Handles call to open Machine Settings dialog the default way. */ 181 181 void sltOpenMachineSettingsDialogDefault() { sltOpenMachineSettingsDialog(); } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r74560 r74878 52 52 53 53 /** Notifies aboud Details-pane link clicked. */ 54 void sigMachineSettingsLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);54 void sigMachineSettingsLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 55 55 56 56 /** Notifies about Tool type change. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.cpp
r74311 r74878 120 120 bool needsResort = true; 121 121 122 m_ strId = m_machine.GetId();122 m_uId = m_machine.GetId(); 123 123 m_strSettingsFile = m_machine.GetSettingsFilePath(); 124 124 … … 158 158 /* Also take restrictions into account: */ 159 159 if ( m_configurationAccessLevel != ConfigurationAccessLevel_Null 160 && !gEDataManager->machineReconfigurationEnabled(m_ strId))160 && !gEDataManager->machineReconfigurationEnabled(m_uId)) 161 161 m_configurationAccessLevel = ConfigurationAccessLevel_Null; 162 162 163 163 /* Should we show details for this item? */ 164 m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_ strId);164 m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_uId); 165 165 } 166 166 else -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.h
r73424 r74878 47 47 QPixmap osPixmap(QSize *pLogicalSize = 0) const; 48 48 QString osTypeId() const { return m_strOSTypeId; } 49 Q String id() const { return m_strId; }49 QUuid id() const { return m_uId; } 50 50 51 51 QString machineStateName() const; … … 93 93 94 94 /* Cached machine data (to minimize server requests) */ 95 Q String m_strId;95 QUuid m_uId; 96 96 QString m_strSettingsFile; 97 97 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h
r74482 r74878 23 23 #include <QRectF> 24 24 #include <QString> 25 #include <QUuid> 25 26 26 27 /* GUI includes: */ … … 174 175 175 176 /** Updates all children items with specified @a strId. */ 176 virtual void updateAllItems(const Q String &strId) = 0;177 virtual void updateAllItems(const QUuid &aId) = 0; 177 178 /** Removes all children items with specified @a strId. */ 178 virtual void removeAllItems(const Q String &strId) = 0;179 virtual void removeAllItems(const QUuid &aId) = 0; 179 180 180 181 /** Searches for a first child item answering to specified @a strSearchTag and @a iItemSearchFlags. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r74775 r74878 276 276 } 277 277 278 void UIChooserItemGlobal::updateAllItems(const Q String&)278 void UIChooserItemGlobal::updateAllItems(const QUuid &) 279 279 { 280 280 /* Update this global-item: */ … … 287 287 } 288 288 289 void UIChooserItemGlobal::removeAllItems(const Q String&)289 void UIChooserItemGlobal::removeAllItems(const QUuid &) 290 290 { 291 291 // Just do nothing .. -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.h
r74596 r74878 116 116 117 117 /** Updates all children items with specified @a strId. */ 118 virtual void updateAllItems(const Q String &strId) /* override */;118 virtual void updateAllItems(const QUuid &aId) /* override */; 119 119 /** Removes all children items with specified @a strId. */ 120 virtual void removeAllItems(const Q String &strId) /* override */;120 virtual void removeAllItems(const QUuid &aId) /* override */; 121 121 122 122 /** Searches for a first child item answering to specified @a strSearchTag and @a iItemSearchFlags. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r74840 r74878 657 657 } 658 658 659 void UIChooserItemGroup::updateAllItems(const Q String &strId)659 void UIChooserItemGroup::updateAllItems(const QUuid &aId) 660 660 { 661 661 /* Update all the required items recursively: */ 662 662 foreach (UIChooserItem *pItem, items()) 663 pItem->updateAllItems( strId);664 } 665 666 void UIChooserItemGroup::removeAllItems(const Q String &strId)663 pItem->updateAllItems(aId); 664 } 665 666 void UIChooserItemGroup::removeAllItems(const QUuid &aId) 667 667 { 668 668 /* Remove all the required items recursively: */ 669 669 foreach (UIChooserItem *pItem, items()) 670 pItem->removeAllItems( strId);670 pItem->removeAllItems(aId); 671 671 } 672 672 … … 1319 1319 } 1320 1320 1321 bool UIChooserItemGroup::isContainsMachine(const Q String &strId) const1321 bool UIChooserItemGroup::isContainsMachine(const QUuid &aId) const 1322 1322 { 1323 1323 /* Check each machine-item: */ 1324 1324 foreach (UIChooserItem *pItem, m_machineItems) 1325 if (pItem->toMachineItem()->id() == strId)1325 if (pItem->toMachineItem()->id() == aId) 1326 1326 return true; 1327 1327 /* Found nothing? */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r74717 r74878 162 162 163 163 /** Updates all children items with specified @a strId. */ 164 virtual void updateAllItems(const Q String &strId) /* override */;164 virtual void updateAllItems(const QUuid &aId) /* override */; 165 165 /** Removes all children items with specified @a strId. */ 166 virtual void removeAllItems(const Q String &strId) /* override */;166 virtual void removeAllItems(const QUuid &aId) /* override */; 167 167 168 168 /** Searches for a first child item answering to specified @a strSearchTag and @a iItemSearchFlags. */ … … 281 281 * @{ */ 282 282 /** Returns whether group contains machine with @a strId. */ 283 bool isContainsMachine(const Q String &strId) const;283 bool isContainsMachine(const QUuid &aId) const; 284 284 /** Returns whether group contains locked machine. */ 285 285 bool isContainsLockedMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r74598 r74878 346 346 } 347 347 348 void UIChooserItemMachine::updateAllItems(const Q String &strId)348 void UIChooserItemMachine::updateAllItems(const QUuid &aId) 349 349 { 350 350 /* Skip other ids: */ 351 if (id() != strId)351 if (id() != QUuid(aId)) 352 352 return; 353 353 … … 365 365 } 366 366 367 void UIChooserItemMachine::removeAllItems(const Q String &strId)367 void UIChooserItemMachine::removeAllItems(const QUuid &aId) 368 368 { 369 369 /* Skip wrong id: */ 370 if (id() != strId)370 if (id() != QUuid(aId)) 371 371 return; 372 372 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h
r74598 r74878 19 19 #define ___UIChooserItemMachine_h___ 20 20 21 /* Qt includes */ 22 #include <QUuid> 23 21 24 /* GUI includes: */ 22 25 #include "UIVirtualMachineItem.h" … … 129 132 130 133 /** Updates all children items with specified @a strId. */ 131 virtual void updateAllItems(const Q String &strId) /* override */;134 virtual void updateAllItems(const QUuid &aId) /* override */; 132 135 /** Removes all children items with specified @a strId. */ 133 virtual void removeAllItems(const Q String &strId) /* override */;136 virtual void removeAllItems(const QUuid &aId) /* override */; 134 137 135 138 /** Searches for a first child item answering to specified @a strSearchTag and @a iItemSearchFlags. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r74868 r74878 749 749 } 750 750 751 void UIChooserModel::sltMachineStateChanged( QString strId,KMachineState)751 void UIChooserModel::sltMachineStateChanged(const QUuid &aId, const KMachineState) 752 752 { 753 753 /* Update machine-items with passed id: */ 754 mainRoot()->updateAllItems( strId);755 } 756 757 void UIChooserModel::sltMachineDataChanged( QString strId)754 mainRoot()->updateAllItems(aId); 755 } 756 757 void UIChooserModel::sltMachineDataChanged(const QUuid &aId) 758 758 { 759 759 /* Update machine-items with passed id: */ 760 mainRoot()->updateAllItems( strId);761 } 762 763 void UIChooserModel::sltMachineRegistered( QString strId,bool fRegistered)760 mainRoot()->updateAllItems(aId); 761 } 762 763 void UIChooserModel::sltMachineRegistered(const QUuid &aId, const bool fRegistered) 764 764 { 765 765 /* New VM registered? */ … … 767 767 { 768 768 /* Search for corresponding machine: */ 769 CMachine comMachine = vboxGlobal().virtualBox().FindMachine( strId);769 CMachine comMachine = vboxGlobal().virtualBox().FindMachine(aId.toString()); 770 770 /* Should we show this machine? */ 771 if (gEDataManager->showMachineInSelectorChooser( strId))771 if (gEDataManager->showMachineInSelectorChooser(aId)) 772 772 { 773 773 /* Add new machine-item: */ … … 777 777 updateLayout(); 778 778 /* Change current-item only if VM was created from the GUI side: */ 779 if ( strId == m_strLastCreatedMachineId)779 if (aId == m_uLastCreatedMachineId) 780 780 { 781 781 setCurrentItem(mainRoot()->searchForItem(comMachine.GetName(), … … 789 789 { 790 790 /* Remove machine-items with passed id: */ 791 mainRoot()->removeAllItems( strId);791 mainRoot()->removeAllItems(aId.toString()); 792 792 /* Update model: */ 793 793 cleanupGroupTree(); … … 805 805 } 806 806 807 void UIChooserModel::sltSessionStateChanged( QString strId,KSessionState)807 void UIChooserModel::sltSessionStateChanged(const QUuid &aId, const KSessionState) 808 808 { 809 809 /* Update machine-items with passed id: */ 810 mainRoot()->updateAllItems( strId);811 } 812 813 void UIChooserModel::sltSnapshotChanged( QString strId, QString)810 mainRoot()->updateAllItems(aId); 811 } 812 813 void UIChooserModel::sltSnapshotChanged(const QUuid &aId, const QUuid &) 814 814 { 815 815 /* Update machine-items with passed id: */ 816 mainRoot()->updateAllItems( strId);816 mainRoot()->updateAllItems(aId); 817 817 } 818 818 … … 1001 1001 * on success for current-item handling: */ 1002 1002 if (pWizard->exec() == QDialog::Accepted) 1003 m_ strLastCreatedMachineId = pWizard->createdMachineId();1003 m_uLastCreatedMachineId = pWizard->createdMachineId(); 1004 1004 1005 1005 if (pWizard) … … 1063 1063 } 1064 1064 1065 void UIChooserModel::sltReloadMachine(const Q String &strId)1065 void UIChooserModel::sltReloadMachine(const QUuid &aId) 1066 1066 { 1067 1067 /* Remove all the items first: */ 1068 mainRoot()->removeAllItems( strId);1068 mainRoot()->removeAllItems(aId); 1069 1069 /* Wipe out empty groups: */ 1070 1070 cleanupGroupTree(); 1071 1071 1072 1072 /* Show machine if we should: */ 1073 CMachine comMachine = vboxGlobal().virtualBox().FindMachine( strId);1074 if (gEDataManager->showMachineInSelectorChooser( strId))1073 CMachine comMachine = vboxGlobal().virtualBox().FindMachine(aId.toString()); 1074 if (gEDataManager->showMachineInSelectorChooser(aId)) 1075 1075 addMachineIntoTheTree(comMachine); 1076 1076 … … 1156 1156 1157 1157 /* Prepare arrays: */ 1158 QMap<Q String, bool> verdicts;1158 QMap<QUuid, bool> verdicts; 1159 1159 QList<UIChooserItem*> itemsToRemove; 1160 Q StringListmachinesToUnregister;1160 QList<QUuid> machinesToUnregister; 1161 1161 1162 1162 /* For each selected machine-item: */ … … 1164 1164 { 1165 1165 /* Get machine-item id: */ 1166 Q String strId = pItem->toMachineItem()->id();1166 QUuid uId = pItem->toMachineItem()->id(); 1167 1167 1168 1168 /* We already decided for that machine? */ 1169 if (verdicts.contains( strId))1169 if (verdicts.contains(uId)) 1170 1170 { 1171 1171 /* To remove similar machine items? */ 1172 if (!verdicts[ strId])1172 if (!verdicts[uId]) 1173 1173 itemsToRemove << pItem; 1174 1174 continue; … … 1178 1178 int iSelectedCopyCount = 0; 1179 1179 foreach (UIChooserItem *pSelectedItem, selectedMachineItemList) 1180 if (pSelectedItem->toMachineItem()->id() == strId)1180 if (pSelectedItem->toMachineItem()->id() == uId) 1181 1181 ++iSelectedCopyCount; 1182 1182 /* Existing copy count: */ 1183 1183 int iExistingCopyCount = 0; 1184 1184 foreach (UIChooserItem *pExistingItem, existingMachineItemList) 1185 if (pExistingItem->toMachineItem()->id() == strId)1185 if (pExistingItem->toMachineItem()->id() == uId) 1186 1186 ++iExistingCopyCount; 1187 1187 /* If selected copy count equal to existing copy count, … … 1189 1189 * we will just propose to remove selected items: */ 1190 1190 bool fVerdict = iSelectedCopyCount == iExistingCopyCount; 1191 verdicts.insert( strId, fVerdict);1191 verdicts.insert(uId, fVerdict); 1192 1192 if (fVerdict) 1193 machinesToUnregister << strId;1193 machinesToUnregister.append(uId); 1194 1194 else 1195 1195 itemsToRemove << pItem; … … 1440 1440 1441 1441 /* Setup global connections: */ 1442 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(Q String, KMachineState)),1443 this, SLOT(sltMachineStateChanged(Q String, KMachineState)));1444 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(Q String)),1445 this, SLOT(sltMachineDataChanged(Q String)));1446 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(Q String, bool)),1447 this, SLOT(sltMachineRegistered(Q String, bool)));1448 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(Q String, KSessionState)),1449 this, SLOT(sltSessionStateChanged(Q String, KSessionState)));1450 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(Q String, QString)),1451 this, SLOT(sltSnapshotChanged(Q String, QString)));1452 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(Q String, QString)),1453 this, SLOT(sltSnapshotChanged(Q String, QString)));1454 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(Q String, QString)),1455 this, SLOT(sltSnapshotChanged(Q String, QString)));1456 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(Q String, QString)),1457 this, SLOT(sltSnapshotChanged(Q String, QString)));1442 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 1443 this, SLOT(sltMachineStateChanged(QUuid, KMachineState))); 1444 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QUuid)), 1445 this, SLOT(sltMachineDataChanged(QUuid))); 1446 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QUuid, bool)), 1447 this, SLOT(sltMachineRegistered(QUuid, bool))); 1448 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), 1449 this, SLOT(sltSessionStateChanged(QUuid, KSessionState))); 1450 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QUuid, QUuid)), 1451 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1452 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), 1453 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1454 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QUuid, QUuid)), 1455 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1456 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), 1457 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1458 1458 1459 1459 /* Setup action connections: */ … … 1754 1754 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1755 1755 { 1756 const Q String strMachineID = machine.GetId();1757 if (! strMachineID.isEmpty() && gEDataManager->showMachineInSelectorChooser(strMachineID))1756 const QUuid uMachineID = machine.GetId(); 1757 if (!uMachineID.isNull() && gEDataManager->showMachineInSelectorChooser(uMachineID)) 1758 1758 addMachineIntoTheTree(machine); 1759 1759 } … … 1769 1769 1770 1770 /* Which VM we are loading: */ 1771 LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().to Utf8().constData()));1771 LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toString().toUtf8().constData())); 1772 1772 /* Is that machine accessible? */ 1773 1773 if (machine.GetAccessible()) … … 1793 1793 } 1794 1794 /* Update group definitions: */ 1795 m_groups[machine.GetId() ] = groupList;1795 m_groups[machine.GetId().toString()] = groupList; 1796 1796 } 1797 1797 /* Inaccessible machine: */ … … 1799 1799 { 1800 1800 /* VM is accessible: */ 1801 LogRelFlow(("UIChooserModel: VM {%s} is inaccessible.\n", machine.GetId().to Utf8().constData()));1801 LogRelFlow(("UIChooserModel: VM {%s} is inaccessible.\n", machine.GetId().toString().toUtf8().constData())); 1802 1802 /* Create machine-item with main-root group-item as parent: */ 1803 1803 createMachineItem(machine, mainRoot()); … … 1911 1911 /* Which position should be current item placed by definitions? */ 1912 1912 QString strDefinitionName = pItem->type() == UIChooserItemType_Group ? pItem->name() : 1913 pItem->type() == UIChooserItemType_Machine ? pItem->toMachineItem()->id() :1913 pItem->type() == UIChooserItemType_Machine ? pItem->toMachineItem()->id().toString() : 1914 1914 QString(); 1915 1915 AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!")); … … 1978 1978 { 1979 1979 /* Create machine-item: */ 1980 new UIChooserItemMachine(pParentItem, machine, getDesiredPosition(pParentItem, UIChooserItemType_Machine, machine.GetId() ));1980 new UIChooserItemMachine(pParentItem, machine, getDesiredPosition(pParentItem, UIChooserItemType_Machine, machine.GetId().toString())); 1981 1981 } 1982 1982 … … 2011 2011 } 2012 2012 2013 void UIChooserModel::unregisterMachines(const Q StringList&ids)2013 void UIChooserModel::unregisterMachines(const QList<QUuid> &ids) 2014 2014 { 2015 2015 /* Populate machine list: */ 2016 2016 QList<CMachine> machines; 2017 2017 CVirtualBox vbox = vboxGlobal().virtualBox(); 2018 foreach (const Q String &strId, ids)2019 { 2020 CMachine machine = vbox.FindMachine( strId);2018 foreach (const QUuid &uId, ids) 2019 { 2020 CMachine machine = vbox.FindMachine(uId.toString()); 2021 2021 if (!machine.isNull()) 2022 2022 machines << machine; … … 2129 2129 UIThreadGroupDefinitionSave::prepare(); 2130 2130 emit sigGroupSavingStateChanged(); 2131 connect(UIThreadGroupDefinitionSave::instance(), SIGNAL(sigReload(Q String)),2132 this, SLOT(sltReloadMachine(Q String)));2131 connect(UIThreadGroupDefinitionSave::instance(), SIGNAL(sigReload(QUuid)), 2132 this, SLOT(sltReloadMachine(QUuid))); 2133 2133 UIThreadGroupDefinitionSave::instance()->configure(this, m_groups, groups); 2134 2134 UIThreadGroupDefinitionSave::instance()->start(); … … 2160 2160 if (UIChooserItemMachine *pMachineItem = pItem->toMachineItem()) 2161 2161 if (pMachineItem->accessible()) 2162 definitions[pMachineItem->id() ] << pParentGroup->fullName();2162 definitions[pMachineItem->id().toString()] << pParentGroup->fullName(); 2163 2163 /* Iterate over all the group-items: */ 2164 2164 foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Group)) … … 2180 2180 /* Iterate over all the machine-items: */ 2181 2181 foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Machine)) 2182 orders[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id() );2182 orders[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id().toString()); 2183 2183 } 2184 2184 … … 2284 2284 { 2285 2285 /* 1. Open session: */ 2286 session = vboxGlobal().openSession( strId);2286 session = vboxGlobal().openSession(QUuid(strId)); 2287 2287 if (session.isNull()) 2288 2288 break; … … 2312 2312 /* Cleanup if necessary: */ 2313 2313 if (machine.isNull() || !machine.isOk()) 2314 emit sigReload( strId);2314 emit sigReload(QUuid(strId)); 2315 2315 if (!session.isNull()) 2316 2316 session.UnlockMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r74586 r74878 25 25 #include <QThread> 26 26 #include <QTransform> 27 #include <QUuid> 27 28 28 29 /* GUI includes: */ … … 266 267 * @{ */ 267 268 /** Handles machine @a enmState change for machine with certain @a strId. */ 268 void sltMachineStateChanged( QString strId,KMachineState enmState);269 void sltMachineStateChanged(const QUuid &aId, const KMachineState enmState); 269 270 /** Handles machine data change for machine with certain @a strId. */ 270 void sltMachineDataChanged( QString strId);271 void sltMachineDataChanged(const QUuid &aId); 271 272 /** Handles machine registering/unregistering for machine with certain @a strId. */ 272 void sltMachineRegistered( QString strId,bool fRegistered);273 void sltMachineRegistered(const QUuid &aId, const bool fRegistered); 273 274 /** Handles session @a enmState change for machine with certain @a strId. */ 274 void sltSessionStateChanged( QString strId,KSessionState enmState);275 void sltSessionStateChanged(const QUuid &aId, const KSessionState enmState); 275 276 /** Handles snapshot change for machine/snapshot with certain @a strId / @a strSnapshotId. */ 276 void sltSnapshotChanged( QString strId, QString strSnapshotId);277 void sltSnapshotChanged(const QUuid &aId, const QUuid &aSnapshotId); 277 278 /** @} */ 278 279 … … 304 305 void sltGroupSelectedMachines(); 305 306 /** Handles reload machine with certain @a strId request. */ 306 void sltReloadMachine(const Q String &strId);307 void sltReloadMachine(const QUuid &aId); 307 308 /** Handles sort parent group request. */ 308 309 void sltSortParentGroup(); … … 431 432 void removeItems(const QList<UIChooserItem*> &items); 432 433 /** Unregisters virtual machines using list of @a ids. */ 433 void unregisterMachines(const Q StringList&ids);434 void unregisterMachines(const QList<QUuid> &ids); 434 435 435 436 /** Processes drag move @a pEvent. */ … … 514 515 515 516 /** Holds the Id of last VM created from the GUI side. */ 516 Q String m_strLastCreatedMachineId;517 QUuid m_uLastCreatedMachineId; 517 518 /** @} */ 518 519 … … 533 534 534 535 /** Notifies about machine with certain @a strId to be reloaded. */ 535 void sigReload( QString strId);536 void sigReload(const QUuid &aId); 536 537 537 538 /** Notifies about task is complete. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h
r74679 r74878 41 41 void sigLinkClicked(const QString &strCategory, 42 42 const QString &strControl, 43 const Q String &strId);43 const QUuid &aId); 44 44 45 45 /** Notifies listeners about sliding started. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r74689 r74878 533 533 connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)), 534 534 model(), SLOT(sltToggleElements(DetailsElementType, bool))); 535 connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)),536 model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)));535 connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid &)), 536 model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid &))); 537 537 } 538 538 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h
r74689 r74878 64 64 * @param strControl Brings the wanted settings control. 65 65 * @param strId Brings the ID. */ 66 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String&strId);66 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &strId); 67 67 /** @} */ 68 68 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp
r74718 r74878 79 79 80 80 /* Generate new group-id: */ 81 m_ strGroupId = QUuid::createUuid().toString();81 m_uGroupId = QUuid::createUuid(); 82 82 83 83 /* Request to build first step: */ 84 emit sigBuildStep(m_ strGroupId, 0);84 emit sigBuildStep(m_uGroupId, 0); 85 85 } 86 86 … … 88 88 { 89 89 /* Generate new group-id: */ 90 m_ strGroupId = QUuid::createUuid().toString();90 m_uGroupId = QUuid::createUuid(); 91 91 } 92 92 … … 172 172 } 173 173 174 void UIDetailsGroup::sltBuildStep( QString strStepId, int iStepNumber)174 void UIDetailsGroup::sltBuildStep(const QUuid &aStepId, int iStepNumber) 175 175 { 176 176 /* Cleanup build-step: */ … … 179 179 180 180 /* Is step id valid? */ 181 if ( strStepId != m_strGroupId)181 if (aStepId != m_uGroupId) 182 182 return; 183 183 … … 194 194 195 195 /* Create next build-step: */ 196 m_pBuildStep = new UIPrepareStep(this, pSet, strStepId, iStepNumber + 1);196 m_pBuildStep = new UIPrepareStep(this, pSet, aStepId, iStepNumber + 1); 197 197 198 198 /* Build set: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h
r74690 r74878 86 86 * @param iStepNumber Brings the step number. */ 87 87 /** @} */ 88 virtual void sltBuildStep( QString strStepId, int iStepNumber) /* override */;88 virtual void sltBuildStep(const QUuid &aStepId, int iStepNumber) /* override */; 89 89 90 90 protected: … … 143 143 UIPrepareStep *m_pBuildStep; 144 144 /** Holds the generated group ID. */ 145 Q String m_strGroupId;145 QUuid m_uGroupId; 146 146 /** @} */ 147 147 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.cpp
r74082 r74878 271 271 } 272 272 273 void UIDetailsItem::sltBuildStep( QString, int)273 void UIDetailsItem::sltBuildStep(const QUuid &, int) 274 274 { 275 275 AssertMsgFailed(("This item doesn't support building!")); … … 281 281 *********************************************************************************************************************************/ 282 282 283 UIPrepareStep::UIPrepareStep(QObject *pParent, QObject *pBuildObject, const Q String &strStepId, int iStepNumber)283 UIPrepareStep::UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber) 284 284 : QObject(pParent) 285 , m_ strStepId(strStepId)285 , m_uStepId(aStepId) 286 286 , m_iStepNumber(iStepNumber) 287 287 { … … 290 290 this, SLOT(sltStepDone()), 291 291 Qt::QueuedConnection); 292 connect(this, SIGNAL(sigStepDone(Q String, int)),293 pParent, SLOT(sltBuildStep(Q String, int)),292 connect(this, SIGNAL(sigStepDone(QUuid, int)), 293 pParent, SLOT(sltBuildStep(QUuid, int)), 294 294 Qt::QueuedConnection); 295 295 } … … 297 297 void UIPrepareStep::sltStepDone() 298 298 { 299 emit sigStepDone(m_ strStepId, m_iStepNumber);300 } 299 emit sigStepDone(m_uStepId, m_iStepNumber); 300 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.h
r74082 r74878 18 18 #ifndef ___UIDetailsItem_h___ 19 19 #define ___UIDetailsItem_h___ 20 21 /* Qt includes */ 22 #include <QUuid> 20 23 21 24 /* GUI includes: */ … … 56 59 * @param strStepId Brings the step ID. 57 60 * @param iStepNumber Brings the step number. */ 58 void sigBuildStep( QString strStepId, int iStepNumber);61 void sigBuildStep(const QUuid &aStepId, int iStepNumber); 59 62 /** Notifies listeners about step build complete. */ 60 63 void sigBuildDone(); … … 127 130 * @param iStepNumber Brings the step number. */ 128 131 /** @} */ 129 virtual void sltBuildStep( QString strStepId, int iStepNumber);132 virtual void sltBuildStep(const QUuid &aStepId, int iStepNumber); 130 133 131 134 protected: … … 154 157 * @param strStepId Brings the step ID. 155 158 * @param iStepNumber Brings the step number. */ 156 void sigStepDone( QString strStepId, int iStepNumber);159 void sigStepDone(const QUuid& aStepId, int iStepNumber); 157 160 158 161 public: … … 162 165 * @param strStepId Brings the step ID. 163 166 * @param iStepNumber Brings the step number.*/ 164 UIPrepareStep(QObject *pParent, QObject *pBuildObject, const Q String &strStepId, int iStepNumber);167 UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber); 165 168 166 169 private slots: … … 172 175 173 176 /** Holds the step ID. */ 174 Q String m_strStepId;177 QUuid m_uStepId; 175 178 /** Holds the step number. */ 176 int 179 int m_iStepNumber; 177 180 }; 178 181 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.h
r74680 r74878 54 54 55 55 /* Notifier: Link processing stuff: */ 56 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);56 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 57 57 58 58 public: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r74735 r74878 115 115 } 116 116 117 void UIDetailsSet::sltBuildStep( QString strStepId, int iStepNumber)117 void UIDetailsSet::sltBuildStep(const QUuid &aStepId, int iStepNumber) 118 118 { 119 119 /* Cleanup build-step: */ … … 122 122 123 123 /* Is step id valid? */ 124 if ( strStepId != m_strSetId)124 if (aStepId != m_uSetId) 125 125 return; 126 126 … … 175 175 { 176 176 /* Create next build-step: */ 177 m_pBuildStep = new UIPrepareStep(this, pElement, strStepId, iStepNumber + 1);177 m_pBuildStep = new UIPrepareStep(this, pElement, aStepId, iStepNumber + 1); 178 178 179 179 /* Build element: */ … … 184 184 { 185 185 /* Just build next step: */ 186 sltBuildStep( strStepId, iStepNumber + 1);186 sltBuildStep(aStepId, iStepNumber + 1); 187 187 } 188 188 } … … 541 541 } 542 542 543 void UIDetailsSet::sltMachineStateChange( QString strId)543 void UIDetailsSet::sltMachineStateChange(const QUuid &aId) 544 544 { 545 545 /* Is this our VM changed? */ 546 if (m_machine.GetId() != strId)546 if (m_machine.GetId() != aId) 547 547 return; 548 548 … … 551 551 } 552 552 553 void UIDetailsSet::sltMachineAttributesChange( QString strId)553 void UIDetailsSet::sltMachineAttributesChange(const QUuid &aId) 554 554 { 555 555 /* Is this our VM changed? */ 556 if (m_machine.GetId() != strId)556 if (m_machine.GetId() != aId) 557 557 return; 558 558 … … 576 576 { 577 577 /* Global-events connections: */ 578 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(Q String, KMachineState)), this, SLOT(sltMachineStateChange(QString)));579 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(Q String)), this, SLOT(sltMachineAttributesChange(QString)));580 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(Q String, KSessionState)), this, SLOT(sltMachineAttributesChange(QString)));581 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));582 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));583 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));584 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));578 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), this, SLOT(sltMachineStateChange(QUuid))); 579 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 580 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), this, SLOT(sltMachineAttributesChange(QUuid))); 581 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 582 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 583 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 584 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 585 585 586 586 /* Meidum-enumeration connections: */ … … 617 617 618 618 /* Generate new set-id: */ 619 m_ strSetId = QUuid::createUuid().toString();619 m_uSetId = QUuid::createUuid(); 620 620 621 621 /* Request to build first step: */ 622 emit sigBuildStep(m_ strSetId, DetailsElementType_General);622 emit sigBuildStep(m_uSetId, DetailsElementType_General); 623 623 } 624 624 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h
r74687 r74878 72 72 * @param iStepNumber Brings the step number. */ 73 73 /** @} */ 74 virtual void sltBuildStep( QString strStepId, int iStepNumber) /* override */;74 virtual void sltBuildStep(const QUuid &aStepId, int iStepNumber) /* override */; 75 75 76 76 protected: … … 125 125 * @{ */ 126 126 /** Handles machine-state change for item with @a strId. */ 127 void sltMachineStateChange( QString strId);127 void sltMachineStateChange(const QUuid &aId); 128 128 /** Handles machine-attribute change for item with @a strId. */ 129 void sltMachineAttributesChange( QString strId);129 void sltMachineAttributesChange(const QUuid &aId); 130 130 /** @} */ 131 131 … … 206 206 int m_iLastStepNumber; 207 207 /** Holds the generated set ID. */ 208 Q String m_strSetId;208 QUuid m_uSetId; 209 209 /** @} */ 210 210 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.cpp
r73424 r74878 113 113 /* Setup connections: */ 114 114 connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(sltRecreatePreview())); 115 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(Q String, KMachineState)),116 this, SLOT(sltMachineStateChange(Q String)));115 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 116 this, SLOT(sltMachineStateChange(QUuid))); 117 117 118 118 /* Retranslate the UI */ … … 170 170 } 171 171 172 void UIMachinePreview::sltMachineStateChange( QString strId)172 void UIMachinePreview::sltMachineStateChange(const QUuid &aId) 173 173 { 174 174 /* Make sure its the event for our machine: */ 175 if (m_machine.isNull() || m_machine.GetId() != strId)175 if (m_machine.isNull() || m_machine.GetId() != aId) 176 176 return; 177 177 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.h
r73424 r74878 66 66 67 67 /* Handler: Global-event listener stuff: */ 68 void sltMachineStateChange( QString strId);68 void sltMachineStateChange(const QUuid &aId); 69 69 70 70 /* Handler: Preview recreator: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.cpp
r74805 r74878 213 213 } 214 214 /* Store the id of the newly create medium: */ 215 m_ strMediumID = newMedium.GetId();215 m_uMediumID = newMedium.GetId(); 216 216 217 217 /* Notify VBoxGlobal about the new medium: */ … … 225 225 } 226 226 227 Q StringUIFDCreationDialog::mediumID() const228 { 229 return m_ strMediumID;230 } 227 QUuid UIFDCreationDialog::mediumID() const 228 { 229 return m_uMediumID; 230 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.h
r72913 r74878 21 21 /* Qt includes: */ 22 22 #include <QDialog> 23 23 #include <QUuid> 24 24 25 25 /* GUI Includes */ … … 48 48 virtual void accept() /* override */; 49 49 /* Return the mediumID */ 50 Q StringmediumID() const;50 QUuid mediumID() const; 51 51 52 52 protected: … … 77 77 QString m_strMachineName; 78 78 QString m_strMachineFolder; 79 Q String m_strMediumID;79 QUuid m_uMediumID; 80 80 }; 81 81 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
r73953 r74878 38 38 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 39 39 40 Q String UIMedium::m_sstrNullID = QUuid().toString().remove('{').remove('}');40 QUuid UIMedium::m_uNullID; 41 41 QString UIMedium::m_sstrTable = QString("<table>%1</table>"); 42 42 QString UIMedium::m_sstrRow = QString("<tr><td>%1</td></tr>"); … … 87 87 m_strLastAccessError = other.lastAccessError(); 88 88 89 m_ strId = other.id();90 m_ strRootId = other.rootID();91 m_ strParentId = other.parentID();92 93 m_ strKey = other.key();89 m_uId = other.id(); 90 m_uRootId = other.rootID(); 91 m_uParentId = other.parentID(); 92 93 m_uKey = other.key(); 94 94 95 95 m_strName = other.name(); … … 155 155 { 156 156 /* Reset ID parameters: */ 157 m_ strId = nullID();158 m_ strRootId = nullID();159 m_ strParentId = nullID();157 m_uId = nullID(); 158 m_uRootId = nullID(); 159 m_uParentId = nullID(); 160 160 161 161 /* Reset cache parameters: */ … … 200 200 { 201 201 /* Refresh medium ID: */ 202 m_ strId = normalizedID(m_medium.GetId());202 m_uId = normalizedID(m_medium.GetId()); 203 203 /* Refresh root medium ID: */ 204 m_ strRootId = m_strId;204 m_uRootId = m_uId; 205 205 206 206 /* Init medium key if necessary: */ 207 if (m_ strKey.isNull())208 m_ strKey = m_strId;207 if (m_uKey.isNull()) 208 m_uKey = m_uId; 209 209 210 210 /* Check whether this is host-drive medium: */ … … 273 273 CMedium parentMedium = m_medium.GetParent(); 274 274 if (!parentMedium.isNull()) 275 m_ strParentId = normalizedID(parentMedium.GetId());275 m_uParentId = normalizedID(parentMedium.GetId()); 276 276 277 277 /* Only for created and accessible media: */ … … 281 281 while (!parentMedium.isNull()) 282 282 { 283 m_ strRootId = normalizedID(parentMedium.GetId());283 m_uRootId = normalizedID(parentMedium.GetId()); 284 284 parentMedium = parentMedium.GetParent(); 285 285 } 286 286 287 287 /* Refresh encryption attributes: */ 288 if (m_ strRootId != m_strId)288 if (m_uRootId != m_uId) 289 289 { 290 290 m_strEncryptionPasswordID = root().encryptionPasswordID(); … … 329 329 QString strMachineUsage; 330 330 /* Walk through all the machines this medium attached to: */ 331 foreach (const Q String &strMachineID, m_machineIds)331 foreach (const QUuid &uMachineID, m_machineIds) 332 332 { 333 333 /* Look for the corresponding machine: */ 334 CMachine machine = vbox.FindMachine( strMachineID);334 CMachine machine = vbox.FindMachine(uMachineID.toString()); 335 335 336 336 /* UIMedium object can wrap newly created CMedium object … … 346 346 347 347 /* Finally we can precisely check if current machine is 'hidden': */ 348 if (gEDataManager->showMachineInSelectorChooser( strMachineID))348 if (gEDataManager->showMachineInSelectorChooser(uMachineID)) 349 349 m_fUsedByHiddenMachinesOnly = false; 350 350 … … 352 352 QString strSnapshotUsage; 353 353 /* Walk through all the snapshots this medium attached to: */ 354 foreach (const Q String &strSnapshotID, m_medium.GetSnapshotIds(strMachineID))355 { 356 if ( strSnapshotID == strMachineID)354 foreach (const QUuid &uSnapshotID, m_medium.GetSnapshotIds(uMachineID)) 355 { 356 if (uSnapshotID == uMachineID) 357 357 { 358 358 /* The medium is attached to the machine in the current 359 359 * state, we don't distinguish this for now by always 360 360 * giving the VM name in front of snapshot names. */ 361 m_curStateMachineIds.push_back( strSnapshotID);361 m_curStateMachineIds.push_back(uSnapshotID); 362 362 continue; 363 363 } 364 364 365 365 /* Look for the corresponding snapshot: */ 366 CSnapshot snapshot = machine.FindSnapshot( strSnapshotID);366 CSnapshot snapshot = machine.FindSnapshot(uSnapshotID.toString()); 367 367 368 368 /* Snapshot can be NULL while takeSnaphot is in progress: */ … … 433 433 void UIMedium::updateParentID() 434 434 { 435 m_ strParentId = nullID();435 m_uParentId = nullID(); 436 436 if (m_type == UIMediumDeviceType_HardDisk) 437 437 { 438 438 CMedium parentMedium = m_medium.GetParent(); 439 439 if (!parentMedium.isNull()) 440 m_ strParentId = normalizedID(parentMedium.GetId());440 m_uParentId = normalizedID(parentMedium.GetId()); 441 441 } 442 442 } … … 565 565 566 566 /* static */ 567 Q StringUIMedium::nullID()568 { 569 return m_ sstrNullID;567 QUuid UIMedium::nullID() 568 { 569 return m_uNullID; 570 570 } 571 571 572 572 /* static */ 573 QString UIMedium::normalizedID(const QString &strID) 574 { 575 /* Handle wrong UUID (null/empty or invalid format): */ 576 if (QUuid(strID).toString().remove('{').remove('}') != strID) 577 return nullID(); 578 return strID; 573 QUuid UIMedium::normalizedID(const QUuid &aID) 574 { 575 /// @todo wipe out! 576 return aID; 579 577 } 580 578 … … 601 599 { 602 600 /* Redirect call to VBoxGlobal: */ 603 return vboxGlobal().medium(m_ strRootId);601 return vboxGlobal().medium(m_uRootId); 604 602 } 605 603 … … 607 605 { 608 606 /* Redirect call to VBoxGlobal: */ 609 return vboxGlobal().medium(m_ strParentId);607 return vboxGlobal().medium(m_uParentId); 610 608 } 611 609 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h
r73953 r74878 126 126 bool isNull() const 127 127 { 128 AssertReturn(m_ strId != nullID() || m_medium.isNull(), true);129 return m_ strId == nullID();128 AssertReturn(m_uId != nullID() || m_medium.isNull(), true); 129 return m_uId == nullID(); 130 130 } 131 131 … … 155 155 156 156 /** Returns the medium ID. */ 157 Q String id() const { return m_strId; }157 QUuid id() const { return m_uId; } 158 158 159 159 /** Returns the medium root ID. */ 160 Q String rootID() const { return m_strRootId; }160 QUuid rootID() const { return m_uRootId; } 161 161 /** Returns the medium parent ID. */ 162 Q String parentID() const { return m_strParentId; }162 QUuid parentID() const { return m_uParentId; } 163 163 164 164 /** Updates medium parent. */ … … 166 166 167 167 /** Returns the medium cache key. */ 168 Q String key() const { return m_strKey; }168 QUuid key() const { return m_uKey; } 169 169 /** Defines the medium cache @a strKey. */ 170 void setKey(const Q String &strKey) { m_strKey = strKey; }170 void setKey(const QUuid &aKey) { m_uKey = aKey; } 171 171 172 172 /** Returns the medium name. … … 309 309 310 310 /** Returns a vector of IDs of all machines this medium is attached to. */ 311 const QList<Q String>& machineIds() const { return m_machineIds; }311 const QList<QUuid>& machineIds() const { return m_machineIds; } 312 312 /** Returns a vector of IDs of all machines this medium is attached to 313 313 * in their current state (i.e. excluding snapshots). */ 314 const QList<Q String>& curStateMachineIds() const { return m_curStateMachineIds; }314 const QList<QUuid>& curStateMachineIds() const { return m_curStateMachineIds; } 315 315 316 316 /** Returns NULL medium ID. */ 317 static Q StringnullID();317 static QUuid nullID(); 318 318 319 319 /** Returns passed @a strID if it's valid or #nullID() overwise. */ 320 static Q String normalizedID(const QString &strID);320 static QUuid normalizedID(const QUuid &aID); 321 321 322 322 /** Determines if passed @a medium is attached to hidden machines only. */ … … 351 351 352 352 /** Holds the medium ID. */ 353 Q String m_strId;353 QUuid m_uId; 354 354 /** Holds the medium root ID. */ 355 Q String m_strRootId;355 QUuid m_uRootId; 356 356 /** Holds the medium parent ID. */ 357 Q String m_strParentId;357 QUuid m_uParentId; 358 358 359 359 /** Holds the medium cache key. */ 360 Q String m_strKey;360 QUuid m_uKey; 361 361 362 362 /** Holds the medium name. */ … … 397 397 QString m_strToolTip; 398 398 /** Holds the vector of IDs of all machines this medium is attached to. */ 399 QList<Q String> m_machineIds;399 QList<QUuid> m_machineIds; 400 400 /** Hodls the vector of IDs of all machines this medium is attached to 401 401 * in their current state (i.e. excluding snapshots). */ 402 QList<Q String> m_curStateMachineIds;402 QList<QUuid> m_curStateMachineIds; 403 403 404 404 /** Holds the medium cache for "don't show diffs" mode. */ … … 419 419 420 420 /** Holds the NULL medium ID. */ 421 static Q String m_sstrNullID;421 static QUuid m_uNullID; 422 422 /** Holds the medium tool-tip table template. */ 423 423 static QString m_sstrTable; … … 427 427 Q_DECLARE_METATYPE(UIMedium); 428 428 429 typedef QMap<Q String, UIMedium> UIMediumMap;429 typedef QMap<QUuid, UIMedium> UIMediumMap; 430 430 431 431 #endif /* !___UIMedium_h___ */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r73938 r74878 38 38 39 39 40 template<class T> 41 static QStringList toStringList(const QList<T> &list) 42 { 43 QStringList l; 44 foreach(const T &t, list) 45 l << t.toString(); 46 return l; 47 } 48 49 40 50 /** UITask extension used for medium enumeration purposes. */ 41 51 class UITaskMediumEnumeration : public UITask … … 86 96 } 87 97 88 QList<Q String> UIMediumEnumerator::mediumIDs() const98 QList<QUuid> UIMediumEnumerator::mediumIDs() const 89 99 { 90 100 /* Return keys of current medium-map: */ … … 92 102 } 93 103 94 UIMedium UIMediumEnumerator::medium(const Q String &strMediumID)104 UIMedium UIMediumEnumerator::medium(const QUuid &aMediumID) 95 105 { 96 106 /* Search through current medium-map for the medium with passed ID: */ 97 if (m_media.contains( strMediumID))98 return m_media[ strMediumID];107 if (m_media.contains(aMediumID)) 108 return m_media[aMediumID]; 99 109 /* Return NULL medium otherwise: */ 100 110 return UIMedium(); … … 104 114 { 105 115 /* Get medium ID: */ 106 const Q String strMediumID = medium.id();116 const QUuid uMediumID = medium.id(); 107 117 108 118 /* Do not create UIMedium(s) with incorrect ID: */ 109 AssertReturnVoid(! strMediumID.isNull());110 AssertReturnVoid( strMediumID != UIMedium::nullID());119 AssertReturnVoid(!uMediumID.isNull()); 120 AssertReturnVoid(uMediumID != UIMedium::nullID()); 111 121 /* Make sure medium doesn't exists already: */ 112 AssertReturnVoid(!m_media.contains( strMediumID));122 AssertReturnVoid(!m_media.contains(uMediumID)); 113 123 114 124 /* Insert medium: */ 115 m_media[ strMediumID] = medium;116 LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} created\n", strMediumID.toUtf8().constData()));125 m_media[uMediumID] = medium; 126 LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} created\n", uMediumID.toString().toUtf8().constData())); 117 127 118 128 /* Notify listener: */ 119 emit sigMediumCreated( strMediumID);120 } 121 122 void UIMediumEnumerator::deleteMedium(const Q String &strMediumID)129 emit sigMediumCreated(uMediumID); 130 } 131 132 void UIMediumEnumerator::deleteMedium(const QUuid &aMediumID) 123 133 { 124 134 /* Do not delete UIMedium(s) with incorrect ID: */ 125 AssertReturnVoid(! strMediumID.isNull());126 AssertReturnVoid( strMediumID != UIMedium::nullID());135 AssertReturnVoid(!aMediumID.isNull()); 136 AssertReturnVoid(aMediumID != UIMedium::nullID()); 127 137 /* Make sure medium still exists: */ 128 AssertReturnVoid(m_media.contains( strMediumID));138 AssertReturnVoid(m_media.contains(aMediumID)); 129 139 130 140 /* Remove medium: */ 131 m_media.remove( strMediumID);132 LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} deleted\n", strMediumID.toUtf8().constData()));141 m_media.remove(aMediumID); 142 LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} deleted\n", aMediumID.toString().toUtf8().constData())); 133 143 134 144 /* Notify listener: */ 135 emit sigMediumDeleted( strMediumID);145 emit sigMediumDeleted(aMediumID); 136 146 } 137 147 … … 175 185 176 186 /* Start enumeration for UIMedium(s) with correct ID: */ 177 foreach (const Q String &strMediumID, m_media.keys())178 if (! strMediumID.isNull() && strMediumID != UIMedium::nullID())179 createMediumEnumerationTask(m_media[ strMediumID]);187 foreach (const QUuid &uMediumID, m_media.keys()) 188 if (!uMediumID.isNull() && uMediumID != UIMedium::nullID()) 189 createMediumEnumerationTask(m_media[uMediumID]); 180 190 } 181 191 … … 186 196 187 197 /* Refresh all known media we have: */ 188 foreach (const Q String &strMediumID, m_media.keys())189 m_media[ strMediumID].refresh();190 } 191 192 void UIMediumEnumerator::sltHandleMachineUpdate( QString strMachineID)198 foreach (const QUuid &uMediumID, m_media.keys()) 199 m_media[uMediumID].refresh(); 200 } 201 202 void UIMediumEnumerator::sltHandleMachineUpdate(const QUuid &aMachineID) 193 203 { 194 204 LogRel2(("GUI: UIMediumEnumerator: Machine (or snapshot) event received, ID = %s\n", 195 strMachineID.toUtf8().constData()));205 aMachineID.toString().toUtf8().constData())); 196 206 197 207 /* Gather previously used UIMedium IDs: */ 198 Q StringListpreviousUIMediumIDs;199 calculateCachedUsage( strMachineID, previousUIMediumIDs, true /* take into account current state only */);208 QList<QUuid> previousUIMediumIDs; 209 calculateCachedUsage(aMachineID, previousUIMediumIDs, true /* take into account current state only */); 200 210 LogRel2(("GUI: UIMediumEnumerator: Old usage: %s\n", 201 previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));211 previousUIMediumIDs.isEmpty() ? "<empty>" : toStringList(previousUIMediumIDs).join(", ").toUtf8().constData())); 202 212 203 213 /* Gather currently used CMediums and their IDs: */ 204 214 CMediumMap currentCMediums; 205 Q StringListcurrentCMediumIDs;206 calculateActualUsage( strMachineID, currentCMediums, currentCMediumIDs, true /* take into account current state only */);215 QList<QUuid> currentCMediumIDs; 216 calculateActualUsage(aMachineID, currentCMediums, currentCMediumIDs, true /* take into account current state only */); 207 217 LogRel2(("GUI: UIMediumEnumerator: New usage: %s\n", 208 currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));218 currentCMediumIDs.isEmpty() ? "<empty>" : toStringList(currentCMediumIDs).join(", ").toUtf8().constData())); 209 219 210 220 /* Determine excluded media: */ 211 const QSet<Q String> previousSet = previousUIMediumIDs.toSet();212 const QSet<Q String> currentSet = currentCMediumIDs.toSet();213 const QSet<Q String> excludedSet = previousSet - currentSet;214 const Q StringListexcludedUIMediumIDs = excludedSet.toList();221 const QSet<QUuid> previousSet = previousUIMediumIDs.toSet(); 222 const QSet<QUuid> currentSet = currentCMediumIDs.toSet(); 223 const QSet<QUuid> excludedSet = previousSet - currentSet; 224 const QList<QUuid> excludedUIMediumIDs = excludedSet.toList(); 215 225 if (!excludedUIMediumIDs.isEmpty()) 216 LogRel2(("GUI: UIMediumEnumerator: Items excluded from usage: %s\n", excludedUIMediumIDs.join(", ").toUtf8().constData()));226 LogRel2(("GUI: UIMediumEnumerator: Items excluded from usage: %s\n", toStringList(excludedUIMediumIDs).join(", ").toUtf8().constData())); 217 227 if (!currentCMediumIDs.isEmpty()) 218 LogRel2(("GUI: UIMediumEnumerator: Items currently in usage: %s\n", currentCMediumIDs.join(", ").toUtf8().constData()));228 LogRel2(("GUI: UIMediumEnumerator: Items currently in usage: %s\n", toStringList(currentCMediumIDs).join(", ").toUtf8().constData())); 219 229 220 230 /* Update cache for excluded UIMediums: */ … … 225 235 226 236 LogRel2(("GUI: UIMediumEnumerator: Machine (or snapshot) event processed, ID = %s\n", 227 strMachineID.toUtf8().constData()));228 } 229 230 void UIMediumEnumerator::sltHandleMachineRegistration( QString strMachineID,bool fRegistered)237 aMachineID.toString().toUtf8().constData())); 238 } 239 240 void UIMediumEnumerator::sltHandleMachineRegistration(const QUuid &aMachineID, const bool fRegistered) 231 241 { 232 242 LogRel2(("GUI: UIMediumEnumerator: Machine %s event received, ID = %s\n", 233 243 fRegistered ? "registration" : "unregistration", 234 strMachineID.toUtf8().constData()));244 aMachineID.toString().toUtf8().constData())); 235 245 236 246 /* Machine was registered: */ … … 239 249 /* Gather currently used CMediums and their IDs: */ 240 250 CMediumMap currentCMediums; 241 Q StringListcurrentCMediumIDs;242 calculateActualUsage( strMachineID, currentCMediums, currentCMediumIDs, false /* take into account current state only */);251 QList<QUuid> currentCMediumIDs; 252 calculateActualUsage(aMachineID, currentCMediums, currentCMediumIDs, false /* take into account current state only */); 243 253 LogRel2(("GUI: UIMediumEnumerator: New usage: %s\n", 244 currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));254 currentCMediumIDs.isEmpty() ? "<empty>" : toStringList(currentCMediumIDs).join(", ").toUtf8().constData())); 245 255 /* Update cache with currently used CMediums: */ 246 256 recacheFromActualUsage(currentCMediums, currentCMediumIDs); … … 250 260 { 251 261 /* Gather previously used UIMedium IDs: */ 252 Q StringListpreviousUIMediumIDs;253 calculateCachedUsage( strMachineID, previousUIMediumIDs, false /* take into account current state only */);262 QList<QUuid> previousUIMediumIDs; 263 calculateCachedUsage(aMachineID, previousUIMediumIDs, false /* take into account current state only */); 254 264 LogRel2(("GUI: UIMediumEnumerator: Old usage: %s\n", 255 previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));265 previousUIMediumIDs.isEmpty() ? "<empty>" : toStringList(previousUIMediumIDs).join(", ").toUtf8().constData())); 256 266 /* Update cache for previously used UIMediums: */ 257 267 recacheFromCachedUsage(previousUIMediumIDs); … … 260 270 LogRel2(("GUI: UIMediumEnumerator: Machine %s event processed, ID = %s\n", 261 271 fRegistered ? "registration" : "unregistration", 262 strMachineID.toUtf8().constData()));263 } 264 265 void UIMediumEnumerator::sltHandleSnapshotDeleted( QString strMachineID, QString strSnapshotID)272 aMachineID.toString().toUtf8().constData())); 273 } 274 275 void UIMediumEnumerator::sltHandleSnapshotDeleted(const QUuid &aMachineID, const QUuid &aSnapshotID) 266 276 { 267 277 LogRel2(("GUI: UIMediumEnumerator: Snapshot-deleted event received, Machine ID = {%s}, Snapshot ID = {%s}\n", 268 strMachineID.toUtf8().constData(), strSnapshotID.toUtf8().constData()));278 aMachineID.toString().toUtf8().constData(), aSnapshotID.toString().toUtf8().constData())); 269 279 270 280 /* Gather previously used UIMedium IDs: */ 271 Q StringListpreviousUIMediumIDs;272 calculateCachedUsage( strMachineID, previousUIMediumIDs, false /* take into account current state only */);281 QList<QUuid> previousUIMediumIDs; 282 calculateCachedUsage(aMachineID, previousUIMediumIDs, false /* take into account current state only */); 273 283 LogRel2(("GUI: UIMediumEnumerator: Old usage: %s\n", 274 previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));284 previousUIMediumIDs.isEmpty() ? "<empty>" : toStringList(previousUIMediumIDs).join(", ").toUtf8().constData())); 275 285 276 286 /* Gather currently used CMediums and their IDs: */ 277 287 CMediumMap currentCMediums; 278 Q StringListcurrentCMediumIDs;279 calculateActualUsage( strMachineID, currentCMediums, currentCMediumIDs, true /* take into account current state only */);288 QList<QUuid> currentCMediumIDs; 289 calculateActualUsage(aMachineID, currentCMediums, currentCMediumIDs, true /* take into account current state only */); 280 290 LogRel2(("GUI: UIMediumEnumerator: New usage: %s\n", 281 currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));291 currentCMediumIDs.isEmpty() ? "<empty>" : toStringList(currentCMediumIDs).join(", ").toUtf8().constData())); 282 292 283 293 /* Update everything: */ … … 286 296 287 297 LogRel2(("GUI: UIMediumEnumerator: Snapshot-deleted event processed, Machine ID = {%s}, Snapshot ID = {%s}\n", 288 strMachineID.toUtf8().constData(), strSnapshotID.toUtf8().constData()));298 aMachineID.toString().toUtf8().constData(), aSnapshotID.toString().toUtf8().constData())); 289 299 } 290 300 … … 298 308 /* Get enumerated UIMedium: */ 299 309 const UIMedium uimedium = pTask->property("medium").value<UIMedium>(); 300 const Q String strUIMediumKey = uimedium.key();301 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} enumerated\n", strUIMediumKey.toUtf8().constData()));310 const QUuid uUIMediumKey = uimedium.key(); 311 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} enumerated\n", uUIMediumKey.toString().toUtf8().constData())); 302 312 303 313 /* Remove task from internal set: */ … … 305 315 306 316 /* Make sure such UIMedium still exists: */ 307 if (!m_media.contains( strUIMediumKey))308 { 309 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n", strUIMediumKey.toUtf8().constData()));317 if (!m_media.contains(uUIMediumKey)) 318 { 319 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n", uUIMediumKey.toString().toUtf8().constData())); 310 320 return; 311 321 } 312 322 313 323 /* Check if UIMedium ID was changed: */ 314 const Q String strUIMediumID = uimedium.id();324 const QUuid uUIMediumID = uimedium.id(); 315 325 /* UIMedium ID was changed to nullID: */ 316 if ( strUIMediumID == UIMedium::nullID())326 if (uUIMediumID == UIMedium::nullID()) 317 327 { 318 328 /* Delete this medium: */ 319 m_media.remove( strUIMediumKey);320 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n", strUIMediumKey.toUtf8().constData()));329 m_media.remove(uUIMediumKey); 330 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n", uUIMediumKey.toString().toUtf8().constData())); 321 331 322 332 /* And notify listener about delete: */ 323 emit sigMediumDeleted( strUIMediumKey);333 emit sigMediumDeleted(uUIMediumKey); 324 334 } 325 335 /* UIMedium ID was changed to something proper: */ 326 else if ( strUIMediumID != strUIMediumKey)336 else if (uUIMediumID != uUIMediumKey) 327 337 { 328 338 /* We have to reinject enumerated medium: */ 329 m_media.remove( strUIMediumKey);330 m_media[ strUIMediumID] = uimedium;331 m_media[ strUIMediumID].setKey(strUIMediumID);332 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n", strUIMediumKey.toUtf8().constData(),333 strUIMediumID.toUtf8().constData()));339 m_media.remove(uUIMediumKey); 340 m_media[uUIMediumID] = uimedium; 341 m_media[uUIMediumID].setKey(uUIMediumID); 342 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n", uUIMediumKey.toString().toUtf8().constData(), 343 uUIMediumID.toString().toUtf8().constData())); 334 344 335 345 /* And notify listener about delete/create: */ 336 emit sigMediumDeleted( strUIMediumKey);337 emit sigMediumCreated( strUIMediumID);346 emit sigMediumDeleted(uUIMediumKey); 347 emit sigMediumCreated(uUIMediumID); 338 348 } 339 349 /* UIMedium ID was not changed: */ … … 341 351 { 342 352 /* Just update enumerated medium: */ 343 m_media[ strUIMediumID] = uimedium;344 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n", strUIMediumID.toUtf8().constData()));353 m_media[uUIMediumID] = uimedium; 354 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n", uUIMediumID.toString().toUtf8().constData())); 345 355 346 356 /* And notify listener about update: */ 347 emit sigMediumEnumerated( strUIMediumID);357 emit sigMediumEnumerated(uUIMediumID); 348 358 } 349 359 … … 379 389 /* Insert NULL uimedium to the passed uimedium map. 380 390 * Get existing one from the previous map if any. */ 381 Q String strNullMediumID = UIMedium::nullID();382 UIMedium uimedium = m_media.contains( strNullMediumID) ? m_media[strNullMediumID] : UIMedium();383 media.insert( strNullMediumID, uimedium);391 QUuid uNullMediumID = UIMedium::nullID(); 392 UIMedium uimedium = m_media.contains(uNullMediumID) ? m_media[uNullMediumID] : UIMedium(); 393 media.insert(uNullMediumID, uimedium); 384 394 } 385 395 … … 395 405 396 406 /* Prepare uimedium on the basis of current medium: */ 397 Q String strMediumID = medium.GetId();398 UIMedium uimedium = m_media.contains( strMediumID) ? m_media[strMediumID] :407 QUuid uMediumID = medium.GetId(); 408 UIMedium uimedium = m_media.contains(uMediumID) ? m_media[uMediumID] : 399 409 UIMedium(medium, UIMediumDefs::mediumTypeToLocal(medium.GetDeviceType())); 400 410 … … 413 423 * @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only. 414 424 */ 415 void UIMediumEnumerator::calculateCachedUsage(const Q String &strMachineID, QStringList &previousUIMediumIDs,bool fTakeIntoAccountCurrentStateOnly) const425 void UIMediumEnumerator::calculateCachedUsage(const QUuid &aMachineID, QList<QUuid> &previousUIMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const 416 426 { 417 427 /* For each the UIMedium ID cache have: */ 418 foreach (const Q String &strMediumID, mediumIDs())428 foreach (const QUuid &uMediumID, mediumIDs()) 419 429 { 420 430 /* Get corresponding UIMedium: */ 421 const UIMedium &uimedium = m_media[ strMediumID];431 const UIMedium &uimedium = m_media[uMediumID]; 422 432 /* Get the list of the machines this UIMedium attached to. 423 433 * Take into account current-state only if necessary. */ 424 const QList<Q String> &machineIDs = fTakeIntoAccountCurrentStateOnly ?434 const QList<QUuid> &machineIDs = fTakeIntoAccountCurrentStateOnly ? 425 435 uimedium.curStateMachineIds() : uimedium.machineIds(); 426 436 /* Add this UIMedium ID to previous usage if necessary: */ 427 if (machineIDs.contains( strMachineID))428 previousUIMediumIDs << strMediumID;437 if (machineIDs.contains(aMachineID)) 438 previousUIMediumIDs.append(uMediumID); 429 439 } 430 440 } … … 437 447 * @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only. 438 448 */ 439 void UIMediumEnumerator::calculateActualUsage(const Q String &strMachineID, CMediumMap ¤tCMediums, QStringList ¤tCMediumIDs,bool fTakeIntoAccountCurrentStateOnly) const449 void UIMediumEnumerator::calculateActualUsage(const QUuid &aMachineID, CMediumMap ¤tCMediums, QList<QUuid> ¤tCMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const 440 450 { 441 451 /* Search for corresponding machine: */ 442 CMachine machine = vboxGlobal().virtualBox().FindMachine( strMachineID);452 CMachine machine = vboxGlobal().virtualBox().FindMachine(aMachineID.toString()); 443 453 if (machine.isNull()) 444 454 { … … 460 470 * @param currentCMediumIDs receives CMedium IDs used in actual data. 461 471 */ 462 void UIMediumEnumerator::calculateActualUsage(const CSnapshot &snapshot, CMediumMap ¤tCMediums, Q StringList¤tCMediumIDs) const472 void UIMediumEnumerator::calculateActualUsage(const CSnapshot &snapshot, CMediumMap ¤tCMediums, QList<QUuid> ¤tCMediumIDs) const 463 473 { 464 474 /* Check passed snapshot: */ … … 480 490 * @param currentCMediumIDs receives CMedium IDs used in actual data. 481 491 */ 482 void UIMediumEnumerator::calculateActualUsage(const CMachine &machine, CMediumMap ¤tCMediums, Q StringList¤tCMediumIDs) const492 void UIMediumEnumerator::calculateActualUsage(const CMachine &machine, CMediumMap ¤tCMediums, QList<QUuid> ¤tCMediumIDs) const 483 493 { 484 494 /* Check passed machine: */ … … 493 503 { 494 504 /* Make sure that CMedium was not yet closed: */ 495 const Q String strCMediumID = cmedium.GetId();496 if (cmedium.isOk() && ! strCMediumID.isNull())505 const QUuid uCMediumID = cmedium.GetId(); 506 if (cmedium.isOk() && !uCMediumID.isNull()) 497 507 { 498 508 /* Add this CMedium to current usage: */ 499 currentCMediums.insert( strCMediumID, cmedium);500 currentCMediumIDs << strCMediumID;509 currentCMediums.insert(uCMediumID, cmedium); 510 currentCMediumIDs.append(uCMediumID); 501 511 } 502 512 } … … 508 518 * @param previousUIMediumIDs reflects UIMedium IDs used in cached data. 509 519 */ 510 void UIMediumEnumerator::recacheFromCachedUsage(const Q StringList&previousUIMediumIDs)520 void UIMediumEnumerator::recacheFromCachedUsage(const QList<QUuid> &previousUIMediumIDs) 511 521 { 512 522 /* For each of previously used UIMedium ID: */ 513 foreach (const Q String &strMediumID, previousUIMediumIDs)523 foreach (const QUuid &uMediumID, previousUIMediumIDs) 514 524 { 515 525 /* Make sure this ID still in our map: */ 516 if (m_media.contains( strMediumID))526 if (m_media.contains(uMediumID)) 517 527 { 518 528 /* Get corresponding UIMedium: */ 519 UIMedium &uimedium = m_media[ strMediumID];529 UIMedium &uimedium = m_media[uMediumID]; 520 530 521 531 /* If corresponding CMedium still exists: */ … … 532 542 { 533 543 /* Uncache corresponding UIMedium: */ 534 m_media.remove( strMediumID);535 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} uncached\n", strMediumID.toUtf8().constData()));544 m_media.remove(uMediumID); 545 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} uncached\n", uMediumID.toString().toUtf8().constData())); 536 546 537 547 /* And notify listeners: */ 538 emit sigMediumDeleted( strMediumID);548 emit sigMediumDeleted(uMediumID); 539 549 } 540 550 } … … 547 557 * @param currentCMediumIDs reflects CMedium IDs used in actual data. 548 558 */ 549 void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap ¤tCMediums, const Q StringList¤tCMediumIDs)559 void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap ¤tCMediums, const QList<QUuid> ¤tCMediumIDs) 550 560 { 551 561 /* For each of currently used CMedium ID: */ 552 foreach (const Q String &strCMediumID, currentCMediumIDs)562 foreach (const QUuid &uCMediumID, currentCMediumIDs) 553 563 { 554 564 /* If that ID is not in our map: */ 555 if (!m_media.contains( strCMediumID))565 if (!m_media.contains(uCMediumID)) 556 566 { 557 567 /* Create new UIMedium: */ 558 const CMedium &cmedium = currentCMediums[ strCMediumID];568 const CMedium &cmedium = currentCMediums[uCMediumID]; 559 569 UIMedium uimedium(cmedium, UIMediumDefs::mediumTypeToLocal(cmedium.GetDeviceType())); 560 Q String strUIMediumKey = uimedium.key();570 QUuid uUIMediumKey = uimedium.key(); 561 571 562 572 /* Cache created UIMedium: */ 563 m_media.insert( strUIMediumKey, uimedium);564 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} cached\n", strUIMediumKey.toUtf8().constData()));573 m_media.insert(uUIMediumKey, uimedium); 574 LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} cached\n", uUIMediumKey.toString().toUtf8().constData())); 565 575 566 576 /* And notify listeners: */ 567 emit sigMediumCreated( strUIMediumKey);577 emit sigMediumCreated(uUIMediumKey); 568 578 } 569 579 570 580 /* Enumerate corresponding UIMedium: */ 571 createMediumEnumerationTask(m_media[ strCMediumID]);581 createMediumEnumerationTask(m_media[uCMediumID]); 572 582 } 573 583 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r73938 r74878 33 33 34 34 /* Typedefs: */ 35 typedef QMap<Q String, CMedium> CMediumMap;35 typedef QMap<QUuid, CMedium> CMediumMap; 36 36 37 37 /* Medium-enumerator prototype. … … 44 44 45 45 /* Notifiers: Medium-operations stuff: */ 46 void sigMediumCreated(const Q String &strMediumID);47 void sigMediumDeleted(const Q String &strMediumID);46 void sigMediumCreated(const QUuid &aMediumID); 47 void sigMediumDeleted(const QUuid &aMediumID); 48 48 49 49 /* Notifiers: Medium-enumeration stuff: */ 50 50 void sigMediumEnumerationStarted(); 51 void sigMediumEnumerated(const Q String &strMediumID);51 void sigMediumEnumerated(const QUuid &aMediumID); 52 52 void sigMediumEnumerationFinished(); 53 53 … … 58 58 59 59 /* API: Medium-access stuff: */ 60 QList<Q String> mediumIDs() const;61 UIMedium medium(const Q String &strMediumID);60 QList<QUuid> mediumIDs() const; 61 UIMedium medium(const QUuid &aMediumID); 62 62 void createMedium(const UIMedium &medium); 63 void deleteMedium(const Q String &strMediumID);63 void deleteMedium(const QUuid &aMediumID); 64 64 65 65 /* API: Medium-enumeration stuff: */ … … 71 71 72 72 /** Handles machine-data-change and snapshot-change events. */ 73 void sltHandleMachineUpdate( QString strMachineID);73 void sltHandleMachineUpdate(const QUuid &aMachineID); 74 74 /** Handles machine-[un]registration events. */ 75 void sltHandleMachineRegistration( QString strMachineID,bool fRegistered);75 void sltHandleMachineRegistration(const QUuid &aMachineID, const bool fRegistered); 76 76 /** Handles snapshot-deleted events. */ 77 void sltHandleSnapshotDeleted( QString strMachineID, QString strSnapshotID);77 void sltHandleSnapshotDeleted(const QUuid &aMachineID, const QUuid &aSnapshotID); 78 78 79 79 /* Handler: Medium-enumeration stuff: */ … … 91 91 92 92 /* Helpers: Medium re-caching stuff: */ 93 void calculateCachedUsage(const Q String &strMachineID, QStringList &previousUIMediumIDs,bool fTakeIntoAccountCurrentStateOnly) const;94 void calculateActualUsage(const Q String &strMachineID, CMediumMap ¤tCMediums, QStringList ¤tCMediumIDs,bool fTakeIntoAccountCurrentStateOnly) const;95 void calculateActualUsage(const CSnapshot &snapshot, CMediumMap ¤tCMediums, Q StringList¤tCMediumIDs) const;96 void calculateActualUsage(const CMachine &machine, CMediumMap ¤tCMediums, Q StringList¤tCMediumIDs) const;97 void recacheFromCachedUsage(const Q StringList&previousUIMediumIDs);98 void recacheFromActualUsage(const CMediumMap ¤tCMediums, const Q StringList¤tCMediumIDs);93 void calculateCachedUsage(const QUuid &aMachineID, QList<QUuid> &previousUIMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const; 94 void calculateActualUsage(const QUuid &strMachineID, CMediumMap ¤tCMediums, QList<QUuid> ¤tCMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const; 95 void calculateActualUsage(const CSnapshot &snapshot, CMediumMap ¤tCMediums, QList<QUuid> ¤tCMediumIDs) const; 96 void calculateActualUsage(const CMachine &machine, CMediumMap ¤tCMediums, QList<QUuid> ¤tCMediumIDs) const; 97 void recacheFromCachedUsage(const QList<QUuid> &previousUIMediumIDs); 98 void recacheFromActualUsage(const CMediumMap ¤tCMediums, const QList<QUuid> ¤tCMediumIDs); 99 99 100 100 /* Variables: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp
r74003 r74878 152 152 153 153 /* Release: */ 154 foreach (const Q String &strMachineId, medium().curStateMachineIds())155 if (!releaseFrom( strMachineId))154 foreach (const QUuid &uMachineId, medium().curStateMachineIds()) 155 if (!releaseFrom(uMachineId)) 156 156 return false; 157 157 … … 231 231 formatFieldText(QApplication::translate("UIMediumManager", "<i>Not Encrypted</i>"), false) : 232 232 formatFieldText(encryptionPasswordID())); 233 m_details.m_aFields << id() ;233 m_details.m_aFields << id().toString(); 234 234 235 235 break; … … 244 244 formatFieldText(QApplication::translate("UIMediumManager", "<i>Not Attached</i>"), false) : 245 245 formatFieldText(usage())); 246 m_details.m_aFields << id() ;246 m_details.m_aFields << id().toString(); 247 247 break; 248 248 } … … 252 252 } 253 253 254 bool UIMediumItem::releaseFrom(const Q String &strMachineId)254 bool UIMediumItem::releaseFrom(const QUuid &aMachineId) 255 255 { 256 256 /* Open session: */ 257 CSession session = vboxGlobal().openSession( strMachineId);257 CSession session = vboxGlobal().openSession(aMachineId); 258 258 if (session.isNull()) 259 259 return false; … … 323 323 /* Remember some of hard-disk attributes: */ 324 324 CMedium hardDisk = medium().medium(); 325 Q String strMediumID = id();325 QUuid uMediumID = id(); 326 326 327 327 /* Propose to remove medium storage: */ … … 338 338 339 339 /* Remove UIMedium finally: */ 340 vboxGlobal().deleteMedium( strMediumID);340 vboxGlobal().deleteMedium(uMediumID); 341 341 342 342 /* True by default: */ … … 450 450 /* Remember some of optical-disk attributes: */ 451 451 CMedium image = medium().medium(); 452 Q String strMediumID = id();452 QUuid uMediumID = id(); 453 453 454 454 /* Close optical-disk: */ … … 461 461 462 462 /* Remove UIMedium finally: */ 463 vboxGlobal().deleteMedium( strMediumID);463 vboxGlobal().deleteMedium(uMediumID); 464 464 465 465 /* True by default: */ … … 521 521 /* Remember some of floppy-disk attributes: */ 522 522 CMedium image = medium().medium(); 523 Q String strMediumID = id();523 QUuid uMediumID = id(); 524 524 525 525 /* Close floppy-disk: */ … … 532 532 533 533 /* Remove UIMedium finally: */ 534 vboxGlobal().deleteMedium( strMediumID);534 vboxGlobal().deleteMedium(uMediumID); 535 535 536 536 /* True by default: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.h
r73953 r74878 68 68 69 69 /** Returns QString <i>ID</i> of the wrapped UIMedium. */ 70 Q Stringid() const { return m_guiMedium.id(); }70 QUuid id() const { return m_guiMedium.id(); } 71 71 /** Returns QString <i>location</i> of the wrapped UIMedium. */ 72 72 QString location() const { return m_guiMedium.location(); } … … 86 86 87 87 /** Returns a vector of IDs of all machines wrapped UIMedium is attached to. */ 88 const QList<Q String> &machineIds() const { return m_guiMedium.machineIds(); }88 const QList<QUuid> &machineIds() const { return m_guiMedium.machineIds(); } 89 89 /** Returns QString <i>usage</i> of the wrapped UIMedium. */ 90 90 QString usage() const { return m_guiMedium.usage(); } … … 111 111 112 112 /** Releases UIMedium wrapped by <i>this</i> item from virtual machine with @a strMachineId. */ 113 bool releaseFrom(const Q String &strMachineId);113 bool releaseFrom(const QUuid &aMachineId); 114 114 115 115 /** Formats field text. */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r74003 r74878 68 68 public: 69 69 /** Constructor accepting @a strID to compare with. */ 70 CheckIfSuitableByID(const Q String &strID) : m_strID(strID) {}70 CheckIfSuitableByID(const QUuid &aID) : m_uID(aID) {} 71 71 72 72 private: 73 73 /** Determines whether passed UIMediumItem is suitable by @a strID. */ 74 bool isItSuitable(UIMediumItem *pItem) const { return pItem->id() == m_ strID; }74 bool isItSuitable(UIMediumItem *pItem) const { return pItem->id() == m_uID; } 75 75 /** Holds the @a strID to compare to. */ 76 Q String m_strID;76 QUuid m_uID; 77 77 }; 78 78 … … 383 383 } 384 384 385 void UIMediumManagerWidget::sltHandleMediumCreated(const Q String &strMediumID)385 void UIMediumManagerWidget::sltHandleMediumCreated(const QUuid &aMediumID) 386 386 { 387 387 /* Search for corresponding medium: */ 388 UIMedium medium = vboxGlobal().medium( strMediumID);388 UIMedium medium = vboxGlobal().medium(aMediumID); 389 389 390 390 /* Ignore non-interesting media: */ … … 414 414 } 415 415 416 void UIMediumManagerWidget::sltHandleMediumDeleted(const Q String &strMediumID)416 void UIMediumManagerWidget::sltHandleMediumDeleted(const QUuid &aMediumID) 417 417 { 418 418 /* Make sure corresponding medium-item deleted: */ 419 deleteMediumItem( strMediumID);419 deleteMediumItem(aMediumID); 420 420 } 421 421 … … 459 459 } 460 460 461 void UIMediumManagerWidget::sltHandleMediumEnumerated(const Q String &strMediumID)461 void UIMediumManagerWidget::sltHandleMediumEnumerated(const QUuid &aMediumID) 462 462 { 463 463 /* Search for corresponding medium: */ 464 UIMedium medium = vboxGlobal().medium( strMediumID);464 UIMedium medium = vboxGlobal().medium(aMediumID); 465 465 466 466 /* Ignore non-interesting media: */ … … 920 920 /* Remember current medium-items: */ 921 921 if (UIMediumItem *pMediumItem = mediumItem(UIMediumDeviceType_HardDisk)) 922 m_ strCurrentIdHD = pMediumItem->id();922 m_uCurrentIdHD = pMediumItem->id(); 923 923 if (UIMediumItem *pMediumItem = mediumItem(UIMediumDeviceType_DVD)) 924 m_ strCurrentIdCD = pMediumItem->id();924 m_uCurrentIdCD = pMediumItem->id(); 925 925 if (UIMediumItem *pMediumItem = mediumItem(UIMediumDeviceType_Floppy)) 926 m_ strCurrentIdFD = pMediumItem->id();926 m_uCurrentIdFD = pMediumItem->id(); 927 927 928 928 /* Clear tree-widgets: */ … … 948 948 /* Create medium-items (do not change current one): */ 949 949 m_fPreventChangeCurrentItem = true; 950 foreach (const Q String &strMediumID, vboxGlobal().mediumIDs())951 sltHandleMediumCreated( strMediumID);950 foreach (const QUuid &uMediumID, vboxGlobal().mediumIDs()) 951 sltHandleMediumCreated(uMediumID); 952 952 m_fPreventChangeCurrentItem = false; 953 953 … … 1144 1144 if (!pMediumItem) 1145 1145 break; 1146 if (pMediumItem->id() == m_ strCurrentIdHD)1146 if (pMediumItem->id() == m_uCurrentIdHD) 1147 1147 { 1148 1148 setCurrentItem(pTreeWidget, pMediumItem); 1149 m_ strCurrentIdHD = QString();1149 m_uCurrentIdHD = QUuid(); 1150 1150 } 1151 1151 } … … 1164 1164 if (!pMediumItem) 1165 1165 break; 1166 LogRel2(("UIMediumManager: Optical medium-item with ID={%s} created.\n", medium.id().to Utf8().constData()));1167 if (pMediumItem->id() == m_ strCurrentIdCD)1166 LogRel2(("UIMediumManager: Optical medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData())); 1167 if (pMediumItem->id() == m_uCurrentIdCD) 1168 1168 { 1169 1169 setCurrentItem(pTreeWidget, pMediumItem); 1170 m_ strCurrentIdCD = QString();1170 m_uCurrentIdCD = QUuid(); 1171 1171 } 1172 1172 } … … 1185 1185 if (!pMediumItem) 1186 1186 break; 1187 LogRel2(("UIMediumManager: Floppy medium-item with ID={%s} created.\n", medium.id().to Utf8().constData()));1188 if (pMediumItem->id() == m_ strCurrentIdFD)1187 LogRel2(("UIMediumManager: Floppy medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData())); 1188 if (pMediumItem->id() == m_uCurrentIdFD) 1189 1189 { 1190 1190 setCurrentItem(pTreeWidget, pMediumItem); 1191 m_ strCurrentIdFD = QString();1191 m_uCurrentIdFD = QUuid(); 1192 1192 } 1193 1193 } … … 1238 1238 UIMedium parentMedium = vboxGlobal().medium(medium.parentID()); 1239 1239 if (parentMedium.isNull()) 1240 AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().to Utf8().constData()));1240 AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().toString().toUtf8().constData())); 1241 1241 /* Try to create parent medium-item: */ 1242 1242 else … … 1247 1247 { 1248 1248 pMediumItem = new UIMediumItemHD(medium, pParentMediumItem); 1249 LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().to Utf8().constData()));1249 LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData())); 1250 1250 } 1251 1251 } … … 1254 1254 { 1255 1255 pMediumItem = new UIMediumItemHD(medium, pTreeWidget); 1256 LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().to Utf8().constData()));1256 LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData())); 1257 1257 } 1258 1258 } … … 1284 1284 /* Update medium-item: */ 1285 1285 pMediumItem->setMedium(medium); 1286 LogRel2(("UIMediumManager: Medium-item with ID={%s} updated.\n", medium.id().to Utf8().constData()));1286 LogRel2(("UIMediumManager: Medium-item with ID={%s} updated.\n", medium.id().toString().toUtf8().constData())); 1287 1287 1288 1288 /* Update tab-icons: */ … … 1294 1294 } 1295 1295 1296 void UIMediumManagerWidget::deleteMediumItem(const Q String &strMediumID)1296 void UIMediumManagerWidget::deleteMediumItem(const QUuid &aMediumID) 1297 1297 { 1298 1298 /* Search for corresponding tree-widget: */ … … 1306 1306 pTreeWidget = treeWidget(type); 1307 1307 /* Search for existing medium-item: */ 1308 pMediumItem = searchItem(pTreeWidget, CheckIfSuitableByID( strMediumID));1308 pMediumItem = searchItem(pTreeWidget, CheckIfSuitableByID(aMediumID)); 1309 1309 if (pMediumItem) 1310 1310 break; … … 1320 1320 /* Delete medium-item: */ 1321 1321 delete pMediumItem; 1322 LogRel2(("UIMediumManager: Medium-item with ID={%s} deleted.\n", strMediumID.toUtf8().constData()));1322 LogRel2(("UIMediumManager: Medium-item with ID={%s} deleted.\n", aMediumID.toString().toUtf8().constData())); 1323 1323 1324 1324 /* If there is no current medium-item now selected -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r73953 r74878 148 148 * @{ */ 149 149 /** Handles VBoxGlobal::sigMediumCreated signal. */ 150 void sltHandleMediumCreated(const Q String &strMediumID);150 void sltHandleMediumCreated(const QUuid &aMediumID); 151 151 /** Handles VBoxGlobal::sigMediumDeleted signal. */ 152 void sltHandleMediumDeleted(const Q String &strMediumID);152 void sltHandleMediumDeleted(const QUuid &aMediumID); 153 153 /** @} */ 154 154 … … 158 158 void sltHandleMediumEnumerationStart(); 159 159 /** Handles VBoxGlobal::sigMediumEnumerated signal. */ 160 void sltHandleMediumEnumerated(const Q String &strMediumID);160 void sltHandleMediumEnumerated(const QUuid &aMediumID); 161 161 /** Handles VBoxGlobal::sigMediumEnumerationFinished signal. */ 162 162 void sltHandleMediumEnumerationFinish(); … … 249 249 void updateMediumItem(const UIMedium &medium); 250 250 /** Deletes UIMediumItem for corresponding @a strMediumID. */ 251 void deleteMediumItem(const Q String &strMediumID);251 void deleteMediumItem(const QUuid &aMediumID); 252 252 253 253 /** Returns tab for passed medium @a type. */ … … 327 327 const QIcon m_iconFD; 328 328 /** Holds current hard-drive tree-view item ID. */ 329 Q String m_strCurrentIdHD;329 QUuid m_uCurrentIdHD; 330 330 /** Holds current optical-disk tree-view item ID. */ 331 Q String m_strCurrentIdCD;331 QUuid m_uCurrentIdCD; 332 332 /** Holds current floppy-disk tree-view item ID. */ 333 Q String m_strCurrentIdFD;333 QUuid m_uCurrentIdFD; 334 334 /** @} */ 335 335 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
r74811 r74878 171 171 } 172 172 173 Q StringListUIMediumSelector::selectedMediumIds() const174 { 175 Q StringListselectedIds;173 QList<QUuid> UIMediumSelector::selectedMediumIds() const 174 { 175 QList<QUuid> selectedIds; 176 176 if (!m_pTreeWidget) 177 177 return selectedIds; … … 365 365 UIMedium parentMedium = vboxGlobal().medium(medium.parentID()); 366 366 if (parentMedium.isNull()) 367 AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().to Utf8().constData()));367 AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().toString().toUtf8().constData())); 368 368 /* Try to create parent medium-item: */ 369 369 else … … 373 373 { 374 374 pMediumItem = new UIMediumItemHD(medium, pParentMediumItem); 375 LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().to Utf8().constData()));375 LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData())); 376 376 } 377 377 else 378 AssertMsgFailed(("Parent medium with ID={%s} could not be created!\n", medium.parentID().to Utf8().constData()));378 AssertMsgFailed(("Parent medium with ID={%s} could not be created!\n", medium.parentID().toString().toUtf8().constData())); 379 379 } 380 380 … … 383 383 { 384 384 pMediumItem = new UIMediumItemHD(medium, pParent); 385 LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().to Utf8().constData()));385 LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData())); 386 386 } 387 387 return pMediumItem; 388 388 } 389 389 390 void UIMediumSelector::restoreSelection(const Q StringList&selectedMediums, QVector<UIMediumItem*> &mediumList)390 void UIMediumSelector::restoreSelection(const QList<QUuid> &selectedMediums, QVector<UIMediumItem*> &mediumList) 391 391 { 392 392 if (!m_pTreeWidget) … … 475 475 { 476 476 QString strDefaultMachineFolder = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 477 Q String strMediumID = vboxGlobal().openMediumWithFileOpenDialog(m_enmMediumType, this, strDefaultMachineFolder);478 if ( strMediumID.isEmpty())477 QUuid uMediumID = vboxGlobal().openMediumWithFileOpenDialog(m_enmMediumType, this, strDefaultMachineFolder); 478 if (uMediumID.isNull()) 479 479 return; 480 480 repopulateTreeWidget(); 481 selectMedium( strMediumID);481 selectMedium(uMediumID); 482 482 483 483 } … … 545 545 } 546 546 547 void UIMediumSelector::selectMedium(const Q String &strMediumID)547 void UIMediumSelector::selectMedium(const QUuid &aMediumID) 548 548 { 549 549 if (!m_pTreeWidget) 550 550 return; 551 UIMediumItem *pMediumItem = searchItem(0, strMediumID);551 UIMediumItem *pMediumItem = searchItem(0, aMediumID); 552 552 if (pMediumItem) 553 553 { … … 623 623 /* Cache the currently selected items: */ 624 624 QList<QTreeWidgetItem*> selectedItems = m_pTreeWidget->selectedItems(); 625 Q StringListselectedMedia = selectedMediumIds();625 QList<QUuid> selectedMedia = selectedMediumIds(); 626 626 /* uuid list of selected items: */ 627 627 /* Reset the related data structure: */ … … 632 632 QVector<UIMediumItem*> menuItemVector; 633 633 634 foreach (const Q String &strMediumID, vboxGlobal().mediumIDs())635 { 636 UIMedium medium = vboxGlobal().medium( strMediumID);634 foreach (const QUuid &uMediumID, vboxGlobal().mediumIDs()) 635 { 636 UIMedium medium = vboxGlobal().medium(uMediumID); 637 637 //printf("name %s\n", qPrintable(medium.name())); 638 638 if (medium.type() == m_enmMediumType) … … 697 697 } 698 698 699 UIMediumItem* UIMediumSelector::searchItem(const QTreeWidgetItem *pParent, const Q String&mediumId)699 UIMediumItem* UIMediumSelector::searchItem(const QTreeWidgetItem *pParent, const QUuid &mediumId) 700 700 { 701 701 if (!m_pTreeWidget) … … 759 759 strMedium = m_mediumItemList[i]->medium().name(); 760 760 else if(searchType == UIMediumSearchWidget::SearchByUUID) 761 strMedium = m_mediumItemList[i]->medium().id() ;761 strMedium = m_mediumItemList[i]->medium().id().toString(); 762 762 if (strMedium.isEmpty()) 763 763 continue; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h
r73953 r74878 50 50 UIMediumSelector(UIMediumDeviceType enmMediumType, const QString &machineName = QString(), 51 51 const QString &machineSettigFilePath = QString(), QWidget *pParent = 0); 52 Q StringListselectedMediumIds() const;52 QList<QUuid> selectedMediumIds() const; 53 53 54 54 protected: … … 93 93 void updateOkButton(); 94 94 UIMediumItem* addTreeItem(const UIMedium &medium, QITreeWidgetItem *pParent); 95 void restoreSelection(const Q StringList&selectedMediums, QVector<UIMediumItem*> &mediumList);95 void restoreSelection(const QList<QUuid> &selectedMediums, QVector<UIMediumItem*> &mediumList); 96 96 /** Recursively create the hard disk hierarchy under the tree widget */ 97 97 UIMediumItem* createHardDiskItem(const UIMedium &medium, QITreeWidgetItem *pParent); 98 UIMediumItem* searchItem(const QTreeWidgetItem *pParent, const Q String&mediumId);98 UIMediumItem* searchItem(const QTreeWidgetItem *pParent, const QUuid &mediumId); 99 99 void performMediumSearch(); 100 100 /** Remember the default foreground brush of the tree so that we can reset tree items' foreground later */ 101 101 void saveDefaultForeground(); 102 void selectMedium(const Q String &strMediumID);102 void selectMedium(const QUuid &aMediumID); 103 103 104 104 QVBoxLayout *m_pMainLayout; -
trunk/src/VBox/Frontends/VirtualBox/src/platform/UIDesktopServices.h
r69500 r74878 19 19 #define ___UIDesktopServices_h___ 20 20 21 /* Qt includes */ 22 #include <QUuid> 23 21 24 /* Qt forward declarations */ 22 25 class QString; … … 25 28 { 26 29 public: 27 static bool createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const Q String &strUuid);30 static bool createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const QUuid &aUuid); 28 31 static bool openInFileManager(const QString &strFile); 29 32 }; -
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIDesktopServices_darwin.cpp
r69500 r74878 24 24 #include <QString> 25 25 26 bool UIDesktopServices::createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const Q String &strUuid)26 bool UIDesktopServices::createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const QUuid &aUuid) 27 27 { 28 28 return ::darwinCreateMachineShortcut(::darwinToNativeString(strSrcFile.toUtf8().constData()), 29 29 ::darwinToNativeString(strDstPath.toUtf8().constData()), 30 30 ::darwinToNativeString(strName.toUtf8().constData()), 31 ::darwinToNativeString( strUuid.toUtf8().constData()));31 ::darwinToNativeString(aUuid.toString().toUtf8().constData())); 32 32 } 33 33 -
trunk/src/VBox/Frontends/VirtualBox/src/platform/win/UIDesktopServices_win.cpp
r69500 r74878 26 26 # include <QDir> 27 27 # include <QCoreApplication> 28 # include <QUuid> 28 29 29 30 /* System includes */ … … 33 34 34 35 35 bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const Q String &strUuid)36 bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const QUuid &aUuid) 36 37 { 37 38 IShellLink *pShl = NULL; … … 51 52 if (FAILED(rc)) 52 53 break; 53 QString strArgs = QString("--comment \"%1\" --startvm \"%2\"").arg(strName).arg( strUuid);54 QString strArgs = QString("--comment \"%1\" --startvm \"%2\"").arg(strName).arg(aUuid.toString()); 54 55 rc = pShl->SetArguments(strArgs.utf16()); 55 56 if (FAILED(rc)) -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/UIDesktopServices_x11.cpp
r69500 r74878 34 34 35 35 36 bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const Q String &strUuid)36 bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const QUuid &aUuid) 37 37 { 38 38 QFile link(strDstPath + QDir::separator() + strName + ".desktop"); … … 48 48 << "Comment=Starts the VirtualBox machine " << strName << endl 49 49 << "Type=Application" << endl 50 << "Exec=" << QCoreApplication::applicationFilePath() << " --comment \"" << strName << "\" --startvm \"" << strUuid<< "\"" << endl50 << "Exec=" << QCoreApplication::applicationFilePath() << " --comment \"" << strName << "\" --startvm \"" << aUuid.toString() << "\"" << endl 51 51 << "Icon=virtualbox-vbox.png" << endl; 52 52 /* This would be a real file link entry, but then we could also simply -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r71651 r74878 393 393 #endif /* Q_OS_WIN */ 394 394 /** Identifier returned by AttachFramebuffer. Used in DetachFramebuffer. */ 395 Q String m_strFramebufferId;395 QUuid m_uFramebufferId; 396 396 }; 397 397 … … 615 615 void UIFrameBufferPrivate::attach() 616 616 { 617 m_ strFramebufferId = display().AttachFramebuffer(m_uScreenId, CFramebuffer(this));617 m_uFramebufferId = display().AttachFramebuffer(m_uScreenId, CFramebuffer(this)); 618 618 } 619 619 … … 623 623 if (!frameBuffer.isNull()) 624 624 { 625 display().DetachFramebuffer(m_uScreenId, m_ strFramebufferId);626 m_ strFramebufferId.clear();625 display().DetachFramebuffer(m_uScreenId, m_uFramebufferId); 626 m_uFramebufferId = QUuid(); 627 627 } 628 628 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r73953 r74878 1267 1267 } 1268 1268 1269 void UIIndicatorsPool::sltHandleConfigurationChange(const Q String &strMachineID)1269 void UIIndicatorsPool::sltHandleConfigurationChange(const QUuid &aMachineID) 1270 1270 { 1271 1271 /* Skip unrelated machine IDs: */ 1272 if (vboxGlobal().managedVMUuid() != strMachineID)1272 if (vboxGlobal().managedVMUuid() != aMachineID) 1273 1273 return; 1274 1274 … … 1348 1348 { 1349 1349 /* Listen for the status-bar configuration changes: */ 1350 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const Q String&)),1351 this, SLOT(sltHandleConfigurationChange(const Q String&)));1350 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QUuid &)), 1351 this, SLOT(sltHandleConfigurationChange(const QUuid &))); 1352 1352 } 1353 1353 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r71027 r74878 67 67 68 68 /** Handles configuration change. */ 69 void sltHandleConfigurationChange(const Q String &strMachineID);69 void sltHandleConfigurationChange(const QUuid &aMachineID); 70 70 71 71 /** Handles indicator-states auto-update. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r73946 r74878 43 43 44 44 /* static */ 45 bool UIMachine::startMachine(const Q String &strID)45 bool UIMachine::startMachine(const QUuid &aID) 46 46 { 47 47 /* Make sure machine is not created: */ … … 52 52 { 53 53 /* Create temporary session: */ 54 CSession session = vboxGlobal().openSession( strID, KLockType_VM);54 CSession session = vboxGlobal().openSession(aID, KLockType_VM); 55 55 if (session.isNull()) 56 56 return false; … … 82 82 { 83 83 /* Get corresponding machine: */ 84 CMachine machine = vboxGlobal().virtualBox().FindMachine(vboxGlobal().managedVMUuid() );84 CMachine machine = vboxGlobal().virtualBox().FindMachine(vboxGlobal().managedVMUuid().toString()); 85 85 AssertMsgReturn(!machine.isNull(), ("VBoxGlobal::managedVMUuid() should have filter that case before!\n"), false); 86 86 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r72363 r74878 49 49 /** Static factory to start machine with passed @a strID. 50 50 * @return true if machine was started, false otherwise. */ 51 static bool startMachine(const Q String &strID);51 static bool startMachine(const QUuid &aID); 52 52 /** Static constructor. */ 53 53 static bool create(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r73982 r74878 121 121 struct USBTarget 122 122 { 123 USBTarget() : attach(false), id(Q String()) {}124 USBTarget(bool fAttach, const Q String &strId)125 : attach(fAttach), id( strId) {}123 USBTarget() : attach(false), id(QUuid()) {} 124 USBTarget(bool fAttach, const QUuid &aId) 125 : attach(fAttach), id(aId) {} 126 126 bool attach; 127 Q Stringid;127 QUuid id; 128 128 }; 129 129 Q_DECLARE_METATYPE(USBTarget); … … 1751 1751 if (fDialogAccepted) 1752 1752 { 1753 Q String strSnapshotId;1753 QUuid uSnapshotId; 1754 1754 /* Prepare the take-snapshot progress: */ 1755 CProgress progress = machine().TakeSnapshot(strSnapshotName, strSnapshotDescription, true, strSnapshotId);1755 CProgress progress = machine().TakeSnapshot(strSnapshotName, strSnapshotDescription, true, uSnapshotId); 1756 1756 if (machine().isOk()) 1757 1757 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r74872 r74878 501 501 } 502 502 503 void UIMachineView::sltHandleScaleFactorChange(const Q String &strMachineID)503 void UIMachineView::sltHandleScaleFactorChange(const QUuid &aMachineID) 504 504 { 505 505 /* Skip unrelated machine IDs: */ 506 if ( strMachineID != vboxGlobal().managedVMUuid())506 if (aMachineID != vboxGlobal().managedVMUuid()) 507 507 return; 508 508 … … 549 549 } 550 550 551 void UIMachineView::sltHandleScalingOptimizationChange(const Q String &strMachineID)551 void UIMachineView::sltHandleScalingOptimizationChange(const QUuid &aMachineID) 552 552 { 553 553 /* Skip unrelated machine IDs: */ 554 if ( strMachineID != vboxGlobal().managedVMUuid())554 if (aMachineID != vboxGlobal().managedVMUuid()) 555 555 return; 556 556 … … 826 826 SLOT(sltDesktopResized())); 827 827 /* Scale-factor change: */ 828 connect(gEDataManager, SIGNAL(sigScaleFactorChange(const Q String&)),829 this, SLOT(sltHandleScaleFactorChange(const Q String&)));828 connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QUuid &)), 829 this, SLOT(sltHandleScaleFactorChange(const QUuid &))); 830 830 /* Scaling-optimization change: */ 831 connect(gEDataManager, SIGNAL(sigScalingOptimizationTypeChange(const Q String&)),832 this, SLOT(sltHandleScalingOptimizationChange(const Q String&)));831 connect(gEDataManager, SIGNAL(sigScalingOptimizationTypeChange(const QUuid &)), 832 this, SLOT(sltHandleScalingOptimizationChange(const QUuid &))); 833 833 } 834 834 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r71104 r74878 127 127 128 128 /** Handles the scale-factor change. */ 129 void sltHandleScaleFactorChange(const Q String &strMachineID);129 void sltHandleScaleFactorChange(const QUuid &aMachineID); 130 130 131 131 /** Handles the scaling-optimization change. */ 132 void sltHandleScalingOptimizationChange(const Q String &strMachineID);132 void sltHandleScalingOptimizationChange(const QUuid &aMachineID); 133 133 134 134 /* Console callback handlers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r72887 r74878 323 323 { 324 324 /* Execute asynchronously and leave: */ 325 QProcess::startDetached(strScript, QStringList() << machine().GetId() );325 QProcess::startDetached(strScript, QStringList() << machine().GetId().toString()); 326 326 return; 327 327 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r73953 r74878 204 204 /* Apply ad-hoc reconfigurations from the command line: */ 205 205 if (vboxGlobal().hasFloppyImageToMount()) 206 mountAdHocImage(KDeviceType_Floppy, UIMediumDeviceType_Floppy, vboxGlobal().getFloppyImage() );206 mountAdHocImage(KDeviceType_Floppy, UIMediumDeviceType_Floppy, vboxGlobal().getFloppyImage().toString()); 207 207 if (vboxGlobal().hasDvdImageToMount()) 208 mountAdHocImage(KDeviceType_DVD, UIMediumDeviceType_DVD, vboxGlobal().getDvdImage() );208 mountAdHocImage(KDeviceType_DVD, UIMediumDeviceType_DVD, vboxGlobal().getDvdImage().toString()); 209 209 210 210 /* Power UP if this is NOT separate process: */ … … 425 425 /* Search for corresponding VM: */ 426 426 CVirtualBox vbox = vboxGlobal().virtualBox(); 427 const Q String strMachineID = vboxGlobal().managedVMUuid();428 const CMachine mach = vbox.FindMachine( strMachineID);427 const QUuid uMachineID = vboxGlobal().managedVMUuid(); 428 const CMachine mach = vbox.FindMachine(uMachineID.toString()); 429 429 if (!vbox.isOk() || mach.isNull()) 430 430 { 431 431 /* Unable to find VM: */ 432 msgCenter().cannotFindMachineById(vbox, strMachineID);432 msgCenter().cannotFindMachineById(vbox, uMachineID); 433 433 break; 434 434 } … … 598 598 599 599 #ifdef RT_OS_DARWIN 600 void UISession::sltHandleMenuBarConfigurationChange(const Q String &strMachineID)600 void UISession::sltHandleMenuBarConfigurationChange(const QUuid &aMachineID) 601 601 { 602 602 /* Skip unrelated machine IDs: */ 603 if (vboxGlobal().managedVMUuid() != strMachineID)603 if (vboxGlobal().managedVMUuid() != aMachineID) 604 604 return; 605 605 … … 1254 1254 { 1255 1255 /* Get machine ID: */ 1256 const Q String strMachineID = vboxGlobal().managedVMUuid();1256 const QUuid uMachineID = vboxGlobal().managedVMUuid(); 1257 1257 1258 1258 /* Prepare machine-window icon: */ … … 1272 1272 #ifndef VBOX_WS_MAC 1273 1273 /* Load user's machine-window name postfix: */ 1274 m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix( strMachineID);1274 m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID); 1275 1275 #endif 1276 1276 1277 1277 /* Is there should be First RUN Wizard? */ 1278 m_fIsFirstTimeStarted = gEDataManager->machineFirstTimeStarted( strMachineID);1278 m_fIsFirstTimeStarted = gEDataManager->machineFirstTimeStarted(uMachineID); 1279 1279 1280 1280 /* Should guest autoresize? */ 1281 1281 QAction *pGuestAutoresizeSwitch = actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize); 1282 pGuestAutoresizeSwitch->setChecked(gEDataManager->guestScreenAutoResizeEnabled( strMachineID));1282 pGuestAutoresizeSwitch->setChecked(gEDataManager->guestScreenAutoResizeEnabled(uMachineID)); 1283 1283 1284 1284 #ifndef VBOX_WS_MAC … … 1286 1286 { 1287 1287 const bool fEnabledGlobally = !gEDataManager->guiFeatureEnabled(GUIFeatureType_NoMenuBar); 1288 const bool fEnabledForMachine = gEDataManager->menuBarEnabled( strMachineID);1288 const bool fEnabledForMachine = gEDataManager->menuBarEnabled(uMachineID); 1289 1289 const bool fEnabled = fEnabledGlobally && fEnabledForMachine; 1290 1290 QAction *pActionMenuBarSettings = actionPool()->action(UIActionIndexRT_M_View_M_MenuBar_S_Settings); … … 1300 1300 { 1301 1301 const bool fEnabledGlobally = !gEDataManager->guiFeatureEnabled(GUIFeatureType_NoStatusBar); 1302 const bool fEnabledForMachine = gEDataManager->statusBarEnabled( strMachineID);1302 const bool fEnabledForMachine = gEDataManager->statusBarEnabled(uMachineID); 1303 1303 const bool fEnabled = fEnabledGlobally && fEnabledForMachine; 1304 1304 QAction *pActionStatusBarSettings = actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_S_Settings); … … 1325 1325 1326 1326 /* What is the default close action and the restricted are? */ 1327 m_defaultCloseAction = gEDataManager->defaultMachineCloseAction( strMachineID);1328 m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions( strMachineID);1327 m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(uMachineID); 1328 m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID); 1329 1329 m_fAllCloseActionsRestricted = (!vboxGlobal().isSeparateProcess() || (m_restrictedCloseActions & MachineCloseAction_Detach)) 1330 1330 && (m_restrictedCloseActions & MachineCloseAction_SaveState) … … 1926 1926 1927 1927 /* Make sure medium ID is valid: */ 1928 const Q String strMediumId = comMedium.GetId();1929 AssertReturn(! strMediumId.isNull(), false);1928 const QUuid uMediumId = comMedium.GetId(); 1929 AssertReturn(!uMediumId.isNull(), false); 1930 1930 1931 1931 /* Try to find UIMedium among cached: */ 1932 guiMedium = vboxGlobal().medium( strMediumId);1932 guiMedium = vboxGlobal().medium(uMediumId); 1933 1933 if (guiMedium.isNull()) 1934 1934 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r73953 r74878 347 347 #ifdef RT_OS_DARWIN 348 348 /** Mac OS X: Handles menu-bar configuration-change. */ 349 void sltHandleMenuBarConfigurationChange(const Q String &strMachineID);349 void sltHandleMenuBarConfigurationChange(const QUuid &aMachineID); 350 350 #endif /* RT_OS_DARWIN */ 351 351 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r69500 r74878 138 138 139 139 #ifndef RT_OS_DARWIN 140 void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange(const Q String &strMachineID)140 void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange(const QUuid &aMachineID) 141 141 { 142 142 /* Skip unrelated machine IDs: */ 143 if (vboxGlobal().managedVMUuid() != strMachineID)143 if (vboxGlobal().managedVMUuid() != aMachineID) 144 144 return; 145 145 … … 172 172 #endif /* !RT_OS_DARWIN */ 173 173 174 void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange(const Q String &strMachineID)174 void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange(const QUuid &aMachineID) 175 175 { 176 176 /* Skip unrelated machine IDs: */ 177 if (vboxGlobal().managedVMUuid() != strMachineID)177 if (vboxGlobal().managedVMUuid() != aMachineID) 178 178 return; 179 179 … … 306 306 } 307 307 /* Post-configure status-bar: */ 308 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const Q String&)),309 this, SLOT(sltHandleStatusBarConfigurationChange(const Q String&)));308 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QUuid &)), 309 this, SLOT(sltHandleStatusBarConfigurationChange(const QUuid &))); 310 310 #ifdef VBOX_WS_MAC 311 311 /* Make sure the status-bar is aware of action hovering: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r69500 r74878 68 68 #ifndef RT_OS_DARWIN 69 69 /** Handles menu-bar configuration-change. */ 70 void sltHandleMenuBarConfigurationChange(const Q String &strMachineID);70 void sltHandleMenuBarConfigurationChange(const QUuid &aMachineID); 71 71 /** Handles menu-bar context-menu-request. */ 72 72 void sltHandleMenuBarContextMenuRequest(const QPoint &position); … … 74 74 75 75 /** Handles status-bar configuration-change. */ 76 void sltHandleStatusBarConfigurationChange(const Q String &strMachineID);76 void sltHandleStatusBarConfigurationChange(const QUuid &aMachineID); 77 77 /** Handles status-bar context-menu-request. */ 78 78 void sltHandleStatusBarContextMenuRequest(const QPoint &position); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r74870 r74878 343 343 /* Look for at least one inaccessible medium: */ 344 344 bool fIsThereAnyInaccessibleMedium = false; 345 foreach (const Q String &strMediumID, vboxGlobal().mediumIDs())346 { 347 if (vboxGlobal().medium( strMediumID).state() == KMediumState_Inaccessible)345 foreach (const QUuid &uMediumID, vboxGlobal().mediumIDs()) 346 { 347 if (vboxGlobal().medium(uMediumID).state() == KMediumState_Inaccessible) 348 348 { 349 349 fIsThereAnyInaccessibleMedium = true; … … 431 431 #endif /* VBOX_WS_MAC */ 432 432 433 void UISelectorWindow::sltHandleStateChange( QString)433 void UISelectorWindow::sltHandleStateChange(const QUuid &) 434 434 { 435 435 /* Get current item: */ … … 654 654 655 655 /* Make sure this machine was NOT registered already: */ 656 CMachine oldMachine = vbox.FindMachine(newMachine.GetId() );656 CMachine oldMachine = vbox.FindMachine(newMachine.GetId().toString()); 657 657 if (!oldMachine.isNull()) 658 658 { … … 667 667 void UISelectorWindow::sltOpenMachineSettingsDialog(const QString &strCategoryRef /* = QString() */, 668 668 const QString &strControlRef /* = QString() */, 669 const Q String &strID /* = QString() */)669 const QUuid &aID /* = QString() */) 670 670 { 671 671 /* This slot should not be called when there is not selection: */ … … 705 705 /* Create and execute corresponding VM settings window: */ 706 706 UISettingsDialogMachine dialog(this, 707 QUuid(strID).isNull() ? currentItem()->id() : strID,707 aID.isNull() ? currentItem()->id() : aID, 708 708 strCategory, strControl); 709 709 dialog.execute(); … … 1119 1119 QIManagerDialog *pLogViewerDialog = 0; 1120 1120 /* Create and Show VM Log Viewer: */ 1121 if (!m_logViewers[pItem->machine().GetHardwareUUID() ])1121 if (!m_logViewers[pItem->machine().GetHardwareUUID().toString()]) 1122 1122 { 1123 1123 UIVMLogViewerDialogFactory dialogFactory(actionPool(), pItem->machine()); … … 1125 1125 if (pLogViewerDialog) 1126 1126 { 1127 m_logViewers[pItem->machine().GetHardwareUUID() ] = pLogViewerDialog;1127 m_logViewers[pItem->machine().GetHardwareUUID().toString()] = pLogViewerDialog; 1128 1128 connect(pLogViewerDialog, &QIManagerDialog::sigClose, 1129 1129 this, &UISelectorWindow::sltCloseLogViewerWindow); … … 1132 1132 else 1133 1133 { 1134 pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID() ];1134 pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID().toString()]; 1135 1135 } 1136 1136 if (pLogViewerDialog) … … 2238 2238 2239 2239 /* VM desktop connections: */ 2240 connect(m_pPaneToolsMachine, SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)),2241 this, SLOT(sltOpenMachineSettingsDialog(const QString&, const QString&, const Q String&)));2240 connect(m_pPaneToolsMachine, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)), 2241 this, SLOT(sltOpenMachineSettingsDialog(const QString&, const QString&, const QUuid&))); 2242 2242 2243 2243 /* Global event handlers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r74868 r74878 118 118 * @{ */ 119 119 /** Handles CVirtualBox event about state change for machine with @a strID. */ 120 void sltHandleStateChange( QString strID);120 void sltHandleStateChange(const QUuid &aID); 121 121 /** @} */ 122 122 … … 163 163 void sltOpenMachineSettingsDialog(const QString &strCategory = QString(), 164 164 const QString &strControl = QString(), 165 const Q String &strID = QString());165 const QUuid &aID = QString()); 166 166 /** Handles call to open Clone Machine wizard. */ 167 167 void sltOpenCloneMachineWizard(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.h
r70185 r74878 53 53 void sigToggleFinished(); 54 54 /** Redirects signal from UIGDetails to UISelectorWindow. */ 55 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);55 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 56 56 57 57 public: -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp
r72704 r74878 224 224 bool needsResort = true; 225 225 226 m_ strId = m_machine.GetId();226 m_uId = m_machine.GetId(); 227 227 m_strSettingsFile = m_machine.GetSettingsFilePath(); 228 228 … … 270 270 /* Also take restrictions into account: */ 271 271 if ( m_configurationAccessLevel != ConfigurationAccessLevel_Null 272 && !gEDataManager->machineReconfigurationEnabled(m_ strId))272 && !gEDataManager->machineReconfigurationEnabled(m_uId)) 273 273 m_configurationAccessLevel = ConfigurationAccessLevel_Null; 274 274 275 275 /* Should we show details for this item? */ 276 m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_ strId);276 m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_uId); 277 277 } 278 278 else -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.h
r72704 r74878 47 47 QPixmap osPixmap(QSize *pLogicalSize = 0) const; 48 48 QString osTypeId() const { return m_strOSTypeId; } 49 Q String id() const { return m_strId; }49 QUuid id() const { return m_uId; } 50 50 51 51 QString machineStateName() const; … … 93 93 94 94 /* Cached machine data (to minimize server requests) */ 95 Q String m_strId;95 QUuid m_uId; 96 96 QString m_strSettingsFile; 97 97 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
r69500 r74878 115 115 virtual bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const = 0; 116 116 virtual void clearItems(UIGChooserItemType type = UIGChooserItemType_Any) = 0; 117 virtual void updateAll(const Q String &strId) = 0;118 virtual void removeAll(const Q String &strId) = 0;117 virtual void updateAll(const QUuid &aId) = 0; 118 virtual void removeAll(const QUuid &aId) = 0; 119 119 virtual UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0; 120 120 virtual UIGChooserItemMachine* firstMachineItem() = 0; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r72709 r74878 259 259 } 260 260 261 bool UIGChooserItemGroup::isContainsMachine(const Q String &strId) const261 bool UIGChooserItemGroup::isContainsMachine(const QUuid &aId) const 262 262 { 263 263 /* Check each machine-item: */ 264 264 foreach (UIGChooserItem *pItem, m_machineItems) 265 if (pItem->toMachineItem()->id() == strId)265 if (pItem->toMachineItem()->id() == aId) 266 266 return true; 267 267 /* Found nothing? */ … … 934 934 } 935 935 936 void UIGChooserItemGroup::updateAll(const Q String &strId)936 void UIGChooserItemGroup::updateAll(const QUuid &aId) 937 937 { 938 938 /* Update all the required items recursively: */ 939 939 foreach (UIGChooserItem *pItem, items()) 940 pItem->updateAll( strId);941 } 942 943 void UIGChooserItemGroup::removeAll(const Q String &strId)940 pItem->updateAll(aId); 941 } 942 943 void UIGChooserItemGroup::removeAll(const QUuid &aId) 944 944 { 945 945 /* Remove all the required items recursively: */ 946 946 foreach (UIGChooserItem *pItem, items()) 947 pItem->removeAll( strId);947 pItem->removeAll(aId); 948 948 } 949 949 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r72708 r74878 79 79 80 80 /* API: Children stuff: */ 81 bool isContainsMachine(const Q String &strId) const;81 bool isContainsMachine(const QUuid &aId) const; 82 82 bool isContainsLockedMachine(); 83 83 … … 143 143 bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const; 144 144 void clearItems(UIGChooserItemType type = UIGChooserItemType_Any); 145 void updateAll(const Q String &strId);146 void removeAll(const Q String &strId);145 void updateAll(const QUuid &aId); 146 void removeAll(const QUuid &aId); 147 147 UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 148 148 UIGChooserItemMachine* firstMachineItem(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r72709 r74878 544 544 } 545 545 546 void UIGChooserItemMachine::updateAll(const Q String &strId)546 void UIGChooserItemMachine::updateAll(const QUuid &aId) 547 547 { 548 548 /* Skip other ids: */ 549 if (id() != strId)549 if (id() != aId) 550 550 return; 551 551 … … 563 563 } 564 564 565 void UIGChooserItemMachine::removeAll(const Q String &strId)565 void UIGChooserItemMachine::removeAll(const QUuid &aId) 566 566 { 567 567 /* Skip wrong id: */ 568 if (id() != strId)568 if (id() != aId) 569 569 return; 570 570 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h
r72708 r74878 125 125 bool hasItems(UIGChooserItemType type) const; 126 126 void clearItems(UIGChooserItemType type); 127 void updateAll(const Q String &strId);128 void removeAll(const Q String &strId);127 void updateAll(const QUuid &aId); 128 void removeAll(const QUuid &aId); 129 129 UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 130 130 UIGChooserItemMachine* firstMachineItem(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r73926 r74878 678 678 } 679 679 680 void UIGChooserModel::sltMachineStateChanged( QString strId,KMachineState)680 void UIGChooserModel::sltMachineStateChanged(const QUuid &aId, const KMachineState) 681 681 { 682 682 /* Update machine-items with passed id: */ 683 mainRoot()->updateAll( strId);684 } 685 686 void UIGChooserModel::sltMachineDataChanged( QString strId)683 mainRoot()->updateAll(aId); 684 } 685 686 void UIGChooserModel::sltMachineDataChanged(const QUuid &aId) 687 687 { 688 688 /* Update machine-items with passed id: */ 689 mainRoot()->updateAll( strId);690 } 691 692 void UIGChooserModel::sltMachineRegistered( QString strId,bool fRegistered)689 mainRoot()->updateAll(aId); 690 } 691 692 void UIGChooserModel::sltMachineRegistered(const QUuid &aId, const bool fRegistered) 693 693 { 694 694 /* New VM registered? */ … … 696 696 { 697 697 /* Search for corresponding machine: */ 698 CMachine machine = vboxGlobal().virtualBox().FindMachine( strId);698 CMachine machine = vboxGlobal().virtualBox().FindMachine(aId.toString()); 699 699 /* Should we show this machine? */ 700 if (gEDataManager->showMachineInSelectorChooser( strId))700 if (gEDataManager->showMachineInSelectorChooser(aId)) 701 701 { 702 702 /* Add new machine-item: */ … … 706 706 updateLayout(); 707 707 /* Change current-item only if VM was created from the GUI side: */ 708 if ( strId == m_strLastCreatedMachineId)708 if (aId == m_uLastCreatedMachineId) 709 709 { 710 710 setCurrentItem(mainRoot()->searchForItem(machine.GetName(), … … 718 718 { 719 719 /* Remove machine-items with passed id: */ 720 mainRoot()->removeAll( strId);720 mainRoot()->removeAll(aId); 721 721 /* Update model: */ 722 722 cleanupGroupTree(); … … 734 734 } 735 735 736 void UIGChooserModel::sltSessionStateChanged( QString strId,KSessionState)736 void UIGChooserModel::sltSessionStateChanged(const QUuid &aId, const KSessionState) 737 737 { 738 738 /* Update machine-items with passed id: */ 739 mainRoot()->updateAll( strId);740 } 741 742 void UIGChooserModel::sltSnapshotChanged( QString strId, QString)739 mainRoot()->updateAll(aId); 740 } 741 742 void UIGChooserModel::sltSnapshotChanged(const QUuid &aId, const QUuid &) 743 743 { 744 744 /* Update machine-items with passed id: */ 745 mainRoot()->updateAll( strId);745 mainRoot()->updateAll(aId); 746 746 } 747 747 … … 936 936 * on success for current-item handling: */ 937 937 if (pWizard->exec() == QDialog::Accepted) 938 m_ strLastCreatedMachineId = pWizard->createdMachineId();938 m_uLastCreatedMachineId = pWizard->createdMachineId(); 939 939 940 940 if (pWizard) … … 997 997 } 998 998 999 void UIGChooserModel::sltReloadMachine(const Q String &strId)999 void UIGChooserModel::sltReloadMachine(const QUuid &aId) 1000 1000 { 1001 1001 /* Remove all the items first: */ 1002 mainRoot()->removeAll( strId);1002 mainRoot()->removeAll(aId); 1003 1003 /* Wipe out empty groups: */ 1004 1004 cleanupGroupTree(); 1005 1005 1006 1006 /* Show machine if we should: */ 1007 CMachine machine = vboxGlobal().virtualBox().FindMachine( strId);1008 if (gEDataManager->showMachineInSelectorChooser( strId))1007 CMachine machine = vboxGlobal().virtualBox().FindMachine(aId.toString()); 1008 if (gEDataManager->showMachineInSelectorChooser(aId)) 1009 1009 addMachineIntoTheTree(machine); 1010 1010 … … 1090 1090 1091 1091 /* Prepare arrays: */ 1092 QMap<Q String, bool> verdicts;1092 QMap<QUuid, bool> verdicts; 1093 1093 QList<UIGChooserItem*> itemsToRemove; 1094 Q StringListmachinesToUnregister;1094 QList<QUuid> machinesToUnregister; 1095 1095 1096 1096 /* For each selected machine-item: */ … … 1098 1098 { 1099 1099 /* Get machine-item id: */ 1100 Q String strId = pItem->toMachineItem()->id();1100 QUuid aId = pItem->toMachineItem()->id(); 1101 1101 1102 1102 /* We already decided for that machine? */ 1103 if (verdicts.contains( strId))1103 if (verdicts.contains(aId)) 1104 1104 { 1105 1105 /* To remove similar machine items? */ 1106 if (!verdicts[ strId])1106 if (!verdicts[aId]) 1107 1107 itemsToRemove << pItem; 1108 1108 continue; … … 1112 1112 int iSelectedCopyCount = 0; 1113 1113 foreach (UIGChooserItem *pSelectedItem, selectedMachineItemList) 1114 if (pSelectedItem->toMachineItem()->id() == strId)1114 if (pSelectedItem->toMachineItem()->id() == aId) 1115 1115 ++iSelectedCopyCount; 1116 1116 /* Existing copy count: */ 1117 1117 int iExistingCopyCount = 0; 1118 1118 foreach (UIGChooserItem *pExistingItem, existingMachineItemList) 1119 if (pExistingItem->toMachineItem()->id() == strId)1119 if (pExistingItem->toMachineItem()->id() == aId) 1120 1120 ++iExistingCopyCount; 1121 1121 /* If selected copy count equal to existing copy count, … … 1123 1123 * we will just propose to remove selected items: */ 1124 1124 bool fVerdict = iSelectedCopyCount == iExistingCopyCount; 1125 verdicts.insert( strId, fVerdict);1125 verdicts.insert(aId, fVerdict); 1126 1126 if (fVerdict) 1127 machinesToUnregister << strId;1127 machinesToUnregister.append(aId); 1128 1128 else 1129 1129 itemsToRemove << pItem; … … 1332 1332 1333 1333 /* Setup global connections: */ 1334 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(Q String, KMachineState)),1335 this, SLOT(sltMachineStateChanged(Q String, KMachineState)));1336 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(Q String)),1337 this, SLOT(sltMachineDataChanged(Q String)));1338 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(Q String, bool)),1339 this, SLOT(sltMachineRegistered(Q String, bool)));1340 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(Q String, KSessionState)),1341 this, SLOT(sltSessionStateChanged(Q String, KSessionState)));1342 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(Q String, QString)),1343 this, SLOT(sltSnapshotChanged(Q String, QString)));1344 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(Q String, QString)),1345 this, SLOT(sltSnapshotChanged(Q String, QString)));1346 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(Q String, QString)),1347 this, SLOT(sltSnapshotChanged(Q String, QString)));1348 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(Q String, QString)),1349 this, SLOT(sltSnapshotChanged(Q String, QString)));1334 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 1335 this, SLOT(sltMachineStateChanged(QUuid, KMachineState))); 1336 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QUuid)), 1337 this, SLOT(sltMachineDataChanged(QUuid))); 1338 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QUuid, bool)), 1339 this, SLOT(sltMachineRegistered(QUuid, bool))); 1340 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), 1341 this, SLOT(sltSessionStateChanged(QUuid, KSessionState))); 1342 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QUuid, QUuid)), 1343 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1344 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), 1345 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1346 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QUuid, QUuid)), 1347 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1348 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), 1349 this, SLOT(sltSnapshotChanged(QUuid, QUuid))); 1350 1350 } 1351 1351 … … 1544 1544 } 1545 1545 1546 void UIGChooserModel::unregisterMachines(const Q StringList&ids)1546 void UIGChooserModel::unregisterMachines(const QList<QUuid> &ids) 1547 1547 { 1548 1548 /* Populate machine list: */ 1549 1549 QList<CMachine> machines; 1550 1550 CVirtualBox vbox = vboxGlobal().virtualBox(); 1551 foreach (const Q String &strId, ids)1552 { 1553 CMachine machine = vbox.FindMachine( strId);1551 foreach (const QUuid &uId, ids) 1552 { 1553 CMachine machine = vbox.FindMachine(uId.toString()); 1554 1554 if (!machine.isNull()) 1555 1555 machines << machine; … … 1754 1754 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1755 1755 { 1756 const Q String strMachineID = machine.GetId();1757 if (! strMachineID.isEmpty() && gEDataManager->showMachineInSelectorChooser(strMachineID))1756 const QUuid uMachineID = machine.GetId(); 1757 if (!uMachineID.isNull() && gEDataManager->showMachineInSelectorChooser(uMachineID)) 1758 1758 addMachineIntoTheTree(machine); 1759 1759 } … … 1769 1769 1770 1770 /* Which VM we are loading: */ 1771 LogRelFlow(("UIGChooserModel: Loading VM with ID={%s}...\n", machine.GetId().to Utf8().constData()));1771 LogRelFlow(("UIGChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toString().toUtf8().constData())); 1772 1772 /* Is that machine accessible? */ 1773 1773 if (machine.GetAccessible()) … … 1793 1793 } 1794 1794 /* Update group definitions: */ 1795 m_groups[machine.GetId() ] = groupList;1795 m_groups[machine.GetId().toString()] = groupList; 1796 1796 } 1797 1797 /* Inaccessible machine: */ … … 1799 1799 { 1800 1800 /* VM is accessible: */ 1801 LogRelFlow(("UIGChooserModel: VM {%s} is inaccessible.\n", machine.GetId().to Utf8().constData()));1801 LogRelFlow(("UIGChooserModel: VM {%s} is inaccessible.\n", machine.GetId().toString().toUtf8().constData())); 1802 1802 /* Create machine-item with main-root group-item as parent: */ 1803 1803 createMachineItem(machine, mainRoot()); … … 1894 1894 /* Which position should be current item placed by definitions? */ 1895 1895 QString strDefinitionName = pItem->type() == UIGChooserItemType_Group ? pItem->name() : 1896 pItem->type() == UIGChooserItemType_Machine ? pItem->toMachineItem()->id() :1896 pItem->type() == UIGChooserItemType_Machine ? pItem->toMachineItem()->id().toString() : 1897 1897 QString(); 1898 1898 AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!")); … … 1964 1964 pParentItem, machine, 1965 1965 /* Which position new group-item should be placed in? */ 1966 getDesiredPosition(pParentItem, UIGChooserItemType_Machine, machine.GetId() ));1966 getDesiredPosition(pParentItem, UIGChooserItemType_Machine, machine.GetId().toString())); 1967 1967 } 1968 1968 … … 1980 1980 UIGroupDefinitionSaveThread::prepare(); 1981 1981 emit sigGroupSavingStateChanged(); 1982 connect(UIGroupDefinitionSaveThread::instance(), SIGNAL(sigReload(Q String)),1983 this, SLOT(sltReloadMachine(Q String)));1982 connect(UIGroupDefinitionSaveThread::instance(), SIGNAL(sigReload(QUuid)), 1983 this, SLOT(sltReloadMachine(QUuid))); 1984 1984 UIGroupDefinitionSaveThread::instance()->configure(this, m_groups, groups); 1985 1985 UIGroupDefinitionSaveThread::instance()->start(); … … 2011 2011 if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem()) 2012 2012 if (pMachineItem->accessible()) 2013 groups[pMachineItem->id() ] << pParentGroup->fullName();2013 groups[pMachineItem->id().toString()] << pParentGroup->fullName(); 2014 2014 /* Iterate over all the group-items: */ 2015 2015 foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group)) … … 2031 2031 /* Iterate over all the machine-items: */ 2032 2032 foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Machine)) 2033 groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id() );2033 groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id().toString()); 2034 2034 } 2035 2035 … … 2130 2130 { 2131 2131 /* 1. Open session: */ 2132 session = vboxGlobal().openSession( strId);2132 session = vboxGlobal().openSession(QUuid(strId)); 2133 2133 if (session.isNull()) 2134 2134 break; … … 2158 2158 /* Cleanup if necessary: */ 2159 2159 if (machine.isNull() || !machine.isOk()) 2160 emit sigReload( strId);2160 emit sigReload(QUuid(strId)); 2161 2161 if (!session.isNull()) 2162 2162 session.UnlockMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r70552 r74878 21 21 /* Qt includes: */ 22 22 #include <QObject> 23 #include <QUuid> 23 24 #include <QPointer> 24 25 #include <QTransform> … … 159 160 160 161 /* Handlers: Global events: */ 161 void sltMachineStateChanged( QString strId,KMachineState state);162 void sltMachineDataChanged( QString strId);163 void sltMachineRegistered( QString strId,bool fRegistered);164 void sltSessionStateChanged( QString strId,KSessionState state);165 void sltSnapshotChanged( QString strId, QString strSnapshotId);162 void sltMachineStateChanged(const QUuid &aId, const KMachineState state); 163 void sltMachineDataChanged(const QUuid &aId); 164 void sltMachineRegistered(const QUuid &aId, const bool fRegistered); 165 void sltSessionStateChanged(const QUuid &aId, const KSessionState state); 166 void sltSnapshotChanged(const QUuid &aId, const QUuid &aSnapshotId); 166 167 167 168 /* Handler: Chooser-view stuff: */ … … 184 185 void sltCreateNewMachine(); 185 186 void sltGroupSelectedMachines(); 186 void sltReloadMachine(const Q String &strId);187 void sltReloadMachine(const QUuid &aId); 187 188 void sltSortParentGroup(); 188 189 void sltPerformRefreshAction(); … … 247 248 /* Helpers: Machine-item stuff: */ 248 249 void removeItems(const QList<UIGChooserItem*> &itemsToRemove); 249 void unregisterMachines(const Q StringList&ids);250 void unregisterMachines(const QList<QUuid> &ids); 250 251 251 252 /* Helpers: Context-menu stuff: */ … … 303 304 304 305 /** Holds the Id of last VM created from the GUI side. */ 305 Q String m_strLastCreatedMachineId;306 QUuid m_uLastCreatedMachineId; 306 307 }; 307 308 … … 314 315 315 316 /* Notifier: Reload stuff: */ 316 void sigReload( QString strId);317 void sigReload(const QUuid &aId); 317 318 318 319 /* Notifier: Complete stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.cpp
r69726 r74878 102 102 connect(m_pDetailsModel, SIGNAL(sigRootItemMinimumHeightHintChanged(int)), 103 103 m_pDetailsView, SLOT(sltMinimumHeightHintChanged(int))); 104 connect(m_pDetailsModel, SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)),105 this, SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)));104 connect(m_pDetailsModel, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)), 105 this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&))); 106 106 connect(this, SIGNAL(sigSlidingStarted()), 107 107 m_pDetailsModel, SLOT(sltHandleSlidingStarted())); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.h
r69500 r74878 36 36 37 37 /* Notifier: Link processing stuff: */ 38 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);38 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 39 39 40 40 /* Notifier: Sliding stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp
r72710 r74878 470 470 connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)), 471 471 model(), SLOT(sltToggleElements(DetailsElementType, bool))); 472 connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)),473 model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const Q String&)));472 connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)), 473 model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&))); 474 474 } 475 475 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.h
r72710 r74878 59 59 60 60 /* Notifier: Link-click stuff: */ 61 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);61 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 62 62 63 63 public: -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.cpp
r71355 r74878 77 77 78 78 /* Generate new group-id: */ 79 m_ strGroupId = QUuid::createUuid().toString();79 m_uGroupId = QUuid::createUuid(); 80 80 81 81 /* Request to build first step: */ 82 emit sigBuildStep(m_ strGroupId, 0);82 emit sigBuildStep(m_uGroupId, 0); 83 83 } 84 84 … … 86 86 { 87 87 /* Generate new group-id: */ 88 m_ strGroupId = QUuid::createUuid().toString();89 } 90 91 void UIGDetailsGroup::sltBuildStep( QString strStepId,int iStepNumber)88 m_uGroupId = QUuid::createUuid(); 89 } 90 91 void UIGDetailsGroup::sltBuildStep(const QUuid &aStepId, const int iStepNumber) 92 92 { 93 93 /* Cleanup build-step: */ … … 96 96 97 97 /* Is step id valid? */ 98 if ( strStepId != m_strGroupId)98 if (aStepId != m_uGroupId) 99 99 return; 100 100 … … 111 111 112 112 /* Create next build-step: */ 113 m_pBuildStep = new UIBuildStep(this, pSet, strStepId, iStepNumber + 1);113 m_pBuildStep = new UIBuildStep(this, pSet, aStepId, iStepNumber + 1); 114 114 115 115 /* Build set: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h
r69500 r74878 56 56 57 57 /* Handler: Build stuff: */ 58 void sltBuildStep( QString strStepId,int iStepNumber);58 void sltBuildStep(const QUuid &aStepId, const int iStepNumber); 59 59 60 60 private: … … 96 96 QList<UIVMItem*> m_machineItems; 97 97 UIBuildStep *m_pBuildStep; 98 Q String m_strGroupId;98 QUuid m_uGroupId; 99 99 100 100 /* Friends: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.cpp
r69500 r74878 271 271 } 272 272 273 void UIGDetailsItem::sltBuildStep( QString,int)273 void UIGDetailsItem::sltBuildStep(const QUuid &, const int) 274 274 { 275 275 AssertMsgFailed(("This item doesn't support building!")); … … 329 329 } 330 330 331 UIBuildStep::UIBuildStep(QObject *pParent, QObject *pBuildObject, const Q String &strStepId, int iStepNumber)331 UIBuildStep::UIBuildStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber) 332 332 : QObject(pParent) 333 , m_ strStepId(strStepId)333 , m_uStepId(aStepId) 334 334 , m_iStepNumber(iStepNumber) 335 335 { 336 336 /* Prepare connections: */ 337 337 connect(pBuildObject, SIGNAL(sigBuildDone()), this, SLOT(sltStepDone()), Qt::QueuedConnection); 338 connect(this, SIGNAL(sigStepDone(Q String, int)), pParent, SLOT(sltBuildStep(QString, int)), Qt::QueuedConnection);338 connect(this, SIGNAL(sigStepDone(QUuid, int)), pParent, SLOT(sltBuildStep(QUuid, int)), Qt::QueuedConnection); 339 339 } 340 340 341 341 void UIBuildStep::sltStepDone() 342 342 { 343 emit sigStepDone(m_ strStepId, m_iStepNumber);344 } 345 343 emit sigStepDone(m_uStepId, m_iStepNumber); 344 } 345 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h
r69500 r74878 18 18 #ifndef __UIGDetailsItem_h__ 19 19 #define __UIGDetailsItem_h__ 20 21 /* Qt includes: */ 22 #include <QUuid> 20 23 21 24 /* GUI includes: */ … … 50 53 51 54 /* Notifiers: Build stuff: */ 52 void sigBuildStep( QString strStepId,int iStepNumber);55 void sigBuildStep(const QUuid &aStepId, const int iStepNumber); 53 56 void sigBuildDone(); 54 57 … … 89 92 90 93 /* Handler: Build stuff: */ 91 virtual void sltBuildStep( QString strStepId,int iStepNumber);94 virtual void sltBuildStep(const QUuid & aStepId, const int iStepNumber); 92 95 93 96 protected: … … 118 121 119 122 /* Notifier: Build stuff: */ 120 void sigStepDone( QString strStepId,int iStepNumber);123 void sigStepDone(const QUuid &aStepId, const int iStepNumber); 121 124 122 125 public: 123 126 124 127 /* Constructor: */ 125 UIBuildStep(QObject *pParent, QObject *pBuildObject, const Q String &strStepId, int iStepNumber);128 UIBuildStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber); 126 129 127 130 private slots: … … 133 136 134 137 /* Variables: */ 135 Q String m_strStepId;138 QUuid m_uStepId; 136 139 int m_iStepNumber; 137 140 }; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h
r69500 r74878 54 54 55 55 /* Notifier: Link processing stuff: */ 56 void sigLinkClicked(const QString &strCategory, const QString &strControl, const Q String &strId);56 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId); 57 57 58 58 public: -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.cpp
r71355 r74878 113 113 } 114 114 115 void UIGDetailsSet::sltBuildStep( QString strStepId,int iStepNumber)115 void UIGDetailsSet::sltBuildStep(const QUuid &aStepId, const int iStepNumber) 116 116 { 117 117 /* Cleanup build-step: */ … … 120 120 121 121 /* Is step id valid? */ 122 if ( strStepId != m_strSetId)122 if (aStepId != m_uSetId) 123 123 return; 124 124 … … 173 173 { 174 174 /* Create next build-step: */ 175 m_pBuildStep = new UIBuildStep(this, pElement, strStepId, iStepNumber + 1);175 m_pBuildStep = new UIBuildStep(this, pElement, aStepId, iStepNumber + 1); 176 176 177 177 /* Build element: */ … … 182 182 { 183 183 /* Just build next step: */ 184 sltBuildStep( strStepId, iStepNumber + 1);184 sltBuildStep(aStepId, iStepNumber + 1); 185 185 } 186 186 } … … 198 198 } 199 199 200 void UIGDetailsSet::sltMachineStateChange( QString strId)200 void UIGDetailsSet::sltMachineStateChange(const QUuid &aId) 201 201 { 202 202 /* Is this our VM changed? */ 203 if (m_machine.GetId() != strId)203 if (m_machine.GetId() != aId) 204 204 return; 205 205 … … 208 208 } 209 209 210 void UIGDetailsSet::sltMachineAttributesChange( QString strId)210 void UIGDetailsSet::sltMachineAttributesChange(const QUuid &aId) 211 211 { 212 212 /* Is this our VM changed? */ 213 if (m_machine.GetId() != strId)213 if (m_machine.GetId() != aId) 214 214 return; 215 215 … … 346 346 { 347 347 /* Global-events connections: */ 348 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(Q String, KMachineState)), this, SLOT(sltMachineStateChange(QString)));349 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(Q String)), this, SLOT(sltMachineAttributesChange(QString)));350 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(Q String, KSessionState)), this, SLOT(sltMachineAttributesChange(QString)));351 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));352 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));353 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));354 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(Q String, QString)), this, SLOT(sltMachineAttributesChange(QString)));348 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), this, SLOT(sltMachineStateChange(QUuid))); 349 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 350 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QUuid, KSessionState)), this, SLOT(sltMachineAttributesChange(QUuid))); 351 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 352 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 353 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 354 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QUuid, QUuid)), this, SLOT(sltMachineAttributesChange(QUuid))); 355 355 356 356 /* Meidum-enumeration connections: */ … … 567 567 568 568 /* Generate new set-id: */ 569 m_ strSetId = QUuid::createUuid().toString();569 m_uSetId = QUuid::createUuid(); 570 570 571 571 /* Request to build first step: */ 572 emit sigBuildStep(m_ strSetId, DetailsElementType_General);572 emit sigBuildStep(m_uSetId, DetailsElementType_General); 573 573 } 574 574 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.h
r69500 r74878 63 63 64 64 /* Handler: Build stuff: */ 65 void sltBuildStep( QString strStepId,int iStepNumber);65 void sltBuildStep(const QUuid &aStepId, const int iStepNumber); 66 66 67 67 /* Handlers: Global event stuff: */ 68 void sltMachineStateChange( QString strId);69 void sltMachineAttributesChange( QString strId);68 void sltMachineStateChange(const QUuid &aId); 69 void sltMachineAttributesChange(const QUuid &aId); 70 70 71 71 /* Handler: Update stuff: */ … … 124 124 UIBuildStep *m_pBuildStep; 125 125 int m_iLastStepNumber; 126 Q String m_strSetId;126 QUuid m_uSetId; 127 127 QMap<DetailsElementType, bool> m_settings; 128 128 }; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp
r71355 r74878 170 170 } 171 171 172 void UIGMachinePreview::sltMachineStateChange( QString strId)172 void UIGMachinePreview::sltMachineStateChange(const QUuid &aId) 173 173 { 174 174 /* Make sure its the event for our machine: */ 175 if (m_machine.isNull() || m_machine.GetId() != strId)175 if (m_machine.isNull() || m_machine.GetId() != aId) 176 176 return; 177 177 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.h
r69708 r74878 66 66 67 67 /* Handler: Global-event listener stuff: */ 68 void sltMachineStateChange( QString strId);68 void sltMachineStateChange(const QUuid &aId); 69 69 70 70 /* Handler: Preview recreator: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r72092 r74878 330 330 *********************************************************************************************************************************/ 331 331 332 UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, const Q String &strMachineId,332 UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, const QUuid &aMachineId, 333 333 const QString &strCategory, const QString &strControl) 334 334 : UISettingsDialog(pParent) 335 , m_ strMachineId(strMachineId)335 , m_uMachineId(aMachineId) 336 336 , m_strCategory(strCategory) 337 337 , m_strControl(strControl) … … 408 408 /* Prepare session: */ 409 409 m_session = configurationAccessLevel() == ConfigurationAccessLevel_Null ? CSession() : 410 configurationAccessLevel() == ConfigurationAccessLevel_Full ? vboxGlobal().openSession(m_ strMachineId) :411 vboxGlobal().openExistingSession(m_ strMachineId);410 configurationAccessLevel() == ConfigurationAccessLevel_Full ? vboxGlobal().openSession(m_uMachineId) : 411 vboxGlobal().openExistingSession(m_uMachineId); 412 412 /* Check that session was created: */ 413 413 if (m_session.isNull()) … … 434 434 /* Prepare session: */ 435 435 m_session = configurationAccessLevel() == ConfigurationAccessLevel_Null ? CSession() : 436 configurationAccessLevel() == ConfigurationAccessLevel_Full ? vboxGlobal().openSession(m_ strMachineId) :437 vboxGlobal().openExistingSession(m_ strMachineId);436 configurationAccessLevel() == ConfigurationAccessLevel_Full ? vboxGlobal().openSession(m_uMachineId) : 437 vboxGlobal().openExistingSession(m_uMachineId); 438 438 /* Check that session was created: */ 439 439 if (m_session.isNull()) … … 482 482 /* Disable First RUN Wizard: */ 483 483 if (m_fResetFirstRunFlag) 484 gEDataManager->setMachineFirstTimeStarted(false, m_ strMachineId);484 gEDataManager->setMachineFirstTimeStarted(false, m_uMachineId); 485 485 486 486 /* Save settings finally: */ … … 509 509 QString strDialogTitle; 510 510 /* Get corresponding machine (required to compose dialog title): */ 511 const CMachine &machine = vboxGlobal().virtualBox().FindMachine(m_ strMachineId);511 const CMachine &machine = vboxGlobal().virtualBox().FindMachine(m_uMachineId.toString()); 512 512 if (!machine.isNull()) 513 513 strDialogTitle = tr("%1 - %2").arg(machine.GetName()).arg(titleExtension()); … … 603 603 } 604 604 605 void UISettingsDialogMachine::sltSessionStateChanged( QString strMachineId,KSessionState enmSessionState)605 void UISettingsDialogMachine::sltSessionStateChanged(const QUuid &aMachineId, const KSessionState enmSessionState) 606 606 { 607 607 /* Ignore if serialization is in progress: */ … … 609 609 return; 610 610 /* Ignore if thats NOT our VM: */ 611 if ( strMachineId != m_strMachineId)611 if (aMachineId != m_uMachineId) 612 612 return; 613 613 … … 622 622 } 623 623 624 void UISettingsDialogMachine::sltMachineStateChanged( QString strMachineId,KMachineState enmMachineState)624 void UISettingsDialogMachine::sltMachineStateChanged(const QUuid &aMachineId, const KMachineState enmMachineState) 625 625 { 626 626 /* Ignore if serialization is in progress: */ … … 628 628 return; 629 629 /* Ignore if thats NOT our VM: */ 630 if ( strMachineId != m_strMachineId)630 if (aMachineId != m_uMachineId) 631 631 return; 632 632 … … 641 641 } 642 642 643 void UISettingsDialogMachine::sltMachineDataChanged( QString strMachineId)643 void UISettingsDialogMachine::sltMachineDataChanged(const QUuid &aMachineId) 644 644 { 645 645 /* Ignore if serialization is in progress: */ … … 647 647 return; 648 648 /* Ignore if thats NOT our VM: */ 649 if ( strMachineId != m_strMachineId)649 if (aMachineId != m_uMachineId) 650 650 return; 651 651 … … 689 689 690 690 /* Get corresponding machine (required to determine dialog type and page availability): */ 691 m_machine = vboxGlobal().virtualBox().FindMachine(m_ strMachineId);691 m_machine = vboxGlobal().virtualBox().FindMachine(m_uMachineId.toString()); 692 692 AssertMsg(!m_machine.isNull(), ("Can't find corresponding machine!\n")); 693 693 m_enmSessionState = m_machine.GetSessionState(); … … 695 695 696 696 /* Creating settings pages: */ 697 QList<MachineSettingsPageType> restrictedMachineSettingsPages = gEDataManager->restrictedMachineSettingsPages(m_ strMachineId);697 QList<MachineSettingsPageType> restrictedMachineSettingsPages = gEDataManager->restrictedMachineSettingsPages(m_uMachineId); 698 698 for (int iPageIndex = MachineSettingsPageType_General; iPageIndex < MachineSettingsPageType_Max; ++iPageIndex) 699 699 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r72092 r74878 81 81 82 82 /** Constructs settings dialog passing @a pParent to the base-class. 83 * @param strMachineIdBrings the machine ID.83 * @param aMachineId Brings the machine ID. 84 84 * @param strCategory Brings the name of category to be opened. 85 85 * @param strControl Brings the name of control to be focused. */ 86 UISettingsDialogMachine(QWidget *pParent, const Q String &strMachineId,86 UISettingsDialogMachine(QWidget *pParent, const QUuid &aMachineId, 87 87 const QString &strCategory, const QString &strControl); 88 88 … … 117 117 private slots: 118 118 119 /** Handles session state change for machine with certain @a strMachineId to @a enmSessionState. */120 void sltSessionStateChanged( QString strMachineId,KSessionState enmSessionState);121 /** Handles machine state change for machine with certain @a strMachineId to @a enmMachineState. */122 void sltMachineStateChanged( QString strMachineId,KMachineState enmMachineState);123 /** Handles machine data change for machine with certain @a strMachineId. */124 void sltMachineDataChanged( QString strMachineId);119 /** Handles session state change for machine with certain @a aMachineId to @a enmSessionState. */ 120 void sltSessionStateChanged(const QUuid &aMachineId, const KSessionState enmSessionState); 121 /** Handles machine state change for machine with certain @a aMachineId to @a enmMachineState. */ 122 void sltMachineStateChanged(const QUuid &aMachineId, const KMachineState enmMachineState); 123 /** Handles machine data change for machine with certain @a aMachineId. */ 124 void sltMachineDataChanged(const QUuid &aMachineId); 125 125 126 126 /** Handles request to allow to reset first run flag. */ … … 144 144 145 145 /** Holds the machine ID. */ 146 Q String m_strMachineId;146 QUuid m_uMachineId; 147 147 /** Holds the name of category to be opened. */ 148 148 QString m_strCategory; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r74862 r74878 1391 1391 1392 1392 /* Get machine ID for further activities: */ 1393 Q String strMachineId;1393 QUuid uMachineId; 1394 1394 if (fSuccess) 1395 1395 { 1396 strMachineId = m_machine.GetId();1396 uMachineId = m_machine.GetId(); 1397 1397 fSuccess = m_machine.isOk(); 1398 1398 } … … 1405 1405 if (fSuccess && newDisplayData.m_scaleFactors != oldDisplayData.m_scaleFactors) 1406 1406 { 1407 gEDataManager->setScaleFactors(newDisplayData.m_scaleFactors, strMachineId);1407 gEDataManager->setScaleFactors(newDisplayData.m_scaleFactors, uMachineId); 1408 1408 } 1409 1409 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r73926 r74878 871 871 872 872 /* Get medium id for further activities: */ 873 Q String strMediumId;873 QUuid aMediumId; 874 874 if (fSuccess) 875 875 { 876 strMediumId = comMedium.GetId();876 aMediumId = comMedium.GetId(); 877 877 fSuccess = comMedium.isOk(); 878 878 } … … 906 906 907 907 /* Check if old password exists/provided: */ 908 const QString strOldPasswordId = encryptedMedium.key( strMediumId);908 const QString strOldPasswordId = encryptedMedium.key(aMediumId); 909 909 const QString strOldPassword = encryptionPasswords.value(strOldPasswordId); 910 910 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp
r71027 r74878 134 134 135 135 136 UIMachineSettingsInterface::UIMachineSettingsInterface(const Q String strMachineId)137 : m_ strMachineId(strMachineId)136 UIMachineSettingsInterface::UIMachineSettingsInterface(const QUuid &aMachineId) 137 : m_uMachineId(aMachineId) 138 138 , m_pActionPool(0) 139 139 , m_pCache(0) … … 319 319 m_pActionPool = UIActionPool::create(UIActionPoolType_Runtime); 320 320 m_pMenuBarEditor->setActionPool(m_pActionPool); 321 m_pMenuBarEditor->setMachineID(m_ strMachineId);321 m_pMenuBarEditor->setMachineID(m_uMachineId); 322 322 } 323 323 … … 326 326 { 327 327 /* Configure editor: */ 328 m_pStatusBarEditor->setMachineID(m_ strMachineId);328 m_pStatusBarEditor->setMachineID(m_uMachineId); 329 329 } 330 330 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h
r72109 r74878 37 37 38 38 /** Constructs User Interface settings page. */ 39 UIMachineSettingsInterface(const Q String strMachineId);39 UIMachineSettingsInterface(const QUuid &aMachineId); 40 40 /** Destructs User Interface settings page. */ 41 41 ~UIMachineSettingsInterface(); … … 83 83 84 84 /** Holds the machine ID copy. */ 85 const Q String m_strMachineId;85 const QUuid m_uMachineId; 86 86 /** Holds the action-pool instance. */ 87 87 UIActionPool *m_pActionPool; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r73953 r74878 69 69 , m_iAttachmentPort(-1) 70 70 , m_iAttachmentDevice(-1) 71 , m_ strAttachmentMediumId(QString())71 , m_uAttachmentMediumId(QUuid()) 72 72 , m_fAttachmentPassthrough(false) 73 73 , m_fAttachmentTempEject(false) … … 83 83 && (m_iAttachmentPort == other.m_iAttachmentPort) 84 84 && (m_iAttachmentDevice == other.m_iAttachmentDevice) 85 && (m_ strAttachmentMediumId == other.m_strAttachmentMediumId)85 && (m_uAttachmentMediumId == other.m_uAttachmentMediumId) 86 86 && (m_fAttachmentPassthrough == other.m_fAttachmentPassthrough) 87 87 && (m_fAttachmentTempEject == other.m_fAttachmentTempEject) … … 103 103 LONG m_iAttachmentDevice; 104 104 /** Holds the attachment medium ID. */ 105 Q String m_strAttachmentMediumId;105 QUuid m_uAttachmentMediumId; 106 106 /** Holds whether the attachment being passed through. */ 107 107 bool m_fAttachmentPassthrough; … … 604 604 } 605 605 606 Q StringAbstractItem::machineId() const606 QUuid AbstractItem::machineId() const 607 607 { 608 608 return mMachineId; 609 609 } 610 610 611 void AbstractItem::setMachineId (const Q String&aMachineId)611 void AbstractItem::setMachineId (const QUuid &aMachineId) 612 612 { 613 613 mMachineId = aMachineId; … … 943 943 } 944 944 945 Q StringAttachmentItem::attMediumId() const945 QUuid AttachmentItem::attMediumId() const 946 946 { 947 947 return mAttMediumId; … … 983 983 } 984 984 985 void AttachmentItem::setAttMediumId (const QString &aAttMediumId) 986 { 987 AssertMsg(!aAttMediumId.isEmpty(), ("Medium ID value can't be null/empty!\n")); 985 void AttachmentItem::setAttMediumId (const QUuid &aAttMediumId) 986 { 987 /// @todo is this required? 988 //AssertMsg(!aAttMediumId.isNull(), ("Medium ID value can't be null!\n")); 988 989 mAttMediumId = vboxGlobal().medium(aAttMediumId).id(); 989 990 cache(); … … 1273 1274 { 1274 1275 if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer())) 1275 return item->id() .toString();1276 return QUuid() .toString();1276 return item->id(); 1277 return QUuid(); 1277 1278 } 1278 1279 case R_ItemPixmap: … … 1511 1512 if (item->rtti() == AbstractItem::Type_AttachmentItem) 1512 1513 return static_cast <AttachmentItem*> (item)->attMediumId(); 1513 return Q String();1514 return QUuid(); 1514 1515 } 1515 1516 case R_AttIsHostDrive: … … 1758 1759 if (item->rtti() == AbstractItem::Type_AttachmentItem) 1759 1760 { 1760 static_cast <AttachmentItem*> (item)->setAttMediumId (aValue.to String());1761 static_cast <AttachmentItem*> (item)->setAttMediumId (aValue.toUuid()); 1761 1762 emit dataChanged (aIndex, aIndex); 1762 1763 return true; … … 1834 1835 } 1835 1836 1836 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const Q String &strMediumId)1837 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QUuid &aMediumId) 1837 1838 { 1838 1839 if (AbstractItem *parent = mRootItem->childItemById (aCtrId)) … … 1843 1844 AttachmentItem *pItem = new AttachmentItem (parent, aDeviceType); 1844 1845 pItem->setAttIsHotPluggable(m_configurationAccessLevel != ConfigurationAccessLevel_Full); 1845 pItem->setAttMediumId( strMediumId);1846 pItem->setAttMediumId(aMediumId); 1846 1847 endInsertRows(); 1847 1848 return index (parent->childCount() - 1, 0, parentIndex); … … 1865 1866 } 1866 1867 1867 void StorageModel::setMachineId (const Q String&aMachineId)1868 void StorageModel::setMachineId (const QUuid &aMachineId) 1868 1869 { 1869 1870 mRootItem->setMachineId (aMachineId); … … 2120 2121 UIMediumIDHolder(QWidget *pParent) : QObject(pParent) {} 2121 2122 2122 Q String id() const { return m_strId; }2123 void setId(const Q String &strId) { m_strId = strId; emit sigChanged(); }2123 QUuid id() const { return m_uId; } 2124 void setId(const QUuid &aId) { m_uId = aId; emit sigChanged(); } 2124 2125 2125 2126 UIMediumDeviceType type() const { return m_type; } 2126 2127 void setType(UIMediumDeviceType type) { m_type = type; } 2127 2128 2128 bool isNull() const { return m_ strId == UIMedium().id(); }2129 bool isNull() const { return m_uId == UIMedium().id(); } 2129 2130 2130 2131 signals: … … 2134 2135 private: 2135 2136 2136 Q String m_strId;2137 QUuid m_uId; 2137 2138 UIMediumDeviceType m_type; 2138 2139 }; … … 2191 2192 2192 2193 /* Gather old common data: */ 2193 m_ strMachineId = m_machine.GetId();2194 m_uMachineId = m_machine.GetId(); 2194 2195 m_strMachineSettingsFilePath = m_machine.GetSettingsFilePath(); 2195 2196 m_strMachineName = m_machine.GetName(); … … 2249 2250 oldAttachmentData.m_fAttachmentHotPluggable = comAttachment.GetHotPluggable(); 2250 2251 const CMedium comMedium = comAttachment.GetMedium(); 2251 oldAttachmentData.m_ strAttachmentMediumId = comMedium.isNull() ? UIMedium::nullID() : comMedium.GetId();2252 oldAttachmentData.m_uAttachmentMediumId = comMedium.isNull() ? UIMedium::nullID() : comMedium.GetId(); 2252 2253 /* Override controller cache key: */ 2253 2254 strAttachmentKey = QString("%1:%2").arg(oldAttachmentData.m_iAttachmentPort).arg(oldAttachmentData.m_iAttachmentDevice); … … 2276 2277 2277 2278 /* Load old common data from the cache: */ 2278 m_pModelStorage->setMachineId(m_ strMachineId);2279 m_pModelStorage->setMachineId(m_uMachineId); 2279 2280 2280 2281 /* For each controller: */ … … 2305 2306 const QModelIndex attachmentIndex = m_pModelStorage->addAttachment(controllerId, 2306 2307 oldAttachmentData.m_attachmentType, 2307 oldAttachmentData.m_ strAttachmentMediumId);2308 oldAttachmentData.m_uAttachmentMediumId); 2308 2309 const StorageSlot attachmentStorageSlot(oldControllerData.m_controllerBus, 2309 2310 oldAttachmentData.m_iAttachmentPort, … … 2368 2369 newAttachmentData.m_fAttachmentNonRotational = m_pModelStorage->data(attachmentIndex, StorageModel::R_AttIsNonRotational).toBool(); 2369 2370 newAttachmentData.m_fAttachmentHotPluggable = m_pModelStorage->data(attachmentIndex, StorageModel::R_AttIsHotPluggable).toBool(); 2370 newAttachmentData.m_ strAttachmentMediumId = m_pModelStorage->data(attachmentIndex, StorageModel::R_AttMediumId).toString();2371 newAttachmentData.m_uAttachmentMediumId = m_pModelStorage->data(attachmentIndex, StorageModel::R_AttMediumId).toString(); 2371 2372 const QString strAttachmentKey = QString("%1:%2").arg(newAttachmentData.m_iAttachmentPort).arg(newAttachmentData.m_iAttachmentDevice); 2372 2373 … … 2627 2628 } 2628 2629 2629 void UIMachineSettingsStorage::sltHandleMediumEnumerated(const Q String &strMediumId)2630 void UIMachineSettingsStorage::sltHandleMediumEnumerated(const QUuid &aMediumId) 2630 2631 { 2631 2632 /* Search for corresponding medium: */ 2632 const UIMedium medium = vboxGlobal().medium( strMediumId);2633 const UIMedium medium = vboxGlobal().medium(aMediumId); 2633 2634 2634 2635 const QModelIndex rootIndex = m_pModelStorage->root(); … … 2639 2640 { 2640 2641 const QModelIndex attIndex = ctrIndex.child(j, 0); 2641 const Q StringattMediumId = m_pModelStorage->data(attIndex, StorageModel::R_AttMediumId).toString();2642 const QUuid attMediumId = m_pModelStorage->data(attIndex, StorageModel::R_AttMediumId).toString(); 2642 2643 if (attMediumId == medium.id()) 2643 2644 { … … 2651 2652 } 2652 2653 2653 void UIMachineSettingsStorage::sltHandleMediumDeleted(const Q String &strMediumId)2654 void UIMachineSettingsStorage::sltHandleMediumDeleted(const QUuid &aMediumId) 2654 2655 { 2655 2656 QModelIndex rootIndex = m_pModelStorage->root(); … … 2660 2661 { 2661 2662 QModelIndex attIndex = ctrIndex.child(j, 0); 2662 Q StringattMediumId = m_pModelStorage->data(attIndex, StorageModel::R_AttMediumId).toString();2663 if (attMediumId == strMediumId)2663 QUuid attMediumId = m_pModelStorage->data(attIndex, StorageModel::R_AttMediumId).toString(); 2664 if (attMediumId == aMediumId) 2664 2665 { 2665 2666 m_pModelStorage->setData(attIndex, UIMedium().id(), StorageModel::R_AttMediumId); … … 3088 3089 void UIMachineSettingsStorage::sltCreateNewHardDisk() 3089 3090 { 3090 const Q String strMediumId = getWithNewHDWizard();3091 if (! strMediumId.isNull())3092 m_pMediumIdHolder->setId( strMediumId);3091 const QUuid uMediumId = getWithNewHDWizard(); 3092 if (!uMediumId.isNull()) 3093 m_pMediumIdHolder->setId(uMediumId); 3093 3094 } 3094 3095 … … 3101 3102 { 3102 3103 const QString strMachineFolder(QFileInfo(m_strMachineSettingsFilePath).absolutePath()); 3103 const Q String strMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), this, strMachineFolder);3104 if (! strMediumId.isNull())3105 m_pMediumIdHolder->setId( strMediumId);3104 const QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), this, strMachineFolder); 3105 if (!uMediumId.isNull()) 3106 m_pMediumIdHolder->setId(uMediumId); 3106 3107 } 3107 3108 … … 3126 3127 const UIMediumDeviceType enmMediumType = (UIMediumDeviceType)mediumInfoList[0].toUInt(); 3127 3128 const QString strMediumLocation = mediumInfoList[1]; 3128 const Q String strMediumId = vboxGlobal().openMedium(enmMediumType, strMediumLocation, this);3129 if (! strMediumId.isNull())3130 m_pMediumIdHolder->setId( strMediumId);3129 const QUuid uMediumId = vboxGlobal().openMedium(enmMediumType, strMediumLocation, this); 3130 if (!uMediumId.isNull()) 3131 m_pMediumIdHolder->setId(uMediumId); 3131 3132 } 3132 3133 } … … 3690 3691 { 3691 3692 /* Configure this: */ 3692 connect(&vboxGlobal(), SIGNAL(sigMediumEnumerated(const Q String&)),3693 this, SLOT(sltHandleMediumEnumerated(const Q String&)));3694 connect(&vboxGlobal(), SIGNAL(sigMediumDeleted(const Q String&)),3695 this, SLOT(sltHandleMediumDeleted(const Q String&)));3693 connect(&vboxGlobal(), SIGNAL(sigMediumEnumerated(const QUuid &)), 3694 this, SLOT(sltHandleMediumEnumerated(const QUuid &))); 3695 connect(&vboxGlobal(), SIGNAL(sigMediumDeleted(const QUuid &)), 3696 this, SLOT(sltHandleMediumDeleted(const QUuid &))); 3696 3697 3697 3698 /* Configure tree-view: */ … … 3795 3796 } 3796 3797 3797 Q StringUIMachineSettingsStorage::openMediumSelectorDialog(UIMediumDeviceType enmMediumType)3798 QUuid UIMachineSettingsStorage::openMediumSelectorDialog(UIMediumDeviceType enmMediumType) 3798 3799 { 3799 3800 QWidget *pParent = windowManager().realParentWindow(this); … … 3806 3807 if (pSelector->execute(true, false)) 3807 3808 { 3808 Q StringListselectedMediumIds = pSelector->selectedMediumIds();3809 QList<QUuid> selectedMediumIds = pSelector->selectedMediumIds(); 3809 3810 delete pSelector; 3810 3811 /* Currently we only care about the 0th since we support single selection by intention: */ 3811 3812 if (selectedMediumIds.isEmpty()) 3812 return Q String();3813 return QUuid(); 3813 3814 else 3814 3815 return selectedMediumIds[0]; … … 3816 3817 3817 3818 delete pSelector; 3818 return Q String();3819 return QUuid(); 3819 3820 } 3820 3821 … … 3827 3828 const QString strMachineFolder(QFileInfo(m_strMachineSettingsFilePath).absolutePath()); 3828 3829 3829 Q String strMediumId;3830 QUuid uMediumId; 3830 3831 switch (enmDevice) 3831 3832 { … … 3834 3835 const int iAnswer = msgCenter().confirmHardDiskAttachmentCreation(strControllerName, this); 3835 3836 if (iAnswer == AlertButton_Choice1) 3836 strMediumId = getWithNewHDWizard();3837 uMediumId = getWithNewHDWizard(); 3837 3838 else if (iAnswer == AlertButton_Choice2) 3838 strMediumId = openMediumSelectorDialog(UIMediumDeviceType_HardDisk);3839 uMediumId = openMediumSelectorDialog(UIMediumDeviceType_HardDisk); 3839 3840 break; 3840 3841 } … … 3843 3844 int iAnswer = msgCenter().confirmOpticalAttachmentCreation(strControllerName, this); 3844 3845 if (iAnswer == AlertButton_Choice1) 3845 strMediumId = vboxGlobal().medium(strMediumId).id();3846 uMediumId = vboxGlobal().medium(uMediumId).id(); 3846 3847 else if (iAnswer == AlertButton_Choice2) 3847 strMediumId = openMediumSelectorDialog(UIMediumDeviceType_DVD);3848 uMediumId = openMediumSelectorDialog(UIMediumDeviceType_DVD); 3848 3849 break; 3849 3850 } … … 3852 3853 int iAnswer = msgCenter().confirmFloppyAttachmentCreation(strControllerName, this); 3853 3854 if (iAnswer == AlertButton_Choice1) 3854 strMediumId = vboxGlobal().medium(strMediumId).id();3855 uMediumId = vboxGlobal().medium(uMediumId).id(); 3855 3856 else if (iAnswer == AlertButton_Choice2) 3856 strMediumId = openMediumSelectorDialog(UIMediumDeviceType_Floppy);3857 uMediumId = openMediumSelectorDialog(UIMediumDeviceType_Floppy); 3857 3858 break; 3858 3859 } … … 3860 3861 } 3861 3862 3862 if (! strMediumId.isEmpty())3863 { 3864 m_pModelStorage->addAttachment(QUuid(m_pModelStorage->data(index, StorageModel::R_ItemId).toString()), enmDevice, strMediumId);3863 if (!uMediumId.isNull()) 3864 { 3865 m_pModelStorage->addAttachment(QUuid(m_pModelStorage->data(index, StorageModel::R_ItemId).toString()), enmDevice, uMediumId); 3865 3866 m_pModelStorage->sort(); 3866 3867 emit sigStorageChanged(); … … 3871 3872 } 3872 3873 3873 Q StringUIMachineSettingsStorage::getWithNewHDWizard()3874 QUuid UIMachineSettingsStorage::getWithNewHDWizard() 3874 3875 { 3875 3876 /* Initialize variables: */ … … 3879 3880 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(this, QString(), fileInfo.absolutePath(), comGuestOSType.GetRecommendedHDD()); 3880 3881 pWizard->prepare(); 3881 const Q String strResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QString();3882 const QUuid uResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QUuid(); 3882 3883 if (pWizard) 3883 3884 delete pWizard; 3884 return strResult;3885 return uResult; 3885 3886 } 3886 3887 … … 3956 3957 void UIMachineSettingsStorage::addChooseHostDriveActions(QMenu *pOpenMediumMenu) 3957 3958 { 3958 foreach (const Q String &strMediumId, vboxGlobal().mediumIDs())3959 { 3960 const UIMedium medium = vboxGlobal().medium( strMediumId);3959 foreach (const QUuid &uMediumId, vboxGlobal().mediumIDs()) 3960 { 3961 const UIMedium medium = vboxGlobal().medium(uMediumId); 3961 3962 if (medium.isHostDrive() && m_pMediumIdHolder->type() == medium.type()) 3962 3963 { … … 4332 4333 { 4333 4334 /* Create attachment: */ 4334 const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_ strAttachmentMediumId);4335 const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_uAttachmentMediumId); 4335 4336 const CMedium comMedium = vboxMedium.medium(); 4336 4337 m_machine.AttachDevice(newControllerData.m_strControllerName, … … 4420 4421 { 4421 4422 /* Remount attachment: */ 4422 const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_ strAttachmentMediumId);4423 const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_uAttachmentMediumId); 4423 4424 const CMedium comMedium = vboxMedium.medium(); 4424 4425 m_machine.MountMedium(newControllerData.m_strControllerName, -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r73953 r74878 272 272 AbstractItem* parent() const; 273 273 QUuid id() const; 274 Q StringmachineId() const;275 276 void setMachineId (const Q String&aMchineId);274 QUuid machineId() const; 275 276 void setMachineId (const QUuid &aMchineId); 277 277 278 278 virtual ItemType rtti() const = 0; … … 290 290 AbstractItem *m_pParentItem; 291 291 QUuid mId; 292 Q StringmMachineId;292 QUuid mMachineId; 293 293 }; 294 294 Q_DECLARE_METATYPE (AbstractItem::ItemType); … … 381 381 KDeviceType attDeviceType() const; 382 382 DeviceTypeList attDeviceTypes() const; 383 Q StringattMediumId() const;383 QUuid attMediumId() const; 384 384 bool attIsHostDrive() const; 385 385 bool attIsPassthrough() const; … … 390 390 void setAttSlot (const StorageSlot &aAttSlot); 391 391 void setAttDevice (KDeviceType aAttDeviceType); 392 void setAttMediumId (const Q String&aAttMediumId);392 void setAttMediumId (const QUuid &aAttMediumId); 393 393 void setAttIsPassthrough (bool aPassthrough); 394 394 void setAttIsTempEject (bool aTempEject); … … 422 422 423 423 StorageSlot mAttSlot; 424 Q StringmAttMediumId;424 QUuid mAttMediumId; 425 425 bool mAttIsHostDrive; 426 426 bool mAttIsPassthrough; … … 542 542 void delController (const QUuid &aCtrId); 543 543 544 QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const Q String &strMediumId);544 QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QUuid &aMediumId); 545 545 void delAttachment (const QUuid &aCtrId, const QUuid &aAttId); 546 546 547 void setMachineId (const Q String&aMachineId);547 void setMachineId (const QUuid &aMachineId); 548 548 549 549 void sort(int iColumn = 0, Qt::SortOrder order = Qt::AscendingOrder); … … 655 655 656 656 /** Handles enumeration of medium with @a strMediumId. */ 657 void sltHandleMediumEnumerated(const Q String &strMediumId);657 void sltHandleMediumEnumerated(const QUuid &aMediumId); 658 658 /** Handles removing of medium with @a strMediumId. */ 659 void sltHandleMediumDeleted(const Q String &strMediumId);659 void sltHandleMediumDeleted(const QUuid &aMediumId); 660 660 661 661 /** Handles command to add controller. */ … … 742 742 void prepareConnections(); 743 743 /** Opens medium selector dialog and retrieves uuid of a selected medium (if any). */ 744 Q StringopenMediumSelectorDialog(UIMediumDeviceType enmMediumType);744 QUuid openMediumSelectorDialog(UIMediumDeviceType enmMediumType); 745 745 /** Cleanups all. */ 746 746 void cleanup(); … … 752 752 753 753 /** Creates new hard-drive. */ 754 Q StringgetWithNewHDWizard();754 QUuid getWithNewHDWizard(); 755 755 756 756 /** Updates additions details according to passed @a enmType. */ … … 794 794 795 795 /** Holds the machine ID. */ 796 Q String m_strMachineId;796 QUuid m_uMachineId; 797 797 /** Holds the machine settings file-path. */ 798 798 QString m_strMachineSettingsFilePath; -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp
r73783 r74878 92 92 CSnapshot snapshot() const { return m_comSnapshot; } 93 93 /** Returns item snapshot ID. */ 94 Q String snapshotID() const { return m_strSnapshotID; }94 QUuid snapshotID() const { return m_uSnapshotID; } 95 95 96 96 /** Returns whether this is the "current state" item. */ … … 137 137 138 138 /** Holds the "current snapshot" ID. */ 139 Q String m_strSnapshotID;139 QUuid m_uSnapshotID; 140 140 /** Holds whether the "current snapshot" is online one. */ 141 bool 141 bool m_fOnline; 142 142 143 143 /** Holds the item timestamp. */ … … 293 293 /* Fetch snapshot information: */ 294 294 AssertReturnVoid(m_comSnapshot.isNotNull()); 295 m_ strSnapshotID = m_comSnapshot.GetId();295 m_uSnapshotID = m_comSnapshot.GetId(); 296 296 m_strName = m_comSnapshot.GetName(); 297 297 setText(Column_Name, m_strName); … … 486 486 if (m_comMachine.isNull()) 487 487 { 488 m_ strMachineId = QString();488 m_uMachineId = QUuid(); 489 489 m_enmSessionState = KSessionState_Null; 490 490 m_fShapshotOperationsAllowed = false; … … 492 492 else 493 493 { 494 m_ strMachineId = comMachine.GetId();494 m_uMachineId = comMachine.GetId(); 495 495 m_enmSessionState = comMachine.GetSessionState(); 496 m_fShapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(m_ strMachineId);496 m_fShapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(m_uMachineId); 497 497 } 498 498 … … 550 550 } 551 551 552 void UISnapshotPane::sltHandleMachineDataChange( QString strMachineId)552 void UISnapshotPane::sltHandleMachineDataChange(const QUuid &aMachineId) 553 553 { 554 554 /* Make sure it's our VM: */ 555 if ( strMachineId != m_strMachineId)555 if (aMachineId != m_uMachineId) 556 556 return; 557 557 … … 566 566 } 567 567 568 void UISnapshotPane::sltHandleMachineStateChange( QString strMachineId,KMachineState enmState)568 void UISnapshotPane::sltHandleMachineStateChange(const QUuid &aMachineId, const KMachineState enmState) 569 569 { 570 570 /* Make sure it's our VM: */ 571 if ( strMachineId != m_strMachineId)571 if (aMachineId != m_uMachineId) 572 572 return; 573 573 … … 580 580 } 581 581 582 void UISnapshotPane::sltHandleSessionStateChange( QString strMachineId,KSessionState enmState)582 void UISnapshotPane::sltHandleSessionStateChange(const QUuid &aMachineId, const KSessionState enmState) 583 583 { 584 584 /* Make sure it's our VM: */ 585 if ( strMachineId != m_strMachineId)585 if (aMachineId != m_uMachineId) 586 586 return; 587 587 … … 596 596 } 597 597 598 void UISnapshotPane::sltHandleSnapshotTake( QString strMachineId, QString strSnapshotId)598 void UISnapshotPane::sltHandleSnapshotTake(const QUuid &aMachineId, const QUuid &aSnapshotId) 599 599 { 600 600 /* Make sure it's our VM: */ 601 if ( strMachineId != m_strMachineId)601 if (aMachineId != m_uMachineId) 602 602 return; 603 603 604 604 LogRel(("GUI: Updating snapshot tree after TAKING snapshot with MachineID={%s}, SnapshotID={%s}...\n", 605 strMachineId.toUtf8().constData(), strSnapshotId.toUtf8().constData()));605 aMachineId.toString().toUtf8().constData(), aSnapshotId.toString().toUtf8().constData())); 606 606 607 607 /* Prepare result: */ … … 612 612 613 613 /* Search for corresponding snapshot: */ 614 CSnapshot comSnapshot = m_comMachine.FindSnapshot( strSnapshotId);614 CSnapshot comSnapshot = m_comMachine.FindSnapshot(aSnapshotId.toString()); 615 615 fSuccess = m_comMachine.isOk() && !comSnapshot.isNull(); 616 616 617 617 /* Show error message if necessary: */ 618 618 if (!fSuccess) 619 msgCenter().cannotFindSnapshotById(m_comMachine, strSnapshotId, this);619 msgCenter().cannotFindSnapshotById(m_comMachine, aSnapshotId, this); 620 620 else 621 621 { … … 628 628 { 629 629 /* Acquire parent snapshot id: */ 630 const Q String strParentSnapshotId = comParentSnapshot.GetId();630 const QUuid uParentSnapshotId = comParentSnapshot.GetId(); 631 631 fSuccess = comParentSnapshot.isOk(); 632 632 … … 637 637 { 638 638 /* Search for an existing parent-item with such id: */ 639 pParentItem = findItem( strParentSnapshotId);639 pParentItem = findItem(uParentSnapshotId); 640 640 fSuccess = pParentItem; 641 641 } … … 692 692 } 693 693 694 void UISnapshotPane::sltHandleSnapshotDelete( QString strMachineId, QString strSnapshotId)694 void UISnapshotPane::sltHandleSnapshotDelete(const QUuid &aMachineId, const QUuid &aSnapshotId) 695 695 { 696 696 /* Make sure it's our VM: */ 697 if ( strMachineId != m_strMachineId)697 if (aMachineId != m_uMachineId) 698 698 return; 699 699 700 700 LogRel(("GUI: Updating snapshot tree after DELETING snapshot with MachineID={%s}, SnapshotID={%s}...\n", 701 strMachineId.toUtf8().constData(), strSnapshotId.toUtf8().constData()));701 aMachineId.toString().toUtf8().constData(), aSnapshotId.toString().toUtf8().constData())); 702 702 703 703 /* Prepare result: */ … … 708 708 709 709 /* Search for an existing item with such id: */ 710 UISnapshotItem *pItem = findItem( strSnapshotId);710 UISnapshotItem *pItem = findItem(aSnapshotId); 711 711 fSuccess = pItem; 712 712 … … 774 774 } 775 775 776 void UISnapshotPane::sltHandleSnapshotChange( QString strMachineId, QString strSnapshotId)776 void UISnapshotPane::sltHandleSnapshotChange(const QUuid &aMachineId, const QUuid &aSnapshotId) 777 777 { 778 778 /* Make sure it's our VM: */ 779 if ( strMachineId != m_strMachineId)779 if (aMachineId != m_uMachineId) 780 780 return; 781 781 782 782 LogRel(("GUI: Updating snapshot tree after CHANGING snapshot with MachineID={%s}, SnapshotID={%s}...\n", 783 strMachineId.toUtf8().constData(), strSnapshotId.toUtf8().constData()));783 aMachineId.toString().toUtf8().constData(), aSnapshotId.toString().toUtf8().constData())); 784 784 785 785 /* Prepare result: */ … … 790 790 791 791 /* Search for an existing item with such id: */ 792 UISnapshotItem *pItem = findItem( strSnapshotId);792 UISnapshotItem *pItem = findItem(aSnapshotId); 793 793 fSuccess = pItem; 794 794 … … 814 814 } 815 815 816 void UISnapshotPane::sltHandleSnapshotRestore( QString strMachineId, QString strSnapshotId)816 void UISnapshotPane::sltHandleSnapshotRestore(const QUuid &aMachineId, const QUuid &aSnapshotId) 817 817 { 818 818 /* Make sure it's our VM: */ 819 if ( strMachineId != m_strMachineId)819 if (aMachineId != m_uMachineId) 820 820 return; 821 821 822 822 LogRel(("GUI: Updating snapshot tree after RESTORING snapshot with MachineID={%s}, SnapshotID={%s}...\n", 823 strMachineId.toUtf8().constData(), strSnapshotId.toUtf8().constData()));823 aMachineId.toString().toUtf8().constData(), aSnapshotId.toString().toUtf8().constData())); 824 824 825 825 /* Prepare result: */ … … 830 830 831 831 /* Search for an existing item with such id: */ 832 UISnapshotItem *pItem = findItem( strSnapshotId);832 UISnapshotItem *pItem = findItem(aSnapshotId); 833 833 fSuccess = pItem; 834 834 … … 924 924 CSession comSession; 925 925 if (m_enmSessionState != KSessionState_Unlocked) 926 comSession = vboxGlobal().openExistingSession(m_ strMachineId);926 comSession = vboxGlobal().openExistingSession(m_uMachineId); 927 927 else 928 comSession = vboxGlobal().openSession(m_ strMachineId);928 comSession = vboxGlobal().openSession(m_uMachineId); 929 929 if (comSession.isNotNull()) 930 930 { … … 936 936 { 937 937 /* Take snapshot: */ 938 Q String strSnapshotId;938 QUuid uSnapshotId; 939 939 CProgress comProgress = comMachine.TakeSnapshot(newData.m_strName, 940 940 newData.m_strDescription, 941 true, strSnapshotId);941 true, uSnapshotId); 942 942 if (!comMachine.isOk()) 943 943 { … … 980 980 CSession comSession; 981 981 if (m_enmSessionState != KSessionState_Unlocked) 982 comSession = vboxGlobal().openExistingSession(m_ strMachineId);982 comSession = vboxGlobal().openExistingSession(m_uMachineId); 983 983 else 984 comSession = vboxGlobal().openSession(m_ strMachineId);984 comSession = vboxGlobal().openSession(m_uMachineId); 985 985 if (comSession.isNotNull()) 986 986 { … … 1335 1335 1336 1336 /* Remember the selected item and it's first child: */ 1337 Q String strSelectedItem, strFirstChildOfSelectedItem;1337 QUuid uSelectedItem, uFirstChildOfSelectedItem; 1338 1338 const UISnapshotItem *pSnapshotItem = UISnapshotItem::toSnapshotItem(m_pSnapshotTree->currentItem()); 1339 1339 if (pSnapshotItem) 1340 1340 { 1341 strSelectedItem = pSnapshotItem->snapshotID();1341 uSelectedItem = pSnapshotItem->snapshotID(); 1342 1342 if (pSnapshotItem->child(0)) 1343 strFirstChildOfSelectedItem = UISnapshotItem::toSnapshotItem(pSnapshotItem->child(0))->snapshotID();1343 uFirstChildOfSelectedItem = UISnapshotItem::toSnapshotItem(pSnapshotItem->child(0))->snapshotID(); 1344 1344 } 1345 1345 … … 1363 1363 1364 1364 /* Search for a previously selected item: */ 1365 UISnapshotItem *pCurrentItem = findItem( strSelectedItem);1365 UISnapshotItem *pCurrentItem = findItem(uSelectedItem); 1366 1366 if (pCurrentItem == 0) 1367 pCurrentItem = findItem( strFirstChildOfSelectedItem);1367 pCurrentItem = findItem(uFirstChildOfSelectedItem); 1368 1368 if (pCurrentItem == 0) 1369 1369 pCurrentItem = m_pCurrentStateItem; … … 1513 1513 CSession comSession; 1514 1514 if (m_enmSessionState != KSessionState_Unlocked) 1515 comSession = vboxGlobal().openExistingSession(m_ strMachineId);1515 comSession = vboxGlobal().openExistingSession(m_uMachineId); 1516 1516 else 1517 comSession = vboxGlobal().openSession(m_ strMachineId);1517 comSession = vboxGlobal().openSession(m_uMachineId); 1518 1518 if (comSession.isNull()) 1519 1519 break; … … 1580 1580 1581 1581 /* Take snapshot: */ 1582 Q String strSnapshotId;1583 CProgress comProgress = comMachine.TakeSnapshot(strFinalName, strFinalDescription, true, strSnapshotId);1582 QUuid uSnapshotId; 1583 CProgress comProgress = comMachine.TakeSnapshot(strFinalName, strFinalDescription, true, uSnapshotId); 1584 1584 if (!comMachine.isOk()) 1585 1585 { … … 1647 1647 CSession comSession; 1648 1648 if (m_enmSessionState != KSessionState_Unlocked) 1649 comSession = vboxGlobal().openExistingSession(m_ strMachineId);1649 comSession = vboxGlobal().openExistingSession(m_uMachineId); 1650 1650 else 1651 comSession = vboxGlobal().openSession(m_ strMachineId);1651 comSession = vboxGlobal().openSession(m_uMachineId); 1652 1652 if (comSession.isNull()) 1653 1653 break; … … 1727 1727 1728 1728 /* Open a direct session (this call will handle all errors): */ 1729 CSession comSession = vboxGlobal().openSession(m_ strMachineId);1729 CSession comSession = vboxGlobal().openSession(m_uMachineId); 1730 1730 if (comSession.isNull()) 1731 1731 break; … … 1813 1813 } 1814 1814 1815 UISnapshotItem *UISnapshotPane::findItem(const Q String &strSnapshotID) const1815 UISnapshotItem *UISnapshotPane::findItem(const QUuid &aSnapshotID) const 1816 1816 { 1817 1817 /* Search for the first item with required ID: */ … … 1820 1820 { 1821 1821 UISnapshotItem *pSnapshotItem = UISnapshotItem::toSnapshotItem(*it); 1822 if (pSnapshotItem->snapshotID() == strSnapshotID)1822 if (pSnapshotItem->snapshotID() == aSnapshotID) 1823 1823 return pSnapshotItem; 1824 1824 ++it; -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.h
r73783 r74878 87 87 * @{ */ 88 88 /** Handles machine data change for machine with @a strMachineId. */ 89 void sltHandleMachineDataChange( QString strMachineId);89 void sltHandleMachineDataChange(const QUuid &aMachineId); 90 90 /** Handles machine @a enmState change for machine with @a strMachineId. */ 91 void sltHandleMachineStateChange( QString strMachineId,KMachineState enmState);91 void sltHandleMachineStateChange(const QUuid &aMachineId, const KMachineState enmState); 92 92 93 93 /** Handles session @a enmState change for machine with @a strMachineId. */ 94 void sltHandleSessionStateChange( QString strMachineId,KSessionState enmState);94 void sltHandleSessionStateChange(const QUuid &aMachineId, const KSessionState enmState); 95 95 96 96 /** Handles snapshot take event for machine with @a strMachineId. */ 97 void sltHandleSnapshotTake( QString strMachineId, QString strSnapshotId);97 void sltHandleSnapshotTake(const QUuid &aMachineId, const QUuid &aSnapshotId); 98 98 /** Handles snapshot delete event for machine with @a strMachineId. */ 99 void sltHandleSnapshotDelete( QString strMachineId, QString strSnapshotId);99 void sltHandleSnapshotDelete(const QUuid &aMachineId, const QUuid &aSnapshotId); 100 100 /** Handles snapshot change event for machine with @a strMachineId. */ 101 void sltHandleSnapshotChange( QString strMachineId, QString strSnapshotId);101 void sltHandleSnapshotChange(const QUuid &aMachineId, const QUuid &aSnapshotId); 102 102 /** Handles snapshot restore event for machine with @a strMachineId. */ 103 void sltHandleSnapshotRestore( QString strMachineId, QString strSnapshotId);103 void sltHandleSnapshotRestore(const QUuid &aMachineId, const QUuid &aSnapshotId); 104 104 /** @} */ 105 105 … … 189 189 190 190 /** Searches for an item with corresponding @a strSnapshotID. */ 191 UISnapshotItem *findItem(const Q String &strSnapshotID) const;191 UISnapshotItem *findItem(const QUuid &aSnapshotID) const; 192 192 193 193 /** Searches for smallest snapshot age starting with @a pItem as parent. */ … … 207 207 CMachine m_comMachine; 208 208 /** Holds the machine object ID. */ 209 Q String m_strMachineId;209 QUuid m_uMachineId; 210 210 /** Holds the cached session state. */ 211 211 KSessionState m_enmSessionState; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.cpp
r73926 r74878 55 55 }; 56 56 57 template<class T> 58 static QStringList toStringList(const QList<T> &list) 59 { 60 QStringList l; 61 foreach(const T &t, list) 62 l << t.toString(); 63 return l; 64 } 57 65 58 66 /** QLineEdit extension used as … … 315 323 /* We are generating tool-tip here and not in retranslateUi() because of the tricky plural form handling, 316 324 * but be quiet, it's safe enough because the tool-tip being re-acquired every time on mouse-hovering. */ 317 const Q StringListencryptedMedia = m_encryptedMedia.values(m_encryptionPasswords.keys().at(index.row()));325 const QList<QUuid> encryptedMedia = m_encryptedMedia.values(m_encryptionPasswords.keys().at(index.row())); 318 326 return UIAddDiskEncryptionPasswordDialog::tr("<nobr>Used by the following %n hard disk(s):</nobr><br>%1", 319 327 "This text is never used with n == 0. " … … 323 331 "and doesn't need to be told).", 324 332 encryptedMedia.size()) 325 .arg( encryptedMedia.join("<br>"));333 .arg(toStringList(encryptedMedia).join("<br>")); 326 334 } 327 335 default: … … 500 508 foreach (const QString &strPasswordId, m_encryptedMedia.uniqueKeys()) 501 509 { 502 const Q String strMediumId = m_encryptedMedia.values(strPasswordId).first();510 const QUuid uMediumId = m_encryptedMedia.values(strPasswordId).first(); 503 511 const QString strPassword = m_pTableEncryptionData->encryptionPasswords().value(strPasswordId); 504 if (!isPasswordValid( strMediumId, strPassword))512 if (!isPasswordValid(uMediumId, strPassword)) 505 513 { 506 514 msgCenter().warnAboutInvalidEncryptionPassword(strPasswordId, this); … … 569 577 570 578 /* static */ 571 bool UIAddDiskEncryptionPasswordDialog::isPasswordValid(const Q String strMediumId, const QString strPassword)579 bool UIAddDiskEncryptionPasswordDialog::isPasswordValid(const QUuid &aMediumId, const QString strPassword) 572 580 { 573 581 /* Look for the medium with passed ID: */ 574 const UIMedium uimedium = vboxGlobal().medium( strMediumId);582 const UIMedium uimedium = vboxGlobal().medium(aMediumId); 575 583 if (!uimedium.isNull()) 576 584 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.h
r73926 r74878 34 34 35 35 /* Type definitions: */ 36 typedef QMultiMap<QString, Q String> EncryptedMediumMap;36 typedef QMultiMap<QString, QUuid> EncryptedMediumMap; 37 37 typedef QMap<QString, QString> EncryptionPasswordMap; 38 38 typedef QMap<QString, bool> EncryptionPasswordStatusMap; … … 76 76 77 77 /** Returns whether passed @a strPassword is valid for medium with passed @a strMediumId. */ 78 static bool isPasswordValid(const Q String strMediumId, const QString strPassword);78 static bool isPasswordValid(const QUuid &aMediumId, const QString strPassword); 79 79 80 80 /** Holds the name of the machine we show this dialog for. */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.cpp
r73953 r74878 35 35 : QComboBox(pParent) 36 36 , m_enmMediaType(UIMediumDeviceType_Invalid) 37 , m_ strMachineId(QString())38 , m_ strLastItemId(QString())37 , m_uMachineId(QUuid()) 38 , m_uLastItemId(QUuid()) 39 39 { 40 40 /* Prepare: */ … … 48 48 49 49 /* Use the medium creation handler to add all the items: */ 50 foreach (const Q String &strMediumId, vboxGlobal().mediumIDs())51 sltHandleMediumCreated( strMediumId);50 foreach (const QUuid &uMediumId, vboxGlobal().mediumIDs()) 51 sltHandleMediumCreated(uMediumId); 52 52 53 53 /* If at least one real medium present, remove null medium: */ … … 70 70 } 71 71 72 void UIMediaComboBox::setCurrentItem(const Q String &strItemId)73 { 74 m_ strLastItemId = strItemId;72 void UIMediaComboBox::setCurrentItem(const QUuid &aItemId) 73 { 74 m_uLastItemId = aItemId; 75 75 76 76 int iIndex; … … 78 78 // Note that the media combo-box may be not populated here yet, 79 79 // so we don't assert.. 80 if (findMediaIndex( strItemId, iIndex))80 if (findMediaIndex(aItemId, iIndex)) 81 81 { 82 82 QComboBox::setCurrentIndex(iIndex); … … 85 85 } 86 86 87 QString UIMediaComboBox::id(int iIndex /* = -1 */) const 87 QUuid UIMediaComboBox::id(int iIndex /* = -1 */) const 88 { 89 AssertReturn(iIndex == -1 || 90 (iIndex >= 0 && iIndex < m_media.size()), 91 QUuid()); 92 93 if (iIndex == -1) 94 iIndex = currentIndex(); 95 return iIndex == -1 ? QUuid() : m_media.at(iIndex).id; 96 } 97 98 QString UIMediaComboBox::location(int iIndex /* = -1 */) const 88 99 { 89 100 AssertReturn(iIndex == -1 || … … 93 104 if (iIndex == -1) 94 105 iIndex = currentIndex(); 95 return iIndex == -1 ? QString() : m_media.at(iIndex).id;96 }97 98 QString UIMediaComboBox::location(int iIndex /* = -1 */) const99 {100 AssertReturn(iIndex == -1 ||101 (iIndex >= 0 && iIndex < m_media.size()),102 QString());103 104 if (iIndex == -1)105 iIndex = currentIndex();106 106 return iIndex == -1 ? QString() : m_media.at(iIndex).location; 107 107 } 108 108 109 void UIMediaComboBox::sltHandleMediumCreated(const Q String &strMediumId)109 void UIMediaComboBox::sltHandleMediumCreated(const QUuid &aMediumId) 110 110 { 111 111 /* Search for corresponding medium: */ 112 UIMedium guiMedium = vboxGlobal().medium( strMediumId);112 UIMedium guiMedium = vboxGlobal().medium(aMediumId); 113 113 114 114 /* Ignore media (and their children) which are … … 129 129 130 130 /* Activate the required item if any: */ 131 if (guiMedium.id() == m_ strLastItemId)131 if (guiMedium.id() == m_uLastItemId) 132 132 setCurrentItem(guiMedium.id()); 133 133 /* Select last added item if there is no item selected: */ … … 136 136 } 137 137 138 void UIMediaComboBox::sltHandleMediumEnumerated(const Q String &strMediumId)138 void UIMediaComboBox::sltHandleMediumEnumerated(const QUuid &aMediumId) 139 139 { 140 140 /* Search for corresponding medium: */ 141 UIMedium guiMedium = vboxGlobal().medium( strMediumId);141 UIMedium guiMedium = vboxGlobal().medium(aMediumId); 142 142 143 143 /* Add only 1. NULL medium and 2. media of required type: */ … … 157 157 } 158 158 159 void UIMediaComboBox::sltHandleMediumDeleted(const Q String &strMediumId)159 void UIMediaComboBox::sltHandleMediumDeleted(const QUuid &aMediumId) 160 160 { 161 161 /* Search for corresponding item index: */ 162 162 int iIndex; 163 if (!findMediaIndex( strMediumId, iIndex))163 if (!findMediaIndex(aMediumId, iIndex)) 164 164 return; 165 165 … … 185 185 AssertReturnVoid(iIndex >= 0 && iIndex < m_media.size()); 186 186 187 m_ strLastItemId = m_media.at(iIndex).id;187 m_uLastItemId = m_media.at(iIndex).id; 188 188 189 189 updateToolTip(iIndex); … … 256 256 } 257 257 258 bool UIMediaComboBox::findMediaIndex(const Q String &strId, int &iIndex)258 bool UIMediaComboBox::findMediaIndex(const QUuid &aId, int &iIndex) 259 259 { 260 260 iIndex = 0; 261 261 262 262 for (; iIndex < m_media.size(); ++ iIndex) 263 if (m_media.at(iIndex).id == strId)263 if (m_media.at(iIndex).id == aId) 264 264 break; 265 265 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.h
r73953 r74878 51 51 52 52 /** Defines @a strMachineId. */ 53 void setMachineId(const Q String &strMachineId) { m_strMachineId = strMachineId; }53 void setMachineId(const QUuid &aMachineId) { m_uMachineId = aMachineId; } 54 54 55 55 /** Defines current item through @a strItemId. */ 56 void setCurrentItem(const Q String &strItemId);56 void setCurrentItem(const QUuid &aItemId); 57 57 58 58 /** Returns id of item with certain @a iIndex. */ 59 Q Stringid(int iIndex = -1) const;59 QUuid id(int iIndex = -1) const; 60 60 /** Returns location of item with certain @a iIndex. */ 61 61 QString location(int iIndex = -1) const; … … 64 64 65 65 /** Habdles medium-created signal for medium with @a strMediumId. */ 66 void sltHandleMediumCreated(const Q String &strMediumId);66 void sltHandleMediumCreated(const QUuid &aMediumId); 67 67 /** Habdles medium-enumerated signal for medium with @a strMediumId. */ 68 void sltHandleMediumEnumerated(const Q String &strMediumId);68 void sltHandleMediumEnumerated(const QUuid &aMediumId); 69 69 /** Habdles medium-deleted signal for medium with @a strMediumId. */ 70 void sltHandleMediumDeleted(const Q String &strMediumId);70 void sltHandleMediumDeleted(const QUuid &aMediumId); 71 71 72 72 /** Handles medium enumeration start. */ … … 93 93 94 94 /** Searches for a @a iIndex of medium with certain @a strId. */ 95 bool findMediaIndex(const Q String &strId, int &iIndex);95 bool findMediaIndex(const QUuid &aId, int &iIndex); 96 96 97 97 /** Holds the media type. */ … … 99 99 100 100 /** Holds the machine ID. */ 101 Q String m_strMachineId;101 QUuid m_uMachineId; 102 102 103 103 /** Simplified media description. */ … … 105 105 { 106 106 Medium() {} 107 Medium(const Q String &strId,107 Medium(const QUuid &aId, 108 108 const QString &strLocation, 109 109 const QString &strToolTip) 110 : id( strId), location(strLocation), toolTip(strToolTip)110 : id(aId), location(strLocation), toolTip(strToolTip) 111 111 {} 112 112 113 Q Stringid;113 QUuid id; 114 114 QString location; 115 115 QString toolTip; … … 122 122 123 123 /** Holds the last chosen medium ID. */ 124 Q String m_strLastItemId;124 QUuid m_uLastItemId; 125 125 }; 126 126 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuBarEditorWindow.cpp
r73507 r74878 327 327 UIMenuBarEditorWidget::UIMenuBarEditorWidget(QWidget *pParent, 328 328 bool fStartedFromVMSettings /* = true */, 329 const Q String &strMachineID /* = QString() */,329 const QUuid &aMachineID /* = QUuid() */, 330 330 UIActionPool *pActionPool /* = 0 */) 331 331 : QIWithRetranslateUI2<QWidget>(pParent) 332 332 , m_fPrepared(false) 333 333 , m_fStartedFromVMSettings(fStartedFromVMSettings) 334 , m_ strMachineID(strMachineID)334 , m_uMachineID(aMachineID) 335 335 , m_pActionPool(pActionPool) 336 336 , m_pMainLayout(0) … … 359 359 } 360 360 361 void UIMenuBarEditorWidget::setMachineID(const Q String &strMachineID)361 void UIMenuBarEditorWidget::setMachineID(const QUuid &aMachineID) 362 362 { 363 363 /* Remember new machine ID: */ 364 m_ strMachineID = strMachineID;364 m_uMachineID = aMachineID; 365 365 /* Prepare: */ 366 366 prepare(); … … 747 747 } 748 748 749 void UIMenuBarEditorWidget::sltHandleConfigurationChange(const Q String &strMachineID)749 void UIMenuBarEditorWidget::sltHandleConfigurationChange(const QUuid &aMachineID) 750 750 { 751 751 /* Skip unrelated machine IDs: */ 752 if (machineID() != strMachineID)752 if (machineID() != aMachineID) 753 753 return; 754 754 … … 963 963 964 964 /* Do not prepare if machine ID or action-pool is not set: */ 965 if (m_ strMachineID.isEmpty() || !m_pActionPool)965 if (m_uMachineID.isNull() || !m_pActionPool) 966 966 return; 967 967 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuBarEditorWindow.h
r72025 r74878 21 21 /* Qt includes: */ 22 22 #include <QMap> 23 #include <QUuid> 23 24 24 25 /* GUI includes: */ … … 77 78 UIMenuBarEditorWidget(QWidget *pParent, 78 79 bool fStartedFromVMSettings = true, 79 const Q String &strMachineID = QString(),80 const QUuid &aMachineID = QUuid(), 80 81 UIActionPool *pActionPool = 0); 81 82 82 83 /** Returns the machine ID instance. */ 83 const Q String &machineID() const { return m_strMachineID; }84 const QUuid &machineID() const { return m_uMachineID; } 84 85 /** Defines the @a strMachineID instance. */ 85 void setMachineID(const Q String &strMachineID);86 void setMachineID(const QUuid &aMachineID); 86 87 87 88 /** Returns the action-pool reference. */ … … 154 155 155 156 /** Handles configuration change. */ 156 void sltHandleConfigurationChange(const Q String &strMachineID);157 void sltHandleConfigurationChange(const QUuid &aMachineID); 157 158 158 159 /** Handles menu-bar menu click. */ … … 210 211 bool m_fStartedFromVMSettings; 211 212 /** Holds the machine ID instance. */ 212 Q String m_strMachineID;213 QUuid m_uMachineID; 213 214 /** Holds the action-pool reference. */ 214 215 const UIActionPool *m_pActionPool; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp
r71578 r74878 59 59 60 60 /** Notifies about @a iPercent change for progress with @a strProgressId. */ 61 void sigProgressPercentageChange( QString strProgressId,int iPercent);61 void sigProgressPercentageChange(const QUuid &aProgressId, const int iPercent); 62 62 /** Notifies about task complete for progress with @a strProgressId. */ 63 void sigProgressTaskComplete( QString strProgressId);63 void sigProgressTaskComplete(const QUuid &aProgressId); 64 64 65 65 public: … … 331 331 } 332 332 333 void UIProgressDialog::sltHandleProgressPercentageChange( QString,int iPercent)333 void UIProgressDialog::sltHandleProgressPercentageChange(const QUuid &, const int iPercent) 334 334 { 335 335 /* New mode only: */ … … 341 341 } 342 342 343 void UIProgressDialog::sltHandleProgressTaskComplete( QString)343 void UIProgressDialog::sltHandleProgressTaskComplete(const QUuid &) 344 344 { 345 345 /* New mode only: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.h
r71630 r74878 89 89 90 90 /** Handles percentage changed event for progress with @a strProgressId to @a iPercent. */ 91 void sltHandleProgressPercentageChange( QString strProgressId,int iPercent);91 void sltHandleProgressPercentageChange(const QUuid &aProgressId, const int iPercent); 92 92 /** Handles task completed event for progress with @a strProgressId. */ 93 void sltHandleProgressTaskComplete( QString strProgressId);93 void sltHandleProgressTaskComplete(const QUuid &aProgressId); 94 94 95 95 /** Handles window stack changed signal. */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.cpp
r72871 r74878 410 410 UIStatusBarEditorWidget::UIStatusBarEditorWidget(QWidget *pParent, 411 411 bool fStartedFromVMSettings /* = true */, 412 const Q String &strMachineID /* = QString() */)412 const QUuid &aMachineID /* = QString() */) 413 413 : QIWithRetranslateUI2<QWidget>(pParent) 414 414 , m_fPrepared(false) 415 415 , m_fStartedFromVMSettings(fStartedFromVMSettings) 416 , m_ strMachineID(strMachineID)416 , m_uMachineID(aMachineID) 417 417 , m_pMainLayout(0), m_pButtonLayout(0) 418 418 , m_pButtonClose(0) … … 425 425 } 426 426 427 void UIStatusBarEditorWidget::setMachineID(const Q String &strMachineID)427 void UIStatusBarEditorWidget::setMachineID(const QUuid &aMachineID) 428 428 { 429 429 /* Remember new machine ID: */ 430 m_ strMachineID = strMachineID;430 m_uMachineID = aMachineID; 431 431 /* Prepare: */ 432 432 prepare(); … … 690 690 } 691 691 692 void UIStatusBarEditorWidget::sltHandleConfigurationChange(const Q String &strMachineID)692 void UIStatusBarEditorWidget::sltHandleConfigurationChange(const QUuid &aMachineID) 693 693 { 694 694 /* Skip unrelated machine IDs: */ 695 if (machineID() != strMachineID)695 if (machineID() != aMachineID) 696 696 return; 697 697 … … 744 744 745 745 /* Do not prepare if machine ID is not set: */ 746 if (m_ strMachineID.isEmpty())746 if (m_uMachineID.isNull()) 747 747 return; 748 748 … … 851 851 gEDataManager->statusBarIndicatorOrder(machineID())); 852 852 /* And listen for the status-bar configuration changes after that: */ 853 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const Q String&)),854 this, SLOT(sltHandleConfigurationChange(const Q String&)));853 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QUuid &)), 854 this, SLOT(sltHandleConfigurationChange(const QUuid &))); 855 855 } 856 856 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.h
r72026 r74878 22 22 #include <QList> 23 23 #include <QMap> 24 #include <QUuid> 24 25 25 26 /* GUI includes: */ … … 75 76 UIStatusBarEditorWidget(QWidget *pParent, 76 77 bool fStartedFromVMSettings = true, 77 const Q String &strMachineID = QString());78 const QUuid &aMachineID = QUuid()); 78 79 79 80 /** Returns the machine ID instance. */ 80 const Q String &machineID() const { return m_strMachineID; }81 const QUuid &machineID() const { return m_uMachineID; } 81 82 /** Defines the @a strMachineID instance. */ 82 void setMachineID(const Q String &strMachineID);83 void setMachineID(const QUuid &aMachineID); 83 84 84 85 /** Returns whether the status-bar enabled. */ … … 114 115 115 116 /** Handles configuration change. */ 116 void sltHandleConfigurationChange(const Q String &strMachineID);117 void sltHandleConfigurationChange(const QUuid &aMachineID); 117 118 118 119 /** Handles button click. */ … … 141 142 bool m_fStartedFromVMSettings; 142 143 /** Holds the machine ID instance. */ 143 Q String m_strMachineID;144 QUuid m_uMachineID; 144 145 /** @} */ 145 146 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic1.cpp
r73953 r74878 45 45 const UIMediumDeviceType enmMediumType = UIMediumDefs::mediumTypeToLocal(sourceVirtualDisk().GetDeviceType()); 46 46 /* Get source virtual-disk using file-open dialog: */ 47 Q String strMediumId = vboxGlobal().openMediumWithFileOpenDialog(enmMediumType, thisImp());48 if (! strMediumId.isNull())47 QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(enmMediumType, thisImp()); 48 if (!uMediumId.isNull()) 49 49 { 50 50 /* Update medium-combo if necessary: */ 51 m_pSourceDiskSelector->setCurrentItem( strMediumId);51 m_pSourceDiskSelector->setCurrentItem(uMediumId); 52 52 /* Focus on virtual-disk combo: */ 53 53 m_pSourceDiskSelector->setFocus(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r74576 r74878 88 88 /* Take the snapshot: */ 89 89 QString strSnapshotName = tr("Linked Base for %1 and %2").arg(m_machine.GetName()).arg(strName); 90 Q String strSnapshotId;91 CProgress progress = machine.TakeSnapshot(strSnapshotName, "", true, strSnapshotId);90 QUuid uSnapshotId; 91 CProgress progress = machine.TakeSnapshot(strSnapshotName, "", true, uSnapshotId); 92 92 93 93 if (machine.isOk()) … … 112 112 113 113 /* Get the new snapshot and the snapshot machine. */ 114 const CSnapshot &newSnapshot = m_machine.FindSnapshot( strSnapshotId);114 const CSnapshot &newSnapshot = m_machine.FindSnapshot(uSnapshotId.toString()); 115 115 if (newSnapshot.isNull()) 116 116 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r74769 r74878 239 239 EncryptedMediumMap encryptedMedia; 240 240 foreach (const QString &strPasswordId, comAppliance.GetPasswordIds()) 241 foreach (const Q String &strMediumId, comAppliance.GetMediumIdsForPasswordId(strPasswordId))242 encryptedMedia.insert(strPasswordId, strMediumId);241 foreach (const QUuid &uMediumId, comAppliance.GetMediumIdsForPasswordId(strPasswordId)) 242 encryptedMedia.insert(strPasswordId, uMediumId); 243 243 244 244 /* Ask for the disk encryption passwords if necessary: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppDefs.h
r73349 r74878 39 39 * @param strUuid Brings the machine ID. 40 40 * @param fInSaveState Brings whether machine is in Saved state. */ 41 UIVMListWidgetItem(QPixmap &pixIcon, QString &strText, Q String strUuid, bool fInSaveState, QListWidget *pParent)41 UIVMListWidgetItem(QPixmap &pixIcon, QString &strText, QUuid aUuid, bool fInSaveState, QListWidget *pParent) 42 42 : QListWidgetItem(pixIcon, strText, pParent) 43 , m_ strUuid(strUuid)43 , m_uUuid(aUuid) 44 44 , m_fInSaveState(fInSaveState) 45 45 {} … … 52 52 53 53 /** Returns the machine ID. */ 54 Q String uuid() const { return m_strUuid; }54 QUuid uuid() const { return m_uUuid; } 55 55 /** Returns whether machine is in Saved state. */ 56 56 bool isInSaveState() const { return m_fInSaveState; } … … 59 59 60 60 /** Holds the machine ID. */ 61 Q String m_strUuid;61 QUuid m_uUuid; 62 62 /** Holds whether machine is in Saved state. */ 63 63 bool m_fInSaveState; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp
r73349 r74878 53 53 QPixmap pixIcon; 54 54 QString strName; 55 Q String strUuid;55 QUuid uUuid; 56 56 bool fInSaveState = false; 57 57 bool fEnabled = false; … … 64 64 pixIcon = vboxGlobal().vmGuestOSTypePixmapDefault(machine.GetOSTypeId()); 65 65 strName = machine.GetName(); 66 strUuid = machine.GetId();66 uUuid = machine.GetId(); 67 67 fEnabled = machine.GetSessionState() == KSessionState_Unlocked; 68 68 fInSaveState = machine.GetState() == KMachineState_Saved; … … 75 75 pixIcon = QPixmap(":/os_other.png").scaled(iIconMetric, iIconMetric, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 76 76 } 77 QListWidgetItem *pItem = new UIVMListWidgetItem(pixIcon, strName, strUuid, fInSaveState, m_pVMSelector);77 QListWidgetItem *pItem = new UIVMListWidgetItem(pixIcon, strName, uUuid, fInSaveState, m_pVMSelector); 78 78 if (!fEnabled) 79 79 pItem->setFlags(0); … … 107 107 } 108 108 109 Q StringListUIWizardExportAppPage1::machineIDs() const109 QList<QUuid> UIWizardExportAppPage1::machineIDs() const 110 110 { 111 111 /* Prepare list: */ 112 Q StringListmachineIDs;112 QList<QUuid> machineIDs; 113 113 /* Iterate over all the selected items: */ 114 114 foreach (QListWidgetItem *pItem, m_pVMSelector->selectedItems()) 115 machineIDs << static_cast<UIVMListWidgetItem*>(pItem)->uuid();115 machineIDs.append(static_cast<UIVMListWidgetItem*>(pItem)->uuid()); 116 116 /* Return result list: */ 117 117 return machineIDs; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.h
r73349 r74878 18 18 #ifndef ___UIWizardExportAppPageBasic1_h___ 19 19 #define ___UIWizardExportAppPageBasic1_h___ 20 21 /* Qt includes */ 22 #include <QUuid> 20 23 21 24 /* GUI includes: */ … … 41 44 QStringList machineNames() const; 42 45 /** Returns a list of selected machine IDs. */ 43 Q StringListmachineIDs() const;46 QList<QUuid> machineIDs() const; 44 47 45 48 /** Holds the VM selector instance. */ … … 53 56 Q_OBJECT; 54 57 Q_PROPERTY(QStringList machineNames READ machineNames); 55 Q_PROPERTY(Q StringListmachineIDs READ machineIDs);58 Q_PROPERTY(QList<QUuid> machineIDs READ machineIDs); 56 59 57 60 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r74842 r74878 439 439 } 440 440 441 void UIWizardExportAppPage2::setProviderById(const Q String &strId)442 { 443 const int iIndex = m_pFormatComboBox->findData( strId, FormatData_ID);441 void UIWizardExportAppPage2::setProviderById(const QUuid &aId) 442 { 443 const int iIndex = m_pFormatComboBox->findData(aId, FormatData_ID); 444 444 AssertMsg(iIndex != -1, ("Data not found!")); 445 445 m_pFormatComboBox->setCurrentIndex(iIndex); 446 446 } 447 447 448 Q StringUIWizardExportAppPage2::providerId() const448 QUuid UIWizardExportAppPage2::providerId() const 449 449 { 450 450 const int iIndex = m_pFormatComboBox->currentIndex(); 451 return m_pFormatComboBox->itemData(iIndex, FormatData_ID).to String();451 return m_pFormatComboBox->itemData(iIndex, FormatData_ID).toUuid(); 452 452 } 453 453 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h
r74769 r74878 137 137 138 138 /** Defines provider by @a strId. */ 139 void setProviderById(const Q String&strId);139 void setProviderById(const QUuid &strId); 140 140 /** Returns provider ID. */ 141 Q StringproviderId() const;141 QUuid providerId() const; 142 142 /** Returns provider short name. */ 143 143 QString providerShortName() const; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r74769 r74878 251 251 { 252 252 /* Iterate over all the selected machine ids: */ 253 Q StringList uuids = fieldImp("machineIDs").toStringList();254 foreach (const Q String&uuid, uuids)253 QList<QUuid> uuids = fieldImp("machineIDs").value<QList<QUuid> >(); 254 foreach (const QUuid &uuid, uuids) 255 255 { 256 256 /* Get the machine with the uuid: */ 257 CMachine comMachine = comVBox.FindMachine(uuid );257 CMachine comMachine = comVBox.FindMachine(uuid.toString()); 258 258 if (comVBox.isOk() && comMachine.isNotNull()) 259 259 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r74769 r74878 35 35 Q_OBJECT; 36 36 Q_PROPERTY(QStringList machineNames READ machineNames); 37 Q_PROPERTY(Q StringListmachineIDs READ machineIDs);37 Q_PROPERTY(QList<QUuid> machineIDs READ machineIDs); 38 38 Q_PROPERTY(QString format READ format WRITE setFormat); 39 39 Q_PROPERTY(bool isFormatCloudOne READ isFormatCloudOne); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRun.cpp
r72696 r74878 85 85 86 86 /* Get chosen 'dvd' medium to mount: */ 87 const Q String strMediumId = field("id").toString();88 const UIMedium guiMedium = vboxGlobal().medium( strMediumId);87 const QUuid uMediumId = field("id").toUuid(); 88 const UIMedium guiMedium = vboxGlobal().medium(uMediumId); 89 89 const CMedium comMedium = guiMedium.medium(); 90 90 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRunPageBasic.cpp
r73953 r74878 46 46 { 47 47 /* Get opened vboxMedium id: */ 48 Q String strMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediaSelector->type(), thisImp());48 QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediaSelector->type(), thisImp()); 49 49 /* Update medium-combo if necessary: */ 50 if (! strMediumId.isNull())51 m_pMediaSelector->setCurrentItem( strMediumId);50 if (!uMediumId.isNull()) 51 m_pMediaSelector->setCurrentItem(uMediumId); 52 52 } 53 53 54 Q StringUIWizardFirstRunPage::id() const54 QUuid UIWizardFirstRunPage::id() const 55 55 { 56 56 return m_pMediaSelector->id(); 57 57 } 58 58 59 void UIWizardFirstRunPage::setId(const Q String &strId)59 void UIWizardFirstRunPage::setId(const QUuid &aId) 60 60 { 61 m_pMediaSelector->setCurrentItem( strId);61 m_pMediaSelector->setCurrentItem(aId); 62 62 } 63 63 64 UIWizardFirstRunPageBasic::UIWizardFirstRunPageBasic(const Q String &strMachineId, bool fBootHardDiskWasSet)64 UIWizardFirstRunPageBasic::UIWizardFirstRunPageBasic(const QUuid &aMachineId, bool fBootHardDiskWasSet) 65 65 : UIWizardFirstRunPage(fBootHardDiskWasSet) 66 66 { … … 73 73 m_pMediaSelector = new UIMediaComboBox(this); 74 74 { 75 m_pMediaSelector->setMachineId( strMachineId);75 m_pMediaSelector->setMachineId(aMachineId); 76 76 m_pMediaSelector->setType(UIMediumDeviceType_DVD); 77 77 m_pMediaSelector->repopulate(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRunPageBasic.h
r71948 r74878 18 18 #ifndef __UIWizardFirstRunPageBasic_h__ 19 19 #define __UIWizardFirstRunPageBasic_h__ 20 21 /* Qt includes: */ 22 #include <QUuid> 20 23 21 24 /* GUI includes: */ … … 40 43 41 44 /* Stuff for 'id' field: */ 42 Q Stringid() const;43 void setId(const Q String &strId);45 QUuid id() const; 46 void setId(const QUuid &aId); 44 47 45 48 /* Variables: */ … … 56 59 Q_OBJECT; 57 60 Q_PROPERTY(QString source READ source); 58 Q_PROPERTY(Q Stringid READ id WRITE setId);61 Q_PROPERTY(QUuid id READ id WRITE setId); 59 62 60 63 public: 61 64 62 65 /* Constructor: */ 63 UIWizardFirstRunPageBasic(const Q String &strMachineId, bool fBootHardDiskWasSet);66 UIWizardFirstRunPageBasic(const QUuid &aMachineId, bool fBootHardDiskWasSet); 64 67 65 68 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r73953 r74878 266 266 { 267 267 bool success = false; 268 Q String strMachineId = m_machine.GetId();269 CSession session = vboxGlobal().openSession( strMachineId);268 QUuid uMachineId = m_machine.GetId(); 269 CSession session = vboxGlobal().openSession(uMachineId); 270 270 if (!session.isNull()) 271 271 { 272 272 CMachine machine = session.GetMachine(); 273 273 274 Q String strId = field("virtualDiskId").toString();274 QUuid uId = field("virtualDiskId").toUuid(); 275 275 /* Boot virtual hard drive: */ 276 if (! strId.isNull())276 if (!uId.isNull()) 277 277 { 278 UIMedium vmedium = vboxGlobal().medium( strId);278 UIMedium vmedium = vboxGlobal().medium(uId); 279 279 CMedium medium = vmedium.medium(); /// @todo r=dj can this be cached somewhere? 280 280 machine.AttachDevice(strHDName, 0, 0, KDeviceType_HardDisk, medium); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r71027 r74878 54 54 55 55 /** Returns the Id of newly created VM. */ 56 Q StringcreatedMachineId() const { return m_machine.GetId(); }56 QUuid createdMachineId() const { return m_machine.GetId(); } 57 57 58 58 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r73953 r74878 53 53 if (m_pDiskSkip->isChecked()) 54 54 { 55 m_ strVirtualDiskId = QString();55 m_uVirtualDiskId = QUuid(); 56 56 m_strVirtualDiskName = QString(); 57 57 m_strVirtualDiskLocation = QString(); … … 59 59 else if (m_pDiskPresent->isChecked()) 60 60 { 61 m_ strVirtualDiskId = m_pDiskSelector->id();61 m_uVirtualDiskId = m_pDiskSelector->id(); 62 62 m_strVirtualDiskName = m_pDiskSelector->currentText(); 63 63 m_strVirtualDiskLocation = m_pDiskSelector->location(); … … 68 68 { 69 69 /* Get opened medium id: */ 70 Q String strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumDeviceType_HardDisk, thisImp());71 if (! strMediumId.isNull())70 QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumDeviceType_HardDisk, thisImp()); 71 if (!uMediumId.isNull()) 72 72 { 73 73 /* Update medium-combo if necessary: */ 74 m_pDiskSelector->setCurrentItem( strMediumId);74 m_pDiskSelector->setCurrentItem(uMediumId); 75 75 /* Update hard disk source: */ 76 76 updateVirtualDiskSource(); … … 109 109 110 110 /* Remember virtual-disk attributes: */ 111 Q String strMediumID = m_virtualDisk.GetId();111 QUuid uMediumID = m_virtualDisk.GetId(); 112 112 QString strLocation = m_virtualDisk.GetLocation(); 113 113 /* Prepare delete storage progress: */ … … 124 124 125 125 /* Inform VBoxGlobal about it: */ 126 vboxGlobal().deleteMedium( strMediumID);126 vboxGlobal().deleteMedium(uMediumID); 127 127 128 128 /* Detach virtual-disk anyway: */ … … 266 266 267 267 /* Ensure unused virtual-disk is deleted: */ 268 if (m_pDiskSkip->isChecked() || m_pDiskCreate->isChecked() || (!m_virtualDisk.isNull() && m_ strVirtualDiskId != m_virtualDisk.GetId()))268 if (m_pDiskSkip->isChecked() || m_pDiskCreate->isChecked() || (!m_virtualDisk.isNull() && m_uVirtualDiskId != m_virtualDisk.GetId())) 269 269 ensureNewVirtualDiskDeleted(); 270 270 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h
r71948 r74878 53 53 54 54 /* Stuff for 'virtualDiskId' field: */ 55 Q String virtualDiskId() const { return m_strVirtualDiskId; }56 void setVirtualDiskId(const Q String &strVirtualDiskId) { m_strVirtualDiskId = strVirtualDiskId; }55 QUuid virtualDiskId() const { return m_uVirtualDiskId; } 56 void setVirtualDiskId(const QUuid &aVirtualDiskId) { m_uVirtualDiskId = aVirtualDiskId; } 57 57 58 58 /* Stuff for 'virtualDiskName' field: */ … … 72 72 /* Variables: */ 73 73 CMedium m_virtualDisk; 74 Q String m_strVirtualDiskId;74 QUuid m_uVirtualDiskId; 75 75 QString m_strVirtualDiskName; 76 76 QString m_strVirtualDiskLocation; … … 89 89 Q_OBJECT; 90 90 Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk); 91 Q_PROPERTY(Q StringvirtualDiskId READ virtualDiskId WRITE setVirtualDiskId);91 Q_PROPERTY(QUuid virtualDiskId READ virtualDiskId WRITE setVirtualDiskId); 92 92 Q_PROPERTY(QString virtualDiskName READ virtualDiskName WRITE setVirtualDiskName); 93 93 Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r72185 r74878 38 38 Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath); 39 39 Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk); 40 Q_PROPERTY(Q StringvirtualDiskId READ virtualDiskId WRITE setVirtualDiskId);40 Q_PROPERTY(QUuid virtualDiskId READ virtualDiskId WRITE setVirtualDiskId); 41 41 Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation); 42 42
Note:
See TracChangeset
for help on using the changeset viewer.