VirtualBox

Changeset 74878 in vbox for trunk


Ignore:
Timestamp:
Oct 17, 2018 1:34:24 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9261: Changed COMWrapper to generate QUuid for GUID instead of QString

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
136 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r72057 r74878  
    58005800void VBoxVHWASettings::init(CSession &session)
    58015801{
    5802     const QString strMachineID = session.GetMachine().GetId();
    5803 
    5804     mStretchLinearEnabled = gEDataManager->useLinearStretch(strMachineID);
     5802    const QUuid uMachineID = session.GetMachine().GetId();
     5803
     5804    mStretchLinearEnabled = gEDataManager->useLinearStretch(uMachineID);
    58055805
    58065806    uint32_t aFourccs[VBOXVHWA_NUMFOURCC];
    58075807    int num = 0;
    5808     if (gEDataManager->usePixelFormatAYUV(strMachineID))
     5808    if (gEDataManager->usePixelFormatAYUV(uMachineID))
    58095809        aFourccs[num++] = FOURCC_AYUV;
    5810     if (gEDataManager->usePixelFormatUYVY(strMachineID))
     5810    if (gEDataManager->usePixelFormatUYVY(uMachineID))
    58115811        aFourccs[num++] = FOURCC_UYVY;
    5812     if (gEDataManager->usePixelFormatYUY2(strMachineID))
     5812    if (gEDataManager->usePixelFormatYUY2(uMachineID))
    58135813        aFourccs[num++] = FOURCC_YUY2;
    5814     if (gEDataManager->usePixelFormatYV12(strMachineID))
     5814    if (gEDataManager->usePixelFormatYV12(uMachineID))
    58155815        aFourccs[num++] = FOURCC_YV12;
    58165816
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r74872 r74878  
    9393
    9494    /** Notifies about 'extra-data change' event: */
    95     void sigExtraDataChange(QString strMachineID, QString strKey, QString strValue);
     95    void sigExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue);
    9696
    9797public:
     
    105105
    106106    /** Preprocess 'extra-data can change' event: */
    107     void sltPreprocessExtraDataCanChange(QString strMachineID, QString strKey, QString strValue, bool &fVeto, QString &strVetoReason);
     107    void sltPreprocessExtraDataCanChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue, bool &fVeto, QString &strVetoReason);
    108108    /** Preprocess 'extra-data change' event: */
    109     void sltPreprocessExtraDataChange(QString strMachineID, QString strKey, QString strValue);
     109    void sltPreprocessExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue);
    110110
    111111protected:
     
    244244}
    245245
    246 void UIExtraDataEventHandler::sltPreprocessExtraDataCanChange(QString strMachineID, QString strKey, QString /* strValue */, bool & /* fVeto */, QString & /* strVetoReason */)
     246void UIExtraDataEventHandler::sltPreprocessExtraDataCanChange(const QUuid &aMachineID, const QString &strKey, const QString &/* strValue */, bool & /* fVeto */, QString & /* strVetoReason */)
    247247{
    248248    /* Preprocess global 'extra-data can change' event: */
    249     if (QUuid(strMachineID).isNull())
     249    if (aMachineID.isNull())
    250250    {
    251251        if (strKey.startsWith("GUI/"))
     
    259259}
    260260
    261 void UIExtraDataEventHandler::sltPreprocessExtraDataChange(QString strMachineID, QString strKey, QString strValue)
     261void UIExtraDataEventHandler::sltPreprocessExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue)
    262262{
    263263    /* Preprocess global 'extra-data change' event: */
    264     if (QUuid(strMachineID).isNull())
     264    if (aMachineID.isNull())
    265265    {
    266266        if (strKey.startsWith("GUI/"))
     
    275275
    276276    /* Motify listener about 'extra-data change' event: */
    277     emit sigExtraDataChange(strMachineID, strKey, strValue);
     277    emit sigExtraDataChange(aMachineID, strKey, strValue);
    278278}
    279279
     
    424424{
    425425    /* If proper machine ID passed => return corresponding pixmap/size: */
    426     if (index.data(Field_ID).toString() != UIExtraDataManager::GlobalID)
     426    if (index.data(Field_ID).toUuid() != UIExtraDataManager::GlobalID)
    427427        pixmap = vboxGlobal().vmGuestOSTypePixmapDefault(index.data(Field_OsTypeID).toString(), &pixmapSize);
    428428    else
     
    455455    {
    456456        /* Compare by ID first: */
    457         const QString strID1 = leftIdx.data(Field_ID).toString();
    458         const QString strID2 = rightIdx.data(Field_ID).toString();
     457        const QUuid strID1 = leftIdx.data(Field_ID).toUuid();
     458        const QUuid strID2 = rightIdx.data(Field_ID).toUuid();
    459459        if (strID1 == UIExtraDataManager::GlobalID)
    460460            return true;
     
    494494      * @{ */
    495495        /** Handles extra-data map acknowledging. */
    496         void sltExtraDataMapAcknowledging(QString strID);
     496        void sltExtraDataMapAcknowledging(const QUuid &aID);
    497497        /** Handles extra-data change. */
    498         void sltExtraDataChange(QString strID, QString strKey, QString strValue);
     498        void sltExtraDataChange(const QUuid &aID, const QString &strKey, const QString &strValue);
    499499    /** @} */
    500500
     
    504504      * @{ */
    505505        /** Handles machine (un)registration. */
    506         void sltMachineRegistered(QString strID, bool fAdded);
     506        void sltMachineRegistered(const QUuid &aID, bool fAdded);
    507507    /** @} */
    508508
     
    604604
    605605        /** Returns chooser ID for @a iRow. */
    606         QString chooserID(int iRow) const;
     606        QUuid chooserID(int iRow) const;
    607607        /** Returns current chooser ID. */
    608         QString currentChooserID() const;
     608        QUuid currentChooserID() const;
    609609
    610610        /** Returns chooser Name for @a iRow. */
     
    614614
    615615        /** Adds chooser item. */
    616         void addChooserItem(const QString &strID,
     616        void addChooserItem(const QUuid &aID,
    617617                            const QString &strName,
    618618                            const QString &strOsTypeID,
     
    622622                                     const int iPosition = -1);
    623623        /** Adds chooser item by ID. */
    624         void addChooserItemByID(const QString &strID,
     624        void addChooserItemByID(const QUuid &aID,
    625625                                const int iPosition = -1);
    626626
     
    752752}
    753753
    754 void UIExtraDataManagerWindow::sltMachineRegistered(QString strID, bool fRegistered)
     754void UIExtraDataManagerWindow::sltMachineRegistered(const QUuid &aID, bool fRegistered)
    755755{
    756756    /* Machine registered: */
     
    758758    {
    759759        /* Gather list of 'known IDs': */
    760         QStringList knownIDs;
     760        QList<QUuid> knownIDs;
    761761        for (int iRow = 0; iRow < m_pModelSourceOfChooser->rowCount(); ++iRow)
    762             knownIDs << chooserID(iRow);
     762            knownIDs.append(chooserID(iRow));
    763763
    764764        /* Get machine items: */
    765765        const CMachineVector machines = vboxGlobal().virtualBox().GetMachines();
    766766        /* Look for the proper place to insert new machine item: */
    767         QString strPositionID = UIExtraDataManager::GlobalID;
     767        QUuid uPositionID = UIExtraDataManager::GlobalID;
    768768        foreach (const CMachine &machine, machines)
    769769        {
    770770            /* Get iterated machine ID: */
    771             const QString strIteratedID = machine.GetId();
     771            const QUuid uIteratedID = machine.GetId();
    772772            /* If 'iterated ID' equal to 'added ID' => break now: */
    773             if (strIteratedID == strID)
     773            if (uIteratedID == aID)
    774774                break;
    775775            /* If 'iterated ID' is 'known ID' => remember it: */
    776             if (knownIDs.contains(strIteratedID))
    777                 strPositionID = strIteratedID;
     776            if (knownIDs.contains(uIteratedID))
     777                uPositionID = uIteratedID;
    778778        }
    779779
    780780        /* Add new chooser item into source-model: */
    781         addChooserItemByID(strID, knownIDs.indexOf(strPositionID) + 1);
     781        addChooserItemByID(aID, knownIDs.indexOf(uPositionID) + 1);
    782782        /* And sort proxy-model: */
    783783        m_pModelProxyOfChooser->sort(0, Qt::AscendingOrder);
     
    790790        /* Remove chooser item with 'removed ID' if it is among 'known IDs': */
    791791        for (int iRow = 0; iRow < m_pModelSourceOfChooser->rowCount(); ++iRow)
    792             if (chooserID(iRow) == strID)
     792            if (chooserID(iRow) == aID)
    793793                m_pModelSourceOfChooser->removeRow(iRow);
    794794    }
    795795}
    796796
    797 void UIExtraDataManagerWindow::sltExtraDataMapAcknowledging(QString strID)
     797void UIExtraDataManagerWindow::sltExtraDataMapAcknowledging(const QUuid &aID)
    798798{
    799799    /* Update item with 'changed ID' if it is among 'known IDs': */
    800800    for (int iRow = 0; iRow < m_pModelSourceOfChooser->rowCount(); ++iRow)
    801         if (chooserID(iRow) == strID)
     801        if (chooserID(iRow) == aID)
    802802            m_pModelSourceOfChooser->itemFromIndex(chooserIndex(iRow))->setData(true, Field_Known);
    803803}
    804804
    805 void UIExtraDataManagerWindow::sltExtraDataChange(QString strID, QString strKey, QString strValue)
     805void UIExtraDataManagerWindow::sltExtraDataChange(const QUuid &aID, const QString &strKey, const QString &strValue)
    806806{
    807807    /* Skip unrelated IDs: */
    808     if (currentChooserID() != strID)
     808    if (currentChooserID() != aID)
    809809        return;
    810810
     
    834834        /* Look for the proper place for 'changed key': */
    835835        QString strPositionKey;
    836         foreach (const QString &strIteratedKey, gEDataManager->map(strID).keys())
     836        foreach (const QString &strIteratedKey, gEDataManager->map(aID).keys())
    837837        {
    838838            /* If 'iterated key' equal to 'changed key' => break now: */
     
    871871
    872872    /* Add all the new items finally: */
    873     const QString 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);
    877877    foreach (const QString &strKey, data.keys())
    878878        addDataItem(strKey, data.value(strKey));
     
    12061206            stream.writeStartElement("VirtualBox");
    12071207            {
    1208                 const QString strID = currentChooserID();
    1209                 bool fIsMachine = strID != UIExtraDataManager::GlobalID;
     1208                const QUuid uID = currentChooserID();
     1209                bool fIsMachine = uID != UIExtraDataManager::GlobalID;
    12101210                const QString strType = fIsMachine ? "Machine" : "Global";
    12111211                stream.writeStartElement(strType);
    12121212                {
    12131213                    if (fIsMachine)
    1214                         stream.writeAttribute("uuid", QString("{%1}").arg(strID));
     1214                        stream.writeAttribute("uuid", QString("{%1}").arg(uID.toString()));
    12151215                    stream.writeStartElement("ExtraData");
    12161216                    {
     
    12981298
    12991299            /* Search for the scope ID: */
    1300             QString strLoadingID;
     1300            QUuid uLoadingID;
    13011301            if (strElementName == "Global")
    1302                 strLoadingID = UIExtraDataManager::GlobalID;
     1302                uLoadingID = UIExtraDataManager::GlobalID;
    13031303            else if (strElementName == "Machine")
    13041304            {
     
    13071307                {
    13081308                    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())
    13131311                        msgCenter().alert(this, MessageType_Warning,
    13141312                                          QString("<p>Invalid extra-data ID:</p>"
     
    13291327
    13301328            /* Check extra-data ID: */
    1331             if (!strLoadingID.isNull() && strLoadingID != currentChooserID() &&
     1329            if (!uLoadingID.isNull() && uLoadingID != currentChooserID() &&
    13321330                !msgCenter().questionBinary(this, MessageType_Question,
    13331331                                            QString("<p>Inconsistent extra-data ID:</p>"
     
    13351333                                                    "<p>Loading: {%2}</p>"
    13361334                                                    "<p>Continue with loading?</p>")
    1337                                                     .arg(currentChooserID(), strLoadingID)))
     1335                                                    .arg(currentChooserID().toString(), uLoadingID.toString())))
    13381336                break;
    13391337        }
     
    18031801}
    18041802
    1805 QString UIExtraDataManagerWindow::chooserID(int iRow) const
    1806 {
    1807     return chooserIndex(iRow).data(Field_ID).toString();
    1808 }
    1809 
    1810 QString UIExtraDataManagerWindow::currentChooserID() const
    1811 {
    1812     return currentChooserIndex().data(Field_ID).toString();
     1803QUuid UIExtraDataManagerWindow::chooserID(int iRow) const
     1804{
     1805    return chooserIndex(iRow).data(Field_ID).toUuid();
     1806}
     1807
     1808QUuid UIExtraDataManagerWindow::currentChooserID() const
     1809{
     1810    return currentChooserIndex().data(Field_ID).toUuid();
    18131811}
    18141812
     
    18231821}
    18241822
    1825 void UIExtraDataManagerWindow::addChooserItem(const QString &strID,
     1823void UIExtraDataManagerWindow::addChooserItem(const QUuid &aID,
    18261824                                              const QString &strName,
    18271825                                              const QString &strOsTypeID,
     
    18351833        pItem->setEditable(false);
    18361834        /* Contains passed ID: */
    1837         pItem->setData(strID, Field_ID);
     1835        pItem->setData(aID, Field_ID);
    18381836        /* Contains passed name: */
    18391837        pItem->setData(strName, Field_Name);
     
    18411839        pItem->setData(strOsTypeID, Field_OsTypeID);
    18421840        /* 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);
    18441842        /* If insert position defined: */
    18451843        if (iPosition != -1)
     
    18651863}
    18661864
    1867 void UIExtraDataManagerWindow::addChooserItemByID(const QString &strID,
     1865void UIExtraDataManagerWindow::addChooserItemByID(const QUuid &aID,
    18681866                                                  const int iPosition /* = -1 */)
    18691867{
    18701868    /* 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);
    18731871
    18741872    /* Search for the corresponding machine by ID: */
    18751873    CVirtualBox vbox = vboxGlobal().virtualBox();
    1876     const CMachine machine = vbox.FindMachine(strID);
     1874    const CMachine machine = vbox.FindMachine(aID.toString());
    18771875    /* Make sure VM is accessible: */
    18781876    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);
    18801878}
    18811879
     
    20532051/* static */
    20542052UIExtraDataManager *UIExtraDataManager::s_pInstance = 0;
    2055 const QString UIExtraDataManager::GlobalID = QUuid().toString().remove(QRegExp("[{}]"));
     2053const QUuid UIExtraDataManager::GlobalID;
    20562054
    20572055/* static */
     
    20882086#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
    20892087
    2090 void UIExtraDataManager::hotloadMachineExtraDataMap(const QString &strID)
     2088void UIExtraDataManager::hotloadMachineExtraDataMap(const QUuid &aID)
    20912089{
    20922090    /* 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()));
    20952093    /* Which is not loaded yet: */
    2096     AssertReturnVoid(!m_data.contains(strID));
     2094    AssertReturnVoid(!m_data.contains(aID));
    20972095
    20982096    /* Search for corresponding machine: */
    20992097    CVirtualBox vbox = vboxGlobal().virtualBox();
    2100     CMachine machine = vbox.FindMachine(strID);
     2098    CMachine machine = vbox.FindMachine(aID.toString());
    21012099    AssertReturnVoid(vbox.isOk() && !machine.isNull());
    21022100
    21032101    /* Make sure at least empty map is created: */
    2104     m_data[strID] = ExtraDataMap();
     2102    m_data[aID] = ExtraDataMap();
    21052103
    21062104    /* Do not handle inaccessible machine: */
     
    21102108    /* Load machine extra-data map: */
    21112109    foreach (const QString &strKey, machine.GetExtraDataKeys())
    2112         m_data[strID][strKey] = machine.GetExtraData(strKey);
     2110        m_data[aID][strKey] = machine.GetExtraData(strKey);
    21132111
    21142112    /* Notifies about extra-data map acknowledged: */
    2115     emit sigExtraDataMapAcknowledging(strID);
    2116 }
    2117 
    2118 QString UIExtraDataManager::extraDataString(const QString &strKey, const QString &strID /* = GlobalID */)
     2113    emit sigExtraDataMapAcknowledging(aID);
     2114}
     2115
     2116QString UIExtraDataManager::extraDataString(const QString &strKey, const QUuid &aID /* = GlobalID */)
    21192117{
    21202118    /* Get the value. Return 'QString()' if not found: */
    2121     const QString strValue = extraDataStringUnion(strKey, strID);
     2119    const QString strValue = extraDataStringUnion(strKey, aID);
    21222120    if (strValue.isNull())
    21232121        return QString();
     
    21272125}
    21282126
    2129 void UIExtraDataManager::setExtraDataString(const QString &strKey, const QString &strValue, const QString &strID /* = GlobalID */)
     2127void UIExtraDataManager::setExtraDataString(const QString &strKey, const QString &strValue, const QUuid &aID /* = GlobalID */)
    21302128{
    21312129    /* Make sure VBoxSVC is available: */
     
    21342132
    21352133    /* 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);
    21382136
    21392137    /* Access corresponding map: */
    2140     ExtraDataMap &data = m_data[strID];
     2138    ExtraDataMap &data = m_data[aID];
    21412139
    21422140    /* [Re]cache passed value: */
     
    21442142
    21452143    /* Global extra-data: */
    2146     if (strID == GlobalID)
     2144    if (aID == GlobalID)
    21472145    {
    21482146        /* Get global object: */
     
    21582156        /* Search for corresponding machine: */
    21592157        CVirtualBox vbox = vboxGlobal().virtualBox();
    2160         const CMachine machine = vbox.FindMachine(strID);
     2158        const CMachine machine = vbox.FindMachine(aID.toString());
    21612159        AssertReturnVoid(vbox.isOk() && !machine.isNull());
    21622160        /* Check the configuration access-level: */
     
    21672165        CSession session;
    21682166        if (cLevel == ConfigurationAccessLevel_Full)
    2169             session = vboxGlobal().openSession(strID);
     2167            session = vboxGlobal().openSession(aID);
    21702168        else
    2171             session = vboxGlobal().openExistingSession(strID);
     2169            session = vboxGlobal().openExistingSession(aID);
    21722170        AssertReturnVoid(!session.isNull());
    21732171        /* Get machine from that session: */
     
    21812179}
    21822180
    2183 QStringList UIExtraDataManager::extraDataStringList(const QString &strKey, const QString &strID /* = GlobalID */)
     2181QStringList UIExtraDataManager::extraDataStringList(const QString &strKey, const QUuid &aID /* = GlobalID */)
    21842182{
    21852183    /* Get the value. Return 'QStringList()' if not found: */
    2186     const QString strValue = extraDataStringUnion(strKey, strID);
     2184    const QString strValue = extraDataStringUnion(strKey, aID);
    21872185    if (strValue.isNull())
    21882186        return QStringList();
     
    21932191}
    21942192
    2195 void UIExtraDataManager::setExtraDataStringList(const QString &strKey, const QStringList &value, const QString &strID /* = GlobalID */)
     2193void UIExtraDataManager::setExtraDataStringList(const QString &strKey, const QStringList &value, const QUuid &aID /* = GlobalID */)
    21962194{
    21972195    /* Make sure VBoxSVC is available: */
     
    22002198
    22012199    /* 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);
    22042202
    22052203    /* Access corresponding map: */
    2206     ExtraDataMap &data = m_data[strID];
     2204    ExtraDataMap &data = m_data[aID];
    22072205
    22082206    /* [Re]cache passed value: */
     
    22102208
    22112209    /* Global extra-data: */
    2212     if (strID == GlobalID)
     2210    if (aID == GlobalID)
    22132211    {
    22142212        /* Get global object: */
     
    22242222        /* Search for corresponding machine: */
    22252223        CVirtualBox vbox = vboxGlobal().virtualBox();
    2226         const CMachine machine = vbox.FindMachine(strID);
     2224        const CMachine machine = vbox.FindMachine(aID.toString());
    22272225        AssertReturnVoid(vbox.isOk() && !machine.isNull());
    22282226        /* Check the configuration access-level: */
     
    22332231        CSession session;
    22342232        if (cLevel == ConfigurationAccessLevel_Full)
    2235             session = vboxGlobal().openSession(strID);
     2233            session = vboxGlobal().openSession(aID);
    22362234        else
    2237             session = vboxGlobal().openExistingSession(strID);
     2235            session = vboxGlobal().openExistingSession(aID);
    22382236        AssertReturnVoid(!session.isNull());
    22392237        /* Get machine from that session: */
     
    22652263}
    22662264
    2267 QStringList UIExtraDataManager::suppressedMessages(const QString &strID /* = GlobalID */)
    2268 {
    2269     return extraDataStringList(GUI_SuppressMessages, strID);
     2265QStringList UIExtraDataManager::suppressedMessages(const QUuid &aID /* = GlobalID */)
     2266{
     2267    return extraDataStringList(GUI_SuppressMessages, aID);
    22702268}
    22712269
     
    23572355}
    23582356
    2359 QList<MachineSettingsPageType> UIExtraDataManager::restrictedMachineSettingsPages(const QString &strID)
     2357QList<MachineSettingsPageType> UIExtraDataManager::restrictedMachineSettingsPages(const QUuid &aID)
    23602358{
    23612359    /* Prepare result: */
    23622360    QList<MachineSettingsPageType> result;
    23632361    /* Get restricted machine-settings-pages: */
    2364     foreach (const QString &strValue, extraDataStringList(GUI_RestrictedMachineSettingsPages, strID))
     2362    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedMachineSettingsPages, aID))
    23652363    {
    23662364        MachineSettingsPageType value = gpConverter->fromInternalString<MachineSettingsPageType>(strValue);
     
    29792977}
    29802978
    2981 bool UIExtraDataManager::showMachineInSelectorChooser(const QString &strID)
     2979bool UIExtraDataManager::showMachineInSelectorChooser(const QUuid &aID)
    29822980{
    29832981    /* 'True' unless 'restriction' feature allowed: */
    2984     return !isFeatureAllowed(GUI_HideFromManager, strID);
    2985 }
    2986 
    2987 bool UIExtraDataManager::showMachineInSelectorDetails(const QString &strID)
     2982    return !isFeatureAllowed(GUI_HideFromManager, aID);
     2983}
     2984
     2985bool UIExtraDataManager::showMachineInSelectorDetails(const QUuid &aID)
    29882986{
    29892987    /* 'True' unless 'restriction' feature allowed: */
    2990     return !isFeatureAllowed(GUI_HideDetails, strID);
    2991 }
    2992 
    2993 bool UIExtraDataManager::machineReconfigurationEnabled(const QString &strID)
     2988    return !isFeatureAllowed(GUI_HideDetails, aID);
     2989}
     2990
     2991bool UIExtraDataManager::machineReconfigurationEnabled(const QUuid &aID)
    29942992{
    29952993    /* 'True' unless 'restriction' feature allowed: */
    2996     return !isFeatureAllowed(GUI_PreventReconfiguration, strID);
    2997 }
    2998 
    2999 bool UIExtraDataManager::machineSnapshotOperationsEnabled(const QString &strID)
     2994    return !isFeatureAllowed(GUI_PreventReconfiguration, aID);
     2995}
     2996
     2997bool UIExtraDataManager::machineSnapshotOperationsEnabled(const QUuid &aID)
    30002998{
    30012999    /* 'True' unless 'restriction' feature allowed: */
    3002     return !isFeatureAllowed(GUI_PreventSnapshotOperations, strID);
    3003 }
    3004 
    3005 bool UIExtraDataManager::machineFirstTimeStarted(const QString &strID)
     3000    return !isFeatureAllowed(GUI_PreventSnapshotOperations, aID);
     3001}
     3002
     3003bool UIExtraDataManager::machineFirstTimeStarted(const QUuid &aID)
    30063004{
    30073005    /* 'True' only if feature is allowed: */
    3008     return isFeatureAllowed(GUI_FirstRun, strID);
    3009 }
    3010 
    3011 void UIExtraDataManager::setMachineFirstTimeStarted(bool fFirstTimeStarted, const QString &strID)
     3006    return isFeatureAllowed(GUI_FirstRun, aID);
     3007}
     3008
     3009void UIExtraDataManager::setMachineFirstTimeStarted(bool fFirstTimeStarted, const QUuid &aID)
    30123010{
    30133011    /* 'True' if feature allowed, null-string otherwise: */
    3014     setExtraDataString(GUI_FirstRun, toFeatureAllowed(fFirstTimeStarted), strID);
    3015 }
    3016 
    3017 QStringList UIExtraDataManager::machineWindowIconNames(const QString &strID)
    3018 {
    3019     return extraDataStringList(GUI_MachineWindowIcons, strID);
     3012    setExtraDataString(GUI_FirstRun, toFeatureAllowed(fFirstTimeStarted), aID);
     3013}
     3014
     3015QStringList UIExtraDataManager::machineWindowIconNames(const QUuid &aID)
     3016{
     3017    return extraDataStringList(GUI_MachineWindowIcons, aID);
    30203018}
    30213019
    30223020#ifndef VBOX_WS_MAC
    3023 QString UIExtraDataManager::machineWindowNamePostfix(const QString &strID)
    3024 {
    3025     return extraDataString(GUI_MachineWindowNamePostfix, strID);
     3021QString UIExtraDataManager::machineWindowNamePostfix(const QUuid &aID)
     3022{
     3023    return extraDataString(GUI_MachineWindowNamePostfix, aID);
    30263024}
    30273025#endif /* !VBOX_WS_MAC */
    30283026
    3029 QRect UIExtraDataManager::machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID)
     3027QRect UIExtraDataManager::machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &aID)
    30303028{
    30313029    /* Choose corresponding key: */
     
    30393037
    30403038    /* Get corresponding extra-data: */
    3041     const QStringList data = extraDataStringList(strKey, strID);
     3039    const QStringList data = extraDataStringList(strKey, aID);
    30423040
    30433041    /* Parse loaded data: */
     
    30613059}
    30623060
    3063 bool UIExtraDataManager::machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID)
     3061bool UIExtraDataManager::machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &aID)
    30643062{
    30653063    /* Choose corresponding key: */
     
    30733071
    30743072    /* Get corresponding extra-data: */
    3075     const QStringList data = extraDataStringList(strKey, strID);
     3073    const QStringList data = extraDataStringList(strKey, aID);
    30763074
    30773075    /* Make sure 5th item has required value: */
     
    30793077}
    30803078
    3081 void UIExtraDataManager::setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QString &strID)
     3079void UIExtraDataManager::setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QUuid &aID)
    30823080{
    30833081    /* Choose corresponding key: */
     
    31003098
    31013099    /* Re-cache corresponding extra-data: */
    3102     setExtraDataStringList(strKey, data, strID);
     3100    setExtraDataStringList(strKey, data, aID);
    31033101}
    31043102
    31053103#ifndef VBOX_WS_MAC
    3106 bool UIExtraDataManager::menuBarEnabled(const QString &strID)
     3104bool UIExtraDataManager::menuBarEnabled(const QUuid &aID)
    31073105{
    31083106    /* 'True' unless feature restricted: */
    3109     return !isFeatureRestricted(GUI_MenuBar_Enabled, strID);
    3110 }
    3111 
    3112 void UIExtraDataManager::setMenuBarEnabled(bool fEnabled, const QString &strID)
     3107    return !isFeatureRestricted(GUI_MenuBar_Enabled, aID);
     3108}
     3109
     3110void UIExtraDataManager::setMenuBarEnabled(bool fEnabled, const QUuid &aID)
    31133111{
    31143112    /* 'False' if feature restricted, null-string otherwise: */
    3115     setExtraDataString(GUI_MenuBar_Enabled, toFeatureRestricted(!fEnabled), strID);
     3113    setExtraDataString(GUI_MenuBar_Enabled, toFeatureRestricted(!fEnabled), aID);
    31163114}
    31173115#endif /* !VBOX_WS_MAC */
    31183116
    3119 bool UIExtraDataManager::menuBarContextMenuEnabled(const QString &strID)
     3117bool UIExtraDataManager::menuBarContextMenuEnabled(const QUuid &aID)
    31203118{
    31213119    /* 'True' unless feature restricted: */
    3122     return !isFeatureRestricted(GUI_MenuBar_ContextMenu_Enabled, strID);
    3123 }
    3124 
    3125 void UIExtraDataManager::setMenuBarContextMenuEnabled(bool fEnabled, const QString &strID)
     3120    return !isFeatureRestricted(GUI_MenuBar_ContextMenu_Enabled, aID);
     3121}
     3122
     3123void UIExtraDataManager::setMenuBarContextMenuEnabled(bool fEnabled, const QUuid &aID)
    31263124{
    31273125    /* 'False' if feature restricted, null-string otherwise: */
    3128     setExtraDataString(GUI_MenuBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), strID);
    3129 }
    3130 
    3131 UIExtraDataMetaDefs::MenuType UIExtraDataManager::restrictedRuntimeMenuTypes(const QString &strID)
     3126    setExtraDataString(GUI_MenuBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), aID);
     3127}
     3128
     3129UIExtraDataMetaDefs::MenuType UIExtraDataManager::restrictedRuntimeMenuTypes(const QUuid &aID)
    31323130{
    31333131    /* Prepare result: */
    31343132    UIExtraDataMetaDefs::MenuType result = UIExtraDataMetaDefs::MenuType_Invalid;
    31353133    /* Get restricted runtime-menu-types: */
    3136     foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMenus, strID))
     3134    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMenus, aID))
    31373135    {
    31383136        UIExtraDataMetaDefs::MenuType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuType>(strValue);
     
    31443142}
    31453143
    3146 void UIExtraDataManager::setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID)
     3144void UIExtraDataManager::setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QUuid &aID)
    31473145{
    31483146    /* We have MenuType enum registered, so we can enumerate it: */
     
    31733171    }
    31743172    /* Save result: */
    3175     setExtraDataStringList(GUI_RestrictedRuntimeMenus, result, strID);
    3176 }
    3177 
    3178 UIExtraDataMetaDefs::MenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const QString &strID)
     3173    setExtraDataStringList(GUI_RestrictedRuntimeMenus, result, aID);
     3174}
     3175
     3176UIExtraDataMetaDefs::MenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const QUuid &aID)
    31793177{
    31803178    /* Prepare result: */
    31813179    UIExtraDataMetaDefs::MenuApplicationActionType result = UIExtraDataMetaDefs::MenuApplicationActionType_Invalid;
    31823180    /* 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))
    31843182    {
    31853183        UIExtraDataMetaDefs::MenuApplicationActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(strValue);
     
    31913189}
    31923190
    3193 void UIExtraDataManager::setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID)
     3191void UIExtraDataManager::setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QUuid &aID)
    31943192{
    31953193    /* We have MenuApplicationActionType enum registered, so we can enumerate it: */
     
    32203218    }
    32213219    /* Save result: */
    3222     setExtraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, result, strID);
    3223 }
    3224 
    3225 UIExtraDataMetaDefs::RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const QString &strID)
     3220    setExtraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, result, aID);
     3221}
     3222
     3223UIExtraDataMetaDefs::RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const QUuid &aID)
    32263224{
    32273225    /* Prepare result: */
    32283226    UIExtraDataMetaDefs::RuntimeMenuMachineActionType result = UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid;
    32293227    /* 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))
    32313229    {
    32323230        UIExtraDataMetaDefs::RuntimeMenuMachineActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(strValue);
     
    32503248}
    32513249
    3252 void UIExtraDataManager::setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QString &strID)
     3250void UIExtraDataManager::setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QUuid &aID)
    32533251{
    32543252    /* We have RuntimeMenuMachineActionType enum registered, so we can enumerate it: */
     
    32833281        result << gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing);
    32843282    /* Save result: */
    3285     setExtraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, result, strID);
    3286 }
    3287 
    3288 UIExtraDataMetaDefs::RuntimeMenuViewActionType UIExtraDataManager::restrictedRuntimeMenuViewActionTypes(const QString &strID)
     3283    setExtraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, result, aID);
     3284}
     3285
     3286UIExtraDataMetaDefs::RuntimeMenuViewActionType UIExtraDataManager::restrictedRuntimeMenuViewActionTypes(const QUuid &aID)
    32893287{
    32903288    /* Prepare result: */
    32913289    UIExtraDataMetaDefs::RuntimeMenuViewActionType result = UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid;
    32923290    /* 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))
    32943292    {
    32953293        UIExtraDataMetaDefs::RuntimeMenuViewActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(strValue);
     
    33013299}
    33023300
    3303 void UIExtraDataManager::setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QString &strID)
     3301void UIExtraDataManager::setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QUuid &aID)
    33043302{
    33053303    /* We have RuntimeMenuViewActionType enum registered, so we can enumerate it: */
     
    33303328    }
    33313329    /* Save result: */
    3332     setExtraDataStringList(GUI_RestrictedRuntimeViewMenuActions, result, strID);
    3333 }
    3334 
    3335 UIExtraDataMetaDefs::RuntimeMenuInputActionType UIExtraDataManager::restrictedRuntimeMenuInputActionTypes(const QString &strID)
     3330    setExtraDataStringList(GUI_RestrictedRuntimeViewMenuActions, result, aID);
     3331}
     3332
     3333UIExtraDataMetaDefs::RuntimeMenuInputActionType UIExtraDataManager::restrictedRuntimeMenuInputActionTypes(const QUuid &aID)
    33363334{
    33373335    /* Prepare result: */
    33383336    UIExtraDataMetaDefs::RuntimeMenuInputActionType result = UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid;
    33393337    /* 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))
    33413339    {
    33423340        UIExtraDataMetaDefs::RuntimeMenuInputActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(strValue);
     
    33483346}
    33493347
    3350 void UIExtraDataManager::setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QString &strID)
     3348void UIExtraDataManager::setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QUuid &aID)
    33513349{
    33523350    /* We have RuntimeMenuInputActionType enum registered, so we can enumerate it: */
     
    33773375    }
    33783376    /* Save result: */
    3379     setExtraDataStringList(GUI_RestrictedRuntimeInputMenuActions, result, strID);
    3380 }
    3381 
    3382 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType UIExtraDataManager::restrictedRuntimeMenuDevicesActionTypes(const QString &strID)
     3377    setExtraDataStringList(GUI_RestrictedRuntimeInputMenuActions, result, aID);
     3378}
     3379
     3380UIExtraDataMetaDefs::RuntimeMenuDevicesActionType UIExtraDataManager::restrictedRuntimeMenuDevicesActionTypes(const QUuid &aID)
    33833381{
    33843382    /* Prepare result: */
    33853383    UIExtraDataMetaDefs::RuntimeMenuDevicesActionType result = UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid;
    33863384    /* 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))
    33883386    {
    33893387        UIExtraDataMetaDefs::RuntimeMenuDevicesActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(strValue);
     
    34063404}
    34073405
    3408 void UIExtraDataManager::setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QString &strID)
     3406void UIExtraDataManager::setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QUuid &aID)
    34093407{
    34103408    /* We have RuntimeMenuDevicesActionType enum registered, so we can enumerate it: */
     
    34393437        result << gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Nothing);
    34403438    /* Save result: */
    3441     setExtraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, result, strID);
     3439    setExtraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, result, aID);
    34423440}
    34433441
    34443442#ifdef VBOX_WITH_DEBUGGER_GUI
    3445 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType UIExtraDataManager::restrictedRuntimeMenuDebuggerActionTypes(const QString &strID)
     3443UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType UIExtraDataManager::restrictedRuntimeMenuDebuggerActionTypes(const QUuid &aID)
    34463444{
    34473445    /* Prepare result: */
    34483446    UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType result = UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid;
    34493447    /* 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))
    34513449    {
    34523450        UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(strValue);
     
    34583456}
    34593457
    3460 void UIExtraDataManager::setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QString &strID)
     3458void UIExtraDataManager::setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QUuid &aID)
    34613459{
    34623460    /* We have RuntimeMenuDebuggerActionType enum registered, so we can enumerate it: */
     
    34873485    }
    34883486    /* Save result: */
    3489     setExtraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, result, strID);
     3487    setExtraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, result, aID);
    34903488}
    34913489#endif /* VBOX_WITH_DEBUGGER_GUI */
    34923490
    34933491#ifdef VBOX_WS_MAC
    3494 UIExtraDataMetaDefs::MenuWindowActionType UIExtraDataManager::restrictedRuntimeMenuWindowActionTypes(const QString &strID)
     3492UIExtraDataMetaDefs::MenuWindowActionType UIExtraDataManager::restrictedRuntimeMenuWindowActionTypes(const QUuid &aID)
    34953493{
    34963494    /* Prepare result: */
    34973495    UIExtraDataMetaDefs::MenuWindowActionType result = UIExtraDataMetaDefs::MenuWindowActionType_Invalid;
    34983496    /* 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))
    35003498    {
    35013499        UIExtraDataMetaDefs::MenuWindowActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuWindowActionType>(strValue);
     
    35073505}
    35083506
    3509 void UIExtraDataManager::setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QString &strID)
     3507void UIExtraDataManager::setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QUuid &aID)
    35103508{
    35113509    /* We have MenuWindowActionType enum registered, so we can enumerate it: */
     
    35363534    }
    35373535    /* Save result: */
    3538     setExtraDataStringList(GUI_RestrictedRuntimeWindowMenuActions, result, strID);
     3536    setExtraDataStringList(GUI_RestrictedRuntimeWindowMenuActions, result, aID);
    35393537}
    35403538#endif /* VBOX_WS_MAC */
    35413539
    3542 UIExtraDataMetaDefs::MenuHelpActionType UIExtraDataManager::restrictedRuntimeMenuHelpActionTypes(const QString &strID)
     3540UIExtraDataMetaDefs::MenuHelpActionType UIExtraDataManager::restrictedRuntimeMenuHelpActionTypes(const QUuid &aID)
    35433541{
    35443542    /* Prepare result: */
    35453543    UIExtraDataMetaDefs::MenuHelpActionType result = UIExtraDataMetaDefs::MenuHelpActionType_Invalid;
    35463544    /* 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))
    35483546    {
    35493547        UIExtraDataMetaDefs::MenuHelpActionType value = gpConverter->fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(strValue);
     
    35553553}
    35563554
    3557 void UIExtraDataManager::setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QString &strID)
     3555void UIExtraDataManager::setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QUuid &aID)
    35583556{
    35593557    /* We have MenuHelpActionType enum registered, so we can enumerate it: */
     
    35843582    }
    35853583    /* Save result: */
    3586     setExtraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, result, strID);
    3587 }
    3588 
    3589 UIVisualStateType UIExtraDataManager::restrictedVisualStates(const QString &strID)
     3584    setExtraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, result, aID);
     3585}
     3586
     3587UIVisualStateType UIExtraDataManager::restrictedVisualStates(const QUuid &aID)
    35903588{
    35913589    /* Prepare result: */
    35923590    UIVisualStateType result = UIVisualStateType_Invalid;
    35933591    /* Get restricted visual-state-types: */
    3594     foreach (const QString &strValue, extraDataStringList(GUI_RestrictedVisualStates, strID))
     3592    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedVisualStates, aID))
    35953593    {
    35963594        UIVisualStateType value = gpConverter->fromInternalString<UIVisualStateType>(strValue);
     
    36023600}
    36033601
    3604 UIVisualStateType UIExtraDataManager::requestedVisualState(const QString &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;
     3602UIVisualStateType 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;
    36093607    return UIVisualStateType_Normal;
    36103608}
    36113609
    3612 void UIExtraDataManager::setRequestedVisualState(UIVisualStateType visualState, const QString &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);
     3610void 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);
    36173615}
    36183616
     
    36243622}
    36253623
    3626 bool UIExtraDataManager::distinguishMachineWindowGroups(const QString &strID)
     3624bool UIExtraDataManager::distinguishMachineWindowGroups(const QUuid &aID)
    36273625{
    36283626    /* 'False' unless feature allowed: */
    3629     return isFeatureAllowed(GUI_DistinguishMachineWindowGroups, strID);
    3630 }
    3631 
    3632 void UIExtraDataManager::setDistinguishMachineWindowGroups(const QString &strID, bool fEnabled)
     3627    return isFeatureAllowed(GUI_DistinguishMachineWindowGroups, aID);
     3628}
     3629
     3630void UIExtraDataManager::setDistinguishMachineWindowGroups(const QUuid &aID, bool fEnabled)
    36333631{
    36343632    /* 'True' if feature allowed, null-string otherwise: */
    3635     setExtraDataString(GUI_DistinguishMachineWindowGroups, toFeatureAllowed(fEnabled), strID);
     3633    setExtraDataString(GUI_DistinguishMachineWindowGroups, toFeatureAllowed(fEnabled), aID);
    36363634}
    36373635#endif /* VBOX_WS_X11 */
    36383636
    3639 bool UIExtraDataManager::guestScreenAutoResizeEnabled(const QString &strID)
     3637bool UIExtraDataManager::guestScreenAutoResizeEnabled(const QUuid &aID)
    36403638{
    36413639    /* 'True' unless feature restricted: */
    3642     return !isFeatureRestricted(GUI_AutoresizeGuest, strID);
    3643 }
    3644 
    3645 void UIExtraDataManager::setGuestScreenAutoResizeEnabled(bool fEnabled, const QString &strID)
     3640    return !isFeatureRestricted(GUI_AutoresizeGuest, aID);
     3641}
     3642
     3643void UIExtraDataManager::setGuestScreenAutoResizeEnabled(bool fEnabled, const QUuid &aID)
    36463644{
    36473645    /* 'False' if feature restricted, null-string otherwise: */
    3648     setExtraDataString(GUI_AutoresizeGuest, toFeatureRestricted(!fEnabled), strID);
    3649 }
    3650 
    3651 bool UIExtraDataManager::lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QString &strID)
     3646    setExtraDataString(GUI_AutoresizeGuest, toFeatureRestricted(!fEnabled), aID);
     3647}
     3648
     3649bool UIExtraDataManager::lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QUuid &aID)
    36523650{
    36533651    /* Not for primary screen: */
     
    36583656
    36593657    /* 'False' unless feature allowed: */
    3660     return isFeatureAllowed(strKey, strID);
    3661 }
    3662 
    3663 void UIExtraDataManager::setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QString &strID)
     3658    return isFeatureAllowed(strKey, aID);
     3659}
     3660
     3661void UIExtraDataManager::setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QUuid &aID)
    36643662{
    36653663    /* Not for primary screen: */
     
    36703668
    36713669    /* 'True' if feature allowed, null-string otherwise: */
    3672     return setExtraDataString(strKey, toFeatureAllowed(fEnabled), strID);
    3673 }
    3674 
    3675 QSize UIExtraDataManager::lastGuestScreenSizeHint(ulong uScreenIndex, const QString &strID)
     3670    return setExtraDataString(strKey, toFeatureAllowed(fEnabled), aID);
     3671}
     3672
     3673QSize UIExtraDataManager::lastGuestScreenSizeHint(ulong uScreenIndex, const QUuid &aID)
    36763674{
    36773675    /* Choose corresponding key: */
     
    36793677
    36803678    /* Get corresponding extra-data: */
    3681     const QStringList data = extraDataStringList(strKey, strID);
     3679    const QStringList data = extraDataStringList(strKey, aID);
    36823680
    36833681    /* Parse loaded data: */
     
    36973695}
    36983696
    3699 void UIExtraDataManager::setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID)
     3697void UIExtraDataManager::setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QUuid &aID)
    37003698{
    37013699    /* Choose corresponding key: */
     
    37083706
    37093707    /* Re-cache corresponding extra-data: */
    3710     setExtraDataStringList(strKey, data, strID);
    3711 }
    3712 
    3713 int UIExtraDataManager::hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID)
     3708    setExtraDataStringList(strKey, data, aID);
     3709}
     3710
     3711int UIExtraDataManager::hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QUuid &aID)
    37143712{
    37153713    /* Choose corresponding key: */
     
    37173715
    37183716    /* Get value and convert it to index: */
    3719     const QString strValue = extraDataString(strKey, strID);
     3717    const QString strValue = extraDataString(strKey, aID);
    37203718    bool fOk = false;
    37213719    const int iHostScreenIndex = strValue.toULong(&fOk);
     
    37253723}
    37263724
    3727 void UIExtraDataManager::setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID)
     3725void UIExtraDataManager::setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QUuid &aID)
    37283726{
    37293727    /* Choose corresponding key: */
     
    37313729
    37323730    /* Save passed index under corresponding value: */
    3733     setExtraDataString(strKey, iHostScreenIndex != -1 ? QString::number(iHostScreenIndex) : QString(), strID);
    3734 }
    3735 
    3736 bool UIExtraDataManager::autoMountGuestScreensEnabled(const QString &strID)
     3731    setExtraDataString(strKey, iHostScreenIndex != -1 ? QString::number(iHostScreenIndex) : QString(), aID);
     3732}
     3733
     3734bool UIExtraDataManager::autoMountGuestScreensEnabled(const QUuid &aID)
    37373735{
    37383736    /* Show only if 'allowed' flag is set: */
    3739     return isFeatureAllowed(GUI_AutomountGuestScreens, strID);
     3737    return isFeatureAllowed(GUI_AutomountGuestScreens, aID);
    37403738}
    37413739
    37423740#ifdef VBOX_WITH_VIDEOHWACCEL
    3743 bool UIExtraDataManager::useLinearStretch(const QString &strID)
     3741bool UIExtraDataManager::useLinearStretch(const QUuid &aID)
    37443742{
    37453743    /* 'True' unless feature restricted: */
    3746     return !isFeatureRestricted(GUI_Accelerate2D_StretchLinear, strID);
    3747 }
    3748 
    3749 bool UIExtraDataManager::usePixelFormatYV12(const QString &strID)
     3744    return !isFeatureRestricted(GUI_Accelerate2D_StretchLinear, aID);
     3745}
     3746
     3747bool UIExtraDataManager::usePixelFormatYV12(const QUuid &aID)
    37503748{
    37513749    /* 'True' unless feature restricted: */
    3752     return !isFeatureRestricted(GUI_Accelerate2D_PixformatYV12, strID);
    3753 }
    3754 
    3755 bool UIExtraDataManager::usePixelFormatUYVY(const QString &strID)
     3750    return !isFeatureRestricted(GUI_Accelerate2D_PixformatYV12, aID);
     3751}
     3752
     3753bool UIExtraDataManager::usePixelFormatUYVY(const QUuid &aID)
    37563754{
    37573755    /* 'True' unless feature restricted: */
    3758     return !isFeatureRestricted(GUI_Accelerate2D_PixformatUYVY, strID);
    3759 }
    3760 
    3761 bool UIExtraDataManager::usePixelFormatYUY2(const QString &strID)
     3756    return !isFeatureRestricted(GUI_Accelerate2D_PixformatUYVY, aID);
     3757}
     3758
     3759bool UIExtraDataManager::usePixelFormatYUY2(const QUuid &aID)
    37623760{
    37633761    /* 'True' unless feature restricted: */
    3764     return !isFeatureRestricted(GUI_Accelerate2D_PixformatYUY2, strID);
    3765 }
    3766 
    3767 bool UIExtraDataManager::usePixelFormatAYUV(const QString &strID)
     3762    return !isFeatureRestricted(GUI_Accelerate2D_PixformatYUY2, aID);
     3763}
     3764
     3765bool UIExtraDataManager::usePixelFormatAYUV(const QUuid &aID)
    37683766{
    37693767    /* 'True' unless feature restricted: */
    3770     return !isFeatureRestricted(GUI_Accelerate2D_PixformatAYUV, strID);
     3768    return !isFeatureRestricted(GUI_Accelerate2D_PixformatAYUV, aID);
    37713769}
    37723770#endif /* VBOX_WITH_VIDEOHWACCEL */
    37733771
    37743772#ifndef VBOX_WS_MAC
    3775 bool UIExtraDataManager::miniToolbarEnabled(const QString &strID)
     3773bool UIExtraDataManager::miniToolbarEnabled(const QUuid &aID)
    37763774{
    37773775    /* 'True' unless feature restricted: */
    3778     return !isFeatureRestricted(GUI_ShowMiniToolBar, strID);
    3779 }
    3780 
    3781 void UIExtraDataManager::setMiniToolbarEnabled(bool fEnabled, const QString &strID)
     3776    return !isFeatureRestricted(GUI_ShowMiniToolBar, aID);
     3777}
     3778
     3779void UIExtraDataManager::setMiniToolbarEnabled(bool fEnabled, const QUuid &aID)
    37823780{
    37833781    /* 'False' if feature restricted, null-string otherwise: */
    3784     setExtraDataString(GUI_ShowMiniToolBar, toFeatureRestricted(!fEnabled), strID);
    3785 }
    3786 
    3787 bool UIExtraDataManager::autoHideMiniToolbar(const QString &strID)
     3782    setExtraDataString(GUI_ShowMiniToolBar, toFeatureRestricted(!fEnabled), aID);
     3783}
     3784
     3785bool UIExtraDataManager::autoHideMiniToolbar(const QUuid &aID)
    37883786{
    37893787    /* 'True' unless feature restricted: */
    3790     return !isFeatureRestricted(GUI_MiniToolBarAutoHide, strID);
    3791 }
    3792 
    3793 void UIExtraDataManager::setAutoHideMiniToolbar(bool fAutoHide, const QString &strID)
     3788    return !isFeatureRestricted(GUI_MiniToolBarAutoHide, aID);
     3789}
     3790
     3791void UIExtraDataManager::setAutoHideMiniToolbar(bool fAutoHide, const QUuid &aID)
    37943792{
    37953793    /* 'False' if feature restricted, null-string otherwise: */
    3796     setExtraDataString(GUI_MiniToolBarAutoHide, toFeatureRestricted(!fAutoHide), strID);
    3797 }
    3798 
    3799 Qt::AlignmentFlag UIExtraDataManager::miniToolbarAlignment(const QString &strID)
     3794    setExtraDataString(GUI_MiniToolBarAutoHide, toFeatureRestricted(!fAutoHide), aID);
     3795}
     3796
     3797Qt::AlignmentFlag UIExtraDataManager::miniToolbarAlignment(const QUuid &aID)
    38003798{
    38013799    /* 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)))
    38033801    {
    38043802        case MiniToolbarAlignment_Top: return Qt::AlignTop;
     
    38083806}
    38093807
    3810 void UIExtraDataManager::setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QString &strID)
     3808void UIExtraDataManager::setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QUuid &aID)
    38113809{
    38123810    /* Remove record unless Qt::AlignTop specified separately: */
    38133811    switch (alignment)
    38143812    {
    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;
    38163814        default: break;
    38173815    }
    3818     setExtraDataString(GUI_MiniToolBarAlignment, QString(), strID);
     3816    setExtraDataString(GUI_MiniToolBarAlignment, QString(), aID);
    38193817}
    38203818#endif /* VBOX_WS_MAC */
    38213819
    3822 bool UIExtraDataManager::statusBarEnabled(const QString &strID)
     3820bool UIExtraDataManager::statusBarEnabled(const QUuid &aID)
    38233821{
    38243822    /* 'True' unless feature restricted: */
    3825     return !isFeatureRestricted(GUI_StatusBar_Enabled, strID);
    3826 }
    3827 
    3828 void UIExtraDataManager::setStatusBarEnabled(bool fEnabled, const QString &strID)
     3823    return !isFeatureRestricted(GUI_StatusBar_Enabled, aID);
     3824}
     3825
     3826void UIExtraDataManager::setStatusBarEnabled(bool fEnabled, const QUuid &aID)
    38293827{
    38303828    /* 'False' if feature restricted, null-string otherwise: */
    3831     setExtraDataString(GUI_StatusBar_Enabled, toFeatureRestricted(!fEnabled), strID);
    3832 }
    3833 
    3834 bool UIExtraDataManager::statusBarContextMenuEnabled(const QString &strID)
     3829    setExtraDataString(GUI_StatusBar_Enabled, toFeatureRestricted(!fEnabled), aID);
     3830}
     3831
     3832bool UIExtraDataManager::statusBarContextMenuEnabled(const QUuid &aID)
    38353833{
    38363834    /* 'True' unless feature restricted: */
    3837     return !isFeatureRestricted(GUI_StatusBar_ContextMenu_Enabled, strID);
    3838 }
    3839 
    3840 void UIExtraDataManager::setStatusBarContextMenuEnabled(bool fEnabled, const QString &strID)
     3835    return !isFeatureRestricted(GUI_StatusBar_ContextMenu_Enabled, aID);
     3836}
     3837
     3838void UIExtraDataManager::setStatusBarContextMenuEnabled(bool fEnabled, const QUuid &aID)
    38413839{
    38423840    /* 'False' if feature restricted, null-string otherwise: */
    3843     setExtraDataString(GUI_StatusBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), strID);
    3844 }
    3845 
    3846 QList<IndicatorType> UIExtraDataManager::restrictedStatusBarIndicators(const QString &strID)
     3841    setExtraDataString(GUI_StatusBar_ContextMenu_Enabled, toFeatureRestricted(!fEnabled), aID);
     3842}
     3843
     3844QList<IndicatorType> UIExtraDataManager::restrictedStatusBarIndicators(const QUuid &aID)
    38473845{
    38483846    /* Prepare result: */
    38493847    QList<IndicatorType> result;
    38503848    /* Get restricted status-bar indicators: */
    3851     foreach (const QString &strValue, extraDataStringList(GUI_RestrictedStatusBarIndicators, strID))
     3849    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedStatusBarIndicators, aID))
    38523850    {
    38533851        const IndicatorType value = gpConverter->fromInternalString<IndicatorType>(strValue);
     
    38593857}
    38603858
    3861 void UIExtraDataManager::setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QString &strID)
     3859void UIExtraDataManager::setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QUuid &aID)
    38623860{
    38633861    /* Parse passed list: */
     
    38673865
    38683866    /* Re-cache corresponding extra-data: */
    3869     setExtraDataStringList(GUI_RestrictedStatusBarIndicators, data, strID);
    3870 }
    3871 
    3872 QList<IndicatorType> UIExtraDataManager::statusBarIndicatorOrder(const QString &strID)
     3867    setExtraDataStringList(GUI_RestrictedStatusBarIndicators, data, aID);
     3868}
     3869
     3870QList<IndicatorType> UIExtraDataManager::statusBarIndicatorOrder(const QUuid &aID)
    38733871{
    38743872    /* Prepare result: */
    38753873    QList<IndicatorType> result;
    38763874    /* 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))
    38783876    {
    38793877        const IndicatorType value = gpConverter->fromInternalString<IndicatorType>(strValue);
     
    39173915}
    39183916
    3919 void UIExtraDataManager::setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QString &strID)
     3917void UIExtraDataManager::setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QUuid &aID)
    39203918{
    39213919    /* Parse passed list: */
     
    39253923
    39263924    /* Re-cache corresponding extra-data: */
    3927     setExtraDataStringList(GUI_StatusBar_IndicatorOrder, data, strID);
     3925    setExtraDataStringList(GUI_StatusBar_IndicatorOrder, data, aID);
    39283926}
    39293927
    39303928#ifdef VBOX_WS_MAC
    3931 bool UIExtraDataManager::realtimeDockIconUpdateEnabled(const QString &strID)
     3929bool UIExtraDataManager::realtimeDockIconUpdateEnabled(const QUuid &aID)
    39323930{
    39333931    /* 'True' unless feature restricted: */
    3934     return !isFeatureRestricted(GUI_RealtimeDockIconUpdateEnabled, strID);
    3935 }
    3936 
    3937 void UIExtraDataManager::setRealtimeDockIconUpdateEnabled(bool fEnabled, const QString &strID)
     3932    return !isFeatureRestricted(GUI_RealtimeDockIconUpdateEnabled, aID);
     3933}
     3934
     3935void UIExtraDataManager::setRealtimeDockIconUpdateEnabled(bool fEnabled, const QUuid &aID)
    39383936{
    39393937    /* 'False' if feature restricted, null-string otherwise: */
    3940     setExtraDataString(GUI_RealtimeDockIconUpdateEnabled, toFeatureRestricted(!fEnabled), strID);
    3941 }
    3942 
    3943 int UIExtraDataManager::realtimeDockIconUpdateMonitor(const QString &strID)
    3944 {
    3945     return extraDataString(GUI_RealtimeDockIconUpdateMonitor, strID).toInt();
    3946 }
    3947 
    3948 void UIExtraDataManager::setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID)
    3949 {
    3950     setExtraDataString(GUI_RealtimeDockIconUpdateMonitor, iIndex ? QString::number(iIndex) : QString(), strID);
    3951 }
    3952 
    3953 bool UIExtraDataManager::dockIconDisableOverlay(const QString &strID)
     3938    setExtraDataString(GUI_RealtimeDockIconUpdateEnabled, toFeatureRestricted(!fEnabled), aID);
     3939}
     3940
     3941int UIExtraDataManager::realtimeDockIconUpdateMonitor(const QUuid &aID)
     3942{
     3943    return extraDataString(GUI_RealtimeDockIconUpdateMonitor, aID).toInt();
     3944}
     3945
     3946void UIExtraDataManager::setRealtimeDockIconUpdateMonitor(int iIndex, const QUuid &aID)
     3947{
     3948    setExtraDataString(GUI_RealtimeDockIconUpdateMonitor, iIndex ? QString::number(iIndex) : QString(), aID);
     3949}
     3950
     3951bool UIExtraDataManager::dockIconDisableOverlay(const QUuid &aID)
    39543952{
    39553953    /* 'False' unless feature allowed: */
    3956     return isFeatureAllowed(GUI_DockIconDisableOverlay, strID);
    3957 }
    3958 
    3959 void UIExtraDataManager::setDockIconDisableOverlay(bool fDisabled, const QString &strID)
     3954    return isFeatureAllowed(GUI_DockIconDisableOverlay, aID);
     3955}
     3956
     3957void UIExtraDataManager::setDockIconDisableOverlay(bool fDisabled, const QUuid &aID)
    39603958{
    39613959    /* 'True' if feature allowed, null-string otherwise: */
    3962     setExtraDataString(GUI_DockIconDisableOverlay, toFeatureAllowed(fDisabled), strID);
     3960    setExtraDataString(GUI_DockIconDisableOverlay, toFeatureAllowed(fDisabled), aID);
    39633961}
    39643962#endif /* VBOX_WS_MAC */
    39653963
    3966 bool UIExtraDataManager::passCADtoGuest(const QString &strID)
     3964bool UIExtraDataManager::passCADtoGuest(const QUuid &aID)
    39673965{
    39683966    /* 'False' unless feature allowed: */
    3969     return isFeatureAllowed(GUI_PassCAD, strID);
    3970 }
    3971 
    3972 MouseCapturePolicy UIExtraDataManager::mouseCapturePolicy(const QString &strID)
    3973 {
    3974     return gpConverter->fromInternalString<MouseCapturePolicy>(extraDataString(GUI_MouseCapturePolicy, strID));
    3975 }
    3976 
    3977 GuruMeditationHandlerType UIExtraDataManager::guruMeditationHandlerType(const QString &strID)
    3978 {
    3979     return gpConverter->fromInternalString<GuruMeditationHandlerType>(extraDataString(GUI_GuruMeditationHandler, strID));
    3980 }
    3981 
    3982 bool UIExtraDataManager::hidLedsSyncState(const QString &strID)
     3967    return isFeatureAllowed(GUI_PassCAD, aID);
     3968}
     3969
     3970MouseCapturePolicy UIExtraDataManager::mouseCapturePolicy(const QUuid &aID)
     3971{
     3972    return gpConverter->fromInternalString<MouseCapturePolicy>(extraDataString(GUI_MouseCapturePolicy, aID));
     3973}
     3974
     3975GuruMeditationHandlerType UIExtraDataManager::guruMeditationHandlerType(const QUuid &aID)
     3976{
     3977    return gpConverter->fromInternalString<GuruMeditationHandlerType>(extraDataString(GUI_GuruMeditationHandler, aID));
     3978}
     3979
     3980bool UIExtraDataManager::hidLedsSyncState(const QUuid &aID)
    39833981{
    39843982    /* 'True' unless feature restricted: */
    3985     return !isFeatureRestricted(GUI_HidLedsSync, strID);
    3986 }
    3987 
    3988 double UIExtraDataManager::scaleFactor(const int uScreenIndex, const QString &strID /* = GlobalID */)
     3983    return !isFeatureRestricted(GUI_HidLedsSync, aID);
     3984}
     3985
     3986double UIExtraDataManager::scaleFactor(const int uScreenIndex, const QUuid &aID /* = GlobalID */)
    39893987{
    39903988    /* Get corresponding extra-data for this machine: */
    3991     QStringList data = extraDataStringList(GUI_ScaleFactor, strID);
     3989    QStringList data = extraDataStringList(GUI_ScaleFactor, aID);
    39923990
    39933991    /* If that fails check the global scale factor: */
     
    40114009}
    40124010
    4013 QList<double> UIExtraDataManager::scaleFactors(const QString &strID /* = GlobalID */)
     4011QList<double> UIExtraDataManager::scaleFactors(const QUuid &aID /* = GlobalID */)
    40144012{
    40154013    /* Look for the scale factor for this machine first: */
    4016     QStringList data = extraDataStringList(GUI_ScaleFactor, strID);
     4014    QStringList data = extraDataStringList(GUI_ScaleFactor, aID);
    40174015
    40184016    /* then looks for the global scale factors: */
     
    40404038}
    40414039
    4042 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const int uScreenIndex, const QString &strID /* = GlobalID */)
    4043 {
    4044     QStringList data = extraDataStringList(GUI_ScaleFactor, strID);
     4040void UIExtraDataManager::setScaleFactor(double dScaleFactor, const int uScreenIndex, const QUuid &aID /* = GlobalID */)
     4041{
     4042    QStringList data = extraDataStringList(GUI_ScaleFactor, aID);
    40454043
    40464044    /* Just make sure that we have corresponding data item: */
     
    40544052    data[uScreenIndex] = QString::number(dScaleFactor);
    40554053
    4056     setExtraDataStringList(GUI_ScaleFactor, data, strID);
    4057 }
    4058 
    4059 void UIExtraDataManager::setScaleFactors(const QList<double> &scaleFactors, const QString &strID /* = GlobalID */)
     4054    setExtraDataStringList(GUI_ScaleFactor, data, aID);
     4055}
     4056
     4057void UIExtraDataManager::setScaleFactors(const QList<double> &scaleFactors, const QUuid &aID /* = GlobalID */)
    40604058{
    40614059    QStringList data;
    40624060    for (int i = 0; i < scaleFactors.size(); ++i)
    40634061        data.append(QString::number(scaleFactors[i]));
    4064     setExtraDataStringList(GUI_ScaleFactor, data, strID);
    4065 }
    4066 
    4067 ScalingOptimizationType UIExtraDataManager::scalingOptimizationType(const QString &strID)
    4068 {
    4069     return gpConverter->fromInternalString<ScalingOptimizationType>(extraDataString(GUI_Scaling_Optimization, strID));
    4070 }
    4071 
    4072 QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID)
     4062    setExtraDataStringList(GUI_ScaleFactor, data, aID);
     4063}
     4064
     4065ScalingOptimizationType UIExtraDataManager::scalingOptimizationType(const QUuid &aID)
     4066{
     4067    return gpConverter->fromInternalString<ScalingOptimizationType>(extraDataString(GUI_Scaling_Optimization, aID));
     4068}
     4069
     4070QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QUuid &aID)
    40734071{
    40744072    /* Get corresponding extra-data: */
    4075     const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, strID);
     4073    const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, aID);
    40764074
    40774075    /* Parse loaded data: */
     
    41204118}
    41214119
    4122 bool UIExtraDataManager::informationWindowShouldBeMaximized(const QString &strID)
     4120bool UIExtraDataManager::informationWindowShouldBeMaximized(const QUuid &aID)
    41234121{
    41244122    /* Get corresponding extra-data: */
    4125     const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, strID);
     4123    const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, aID);
    41264124
    41274125    /* Make sure 5th item has required value: */
     
    41294127}
    41304128
    4131 void UIExtraDataManager::setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID)
     4129void UIExtraDataManager::setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QUuid &aID)
    41324130{
    41334131    /* Serialize passed values: */
     
    41414139
    41424140    /* Re-cache corresponding extra-data: */
    4143     setExtraDataStringList(GUI_InformationWindowGeometry, data, strID);
     4141    setExtraDataStringList(GUI_InformationWindowGeometry, data, aID);
    41444142}
    41454143
     
    42354233}
    42364234
    4237 MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QString &strID)
    4238 {
    4239     return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_DefaultCloseAction, strID));
    4240 }
    4241 
    4242 MachineCloseAction UIExtraDataManager::restrictedMachineCloseActions(const QString &strID)
     4235MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QUuid &aID)
     4236{
     4237    return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_DefaultCloseAction, aID));
     4238}
     4239
     4240MachineCloseAction UIExtraDataManager::restrictedMachineCloseActions(const QUuid &aID)
    42434241{
    42444242    /* Prepare result: */
    42454243    MachineCloseAction result = MachineCloseAction_Invalid;
    42464244    /* Get restricted machine-close-actions: */
    4247     foreach (const QString &strValue, extraDataStringList(GUI_RestrictedCloseActions, strID))
     4245    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedCloseActions, aID))
    42484246    {
    42494247        MachineCloseAction value = gpConverter->fromInternalString<MachineCloseAction>(strValue);
     
    42554253}
    42564254
    4257 MachineCloseAction UIExtraDataManager::lastMachineCloseAction(const QString &strID)
    4258 {
    4259     return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_LastCloseAction, strID));
    4260 }
    4261 
    4262 void UIExtraDataManager::setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QString &strID)
    4263 {
    4264     setExtraDataString(GUI_LastCloseAction, gpConverter->toInternalString(machineCloseAction), strID);
    4265 }
    4266 
    4267 QString UIExtraDataManager::machineCloseHookScript(const QString &strID)
    4268 {
    4269     return extraDataString(GUI_CloseActionHook, strID);
     4255MachineCloseAction UIExtraDataManager::lastMachineCloseAction(const QUuid &aID)
     4256{
     4257    return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_LastCloseAction, aID));
     4258}
     4259
     4260void UIExtraDataManager::setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QUuid &aID)
     4261{
     4262    setExtraDataString(GUI_LastCloseAction, gpConverter->toInternalString(machineCloseAction), aID);
     4263}
     4264
     4265QString UIExtraDataManager::machineCloseHookScript(const QUuid &aID)
     4266{
     4267    return extraDataString(GUI_CloseActionHook, aID);
    42704268}
    42714269
     
    45234521}
    45244522
    4525 void UIExtraDataManager::sltExtraDataChange(QString strMachineID, QString strKey, QString strValue)
     4523void UIExtraDataManager::sltExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue)
    45264524{
    45274525    /* Re-cache value only if strMachineID known already: */
    4528     if (m_data.contains(strMachineID))
     4526    if (m_data.contains(aMachineID))
    45294527    {
    45304528        if (!strValue.isEmpty())
    4531             m_data[strMachineID][strKey] = strValue;
     4529            m_data[aMachineID][strKey] = strValue;
    45324530        else
    4533             m_data[strMachineID].remove(strKey);
     4531            m_data[aMachineID].remove(strKey);
    45344532    }
    45354533
    45364534    /* Global extra-data 'change' event: */
    4537     if (strMachineID == GlobalID)
     4535    if (aMachineID == GlobalID)
    45384536    {
    45394537        if (strKey.startsWith("GUI/"))
     
    45584556        /* Current VM only: */
    45594557        if (   vboxGlobal().isVMConsoleProcess()
    4560             && strMachineID == vboxGlobal().managedVMUuid())
     4558            && aMachineID == vboxGlobal().managedVMUuid())
    45614559        {
    45624560            /* HID LEDs sync state changed (allowed if not restricted)? */
    45634561            if (strKey == GUI_HidLedsSync)
    4564                 emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, strMachineID));
     4562                emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, aMachineID));
    45654563#ifdef VBOX_WS_MAC
    45664564            /* 'Dock icon' appearance changed (allowed if not restricted)? */
    45674565            else if (strKey == GUI_RealtimeDockIconUpdateEnabled ||
    45684566                     strKey == GUI_RealtimeDockIconUpdateMonitor)
    4569                 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID));
     4567                emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, aMachineID));
    45704568            /* 'Dock icon overlay' appearance changed (restricted if not allowed)? */
    45714569            else if (strKey == GUI_DockIconDisableOverlay)
    4572                 emit sigDockIconOverlayAppearanceChange(isFeatureAllowed(strKey, strMachineID));
     4570                emit sigDockIconOverlayAppearanceChange(isFeatureAllowed(strKey, aMachineID));
    45734571#endif /* VBOX_WS_MAC */
    45744572        }
     
    45924590#endif /* VBOX_WS_MAC */
    45934591            strKey == GUI_RestrictedRuntimeHelpMenuActions)
    4594             emit sigMenuBarConfigurationChange(strMachineID);
     4592            emit sigMenuBarConfigurationChange(aMachineID);
    45954593        /* Status-bar configuration change: */
    45964594        else if (strKey == GUI_StatusBar_Enabled ||
    45974595                 strKey == GUI_RestrictedStatusBarIndicators ||
    45984596                 strKey == GUI_StatusBar_IndicatorOrder)
    4599             emit sigStatusBarConfigurationChange(strMachineID);
     4597            emit sigStatusBarConfigurationChange(aMachineID);
    46004598        /* Scale-factor change: */
    46014599        else if (strKey ==GUI_ScaleFactor)
    4602             emit sigScaleFactorChange(strMachineID);
     4600            emit sigScaleFactorChange(aMachineID);
    46034601        /* Scaling optimization type change: */
    46044602        else if (strKey == GUI_Scaling_Optimization)
    4605             emit sigScalingOptimizationTypeChange(strMachineID);
     4603            emit sigScalingOptimizationTypeChange(aMachineID);
    46064604    }
    46074605
    46084606    /* Notify listeners: */
    4609     emit sigExtraDataChange(strMachineID, strKey, strValue);
     4607    emit sigExtraDataChange(aMachineID, strKey, strValue);
    46104608}
    46114609
     
    46884686#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
    46894687
    4690 QString UIExtraDataManager::extraDataStringUnion(const QString &strKey, const QString &strID)
     4688QString UIExtraDataManager::extraDataStringUnion(const QString &strKey, const QUuid &aID)
    46914689{
    46924690    /* If passed strID differs from the GlobalID: */
    4693     if (strID != GlobalID)
     4691    if (aID != GlobalID)
    46944692    {
    46954693        /* 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);
    46974695        /* Hot-load machine extra-data map if necessary: */
    46984696        if (itMap == m_data.constEnd())
    46994697        {
    4700             hotloadMachineExtraDataMap(strID);
    4701             itMap = m_data.constFind(strID);
     4698            hotloadMachineExtraDataMap(aID);
     4699            itMap = m_data.constFind(aID);
    47024700        }
    47034701        if (itMap != m_data.constEnd())
     
    47244722}
    47254723
    4726 bool UIExtraDataManager::isFeatureAllowed(const QString &strKey, const QString &strID /* = GlobalID */)
     4724bool UIExtraDataManager::isFeatureAllowed(const QString &strKey, const QUuid &aID /* = GlobalID */)
    47274725{
    47284726    /* Get the value. Return 'false' if not found: */
    4729     const QString strValue = extraDataStringUnion(strKey, strID);
     4727    const QString strValue = extraDataStringUnion(strKey, aID);
    47304728    if (strValue.isNull())
    47314729        return false;
     
    47384736}
    47394737
    4740 bool UIExtraDataManager::isFeatureRestricted(const QString &strKey, const QString &strID /* = GlobalID */)
     4738bool UIExtraDataManager::isFeatureRestricted(const QString &strKey, const QUuid &aID /* = GlobalID */)
    47414739{
    47424740    /* Get the value. Return 'false' if not found: */
    4743     const QString strValue = extraDataStringUnion(strKey, strID);
     4741    const QString strValue = extraDataStringUnion(strKey, aID);
    47444742    if (strValue.isNull())
    47454743        return false;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r74872 r74878  
    2323#include <QObject>
    2424#include <QSize>
     25#include <QUuid>
    2526#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    2627# include <QPointer>
     
    3839/** Defines the map of extra data values. The index is an extra-data key. */
    3940typedef QMap<QString, QString> ExtraDataMap;
    40 /** Defines the map of extra data maps. The index is a UUID string. */
    41 typedef QMap<QString, ExtraDataMap> MapOfExtraDataMaps;
     41/** Defines the map of extra data maps. */
     42typedef QMap<QUuid, ExtraDataMap> MapOfExtraDataMaps;
    4243
    4344/** Singleton QObject extension
     
    5657
    5758    /** Notifies about extra-data map acknowledging. */
    58     void sigExtraDataMapAcknowledging(QString strID);
     59    void sigExtraDataMapAcknowledging(const QUuid &aID);
    5960
    6061    /** Notifies about extra-data change. */
    61     void sigExtraDataChange(QString strID, QString strKey, QString strValue);
     62    void sigExtraDataChange(const QUuid &aID, const QString &strKey, const QString &strValue);
    6263
    6364    /** Notifies about GUI language change. */
     
    7273
    7374    /** Notifies about menu-bar configuration change. */
    74     void sigMenuBarConfigurationChange(const QString &strMachineID);
     75    void sigMenuBarConfigurationChange(const QUuid &aMachineID);
    7576    /** Notifies about status-bar configuration change. */
    76     void sigStatusBarConfigurationChange(const QString &strMachineID);
     77    void sigStatusBarConfigurationChange(const QUuid &aMachineID);
    7778
    7879    /** Notifies about HID LEDs synchronization state change. */
     
    8081
    8182    /** Notifies about the scale-factor change. */
    82     void sigScaleFactorChange(const QString &strMachineID);
     83    void sigScaleFactorChange(const QUuid &aMachineID);
    8384
    8485    /** Notifies about the scaling optimization type change. */
    85     void sigScalingOptimizationTypeChange(const QString &strMachineID);
     86    void sigScalingOptimizationTypeChange(const QUuid &aMachineID);
    8687
    8788#ifdef VBOX_WS_MAC
    8889    /** Notifies about the HiDPI optimization type change. */
    89     void sigHiDPIOptimizationTypeChange(const QString &strMachineID);
     90    void sigHiDPIOptimizationTypeChange(const QUuid &aMachineID);
    9091
    9192    /** Mac OS X: Notifies about 'dock icon' appearance change. */
     
    9899
    99100    /** Global extra-data ID. */
    100     static const QString GlobalID;
     101    static const QUuid GlobalID;
    101102
    102103    /** Static Extra-data Manager instance/constructor. */
     
    113114      * @{ */
    114115        /** Returns whether Extra-data Manager cached the map with passed @a strID. */
    115         bool contains(const QString &strID) const { return m_data.contains(strID); }
     116        bool contains(const QUuid &aID) const { return m_data.contains(aID); }
    116117        /** Returns read-only extra-data map for passed @a strID. */
    117         const ExtraDataMap map(const QString &strID) const { return m_data.value(strID); }
     118        const ExtraDataMap map(const QUuid &aID) const { return m_data.value(aID); }
    118119
    119120        /** Hot-load machine extra-data map. */
    120         void hotloadMachineExtraDataMap(const QString &strID);
     121        void hotloadMachineExtraDataMap(const QUuid &aID);
    121122
    122123        /** Returns extra-data value corresponding to passed @a strKey as QString.
    123124          * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
    124         QString extraDataString(const QString &strKey, const QString &strID = GlobalID);
     125        QString extraDataString(const QString &strKey, const QUuid &aID = GlobalID);
    125126        /** Defines extra-data value corresponding to passed @a strKey as strValue.
    126127          * 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 QString &strID = GlobalID);
     128        void setExtraDataString(const QString &strKey, const QString &strValue, const QUuid &aID = GlobalID);
    128129
    129130        /** Returns extra-data value corresponding to passed @a strKey as QStringList.
    130131          * If valid @a strID is set => applies to machine extra-data, otherwise => to global one. */
    131         QStringList extraDataStringList(const QString &strKey, const QString &strID = GlobalID);
     132        QStringList extraDataStringList(const QString &strKey, const QUuid &aID = GlobalID);
    132133        /** Defines extra-data value corresponding to passed @a strKey as value.
    133134          * 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 QString &strID = GlobalID);
     135        void setExtraDataStringList(const QString &strKey, const QStringList &value, const QUuid &aID = GlobalID);
    135136    /** @} */
    136137
     
    144145      * @{ */
    145146        /** Returns the list of supressed messages for the Message/Popup center frameworks. */
    146         QStringList suppressedMessages(const QString &strID = GlobalID);
     147        QStringList suppressedMessages(const QUuid &aID = GlobalID);
    147148        /** Defines the @a list of supressed messages for the Message/Popup center frameworks. */
    148149        void setSuppressedMessages(const QStringList &list);
     
    189190        QList<GlobalSettingsPageType> restrictedGlobalSettingsPages();
    190191        /** Returns restricted machine settings pages. */
    191         QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QString &strID);
     192        QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QUuid &aID);
    192193    /** @} */
    193194
     
    395396      * @{ */
    396397        /** Returns whether machine should be shown in selector-window chooser-pane. */
    397         bool showMachineInSelectorChooser(const QString &strID);
     398        bool showMachineInSelectorChooser(const QUuid &aID);
    398399        /** Returns whether machine should be shown in selector-window details-pane. */
    399         bool showMachineInSelectorDetails(const QString &strID);
     400        bool showMachineInSelectorDetails(const QUuid &aID);
    400401
    401402        /** Returns whether machine reconfiguration enabled. */
    402         bool machineReconfigurationEnabled(const QString &strID);
     403        bool machineReconfigurationEnabled(const QUuid &aID);
    403404        /** Returns whether machine snapshot operations enabled. */
    404         bool machineSnapshotOperationsEnabled(const QString &strID);
     405        bool machineSnapshotOperationsEnabled(const QUuid &aID);
    405406
    406407        /** Returns whether this machine is first time started. */
    407         bool machineFirstTimeStarted(const QString &strID);
     408        bool machineFirstTimeStarted(const QUuid &aID);
    408409        /** Returns whether this machine is fFirstTimeStarted. */
    409         void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QString &strID);
     410        void setMachineFirstTimeStarted(bool fFirstTimeStarted, const QUuid &aID);
    410411
    411412        /** Except Mac OS X: Returns redefined machine-window icon names. */
    412         QStringList machineWindowIconNames(const QString &strID);
     413        QStringList machineWindowIconNames(const QUuid &aID);
    413414#ifndef VBOX_WS_MAC
    414415        /** Except Mac OS X: Returns redefined machine-window name postfix. */
    415         QString machineWindowNamePostfix(const QString &strID);
     416        QString machineWindowNamePostfix(const QUuid &aID);
    416417#endif
    417418
    418419        /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */
    419         QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
     420        QRect machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &sID);
    420421        /** Returns whether machine-window with @a uScreenIndex in @a visualStateType should be maximized. */
    421         bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strID);
     422        bool machineWindowShouldBeMaximized(UIVisualStateType visualStateType, ulong uScreenIndex, const QUuid &aID);
    422423        /** 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 QString &strID);
     424        void setMachineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QRect &geometry, bool fMaximized, const QUuid &aID);
    424425
    425426#ifndef VBOX_WS_MAC
    426427        /** Returns whether Runtime UI menu-bar is enabled. */
    427         bool menuBarEnabled(const QString &strID);
     428        bool menuBarEnabled(const QUuid &aID);
    428429        /** Defines whether Runtime UI menu-bar is @a fEnabled. */
    429         void setMenuBarEnabled(bool fEnabled, const QString &strID);
     430        void setMenuBarEnabled(bool fEnabled, const QUuid &aID);
    430431#endif /* !VBOX_WS_MAC */
    431432
    432433        /** Returns whether Runtime UI menu-bar context-menu is enabled. */
    433         bool menuBarContextMenuEnabled(const QString &strID);
     434        bool menuBarContextMenuEnabled(const QUuid &aID);
    434435        /** Defines whether Runtime UI menu-bar context-menu is @a fEnabled. */
    435         void setMenuBarContextMenuEnabled(bool fEnabled, const QString &strID);
     436        void setMenuBarContextMenuEnabled(bool fEnabled, const QUuid &aID);
    436437
    437438        /** Returns restricted Runtime UI menu types. */
    438         UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QString &strID);
     439        UIExtraDataMetaDefs::MenuType restrictedRuntimeMenuTypes(const QUuid &aID);
    439440        /** Defines restricted Runtime UI menu types. */
    440         void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID);
     441        void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QUuid &aID);
    441442
    442443        /** Returns restricted Runtime UI action types for Application menu. */
    443         UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QString &strID);
     444        UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QUuid &aID);
    444445        /** Defines restricted Runtime UI action types for Application menu. */
    445         void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID);
     446        void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QUuid &aID);
    446447
    447448        /** Returns restricted Runtime UI action types for Machine menu. */
    448         UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QString &strID);
     449        UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QUuid &aID);
    449450        /** Defines restricted Runtime UI action types for Machine menu. */
    450         void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QString &strID);
     451        void setRestrictedRuntimeMenuMachineActionTypes(UIExtraDataMetaDefs::RuntimeMenuMachineActionType types, const QUuid &aID);
    451452
    452453        /** Returns restricted Runtime UI action types for View menu. */
    453         UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QString &strID);
     454        UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QUuid &aID);
    454455        /** Defines restricted Runtime UI action types for View menu. */
    455         void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QString &strID);
     456        void setRestrictedRuntimeMenuViewActionTypes(UIExtraDataMetaDefs::RuntimeMenuViewActionType types, const QUuid &aID);
    456457
    457458        /** Returns restricted Runtime UI action types for Input menu. */
    458         UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QString &strID);
     459        UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictedRuntimeMenuInputActionTypes(const QUuid &aID);
    459460        /** Defines restricted Runtime UI action types for Input menu. */
    460         void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QString &strID);
     461        void setRestrictedRuntimeMenuInputActionTypes(UIExtraDataMetaDefs::RuntimeMenuInputActionType types, const QUuid &aID);
    461462
    462463        /** Returns restricted Runtime UI action types for Devices menu. */
    463         UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QString &strID);
     464        UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QUuid &aID);
    464465        /** Defines restricted Runtime UI action types for Devices menu. */
    465         void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QString &strID);
     466        void setRestrictedRuntimeMenuDevicesActionTypes(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType types, const QUuid &aID);
    466467
    467468#ifdef VBOX_WITH_DEBUGGER_GUI
    468469        /** Returns restricted Runtime UI action types for Debugger menu. */
    469         UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QString &strID);
     470        UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QUuid &aID);
    470471        /** Defines restricted Runtime UI action types for Debugger menu. */
    471         void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QString &strID);
     472        void setRestrictedRuntimeMenuDebuggerActionTypes(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType types, const QUuid &aID);
    472473#endif /* VBOX_WITH_DEBUGGER_GUI */
    473474
    474475#ifdef VBOX_WS_MAC
    475476        /** Mac OS X: Returns restricted Runtime UI action types for Window menu. */
    476         UIExtraDataMetaDefs::MenuWindowActionType restrictedRuntimeMenuWindowActionTypes(const QString &strID);
     477        UIExtraDataMetaDefs::MenuWindowActionType restrictedRuntimeMenuWindowActionTypes(const QUuid &aID);
    477478        /** Mac OS X: Defines restricted Runtime UI action types for Window menu. */
    478         void setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QString &strID);
     479        void setRestrictedRuntimeMenuWindowActionTypes(UIExtraDataMetaDefs::MenuWindowActionType types, const QUuid &aID);
    479480#endif /* VBOX_WS_MAC */
    480481
    481482        /** Returns restricted Runtime UI action types for Help menu. */
    482         UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QString &strID);
     483        UIExtraDataMetaDefs::MenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QUuid &aID);
    483484        /** Defines restricted Runtime UI action types for Help menu. */
    484         void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QString &strID);
     485        void setRestrictedRuntimeMenuHelpActionTypes(UIExtraDataMetaDefs::MenuHelpActionType types, const QUuid &aID);
    485486
    486487        /** Returns restricted Runtime UI visual-states. */
    487         UIVisualStateType restrictedVisualStates(const QString &strID);
     488        UIVisualStateType restrictedVisualStates(const QUuid &aID);
    488489
    489490        /** Returns requested Runtime UI visual-state. */
    490         UIVisualStateType requestedVisualState(const QString &strID);
     491        UIVisualStateType requestedVisualState(const QUuid &aID);
    491492        /** Defines requested Runtime UI visual-state as @a visualState. */
    492         void setRequestedVisualState(UIVisualStateType visualState, const QString &strID);
     493        void setRequestedVisualState(UIVisualStateType visualState, const QUuid &aID);
    493494
    494495#ifdef VBOX_WS_X11
     
    497498
    498499        /** Returns whether internal machine-window name should be unique. */
    499         bool distinguishMachineWindowGroups(const QString &strID);
     500        bool distinguishMachineWindowGroups(const QUuid &aID);
    500501        /** Defines whether internal machine-window name should be unique. */
    501         void setDistinguishMachineWindowGroups(const QString &strID, bool fEnabled);
     502        void setDistinguishMachineWindowGroups(const QUuid &aID, bool fEnabled);
    502503#endif /* VBOX_WS_X11 */
    503504
    504505        /** Returns whether guest-screen auto-resize according machine-window size is enabled. */
    505         bool guestScreenAutoResizeEnabled(const QString &strID);
     506        bool guestScreenAutoResizeEnabled(const QUuid &aID);
    506507        /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
    507         void setGuestScreenAutoResizeEnabled(bool fEnabled, const QString &strID);
     508        void setGuestScreenAutoResizeEnabled(bool fEnabled, const QUuid &aID);
    508509
    509510        /** Returns last guest-screen visibility status for screen with @a uScreenIndex. */
    510         bool lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QString &strID);
     511        bool lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QUuid &aID);
    511512        /** Defines whether last guest-screen visibility status was @a fEnabled for screen with @a uScreenIndex. */
    512         void setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QString &strID);
     513        void setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QUuid &aID);
    513514
    514515        /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */
    515         QSize lastGuestScreenSizeHint(ulong uScreenIndex, const QString &strID);
     516        QSize lastGuestScreenSizeHint(ulong uScreenIndex, const QUuid &aID);
    516517        /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */
    517         void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);
     518        void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QUuid &aID);
    518519
    519520        /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */
    520         int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID);
     521        int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QUuid &aID);
    521522        /** Defines @a iHostScreenIndex corresponding to passed guest-screen @a iGuestScreenIndex. */
    522         void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID);
     523        void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QUuid &aID);
    523524
    524525        /** Returns whether automatic mounting/unmounting of guest-screens enabled. */
    525         bool autoMountGuestScreensEnabled(const QString &strID);
     526        bool autoMountGuestScreensEnabled(const QUuid &aID);
    526527
    527528#ifdef VBOX_WITH_VIDEOHWACCEL
    528529        /** Returns whether 2D acceleration should use linear sretch. */
    529         bool useLinearStretch(const QString &strID);
     530        bool useLinearStretch(const QUuid &aID);
    530531        /** Returns whether 2D acceleration should use YV12 pixel format. */
    531         bool usePixelFormatYV12(const QString &strID);
     532        bool usePixelFormatYV12(const QUuid &aID);
    532533        /** Returns whether 2D acceleration should use UYVY pixel format. */
    533         bool usePixelFormatUYVY(const QString &strID);
     534        bool usePixelFormatUYVY(const QUuid &aID);
    534535        /** Returns whether 2D acceleration should use YUY2 pixel format. */
    535         bool usePixelFormatYUY2(const QString &strID);
     536        bool usePixelFormatYUY2(const QUuid &aID);
    536537        /** Returns whether 2D acceleration should use AYUV pixel format. */
    537         bool usePixelFormatAYUV(const QString &strID);
     538        bool usePixelFormatAYUV(const QUuid &aID);
    538539#endif /* VBOX_WITH_VIDEOHWACCEL */
    539540
    540541#ifndef VBOX_WS_MAC
    541542        /** Returns whether mini-toolbar is enabled for full and seamless screens. */
    542         bool miniToolbarEnabled(const QString &strID);
     543        bool miniToolbarEnabled(const QUuid &aID);
    543544        /** Defines whether mini-toolbar is @a fEnabled for full and seamless screens. */
    544         void setMiniToolbarEnabled(bool fEnabled, const QString &strID);
     545        void setMiniToolbarEnabled(bool fEnabled, const QUuid &aID);
    545546
    546547        /** Returns whether mini-toolbar should auto-hide itself. */
    547         bool autoHideMiniToolbar(const QString &strID);
     548        bool autoHideMiniToolbar(const QUuid &aID);
    548549        /** Defines whether mini-toolbar should @a fAutoHide itself. */
    549         void setAutoHideMiniToolbar(bool fAutoHide, const QString &strID);
     550        void setAutoHideMiniToolbar(bool fAutoHide, const QUuid &aID);
    550551
    551552        /** Returns mini-toolbar alignment. */
    552         Qt::AlignmentFlag miniToolbarAlignment(const QString &strID);
     553        Qt::AlignmentFlag miniToolbarAlignment(const QUuid &aID);
    553554        /** Returns mini-toolbar @a alignment. */
    554         void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QString &strID);
     555        void setMiniToolbarAlignment(Qt::AlignmentFlag alignment, const QUuid &aID);
    555556#endif /* VBOX_WS_MAC */
    556557
    557558        /** Returns whether Runtime UI status-bar is enabled. */
    558         bool statusBarEnabled(const QString &strID);
     559        bool statusBarEnabled(const QUuid &aID);
    559560        /** Defines whether Runtime UI status-bar is @a fEnabled. */
    560         void setStatusBarEnabled(bool fEnabled, const QString &strID);
     561        void setStatusBarEnabled(bool fEnabled, const QUuid &aID);
    561562
    562563        /** Returns whether Runtime UI status-bar context-menu is enabled. */
    563         bool statusBarContextMenuEnabled(const QString &strID);
     564        bool statusBarContextMenuEnabled(const QUuid &aID);
    564565        /** Defines whether Runtime UI status-bar context-menu is @a fEnabled. */
    565         void setStatusBarContextMenuEnabled(bool fEnabled, const QString &strID);
     566        void setStatusBarContextMenuEnabled(bool fEnabled, const QUuid &aID);
    566567
    567568        /** Returns restricted Runtime UI status-bar indicator list. */
    568         QList<IndicatorType> restrictedStatusBarIndicators(const QString &strID);
     569        QList<IndicatorType> restrictedStatusBarIndicators(const QUuid &aID);
    569570        /** Defines restricted Runtime UI status-bar indicator @a list. */
    570         void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QString &strID);
     571        void setRestrictedStatusBarIndicators(const QList<IndicatorType> &list, const QUuid &aID);
    571572
    572573        /** Returns Runtime UI status-bar indicator order list. */
    573         QList<IndicatorType> statusBarIndicatorOrder(const QString &strID);
     574        QList<IndicatorType> statusBarIndicatorOrder(const QUuid &aID);
    574575        /** Defines Runtime UI status-bar indicator order @a list. */
    575         void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QString &strID);
     576        void setStatusBarIndicatorOrder(const QList<IndicatorType> &list, const QUuid &aID);
    576577
    577578#ifdef VBOX_WS_MAC
    578579        /** Mac OS X: Returns whether Dock icon should be updated at runtime. */
    579         bool realtimeDockIconUpdateEnabled(const QString &strID);
     580        bool realtimeDockIconUpdateEnabled(const QUuid &aID);
    580581        /** Mac OS X: Defines whether Dock icon update should be fEnabled at runtime. */
    581         void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QString &strID);
     582        void setRealtimeDockIconUpdateEnabled(bool fEnabled, const QUuid &aID);
    582583
    583584        /** Mac OS X: Returns guest-screen which Dock icon should reflect at runtime. */
    584         int realtimeDockIconUpdateMonitor(const QString &strID);
     585        int realtimeDockIconUpdateMonitor(const QUuid &aID);
    585586        /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */
    586         void setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID);
     587        void setRealtimeDockIconUpdateMonitor(int iIndex, const QUuid &aID);
    587588
    588589        /** Mac OS X: Returns whether Dock icon overlay is disabled. */
    589         bool dockIconDisableOverlay(const QString &strID);
     590        bool dockIconDisableOverlay(const QUuid &aID);
    590591        /** Mac OS X: Defines whether Dock icon overlay is @a fDisabled. */
    591         void setDockIconDisableOverlay(bool fDisabled, const QString &strID);
     592        void setDockIconDisableOverlay(bool fDisabled, const QUuid &aID);
    592593#endif /* VBOX_WS_MAC */
    593594
    594595        /** Returns whether machine should pass CAD to guest. */
    595         bool passCADtoGuest(const QString &strID);
     596        bool passCADtoGuest(const QUuid &aID);
    596597
    597598        /** Returns the mouse-capture policy. */
    598         MouseCapturePolicy mouseCapturePolicy(const QString &strID);
     599        MouseCapturePolicy mouseCapturePolicy(const QUuid &aID);
    599600
    600601        /** Returns redefined guru-meditation handler type. */
    601         GuruMeditationHandlerType guruMeditationHandlerType(const QString &strID);
     602        GuruMeditationHandlerType guruMeditationHandlerType(const QUuid &aID);
    602603
    603604        /** Returns whether machine should perform HID LEDs synchronization. */
    604         bool hidLedsSyncState(const QString &strID);
     605        bool hidLedsSyncState(const QUuid &aID);
    605606
    606607        /** Returns the scale-factor. */
    607         double scaleFactor(const int uScreenIndex, const QString &strID = GlobalID);
    608         QList<double> scaleFactors(const QString &strID = GlobalID);
     608        double scaleFactor(const int uScreenIndex, const QUuid &aID = GlobalID);
     609        QList<double> scaleFactors(const QUuid &aID = GlobalID);
    609610        /** Defines the @a dScaleFactor. */
    610         void setScaleFactor(double dScaleFactor, const int uScreenIndex, const QString &strID = GlobalID);
    611         void setScaleFactors(const QList<double> &scaleFactors, const QString &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);
    612613
    613614        /** Returns the scaling optimization type. */
    614         ScalingOptimizationType scalingOptimizationType(const QString &strID);
     615        ScalingOptimizationType scalingOptimizationType(const QUuid &aID);
    615616    /** @} */
    616617
     
    618619      * @{ */
    619620        /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */
    620         QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID);
     621        QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QUuid &aID);
    621622        /** Returns whether information-window should be maximized or not. */
    622         bool informationWindowShouldBeMaximized(const QString &strID);
     623        bool informationWindowShouldBeMaximized(const QUuid &aID);
    623624        /** Defines information-window @a geometry and @a fMaximized state. */
    624         void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID);
     625        void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QUuid &aID);
    625626
    626627        /** Returns information-window elements. */
     
    637638      * @{ */
    638639        /** Returns default machine close action. */
    639         MachineCloseAction defaultMachineCloseAction(const QString &strID);
     640        MachineCloseAction defaultMachineCloseAction(const QUuid &aID);
    640641        /** Returns restricted machine close actions. */
    641         MachineCloseAction restrictedMachineCloseActions(const QString &strID);
     642        MachineCloseAction restrictedMachineCloseActions(const QUuid &aID);
    642643
    643644        /** Returns last machine close action. */
    644         MachineCloseAction lastMachineCloseAction(const QString &strID);
     645        MachineCloseAction lastMachineCloseAction(const QUuid &aID);
    645646        /** Defines last @a machineCloseAction. */
    646         void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QString &strID);
     647        void setLastMachineCloseAction(MachineCloseAction machineCloseAction, const QUuid &aID);
    647648
    648649        /** Returns machine close hook script name as simple string. */
    649         QString machineCloseHookScript(const QString &strID);
     650        QString machineCloseHookScript(const QUuid &aID);
    650651    /** @} */
    651652
     
    699700
    700701    /** Handles 'extra-data change' event: */
    701     void sltExtraDataChange(QString strMachineID, QString strKey, QString strValue);
     702    void sltExtraDataChange(const QUuid &aMachineID, const QString &strKey, const QString &strValue);
    702703
    703704private:
     
    735736      * @returns String value if found, null string if not.
    736737      * @param   strKey      The extra-data key to get.
    737       * @param   strID       Machine UUID or #GlobalID.
     738      * @param   aID         Machine UUID or #GlobalID.
    738739      * @param   strValue    Where to return the value when found. */
    739     QString extraDataStringUnion(const QString &strKey, const QString &strID);
     740    QString extraDataStringUnion(const QString &strKey, const QUuid &aID);
    740741    /** 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,
    742743      * otherwise => only to global one. */
    743     bool isFeatureAllowed(const QString &strKey, const QString &strID = GlobalID);
     744    bool isFeatureAllowed(const QString &strKey, const QUuid &aID = GlobalID);
    744745    /** 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,
    746747      * otherwise => only to global one. */
    747     bool isFeatureRestricted(const QString &strKey, const QString &strID = GlobalID);
     748    bool isFeatureRestricted(const QString &strKey, const QUuid &aID = GlobalID);
    748749
    749750    /** Translates bool flag into QString value. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.cpp

    r69500 r74878  
    238238}
    239239
     240/* static */
     241void 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 */
     251void 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
    240259////////////////////////////////////////////////////////////////////////////////
    241260
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h

    r71791 r74878  
    291291                              QVector<QUuid> &aVec);
    292292
     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
    293300    /* Arrays of enums. Does a cast similar to what ENUMOut does. */
    294301
     
    392399
    393400        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;
    394445        BSTR bstr;
    395446    };
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/COMWrappers.xsl

    r71795 r74878  
    14021402    </xsl:when>
    14031403    <!-- string types -->
    1404     <xsl:when test="@type = 'wstring' or @type = 'uuid'">
     1404    <xsl:when test="@type = 'wstring'">
    14051405      <xsl:choose>
    14061406        <xsl:when test="$isIn">
     
    14131413        <xsl:when test="$isOut">
    14141414          <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>
    14151434          <xsl:call-template name="capitalize">
    14161435            <xsl:with-param name="str" select="@name"/>
     
    15321551            <!-- standard types -->
    15331552            <!--xsl:when test=".='result'">??</xsl:when-->
    1534             <xsl:when test=".='uuid'">QString</xsl:when>
     1553            <xsl:when test=".='uuid'">QUuid</xsl:when>
    15351554            <xsl:otherwise>
    15361555              <xsl:message terminate="yes">
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r74872 r74878  
    31403140#endif /* VBOX_WITH_DEBUGGER_GUI */
    31413141
    3142 void UIActionPoolRuntime::sltHandleConfigurationChange(const QString &strMachineID)
     3142void UIActionPoolRuntime::sltHandleConfigurationChange(const QUuid &aMachineID)
    31433143{
    31443144    /* Skip unrelated machine IDs: */
    3145     if (vboxGlobal().managedVMUuid() != strMachineID)
     3145    if (vboxGlobal().managedVMUuid() != aMachineID)
    31463146        return;
    31473147
     
    33383338    connect(gShortcutPool, SIGNAL(sigSelectorShortcutsReloaded()), this, SLOT(sltApplyShortcuts()));
    33393339    connect(gShortcutPool, SIGNAL(sigMachineShortcutsReloaded()), this, SLOT(sltApplyShortcuts()));
    3340     connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)),
    3341             this, SLOT(sltHandleConfigurationChange(const QString&)));
     3340    connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QUuid &)),
     3341            this, SLOT(sltHandleConfigurationChange(const QUuid &)));
    33423342
    33433343    /* Call to base-class: */
     
    33483348{
    33493349    /* Get machine ID: */
    3350     const QString strMachineID = vboxGlobal().managedVMUuid();
    3351     if (strMachineID.isNull())
     3350    const QUuid aMachineID = vboxGlobal().managedVMUuid();
     3351    if (aMachineID.isNull())
    33523352        return;
    33533353
    33543354    /* 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);
    33613361#ifdef VBOX_WITH_DEBUGGER_GUI
    3362     m_restrictedActionsMenuDebug[UIActionRestrictionLevel_Base] =       gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(strMachineID);
     3362    m_restrictedActionsMenuDebug[UIActionRestrictionLevel_Base] =       gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(aMachineID);
    33633363#endif /* VBOX_WITH_DEBUGGER_GUI */
    33643364#ifdef VBOX_WS_MAC
    3365     m_restrictedActionsMenuWindow[UIActionRestrictionLevel_Base] =      gEDataManager->restrictedRuntimeMenuWindowActionTypes(strMachineID);
     3365    m_restrictedActionsMenuWindow[UIActionRestrictionLevel_Base] =      gEDataManager->restrictedRuntimeMenuWindowActionTypes(aMachineID);
    33663366#endif /* VBOX_WS_MAC */
    3367     m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] =        gEDataManager->restrictedRuntimeMenuHelpActionTypes(strMachineID);
     3367    m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] =        gEDataManager->restrictedRuntimeMenuHelpActionTypes(aMachineID);
    33683368
    33693369    /* Recache visual state action restrictions: */
    3370     UIVisualStateType restrictedVisualStates = gEDataManager->restrictedVisualStates(strMachineID);
     3370    UIVisualStateType restrictedVisualStates = gEDataManager->restrictedVisualStates(aMachineID);
    33713371    {
    33723372        if (restrictedVisualStates & UIVisualStateType_Fullscreen)
     
    33823382
    33833383    /* Recache reconfiguration action restrictions: */
    3384     bool fReconfigurationAllowed = gEDataManager->machineReconfigurationEnabled(strMachineID);
     3384    bool fReconfigurationAllowed = gEDataManager->machineReconfigurationEnabled(aMachineID);
    33853385    if (!fReconfigurationAllowed)
    33863386    {
     
    34023402
    34033403    /* Recache snapshot related action restrictions: */
    3404     bool fSnapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(strMachineID);
     3404    bool fSnapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(aMachineID);
    34053405    if (!fSnapshotOperationsAllowed)
    34063406    {
     
    34233423
    34243424    /* Recache close related action restrictions: */
    3425     MachineCloseAction restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(strMachineID);
     3425    MachineCloseAction restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(aMachineID);
    34263426    bool fAllCloseActionsRestricted =    (!vboxGlobal().isSeparateProcess() || (restrictedCloseActions & MachineCloseAction_Detach))
    34273427                                      && (restrictedCloseActions & MachineCloseAction_SaveState)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h

    r73841 r74878  
    201201
    202202    /** Handles configuration-change. */
    203     void sltHandleConfigurationChange(const QString &strMachineID);
     203    void sltHandleConfigurationChange(const QUuid &aMachineID);
    204204
    205205    /** Handles 'View' : 'Scale Factor' menu : @a pAction trigger. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r74815 r74878  
    376376{
    377377    /* Get machine ID: */
    378     const QString strMachineId = comMachine.GetId();
     378    const QUuid uMachineId = comMachine.GetId();
    379379    AssertReturn(comMachine.isOk(), QPixmap());
    380380
     
    384384    /* 1. First, load icon from IMachine extra-data: */
    385385    if (icon.isNull())
    386         foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(strMachineId))
     386        foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(uMachineId))
    387387            if (!strIconName.isEmpty() && QFile::exists(strIconName))
    388388                icon.addFile(strIconName);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r71630 r74878  
    7676      * @{ */
    7777        /** 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);
    7979        /** Notifies about data change event for the machine with @a strId. */
    80         void sigMachineDataChange(QString strId);
     80        void sigMachineDataChange(const QUuid &aId);
    8181        /** 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);
    8383        /** 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);
    8585        /** 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);
    8787        /** 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);
    8989        /** 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);
    9191        /** 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);
    9393    /** @} */
    9494
     
    9696      * @{ */
    9797        /** 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, QString strValue, 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 */
    9999        /** 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, QString strValue);
     100        void sigExtraDataChange(const QUuid &aId, const QString &strKey, const QString &strValue);
    101101    /** @} */
    102102
     
    149149      * @{ */
    150150        /** 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);
    152152        /** Notifies about task complete for progress with @a strProgressId. */
    153         void sigProgressTaskComplete(QString strProgressId);
     153        void sigProgressTaskComplete(const QUuid &aProgressId);
    154154    /** @} */
    155155
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r74553 r74878  
    519519}
    520520
    521 void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QString &strId) const
     521void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QUuid &aId) const
    522522{
    523523    error(0, MessageType_Error,
    524524          tr("There is no virtual machine with the identifier <b>%1</b>.")
    525              .arg(strId),
     525             .arg(aId.toString()),
    526526          UIErrorString::formatErrorInfo(vbox));
    527527}
     
    672672                    /* Check if that hard disk isn't shared.
    673673                     * If hard disk is shared, it will *never* be deleted: */
    674                     QVector<QString> usedMachineList = attachment.GetMedium().GetMachineIds();
     674                    QVector<QUuid> usedMachineList = attachment.GetMedium().GetMachineIds();
    675675                    if (usedMachineList.size() == 1)
    676676                    {
     
    10181018
    10191019void UIMessageCenter::cannotFindSnapshotById(const CMachine &comMachine,
    1020                                              const QString &strId,
     1020                                             const QUuid &aId,
    10211021                                             QWidget *pParent /* = 0 */) const
    10221022{
    10231023    error(pParent, MessageType_Error,
    10241024          tr("Can't find snapshot with ID=<b>%1</b>.")
    1025              .arg(strId),
     1025             .arg(aId.toString()),
    10261026          UIErrorString::formatErrorInfo(comMachine));
    10271027}
     
    12761276    QStringList usage;
    12771277    CVirtualBox vbox = vboxGlobal().virtualBox();
    1278     foreach (const QString &strMachineID, medium.curStateMachineIds())
     1278    foreach (const QUuid &uMachineID, medium.curStateMachineIds())
    12791279    {
    1280         CMachine machine = vbox.FindMachine(strMachineID);
     1280        CMachine machine = vbox.FindMachine(uMachineID.toString());
    12811281        if (!vbox.isOk() || machine.isNull())
    12821282            continue;
     
    27972797    if (!strAutoConfirmId.isEmpty())
    27982798    {
    2799         const QString 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);
    28012801        if (   confirmedMessageList.contains(strAutoConfirmId)
    28022802            || confirmedMessageList.contains("allMessageBoxes")
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r73953 r74878  
    251251    void cannotLoadLanguage(const QString &strLangFile) const;
    252252    void cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const;
    253     void cannotFindMachineById(const CVirtualBox &vbox, const QString &strId) const;
     253    void cannotFindMachineById(const CVirtualBox &vbox, const QUuid &aId) const;
    254254    void cannotOpenSession(const CSession &session) const;
    255255    void cannotOpenSession(const CMachine &machine) const;
     
    301301    void cannotChangeSnapshot(const CSnapshot &comSnapshot, const QString &strSnapshotName, const QString &strMachineName) const;
    302302    void cannotFindSnapshotByName(const CMachine &comMachine, const QString &strName, QWidget *pParent = 0) const;
    303     void cannotFindSnapshotById(const CMachine &comMachine, const QString &strId, QWidget *pParent = 0) const;
     303    void cannotFindSnapshotById(const CMachine &comMachine, const QUuid &aId, QWidget *pParent = 0) const;
    304304    void cannotAcquireSnapshotAttributes(const CSnapshot &comSnapshot, QWidget *pParent = 0);
    305305
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp

    r73385 r74878  
    4747
    4848    /** 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);
    5050    /** Notifies about data change event for the machine with @a strId. */
    51     void sigMachineDataChange(QString strId);
     51    void sigMachineDataChange(const QUuid &aId);
    5252    /** 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);
    5454    /** 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);
    5656    /** 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);
    5858    /** 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);
    6060    /** 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);
    6262    /** 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);
    6464
    6565public:
     
    185185            this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    186186            Qt::DirectConnection);
    187     connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineStateChange(QString, KMachineState)),
    188             this, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    189             Qt::DirectConnection);
    190     connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineDataChange(QString)),
    191             this, SIGNAL(sigMachineDataChange(QString)),
    192             Qt::DirectConnection);
    193     connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineRegistered(QString, bool)),
    194             this, SIGNAL(sigMachineRegistered(QString, bool)),
    195             Qt::DirectConnection);
    196     connect(m_pQtListener->getWrapped(), SIGNAL(sigSessionStateChange(QString, KSessionState)),
    197             this, SIGNAL(sigSessionStateChange(QString, KSessionState)),
    198             Qt::DirectConnection);
    199     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotTake(QString, QString)),
    200             this, SIGNAL(sigSnapshotTake(QString, QString)),
    201             Qt::DirectConnection);
    202     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotDelete(QString, QString)),
    203             this, SIGNAL(sigSnapshotDelete(QString, QString)),
    204             Qt::DirectConnection);
    205     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotChange(QString, QString)),
    206             this, SIGNAL(sigSnapshotChange(QString, QString)),
    207             Qt::DirectConnection);
    208     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotRestore(QString, QString)),
    209             this, SIGNAL(sigSnapshotRestore(QString, 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)),
    210210            Qt::DirectConnection);
    211211}
     
    282282            this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    283283            Qt::QueuedConnection);
    284     connect(m_pProxy, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    285             this, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    286             Qt::QueuedConnection);
    287     connect(m_pProxy, SIGNAL(sigMachineDataChange(QString)),
    288             this, SIGNAL(sigMachineDataChange(QString)),
    289             Qt::QueuedConnection);
    290     connect(m_pProxy, SIGNAL(sigMachineRegistered(QString, bool)),
    291             this, SIGNAL(sigMachineRegistered(QString, bool)),
    292             Qt::QueuedConnection);
    293     connect(m_pProxy, SIGNAL(sigSessionStateChange(QString, KSessionState)),
    294             this, SIGNAL(sigSessionStateChange(QString, KSessionState)),
    295             Qt::QueuedConnection);
    296     connect(m_pProxy, SIGNAL(sigSnapshotTake(QString, QString)),
    297             this, SIGNAL(sigSnapshotTake(QString, QString)),
    298             Qt::QueuedConnection);
    299     connect(m_pProxy, SIGNAL(sigSnapshotDelete(QString, QString)),
    300             this, SIGNAL(sigSnapshotDelete(QString, QString)),
    301             Qt::QueuedConnection);
    302     connect(m_pProxy, SIGNAL(sigSnapshotChange(QString, QString)),
    303             this, SIGNAL(sigSnapshotChange(QString, QString)),
    304             Qt::QueuedConnection);
    305     connect(m_pProxy, SIGNAL(sigSnapshotRestore(QString, QString)),
    306             this, SIGNAL(sigSnapshotRestore(QString, 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)),
    307307            Qt::QueuedConnection);
    308308}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.h

    r73385 r74878  
    4343
    4444    /** 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);
    4646    /** Notifies about data change event for the machine with @a strId. */
    47     void sigMachineDataChange(QString strId);
     47    void sigMachineDataChange(const QUuid &aId);
    4848    /** 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);
    5050    /** 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);
    5252    /** 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);
    5454    /** 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);
    5656    /** 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);
    5858    /** 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);
    6060
    6161public:
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r74305 r74878  
    23622362}
    23632363
    2364 CSession VBoxGlobal::openSession(const QString &strId, KLockType lockType /* = KLockType_Shared */)
     2364CSession VBoxGlobal::openSession(const QUuid &aId, KLockType lockType /* = KLockType_Shared */)
    23652365{
    23662366    /* Prepare session: */
     
    23802380
    23812381        /* Search for the corresponding machine: */
    2382         CMachine comMachine = m_comVBox.FindMachine(strId);
     2382        CMachine comMachine = m_comVBox.FindMachine(aId.toString());
    23832383        if (comMachine.isNull())
    23842384        {
    2385             msgCenter().cannotFindMachineById(m_comVBox, strId);
     2385            msgCenter().cannotFindMachineById(m_comVBox, aId);
    23862386            break;
    23872387        }
     
    24862486}
    24872487
    2488 UIMedium VBoxGlobal::medium(const QString &strMediumID) const
     2488UIMedium VBoxGlobal::medium(const QUuid &aMediumID) const
    24892489{
    24902490    if (m_meCleanupProtectionToken.tryLockForRead())
     
    24932493        UIMedium guiMedium;
    24942494        if (m_pMediumEnumerator)
    2495             guiMedium = m_pMediumEnumerator->medium(strMediumID);
     2495            guiMedium = m_pMediumEnumerator->medium(aMediumID);
    24962496        m_meCleanupProtectionToken.unlock();
    24972497        return guiMedium;
     
    25002500}
    25012501
    2502 QList<QString> VBoxGlobal::mediumIDs() const
     2502QList<QUuid> VBoxGlobal::mediumIDs() const
    25032503{
    25042504    if (m_meCleanupProtectionToken.tryLockForRead())
    25052505    {
    25062506        /* Redirect call to medium-enumerator: */
    2507         QList<QString> listOfMedia;
     2507        QList<QUuid> listOfMedia;
    25082508        if (m_pMediumEnumerator)
    25092509            listOfMedia = m_pMediumEnumerator->mediumIDs();
     
    25112511        return listOfMedia;
    25122512    }
    2513     return QList<QString>();
     2513    return QList<QUuid>();
    25142514}
    25152515
     
    25252525}
    25262526
    2527 void VBoxGlobal::deleteMedium(const QString &strMediumID)
     2527void VBoxGlobal::deleteMedium(const QUuid &aMediumID)
    25282528{
    25292529    if (m_meCleanupProtectionToken.tryLockForRead())
     
    25312531        /* Delete medium from medium-enumerator: */
    25322532        if (m_pMediumEnumerator)
    2533             m_pMediumEnumerator->deleteMedium(strMediumID);
     2533            m_pMediumEnumerator->deleteMedium(aMediumID);
    25342534        m_meCleanupProtectionToken.unlock();
    25352535    }
    25362536}
    25372537
    2538 QString VBoxGlobal::openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent /* = 0 */)
     2538QUuid VBoxGlobal::openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent /* = 0 */)
    25392539{
    25402540    /* Convert to native separators: */
     
    25682568        msgCenter().cannotOpenMedium(comVBox, enmMediumType, strMediumLocation, pParent);
    25692569
    2570     return QString();
    2571 }
    2572 
    2573 QString VBoxGlobal::openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent,
     2570    return QUuid();
     2571}
     2572
     2573QUuid VBoxGlobal::openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent,
    25742574                                                 const QString &strDefaultFolder /* = QString() */,
    25752575                                                 bool fUseLastFolder /* = false */)
     
    26492649        return openMedium(enmMediumType, files[0], pParent);
    26502650
    2651     return QString();
    2652 }
    2653 
    2654 QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder)
     2651    return QUuid();
     2652}
     2653
     2654QUuid VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder)
    26552655{
    26562656    AssertReturn(!strFolder.isEmpty(), QString());
     
    26722672    /* Return if no result. */
    26732673    if (files.empty() || files[0].isEmpty())
    2674         return QString();
     2674        return QUuid();
    26752675
    26762676    /* Remember folder for the next time. */
     
    27212721
    27222722    /** @todo error message. */
    2723     return QString();
    2724 }
    2725 
    2726 QString VBoxGlobal::showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder)
     2723    return QUuid();
     2724}
     2725
     2726QUuid VBoxGlobal::showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder)
    27272727{
    27282728    UIFDCreationDialog *pDialog = new UIFDCreationDialog(pParent, strMachineName, strMachineFolder);
     
    27322732    }
    27332733    delete pDialog;
    2734     return QString();
     2734    return QUuid();
    27352735}
    27362736
     
    27442744                                                                                  storageSlot.device);
    27452745    const CMedium comCurrentMedium = comCurrentAttachment.GetMedium();
    2746     const QString strCurrentID = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetId();
     2746    const QUuid uCurrentID = comCurrentMedium.isNull() ? QUuid() : comCurrentMedium.GetId();
    27472747    const QString strCurrentLocation = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetLocation();
    27482748
     
    28182818            QAction *pActionChooseHostDrive = menu.addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName);
    28192819            pActionChooseHostDrive->setCheckable(true);
    2820             pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == strCurrentID);
     2820            pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == uCurrentID);
    28212821            pActionChooseHostDrive->setData(QVariant::fromValue(UIMediumTarget(strControllerName,
    28222822                                                                               comCurrentAttachment.GetPort(),
     
    28242824                                                                               enmMediumType,
    28252825                                                                               UIMediumTarget::UIMediumTargetType_WithID,
    2826                                                                                comMedium.GetId())));
     2826                                                                               comMedium.GetId().toString())));
    28272827        }
    28282828    }
     
    29082908    CMedium comMedium;
    29092909    /* With null ID (by default): */
    2910     QString strActualID;
     2910    QUuid uActualID;
    29112911
    29122912    /* Current mount-target attributes: */
     
    29152915    const CMediumAttachment comCurrentAttachment = comConstMachine.GetMediumAttachment(target.name, target.port, target.device);
    29162916    const CMedium comCurrentMedium = comCurrentAttachment.GetMedium();
    2917     const QString strCurrentID = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetId();
     2917    const QUuid uCurrentID = comCurrentMedium.isNull() ? QUuid() : comCurrentMedium.GetId();
    29182918    const QString strCurrentLocation = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetLocation();
    29192919
     
    29272927        {
    29282928            /* New mount-target attributes: */
    2929             QString strNewID;
     2929            QUuid uNewID;
    29302930
    29312931            /* Invoke file-open dialog to choose medium ID: */
     
    29432943                /* Call for file-open dialog: */
    29442944                const QString strMachineFolder(QFileInfo(comConstMachine.GetSettingsFilePath()).absolutePath());
    2945                 QString strMediumID;
     2945                QUuid uMediumID;
    29462946                if (target.type == UIMediumTarget::UIMediumTargetType_WithID)
    2947                     strMediumID = openMediumWithFileOpenDialog(target.mediumType, windowManager().mainWindowShown(), strMachineFolder);
     2947                    uMediumID = openMediumWithFileOpenDialog(target.mediumType, windowManager().mainWindowShown(), strMachineFolder);
    29482948                else if(target.type == UIMediumTarget::UIMediumTargetType_CreateAdHocVISO)
    2949                     strMediumID = createVisoMediumWithFileOpenDialog(windowManager().mainWindowShown(), strMachineFolder);
     2949                    uMediumID = createVisoMediumWithFileOpenDialog(windowManager().mainWindowShown(), strMachineFolder);
    29502950                else if(target.type == UIMediumTarget::UIMediumTargetType_CreateFloppyDisk)
    2951                     strMediumID = showCreateFloppyDiskDialog(windowManager().mainWindowShown(), comConstMachine.GetName(), strMachineFolder);
     2951                    uMediumID = showCreateFloppyDiskDialog(windowManager().mainWindowShown(), comConstMachine.GetName(), strMachineFolder);
    29522952
    29532953                /* Return focus back: */
     
    29552955                    pLastFocusedWidget->setFocus();
    29562956                /* Accept new medium ID: */
    2957                 if (!strMediumID.isNull())
    2958                     strNewID = strMediumID;
     2957                if (!uMediumID.isNull())
     2958                    uNewID = uMediumID;
    29592959                /* Else just exit: */
    29602960                else return;
    29612961            }
    29622962            /* 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;
    29652965
    29662966            /* Should we mount or unmount? */
    2967             fMount = !strNewID.isEmpty();
     2967            fMount = !uNewID.isNull();
    29682968
    29692969            /* Prepare target medium: */
    2970             const UIMedium guiMedium = medium(strNewID);
     2970            const UIMedium guiMedium = medium(uNewID);
    29712971            comMedium = guiMedium.medium();
    2972             strActualID = fMount ? strNewID : strCurrentID;
     2972            uActualID = fMount ? uNewID : uCurrentID;
    29732973            break;
    29742974        }
     
    29772977        {
    29782978            /* Open medium by location and get new medium ID if any: */
    2979             const QString strNewID = openMedium(target.mediumType, target.data);
     2979            const QUuid uNewID = openMedium(target.mediumType, target.data);
    29802980            /* Else just exit: */
    2981             if (strNewID.isEmpty())
     2981            if (uNewID.isNull())
    29822982                return;
    29832983
    29842984            /* Should we mount or unmount? */
    2985             fMount = strNewID != strCurrentID;
     2985            fMount = uNewID != uCurrentID;
    29862986
    29872987            /* Prepare target medium: */
    2988             const UIMedium guiMedium = fMount ? medium(strNewID) : UIMedium();
     2988            const UIMedium guiMedium = fMount ? medium(uNewID) : UIMedium();
    29892989            comMedium = fMount ? guiMedium.medium() : CMedium();
    2990             strActualID = fMount ? strNewID : strCurrentID;
     2990            uActualID = fMount ? uNewID : uCurrentID;
    29912991            break;
    29922992        }
     
    30503050        {
    30513051            /* Ask for force remounting: */
    3052             if (msgCenter().cannotRemountMedium(comMachine, medium(strActualID),
     3052            if (msgCenter().cannotRemountMedium(comMachine, medium(uActualID),
    30533053                                                fMount, true /* retry? */))
    30543054            {
     
    30573057                fWasMounted = comMachine.isOk();
    30583058                if (!fWasMounted)
    3059                     msgCenter().cannotRemountMedium(comMachine, medium(strActualID),
     3059                    msgCenter().cannotRemountMedium(comMachine, medium(uActualID),
    30603060                                                    fMount, false /* retry? */);
    30613061            }
     
    30863086{
    30873087    /* Search for corresponding UI medium: */
    3088     const QString 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);
    30903090    if (!comMedium.isNull() && guiMedium.isNull())
    30913091    {
     
    30943094
    30953095        /* Search for corresponding UI medium again: */
    3096         guiMedium = medium(strMediumID);
     3096        guiMedium = medium(uMediumID);
    30973097        if (guiMedium.isNull())
    30983098        {
     
    41494149        m_comVBox.SetSettingsSecret(m_astrSettingsPw);
    41504150
    4151     if (visualStateType != UIVisualStateType_Invalid && !m_strManagedVMId.isEmpty())
     4151    if (visualStateType != UIVisualStateType_Invalid && !m_strManagedVMId.isNull())
    41524152        gEDataManager->setRequestedVisualState(visualStateType, m_strManagedVMId);
    41534153
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r74743 r74878  
    9191     * @{ */
    9292        /** Notifies listeners about medium with certain @a strMediumID created. */
    93         void sigMediumCreated(const QString &strMediumID);
     93        void sigMediumCreated(const QUuid &aMediumID);
    9494        /** Notifies listeners about medium with certain @a strMediumID deleted. */
    95         void sigMediumDeleted(const QString &strMediumID);
     95        void sigMediumDeleted(const QUuid &aMediumID);
    9696
    9797        /** Notifies listeners about medium enumeration started. */
    9898        void sigMediumEnumerationStarted();
    9999        /** Notifies listeners about medium with certain @a strMediumID enumerated. */
    100         void sigMediumEnumerated(const QString &strMediumID);
     100        void sigMediumEnumerated(const QUuid &aMediumID);
    101101        /** Notifies listeners about medium enumeration finished. */
    102102        void sigMediumEnumerationFinished();
     
    211211
    212212        /** Returns the --startvm option value (managed VM id). */
    213         QString managedVMUuid() const { return m_strManagedVMId; }
     213        QUuid managedVMUuid() const { return m_strManagedVMId; }
    214214        /** Returns whether this is VM console process. */
    215215        bool isVMConsoleProcess() const { return !m_strManagedVMId.isNull(); }
     
    228228
    229229        /** Returns the --fda option value (whether we have floppy image). */
    230         bool hasFloppyImageToMount() const { return !m_strFloppyImage.isEmpty(); }
     230        bool hasFloppyImageToMount() const { return !m_strFloppyImage.isNull(); }
    231231        /** Returns the --dvd | --cdrom option value (whether we have DVD image). */
    232         bool hasDvdImageToMount() const { return !m_strDvdImage.isEmpty(); }
     232        bool hasDvdImageToMount() const { return !m_strDvdImage.isNull(); }
    233233        /** Returns floppy image name. */
    234         QString const &getFloppyImage() const { return m_strFloppyImage; }
     234        QUuid const &getFloppyImage() const { return m_strFloppyImage; }
    235235        /** Returns DVD image name. */
    236         QString const &getDvdImage() const { return m_strDvdImage; }
     236        QUuid const &getDvdImage() const { return m_strDvdImage; }
    237237
    238238        /** Returns the --disable-patm option value. */
     
    474474
    475475        /** Opens session of certain @a enmLockType for VM with certain @a strId. */
    476         CSession openSession(const QString &strId, KLockType enmLockType = KLockType_Write);
     476        CSession openSession(const QUuid &aId, KLockType enmLockType = KLockType_Write);
    477477        /** Opens session of KLockType_Shared type for VM with certain @a strId. */
    478         CSession openExistingSession(const QString &strId) { return openSession(strId, KLockType_Shared); }
     478        CSession openExistingSession(const QUuid &aId) { return openSession(aId, KLockType_Shared); }
    479479    /** @} */
    480480
     
    488488        bool isMediumEnumerationInProgress() const;
    489489        /** Returns enumerated medium with certain @a strMediumID. */
    490         UIMedium medium(const QString &strMediumID) const;
     490        UIMedium medium(const QUuid &aMediumID) const;
    491491        /** Returns enumerated medium IDs. */
    492         QList<QString> mediumIDs() const;
     492        QList<QUuid> mediumIDs() const;
    493493        /** Creates medium on the basis of passed @a guiMedium description. */
    494494        void createMedium(const UIMedium &guiMedium);
    495495        /** Deletes medium with certain @a strMediumID. */
    496         void deleteMedium(const QString &strMediumID);
     496        void deleteMedium(const QUuid &aMediumID);
    497497
    498498        /** Opens external medium by passed @a strMediumLocation.
     
    501501          * @param  strMediumLocation  Brings the file path to load medium from.
    502502          * @param  pParent            Brings the dialog parent. */
    503         QString openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent = 0);
     503        QUuid openMedium(UIMediumDeviceType enmMediumType, QString strMediumLocation, QWidget *pParent = 0);
    504504
    505505        /** Opens external medium using file-open dialog.
     
    508508          * @param  strDefaultFolder  Brings the folder to browse for medium.
    509509          * @param  fUseLastFolder    Brings whether we should propose to use last used folder. */
    510         QString openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent = 0,
     510        QUuid openMediumWithFileOpenDialog(UIMediumDeviceType enmMediumType, QWidget *pParent = 0,
    511511                                             const QString &strDefaultFolder = QString(), bool fUseLastFolder = true);
    512512
     
    514514          * @param  pParent    Brings the dialog parent.
    515515          * @param  strFolder  Brings the folder to browse for VISO file contents. */
    516         QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder);
     516        QUuid createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder);
    517517
    518518        /** Creates and shows a dialog thru which user can create a new floppy disk a VISO using the file-open dialog.
     
    521521          * @param  strMachineFolder  Passes the machine folder,
    522522          * returns the ID of the newly created medium if successful, an empty string otherwise.*/
    523         QString showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder);
     523        QUuid showCreateFloppyDiskDialog(QWidget *pParent, const QString &strMachineName, const QString &strMachineFolder);
    524524
    525525        /** Prepares storage menu according passed parameters.
     
    763763
    764764        /** Holds the --startvm option value (managed VM id). */
    765         QString  m_strManagedVMId;
     765        QUuid  m_strManagedVMId;
    766766        /** Holds the --separate option value (whether GUI process is separate from VM process). */
    767767        bool     m_fSeparateProcess;
     
    776776
    777777        /** Holds the --fda option value (floppy image). */
    778         QString  m_strFloppyImage;
     778        QUuid  m_strFloppyImage;
    779779        /** Holds the --dvd | --cdrom option value (DVD image). */
    780         QString  m_strDvdImage;
     780        QUuid  m_strDvdImage;
    781781
    782782        /** Holds the --disable-patm option value. */
  • trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp

    r73783 r74878  
    461461            strNetworkName = comInterface.GetNetworkName();
    462462        /* Get interface id for further activities: */
    463         QString strInterfaceId;
     463        QUuid uInterfaceId;
    464464        if (comInterface.isOk())
    465             strInterfaceId = comInterface.GetId();
     465            uInterfaceId = comInterface.GetId();
    466466
    467467        /* Show error message if necessary: */
     
    486486
    487487            /* Remove interface finally: */
    488             CProgress progress = comHost.RemoveHostOnlyNetworkInterface(strInterfaceId);
     488            CProgress progress = comHost.RemoveHostOnlyNetworkInterface(uInterfaceId);
    489489
    490490            /* Show error message if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h

    r74557 r74878  
    5252    void sigToggleFinished();
    5353    /** Redirects signal from UIDetails to UIVirtualBoxManager. */
    54     void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     54    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    5555
    5656public:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r74870 r74878  
    295295    /* Look for at least one inaccessible medium: */
    296296    bool fIsThereAnyInaccessibleMedium = false;
    297     foreach (const QString &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)
    300300        {
    301301            fIsThereAnyInaccessibleMedium = true;
     
    383383}
    384384
    385 void UIVirtualBoxManager::sltHandleStateChange(const QString &)
     385void UIVirtualBoxManager::sltHandleStateChange(const QUuid &)
    386386{
    387387    updateActionsAppearance();
     
    598598
    599599    /* Make sure this machine was NOT registered already: */
    600     CMachine comMachineOld = comVBox.FindMachine(comMachineNew.GetId());
     600    CMachine comMachineOld = comVBox.FindMachine(comMachineNew.GetId().toString());
    601601    if (!comMachineOld.isNull())
    602602    {
     
    611611void UIVirtualBoxManager::sltOpenMachineSettingsDialog(QString strCategory /* = QString() */,
    612612                                                       QString strControl /* = QString() */,
    613                                                        const QString &strID /* = QString() */)
     613                                                       const QUuid &aID /* = QString() */)
    614614{
    615615    /* Get current item: */
     
    644644        /* Create and execute corresponding VM settings window: */
    645645        QPointer<UISettingsDialogMachine> pDlg = new UISettingsDialogMachine(this,
    646                                                                              QUuid(strID).isNull() ? pItem->id() : strID,
     646                                                                             aID.isNull() ? pItem->id() : aID,
    647647                                                                             strCategory, strControl);
    648648        pDlg->execute();
     
    10661066        QIManagerDialog *pLogViewerDialog = 0;
    10671067        /* Create and Show VM Log Viewer: */
    1068         if (!m_logViewers[pItem->machine().GetHardwareUUID()])
     1068        if (!m_logViewers[pItem->machine().GetHardwareUUID().toString()])
    10691069        {
    10701070            UIVMLogViewerDialogFactory dialogFactory(actionPool(), pItem->machine());
     
    10721072            if (pLogViewerDialog)
    10731073            {
    1074                 m_logViewers[pItem->machine().GetHardwareUUID()] = pLogViewerDialog;
     1074                m_logViewers[pItem->machine().GetHardwareUUID().toString()] = pLogViewerDialog;
    10751075                connect(pLogViewerDialog, &QIManagerDialog::sigClose,
    10761076                        this, &UIVirtualBoxManager::sltCloseLogViewerWindow);
     
    10791079        else
    10801080        {
    1081             pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID()];
     1081            pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID().toString()];
    10821082        }
    10831083        if (pLogViewerDialog)
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r74868 r74878  
    120120      * @{ */
    121121        /** Handles CVirtualBox event about state change for machine with @a strID. */
    122         void sltHandleStateChange(const QString &strID);
     122        void sltHandleStateChange(const QUuid &aID);
    123123    /** @} */
    124124
     
    177177        void sltOpenMachineSettingsDialog(QString strCategory = QString(),
    178178                                          QString strControl = QString(),
    179                                           const QString &strID = QString());
     179                                          const QUuid &aID = QUuid());
    180180        /** Handles call to open Machine Settings dialog the default way. */
    181181        void sltOpenMachineSettingsDialogDefault() { sltOpenMachineSettingsDialog(); }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r74560 r74878  
    5252
    5353    /** Notifies aboud Details-pane link clicked. */
    54     void sigMachineSettingsLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     54    void sigMachineSettingsLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    5555
    5656    /** Notifies about Tool type change. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.cpp

    r74311 r74878  
    120120    bool needsResort = true;
    121121
    122     m_strId = m_machine.GetId();
     122    m_uId = m_machine.GetId();
    123123    m_strSettingsFile = m_machine.GetSettingsFilePath();
    124124
     
    158158        /* Also take restrictions into account: */
    159159        if (   m_configurationAccessLevel != ConfigurationAccessLevel_Null
    160             && !gEDataManager->machineReconfigurationEnabled(m_strId))
     160            && !gEDataManager->machineReconfigurationEnabled(m_uId))
    161161            m_configurationAccessLevel = ConfigurationAccessLevel_Null;
    162162
    163163        /* Should we show details for this item? */
    164         m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_strId);
     164        m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_uId);
    165165    }
    166166    else
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.h

    r73424 r74878  
    4747    QPixmap osPixmap(QSize *pLogicalSize = 0) const;
    4848    QString osTypeId() const { return m_strOSTypeId; }
    49     QString id() const { return m_strId; }
     49    QUuid id() const { return m_uId; }
    5050
    5151    QString machineStateName() const;
     
    9393
    9494    /* Cached machine data (to minimize server requests) */
    95     QString m_strId;
     95    QUuid   m_uId;
    9696    QString m_strSettingsFile;
    9797
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h

    r74482 r74878  
    2323#include <QRectF>
    2424#include <QString>
     25#include <QUuid>
    2526
    2627/* GUI includes: */
     
    174175
    175176        /** Updates all children items with specified @a strId. */
    176         virtual void updateAllItems(const QString &strId) = 0;
     177        virtual void updateAllItems(const QUuid &aId) = 0;
    177178        /** Removes all children items with specified @a strId. */
    178         virtual void removeAllItems(const QString &strId) = 0;
     179        virtual void removeAllItems(const QUuid &aId) = 0;
    179180
    180181        /** 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  
    276276}
    277277
    278 void UIChooserItemGlobal::updateAllItems(const QString &)
     278void UIChooserItemGlobal::updateAllItems(const QUuid &)
    279279{
    280280    /* Update this global-item: */
     
    287287}
    288288
    289 void UIChooserItemGlobal::removeAllItems(const QString &)
     289void UIChooserItemGlobal::removeAllItems(const QUuid &)
    290290{
    291291    // Just do nothing ..
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.h

    r74596 r74878  
    116116
    117117        /** Updates all children items with specified @a strId. */
    118         virtual void updateAllItems(const QString &strId) /* override */;
     118        virtual void updateAllItems(const QUuid &aId) /* override */;
    119119        /** Removes all children items with specified @a strId. */
    120         virtual void removeAllItems(const QString &strId) /* override */;
     120        virtual void removeAllItems(const QUuid &aId) /* override */;
    121121
    122122        /** 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  
    657657}
    658658
    659 void UIChooserItemGroup::updateAllItems(const QString &strId)
     659void UIChooserItemGroup::updateAllItems(const QUuid &aId)
    660660{
    661661    /* Update all the required items recursively: */
    662662    foreach (UIChooserItem *pItem, items())
    663         pItem->updateAllItems(strId);
    664 }
    665 
    666 void UIChooserItemGroup::removeAllItems(const QString &strId)
     663        pItem->updateAllItems(aId);
     664}
     665
     666void UIChooserItemGroup::removeAllItems(const QUuid &aId)
    667667{
    668668    /* Remove all the required items recursively: */
    669669    foreach (UIChooserItem *pItem, items())
    670         pItem->removeAllItems(strId);
     670        pItem->removeAllItems(aId);
    671671}
    672672
     
    13191319}
    13201320
    1321 bool UIChooserItemGroup::isContainsMachine(const QString &strId) const
     1321bool UIChooserItemGroup::isContainsMachine(const QUuid &aId) const
    13221322{
    13231323    /* Check each machine-item: */
    13241324    foreach (UIChooserItem *pItem, m_machineItems)
    1325         if (pItem->toMachineItem()->id() == strId)
     1325        if (pItem->toMachineItem()->id() == aId)
    13261326            return true;
    13271327    /* Found nothing? */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r74717 r74878  
    162162
    163163        /** Updates all children items with specified @a strId. */
    164         virtual void updateAllItems(const QString &strId) /* override */;
     164        virtual void updateAllItems(const QUuid &aId) /* override */;
    165165        /** Removes all children items with specified @a strId. */
    166         virtual void removeAllItems(const QString &strId) /* override */;
     166        virtual void removeAllItems(const QUuid &aId) /* override */;
    167167
    168168        /** Searches for a first child item answering to specified @a strSearchTag and @a iItemSearchFlags. */
     
    281281      * @{ */
    282282        /** Returns whether group contains machine with @a strId. */
    283         bool isContainsMachine(const QString &strId) const;
     283        bool isContainsMachine(const QUuid &aId) const;
    284284        /** Returns whether group contains locked machine. */
    285285        bool isContainsLockedMachine();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r74598 r74878  
    346346}
    347347
    348 void UIChooserItemMachine::updateAllItems(const QString &strId)
     348void UIChooserItemMachine::updateAllItems(const QUuid &aId)
    349349{
    350350    /* Skip other ids: */
    351     if (id() != strId)
     351    if (id() != QUuid(aId))
    352352        return;
    353353
     
    365365}
    366366
    367 void UIChooserItemMachine::removeAllItems(const QString &strId)
     367void UIChooserItemMachine::removeAllItems(const QUuid &aId)
    368368{
    369369    /* Skip wrong id: */
    370     if (id() != strId)
     370    if (id() != QUuid(aId))
    371371        return;
    372372
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h

    r74598 r74878  
    1919#define ___UIChooserItemMachine_h___
    2020
     21/* Qt includes */
     22#include <QUuid>
     23
    2124/* GUI includes: */
    2225#include "UIVirtualMachineItem.h"
     
    129132
    130133        /** Updates all children items with specified @a strId. */
    131         virtual void updateAllItems(const QString &strId) /* override */;
     134        virtual void updateAllItems(const QUuid &aId) /* override */;
    132135        /** Removes all children items with specified @a strId. */
    133         virtual void removeAllItems(const QString &strId) /* override */;
     136        virtual void removeAllItems(const QUuid &aId) /* override */;
    134137
    135138        /** 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  
    749749}
    750750
    751 void UIChooserModel::sltMachineStateChanged(QString strId, KMachineState)
     751void UIChooserModel::sltMachineStateChanged(const QUuid &aId, const KMachineState)
    752752{
    753753    /* Update machine-items with passed id: */
    754     mainRoot()->updateAllItems(strId);
    755 }
    756 
    757 void UIChooserModel::sltMachineDataChanged(QString strId)
     754    mainRoot()->updateAllItems(aId);
     755}
     756
     757void UIChooserModel::sltMachineDataChanged(const QUuid &aId)
    758758{
    759759    /* 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
     763void UIChooserModel::sltMachineRegistered(const QUuid &aId, const bool fRegistered)
    764764{
    765765    /* New VM registered? */
     
    767767    {
    768768        /* Search for corresponding machine: */
    769         CMachine comMachine = vboxGlobal().virtualBox().FindMachine(strId);
     769        CMachine comMachine = vboxGlobal().virtualBox().FindMachine(aId.toString());
    770770        /* Should we show this machine? */
    771         if (gEDataManager->showMachineInSelectorChooser(strId))
     771        if (gEDataManager->showMachineInSelectorChooser(aId))
    772772        {
    773773            /* Add new machine-item: */
     
    777777            updateLayout();
    778778            /* Change current-item only if VM was created from the GUI side: */
    779             if (strId == m_strLastCreatedMachineId)
     779            if (aId == m_uLastCreatedMachineId)
    780780            {
    781781                setCurrentItem(mainRoot()->searchForItem(comMachine.GetName(),
     
    789789    {
    790790        /* Remove machine-items with passed id: */
    791         mainRoot()->removeAllItems(strId);
     791        mainRoot()->removeAllItems(aId.toString());
    792792        /* Update model: */
    793793        cleanupGroupTree();
     
    805805}
    806806
    807 void UIChooserModel::sltSessionStateChanged(QString strId, KSessionState)
     807void UIChooserModel::sltSessionStateChanged(const QUuid &aId, const KSessionState)
    808808{
    809809    /* 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
     813void UIChooserModel::sltSnapshotChanged(const QUuid &aId, const QUuid &)
    814814{
    815815    /* Update machine-items with passed id: */
    816     mainRoot()->updateAllItems(strId);
     816    mainRoot()->updateAllItems(aId);
    817817}
    818818
     
    10011001     * on success for current-item handling: */
    10021002    if (pWizard->exec() == QDialog::Accepted)
    1003         m_strLastCreatedMachineId = pWizard->createdMachineId();
     1003        m_uLastCreatedMachineId = pWizard->createdMachineId();
    10041004
    10051005    if (pWizard)
     
    10631063}
    10641064
    1065 void UIChooserModel::sltReloadMachine(const QString &strId)
     1065void UIChooserModel::sltReloadMachine(const QUuid &aId)
    10661066{
    10671067    /* Remove all the items first: */
    1068     mainRoot()->removeAllItems(strId);
     1068    mainRoot()->removeAllItems(aId);
    10691069    /* Wipe out empty groups: */
    10701070    cleanupGroupTree();
    10711071
    10721072    /* 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))
    10751075        addMachineIntoTheTree(comMachine);
    10761076
     
    11561156
    11571157    /* Prepare arrays: */
    1158     QMap<QString, bool> verdicts;
     1158    QMap<QUuid, bool> verdicts;
    11591159    QList<UIChooserItem*> itemsToRemove;
    1160     QStringList machinesToUnregister;
     1160    QList<QUuid> machinesToUnregister;
    11611161
    11621162    /* For each selected machine-item: */
     
    11641164    {
    11651165        /* Get machine-item id: */
    1166         QString strId = pItem->toMachineItem()->id();
     1166        QUuid uId = pItem->toMachineItem()->id();
    11671167
    11681168        /* We already decided for that machine? */
    1169         if (verdicts.contains(strId))
     1169        if (verdicts.contains(uId))
    11701170        {
    11711171            /* To remove similar machine items? */
    1172             if (!verdicts[strId])
     1172            if (!verdicts[uId])
    11731173                itemsToRemove << pItem;
    11741174            continue;
     
    11781178        int iSelectedCopyCount = 0;
    11791179        foreach (UIChooserItem *pSelectedItem, selectedMachineItemList)
    1180             if (pSelectedItem->toMachineItem()->id() == strId)
     1180            if (pSelectedItem->toMachineItem()->id() == uId)
    11811181                ++iSelectedCopyCount;
    11821182        /* Existing copy count: */
    11831183        int iExistingCopyCount = 0;
    11841184        foreach (UIChooserItem *pExistingItem, existingMachineItemList)
    1185             if (pExistingItem->toMachineItem()->id() == strId)
     1185            if (pExistingItem->toMachineItem()->id() == uId)
    11861186                ++iExistingCopyCount;
    11871187        /* If selected copy count equal to existing copy count,
     
    11891189         * we will just propose to remove selected items: */
    11901190        bool fVerdict = iSelectedCopyCount == iExistingCopyCount;
    1191         verdicts.insert(strId, fVerdict);
     1191        verdicts.insert(uId, fVerdict);
    11921192        if (fVerdict)
    1193             machinesToUnregister << strId;
     1193            machinesToUnregister.append(uId);
    11941194        else
    11951195            itemsToRemove << pItem;
     
    14401440
    14411441    /* Setup global connections: */
    1442     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    1443             this, SLOT(sltMachineStateChanged(QString, KMachineState)));
    1444     connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
    1445             this, SLOT(sltMachineDataChanged(QString)));
    1446     connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),
    1447             this, SLOT(sltMachineRegistered(QString, bool)));
    1448     connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)),
    1449             this, SLOT(sltSessionStateChanged(QString, KSessionState)));
    1450     connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QString, QString)),
    1451             this, SLOT(sltSnapshotChanged(QString, QString)));
    1452     connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QString, QString)),
    1453             this, SLOT(sltSnapshotChanged(QString, QString)));
    1454     connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)),
    1455             this, SLOT(sltSnapshotChanged(QString, QString)));
    1456     connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QString, QString)),
    1457             this, SLOT(sltSnapshotChanged(QString, 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)));
    14581458
    14591459    /* Setup action connections: */
     
    17541754    foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines())
    17551755    {
    1756         const QString strMachineID = machine.GetId();
    1757         if (!strMachineID.isEmpty() && gEDataManager->showMachineInSelectorChooser(strMachineID))
     1756        const QUuid uMachineID = machine.GetId();
     1757        if (!uMachineID.isNull() && gEDataManager->showMachineInSelectorChooser(uMachineID))
    17581758            addMachineIntoTheTree(machine);
    17591759    }
     
    17691769
    17701770    /* Which VM we are loading: */
    1771     LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toUtf8().constData()));
     1771    LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toString().toUtf8().constData()));
    17721772    /* Is that machine accessible? */
    17731773    if (machine.GetAccessible())
     
    17931793        }
    17941794        /* Update group definitions: */
    1795         m_groups[machine.GetId()] = groupList;
     1795        m_groups[machine.GetId().toString()] = groupList;
    17961796    }
    17971797    /* Inaccessible machine: */
     
    17991799    {
    18001800        /* VM is accessible: */
    1801         LogRelFlow(("UIChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toUtf8().constData()));
     1801        LogRelFlow(("UIChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toString().toUtf8().constData()));
    18021802        /* Create machine-item with main-root group-item as parent: */
    18031803        createMachineItem(machine, mainRoot());
     
    19111911            /* Which position should be current item placed by definitions? */
    19121912            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() :
    19141914                                        QString();
    19151915            AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!"));
     
    19781978{
    19791979    /* 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()));
    19811981}
    19821982
     
    20112011}
    20122012
    2013 void UIChooserModel::unregisterMachines(const QStringList &ids)
     2013void UIChooserModel::unregisterMachines(const QList<QUuid> &ids)
    20142014{
    20152015    /* Populate machine list: */
    20162016    QList<CMachine> machines;
    20172017    CVirtualBox vbox = vboxGlobal().virtualBox();
    2018     foreach (const QString &strId, ids)
    2019     {
    2020         CMachine machine = vbox.FindMachine(strId);
     2018    foreach (const QUuid &uId, ids)
     2019    {
     2020        CMachine machine = vbox.FindMachine(uId.toString());
    20212021        if (!machine.isNull())
    20222022            machines << machine;
     
    21292129    UIThreadGroupDefinitionSave::prepare();
    21302130    emit sigGroupSavingStateChanged();
    2131     connect(UIThreadGroupDefinitionSave::instance(), SIGNAL(sigReload(QString)),
    2132             this, SLOT(sltReloadMachine(QString)));
     2131    connect(UIThreadGroupDefinitionSave::instance(), SIGNAL(sigReload(QUuid)),
     2132            this, SLOT(sltReloadMachine(QUuid)));
    21332133    UIThreadGroupDefinitionSave::instance()->configure(this, m_groups, groups);
    21342134    UIThreadGroupDefinitionSave::instance()->start();
     
    21602160        if (UIChooserItemMachine *pMachineItem = pItem->toMachineItem())
    21612161            if (pMachineItem->accessible())
    2162                 definitions[pMachineItem->id()] << pParentGroup->fullName();
     2162                definitions[pMachineItem->id().toString()] << pParentGroup->fullName();
    21632163    /* Iterate over all the group-items: */
    21642164    foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Group))
     
    21802180    /* Iterate over all the machine-items: */
    21812181    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());
    21832183}
    21842184
     
    22842284        {
    22852285            /* 1. Open session: */
    2286             session = vboxGlobal().openSession(strId);
     2286            session = vboxGlobal().openSession(QUuid(strId));
    22872287            if (session.isNull())
    22882288                break;
     
    23122312        /* Cleanup if necessary: */
    23132313        if (machine.isNull() || !machine.isOk())
    2314             emit sigReload(strId);
     2314            emit sigReload(QUuid(strId));
    23152315        if (!session.isNull())
    23162316            session.UnlockMachine();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r74586 r74878  
    2525#include <QThread>
    2626#include <QTransform>
     27#include <QUuid>
    2728
    2829/* GUI includes: */
     
    266267      * @{ */
    267268        /** 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);
    269270        /** Handles machine data change for machine with certain @a strId. */
    270         void sltMachineDataChanged(QString strId);
     271        void sltMachineDataChanged(const QUuid &aId);
    271272        /** 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);
    273274        /** 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);
    275276        /** 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);
    277278    /** @} */
    278279
     
    304305        void sltGroupSelectedMachines();
    305306        /** Handles reload machine with certain @a strId request. */
    306         void sltReloadMachine(const QString &strId);
     307        void sltReloadMachine(const QUuid &aId);
    307308        /** Handles sort parent group request. */
    308309        void sltSortParentGroup();
     
    431432        void removeItems(const QList<UIChooserItem*> &items);
    432433        /** Unregisters virtual machines using list of @a ids. */
    433         void unregisterMachines(const QStringList &ids);
     434        void unregisterMachines(const QList<QUuid> &ids);
    434435
    435436        /** Processes drag move @a pEvent. */
     
    514515
    515516        /** Holds the Id of last VM created from the GUI side. */
    516         QString  m_strLastCreatedMachineId;
     517        QUuid  m_uLastCreatedMachineId;
    517518    /** @} */
    518519
     
    533534
    534535    /** Notifies about machine with certain @a strId to be reloaded. */
    535     void sigReload(QString strId);
     536    void sigReload(const QUuid &aId);
    536537
    537538    /** Notifies about task is complete. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h

    r74679 r74878  
    4141    void sigLinkClicked(const QString &strCategory,
    4242                        const QString &strControl,
    43                         const QString &strId);
     43                        const QUuid &aId);
    4444
    4545    /** Notifies listeners about sliding started. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp

    r74689 r74878  
    533533    connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)),
    534534            model(), SLOT(sltToggleElements(DetailsElementType, bool)));
    535     connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)),
    536             model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)));
     535    connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid &)),
     536            model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid &)));
    537537}
    538538
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h

    r74689 r74878  
    6464          * @param  strControl   Brings the wanted settings control.
    6565          * @param  strId        Brings the ID. */
    66         void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     66        void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &strId);
    6767    /** @} */
    6868
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp

    r74718 r74878  
    7979
    8080    /* Generate new group-id: */
    81     m_strGroupId = QUuid::createUuid().toString();
     81    m_uGroupId = QUuid::createUuid();
    8282
    8383    /* Request to build first step: */
    84     emit sigBuildStep(m_strGroupId, 0);
     84    emit sigBuildStep(m_uGroupId, 0);
    8585}
    8686
     
    8888{
    8989    /* Generate new group-id: */
    90     m_strGroupId = QUuid::createUuid().toString();
     90    m_uGroupId = QUuid::createUuid();
    9191}
    9292
     
    172172}
    173173
    174 void UIDetailsGroup::sltBuildStep(QString strStepId, int iStepNumber)
     174void UIDetailsGroup::sltBuildStep(const QUuid &aStepId, int iStepNumber)
    175175{
    176176    /* Cleanup build-step: */
     
    179179
    180180    /* Is step id valid? */
    181     if (strStepId != m_strGroupId)
     181    if (aStepId != m_uGroupId)
    182182        return;
    183183
     
    194194
    195195        /* Create next build-step: */
    196         m_pBuildStep = new UIPrepareStep(this, pSet, strStepId, iStepNumber + 1);
     196        m_pBuildStep = new UIPrepareStep(this, pSet, aStepId, iStepNumber + 1);
    197197
    198198        /* Build set: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h

    r74690 r74878  
    8686          * @param  iStepNumber  Brings the step number. */
    8787    /** @} */
    88     virtual void sltBuildStep(QString strStepId, int iStepNumber) /* override */;
     88    virtual void sltBuildStep(const QUuid &aStepId, int iStepNumber) /* override */;
    8989
    9090protected:
     
    143143        UIPrepareStep *m_pBuildStep;
    144144        /** Holds the generated group ID. */
    145         QString        m_strGroupId;
     145        QUuid          m_uGroupId;
    146146    /** @} */
    147147
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.cpp

    r74082 r74878  
    271271}
    272272
    273 void UIDetailsItem::sltBuildStep(QString, int)
     273void UIDetailsItem::sltBuildStep(const QUuid &, int)
    274274{
    275275    AssertMsgFailed(("This item doesn't support building!"));
     
    281281*********************************************************************************************************************************/
    282282
    283 UIPrepareStep::UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber)
     283UIPrepareStep::UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber)
    284284    : QObject(pParent)
    285     , m_strStepId(strStepId)
     285    , m_uStepId(aStepId)
    286286    , m_iStepNumber(iStepNumber)
    287287{
     
    290290            this, SLOT(sltStepDone()),
    291291            Qt::QueuedConnection);
    292     connect(this, SIGNAL(sigStepDone(QString, int)),
    293             pParent, SLOT(sltBuildStep(QString, int)),
     292    connect(this, SIGNAL(sigStepDone(QUuid, int)),
     293            pParent, SLOT(sltBuildStep(QUuid, int)),
    294294            Qt::QueuedConnection);
    295295}
     
    297297void UIPrepareStep::sltStepDone()
    298298{
    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  
    1818#ifndef ___UIDetailsItem_h___
    1919#define ___UIDetailsItem_h___
     20
     21/* Qt includes */
     22#include <QUuid>
    2023
    2124/* GUI includes: */
     
    5659          * @param  strStepId    Brings the step ID.
    5760          * @param  iStepNumber  Brings the step number. */
    58         void sigBuildStep(QString strStepId, int iStepNumber);
     61        void sigBuildStep(const QUuid &aStepId, int iStepNumber);
    5962        /** Notifies listeners about step build complete. */
    6063        void sigBuildDone();
     
    127130          * @param  iStepNumber  Brings the step number. */
    128131    /** @} */
    129     virtual void sltBuildStep(QString strStepId, int iStepNumber);
     132    virtual void sltBuildStep(const QUuid &aStepId, int iStepNumber);
    130133
    131134protected:
     
    154157      * @param  strStepId    Brings the step ID.
    155158      * @param  iStepNumber  Brings the step number. */
    156     void sigStepDone(QString strStepId, int iStepNumber);
     159    void sigStepDone(const QUuid& aStepId, int iStepNumber);
    157160
    158161public:
     
    162165      * @param  strStepId     Brings the step ID.
    163166      * @param  iStepNumber   Brings the step number.*/
    164     UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber);
     167    UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber);
    165168
    166169private slots:
     
    172175
    173176    /** Holds the step ID. */
    174     QString  m_strStepId;
     177    QUuid  m_uStepId;
    175178    /** Holds the step number. */
    176     int      m_iStepNumber;
     179    int    m_iStepNumber;
    177180};
    178181
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.h

    r74680 r74878  
    5454
    5555    /* Notifier: Link processing stuff: */
    56     void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     56    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    5757
    5858public:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp

    r74735 r74878  
    115115}
    116116
    117 void UIDetailsSet::sltBuildStep(QString strStepId, int iStepNumber)
     117void UIDetailsSet::sltBuildStep(const QUuid &aStepId, int iStepNumber)
    118118{
    119119    /* Cleanup build-step: */
     
    122122
    123123    /* Is step id valid? */
    124     if (strStepId != m_strSetId)
     124    if (aStepId != m_uSetId)
    125125        return;
    126126
     
    175175        {
    176176            /* Create next build-step: */
    177             m_pBuildStep = new UIPrepareStep(this, pElement, strStepId, iStepNumber + 1);
     177            m_pBuildStep = new UIPrepareStep(this, pElement, aStepId, iStepNumber + 1);
    178178
    179179            /* Build element: */
     
    184184        {
    185185            /* Just build next step: */
    186             sltBuildStep(strStepId, iStepNumber + 1);
     186            sltBuildStep(aStepId, iStepNumber + 1);
    187187        }
    188188    }
     
    541541}
    542542
    543 void UIDetailsSet::sltMachineStateChange(QString strId)
     543void UIDetailsSet::sltMachineStateChange(const QUuid &aId)
    544544{
    545545    /* Is this our VM changed? */
    546     if (m_machine.GetId() != strId)
     546    if (m_machine.GetId() != aId)
    547547        return;
    548548
     
    551551}
    552552
    553 void UIDetailsSet::sltMachineAttributesChange(QString strId)
     553void UIDetailsSet::sltMachineAttributesChange(const QUuid &aId)
    554554{
    555555    /* Is this our VM changed? */
    556     if (m_machine.GetId() != strId)
     556    if (m_machine.GetId() != aId)
    557557        return;
    558558
     
    576576{
    577577    /* Global-events connections: */
    578     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChange(QString)));
    579     connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), this, SLOT(sltMachineAttributesChange(QString)));
    580     connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltMachineAttributesChange(QString)));
    581     connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QString, QString)), this, SLOT(sltMachineAttributesChange(QString)));
    582     connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QString, QString)), this, SLOT(sltMachineAttributesChange(QString)));
    583     connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltMachineAttributesChange(QString)));
    584     connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QString, 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)));
    585585
    586586    /* Meidum-enumeration connections: */
     
    617617
    618618    /* Generate new set-id: */
    619     m_strSetId = QUuid::createUuid().toString();
     619    m_uSetId = QUuid::createUuid();
    620620
    621621    /* Request to build first step: */
    622     emit sigBuildStep(m_strSetId, DetailsElementType_General);
     622    emit sigBuildStep(m_uSetId, DetailsElementType_General);
    623623}
    624624
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h

    r74687 r74878  
    7272          * @param  iStepNumber  Brings the step number. */
    7373    /** @} */
    74     virtual void sltBuildStep(QString strStepId, int iStepNumber) /* override */;
     74    virtual void sltBuildStep(const QUuid &aStepId, int iStepNumber) /* override */;
    7575
    7676protected:
     
    125125      * @{ */
    126126        /** Handles machine-state change for item with @a strId. */
    127         void sltMachineStateChange(QString strId);
     127        void sltMachineStateChange(const QUuid &aId);
    128128        /** Handles machine-attribute change for item with @a strId. */
    129         void sltMachineAttributesChange(QString strId);
     129        void sltMachineAttributesChange(const QUuid &aId);
    130130    /** @} */
    131131
     
    206206        int            m_iLastStepNumber;
    207207        /** Holds the generated set ID. */
    208         QString        m_strSetId;
     208        QUuid          m_uSetId;
    209209    /** @} */
    210210
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.cpp

    r73424 r74878  
    113113    /* Setup connections: */
    114114    connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(sltRecreatePreview()));
    115     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    116             this, SLOT(sltMachineStateChange(QString)));
     115    connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
     116            this, SLOT(sltMachineStateChange(QUuid)));
    117117
    118118    /* Retranslate the UI */
     
    170170}
    171171
    172 void UIMachinePreview::sltMachineStateChange(QString strId)
     172void UIMachinePreview::sltMachineStateChange(const QUuid &aId)
    173173{
    174174    /* 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)
    176176        return;
    177177
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.h

    r73424 r74878  
    6666
    6767    /* Handler: Global-event listener stuff: */
    68     void sltMachineStateChange(QString strId);
     68    void sltMachineStateChange(const QUuid &aId);
    6969
    7070    /* Handler: Preview recreator: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.cpp

    r74805 r74878  
    213213    }
    214214    /* Store the id of the newly create medium: */
    215     m_strMediumID = newMedium.GetId();
     215    m_uMediumID = newMedium.GetId();
    216216
    217217    /* Notify VBoxGlobal about the new medium: */
     
    225225}
    226226
    227 QString UIFDCreationDialog::mediumID() const
    228 {
    229     return m_strMediumID;
    230 }
     227QUuid UIFDCreationDialog::mediumID() const
     228{
     229    return m_uMediumID;
     230}
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.h

    r72913 r74878  
    2121/* Qt includes: */
    2222#include <QDialog>
    23 
     23#include <QUuid>
    2424
    2525/* GUI Includes */
     
    4848    virtual void accept() /* override */;
    4949    /* Return the mediumID */
    50     QString mediumID() const;
     50    QUuid mediumID() const;
    5151
    5252protected:
     
    7777    QString             m_strMachineName;
    7878    QString             m_strMachineFolder;
    79     QString             m_strMediumID;
     79    QUuid               m_uMediumID;
    8080};
    8181
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp

    r73953 r74878  
    3838#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3939
    40 QString UIMedium::m_sstrNullID = QUuid().toString().remove('{').remove('}');
     40QUuid   UIMedium::m_uNullID;
    4141QString UIMedium::m_sstrTable = QString("<table>%1</table>");
    4242QString UIMedium::m_sstrRow = QString("<tr><td>%1</td></tr>");
     
    8787    m_strLastAccessError = other.lastAccessError();
    8888
    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();
    9494
    9595    m_strName = other.name();
     
    155155{
    156156    /* 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();
    160160
    161161    /* Reset cache parameters: */
     
    200200    {
    201201        /* Refresh medium ID: */
    202         m_strId = normalizedID(m_medium.GetId());
     202        m_uId = normalizedID(m_medium.GetId());
    203203        /* Refresh root medium ID: */
    204         m_strRootId = m_strId;
     204        m_uRootId = m_uId;
    205205
    206206        /* 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;
    209209
    210210        /* Check whether this is host-drive medium: */
     
    273273            CMedium parentMedium = m_medium.GetParent();
    274274            if (!parentMedium.isNull())
    275                 m_strParentId = normalizedID(parentMedium.GetId());
     275                m_uParentId = normalizedID(parentMedium.GetId());
    276276
    277277            /* Only for created and accessible media: */
     
    281281                while (!parentMedium.isNull())
    282282                {
    283                     m_strRootId = normalizedID(parentMedium.GetId());
     283                    m_uRootId = normalizedID(parentMedium.GetId());
    284284                    parentMedium = parentMedium.GetParent();
    285285                }
    286286
    287287                /* Refresh encryption attributes: */
    288                 if (m_strRootId != m_strId)
     288                if (m_uRootId != m_uId)
    289289                {
    290290                    m_strEncryptionPasswordID = root().encryptionPasswordID();
     
    329329            QString strMachineUsage;
    330330            /* Walk through all the machines this medium attached to: */
    331             foreach (const QString &strMachineID, m_machineIds)
     331            foreach (const QUuid &uMachineID, m_machineIds)
    332332            {
    333333                /* Look for the corresponding machine: */
    334                 CMachine machine = vbox.FindMachine(strMachineID);
     334                CMachine machine = vbox.FindMachine(uMachineID.toString());
    335335
    336336                /* UIMedium object can wrap newly created CMedium object
     
    346346
    347347                /* Finally we can precisely check if current machine is 'hidden': */
    348                 if (gEDataManager->showMachineInSelectorChooser(strMachineID))
     348                if (gEDataManager->showMachineInSelectorChooser(uMachineID))
    349349                    m_fUsedByHiddenMachinesOnly = false;
    350350
     
    352352                QString strSnapshotUsage;
    353353                /* Walk through all the snapshots this medium attached to: */
    354                 foreach (const QString &strSnapshotID, m_medium.GetSnapshotIds(strMachineID))
    355                 {
    356                     if (strSnapshotID == strMachineID)
     354                foreach (const QUuid &uSnapshotID, m_medium.GetSnapshotIds(uMachineID))
     355                {
     356                    if (uSnapshotID == uMachineID)
    357357                    {
    358358                        /* The medium is attached to the machine in the current
    359359                         * state, we don't distinguish this for now by always
    360360                         * giving the VM name in front of snapshot names. */
    361                         m_curStateMachineIds.push_back(strSnapshotID);
     361                        m_curStateMachineIds.push_back(uSnapshotID);
    362362                        continue;
    363363                    }
    364364
    365365                    /* Look for the corresponding snapshot: */
    366                     CSnapshot snapshot = machine.FindSnapshot(strSnapshotID);
     366                    CSnapshot snapshot = machine.FindSnapshot(uSnapshotID.toString());
    367367
    368368                    /* Snapshot can be NULL while takeSnaphot is in progress: */
     
    433433void UIMedium::updateParentID()
    434434{
    435     m_strParentId = nullID();
     435    m_uParentId = nullID();
    436436    if (m_type == UIMediumDeviceType_HardDisk)
    437437    {
    438438        CMedium parentMedium = m_medium.GetParent();
    439439        if (!parentMedium.isNull())
    440             m_strParentId = normalizedID(parentMedium.GetId());
     440            m_uParentId = normalizedID(parentMedium.GetId());
    441441    }
    442442}
     
    565565
    566566/* static */
    567 QString UIMedium::nullID()
    568 {
    569     return m_sstrNullID;
     567QUuid UIMedium::nullID()
     568{
     569    return m_uNullID;
    570570}
    571571
    572572/* 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;
     573QUuid UIMedium::normalizedID(const QUuid &aID)
     574{
     575    /// @todo wipe out!
     576    return aID;
    579577}
    580578
     
    601599{
    602600    /* Redirect call to VBoxGlobal: */
    603     return vboxGlobal().medium(m_strRootId);
     601    return vboxGlobal().medium(m_uRootId);
    604602}
    605603
     
    607605{
    608606    /* Redirect call to VBoxGlobal: */
    609     return vboxGlobal().medium(m_strParentId);
     607    return vboxGlobal().medium(m_uParentId);
    610608}
    611609
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r73953 r74878  
    126126    bool isNull() const
    127127    {
    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();
    130130    }
    131131
     
    155155
    156156    /** Returns the medium ID. */
    157     QString id() const { return m_strId; }
     157    QUuid id() const { return m_uId; }
    158158
    159159    /** Returns the medium root ID. */
    160     QString rootID() const { return m_strRootId; }
     160    QUuid rootID() const { return m_uRootId; }
    161161    /** Returns the medium parent ID. */
    162     QString parentID() const { return m_strParentId; }
     162    QUuid parentID() const { return m_uParentId; }
    163163
    164164    /** Updates medium parent. */
     
    166166
    167167    /** Returns the medium cache key. */
    168     QString key() const { return m_strKey; }
     168    QUuid key() const { return m_uKey; }
    169169    /** Defines the medium cache @a strKey. */
    170     void setKey(const QString &strKey) { m_strKey = strKey; }
     170    void setKey(const QUuid &aKey) { m_uKey = aKey; }
    171171
    172172    /** Returns the medium name.
     
    309309
    310310    /** Returns a vector of IDs of all machines this medium is attached to. */
    311     const QList<QString>& machineIds() const { return m_machineIds; }
     311    const QList<QUuid>& machineIds() const { return m_machineIds; }
    312312    /** Returns a vector of IDs of all machines this medium is attached to
    313313      * in their current state (i.e. excluding snapshots). */
    314     const QList<QString>& curStateMachineIds() const { return m_curStateMachineIds; }
     314    const QList<QUuid>& curStateMachineIds() const { return m_curStateMachineIds; }
    315315
    316316    /** Returns NULL medium ID. */
    317     static QString nullID();
     317    static QUuid nullID();
    318318
    319319    /** Returns passed @a strID if it's valid or #nullID() overwise. */
    320     static QString normalizedID(const QString &strID);
     320    static QUuid normalizedID(const QUuid &aID);
    321321
    322322    /** Determines if passed @a medium is attached to hidden machines only. */
     
    351351
    352352    /** Holds the medium ID. */
    353     QString m_strId;
     353    QUuid m_uId;
    354354    /** Holds the medium root ID. */
    355     QString m_strRootId;
     355    QUuid m_uRootId;
    356356    /** Holds the medium parent ID. */
    357     QString m_strParentId;
     357    QUuid m_uParentId;
    358358
    359359    /** Holds the medium cache key. */
    360     QString m_strKey;
     360    QUuid m_uKey;
    361361
    362362    /** Holds the medium name. */
     
    397397    QString m_strToolTip;
    398398    /** Holds the vector of IDs of all machines this medium is attached to. */
    399     QList<QString> m_machineIds;
     399    QList<QUuid> m_machineIds;
    400400    /** Hodls the vector of IDs of all machines this medium is attached to
    401401      * in their current state (i.e. excluding snapshots). */
    402     QList<QString> m_curStateMachineIds;
     402    QList<QUuid> m_curStateMachineIds;
    403403
    404404    /** Holds the medium cache for "don't show diffs" mode. */
     
    419419
    420420    /** Holds the NULL medium ID. */
    421     static QString m_sstrNullID;
     421    static QUuid m_uNullID;
    422422    /** Holds the medium tool-tip table template. */
    423423    static QString m_sstrTable;
     
    427427Q_DECLARE_METATYPE(UIMedium);
    428428
    429 typedef QMap<QString, UIMedium> UIMediumMap;
     429typedef QMap<QUuid, UIMedium> UIMediumMap;
    430430
    431431#endif /* !___UIMedium_h___ */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp

    r73938 r74878  
    3838
    3939
     40template<class T>
     41static 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
    4050/** UITask extension used for medium enumeration purposes. */
    4151class UITaskMediumEnumeration : public UITask
     
    8696}
    8797
    88 QList<QString> UIMediumEnumerator::mediumIDs() const
     98QList<QUuid> UIMediumEnumerator::mediumIDs() const
    8999{
    90100    /* Return keys of current medium-map: */
     
    92102}
    93103
    94 UIMedium UIMediumEnumerator::medium(const QString &strMediumID)
     104UIMedium UIMediumEnumerator::medium(const QUuid &aMediumID)
    95105{
    96106    /* 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];
    99109    /* Return NULL medium otherwise: */
    100110    return UIMedium();
     
    104114{
    105115    /* Get medium ID: */
    106     const QString strMediumID = medium.id();
     116    const QUuid uMediumID = medium.id();
    107117
    108118    /* 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());
    111121    /* Make sure medium doesn't exists already: */
    112     AssertReturnVoid(!m_media.contains(strMediumID));
     122    AssertReturnVoid(!m_media.contains(uMediumID));
    113123
    114124    /* 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()));
    117127
    118128    /* Notify listener: */
    119     emit sigMediumCreated(strMediumID);
    120 }
    121 
    122 void UIMediumEnumerator::deleteMedium(const QString &strMediumID)
     129    emit sigMediumCreated(uMediumID);
     130}
     131
     132void UIMediumEnumerator::deleteMedium(const QUuid &aMediumID)
    123133{
    124134    /* 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());
    127137    /* Make sure medium still exists: */
    128     AssertReturnVoid(m_media.contains(strMediumID));
     138    AssertReturnVoid(m_media.contains(aMediumID));
    129139
    130140    /* 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()));
    133143
    134144    /* Notify listener: */
    135     emit sigMediumDeleted(strMediumID);
     145    emit sigMediumDeleted(aMediumID);
    136146}
    137147
     
    175185
    176186    /* Start enumeration for UIMedium(s) with correct ID: */
    177     foreach (const QString &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]);
    180190}
    181191
     
    186196
    187197    /* Refresh all known media we have: */
    188     foreach (const QString &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
     202void UIMediumEnumerator::sltHandleMachineUpdate(const QUuid &aMachineID)
    193203{
    194204    LogRel2(("GUI: UIMediumEnumerator: Machine (or snapshot) event received, ID = %s\n",
    195              strMachineID.toUtf8().constData()));
     205             aMachineID.toString().toUtf8().constData()));
    196206
    197207    /* Gather previously used UIMedium IDs: */
    198     QStringList previousUIMediumIDs;
    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 */);
    200210    LogRel2(("GUI: UIMediumEnumerator:  Old usage: %s\n",
    201              previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));
     211             previousUIMediumIDs.isEmpty() ? "<empty>" : toStringList(previousUIMediumIDs).join(", ").toUtf8().constData()));
    202212
    203213    /* Gather currently used CMediums and their IDs: */
    204214    CMediumMap currentCMediums;
    205     QStringList currentCMediumIDs;
    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 */);
    207217    LogRel2(("GUI: UIMediumEnumerator:  New usage: %s\n",
    208              currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
     218             currentCMediumIDs.isEmpty() ? "<empty>" : toStringList(currentCMediumIDs).join(", ").toUtf8().constData()));
    209219
    210220    /* Determine excluded media: */
    211     const QSet<QString> previousSet = previousUIMediumIDs.toSet();
    212     const QSet<QString> currentSet = currentCMediumIDs.toSet();
    213     const QSet<QString> excludedSet = previousSet - currentSet;
    214     const QStringList excludedUIMediumIDs = 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();
    215225    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()));
    217227    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()));
    219229
    220230    /* Update cache for excluded UIMediums: */
     
    225235
    226236    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
     240void UIMediumEnumerator::sltHandleMachineRegistration(const QUuid &aMachineID, const bool fRegistered)
    231241{
    232242    LogRel2(("GUI: UIMediumEnumerator: Machine %s event received, ID = %s\n",
    233243             fRegistered ? "registration" : "unregistration",
    234              strMachineID.toUtf8().constData()));
     244             aMachineID.toString().toUtf8().constData()));
    235245
    236246    /* Machine was registered: */
     
    239249        /* Gather currently used CMediums and their IDs: */
    240250        CMediumMap currentCMediums;
    241         QStringList currentCMediumIDs;
    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 */);
    243253        LogRel2(("GUI: UIMediumEnumerator:  New usage: %s\n",
    244                  currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
     254                 currentCMediumIDs.isEmpty() ? "<empty>" : toStringList(currentCMediumIDs).join(", ").toUtf8().constData()));
    245255        /* Update cache with currently used CMediums: */
    246256        recacheFromActualUsage(currentCMediums, currentCMediumIDs);
     
    250260    {
    251261        /* Gather previously used UIMedium IDs: */
    252         QStringList previousUIMediumIDs;
    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 */);
    254264        LogRel2(("GUI: UIMediumEnumerator:  Old usage: %s\n",
    255                  previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));
     265                 previousUIMediumIDs.isEmpty() ? "<empty>" : toStringList(previousUIMediumIDs).join(", ").toUtf8().constData()));
    256266        /* Update cache for previously used UIMediums: */
    257267        recacheFromCachedUsage(previousUIMediumIDs);
     
    260270    LogRel2(("GUI: UIMediumEnumerator: Machine %s event processed, ID = %s\n",
    261271             fRegistered ? "registration" : "unregistration",
    262              strMachineID.toUtf8().constData()));
    263 }
    264 
    265 void UIMediumEnumerator::sltHandleSnapshotDeleted(QString strMachineID, QString strSnapshotID)
     272             aMachineID.toString().toUtf8().constData()));
     273}
     274
     275void UIMediumEnumerator::sltHandleSnapshotDeleted(const QUuid &aMachineID, const QUuid &aSnapshotID)
    266276{
    267277    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()));
    269279
    270280    /* Gather previously used UIMedium IDs: */
    271     QStringList previousUIMediumIDs;
    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 */);
    273283    LogRel2(("GUI: UIMediumEnumerator:  Old usage: %s\n",
    274              previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));
     284             previousUIMediumIDs.isEmpty() ? "<empty>" : toStringList(previousUIMediumIDs).join(", ").toUtf8().constData()));
    275285
    276286    /* Gather currently used CMediums and their IDs: */
    277287    CMediumMap currentCMediums;
    278     QStringList currentCMediumIDs;
    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 */);
    280290    LogRel2(("GUI: UIMediumEnumerator:  New usage: %s\n",
    281              currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
     291             currentCMediumIDs.isEmpty() ? "<empty>" : toStringList(currentCMediumIDs).join(", ").toUtf8().constData()));
    282292
    283293    /* Update everything: */
     
    286296
    287297    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()));
    289299}
    290300
     
    298308    /* Get enumerated UIMedium: */
    299309    const UIMedium uimedium = pTask->property("medium").value<UIMedium>();
    300     const QString 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()));
    302312
    303313    /* Remove task from internal set: */
     
    305315
    306316    /* 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()));
    310320        return;
    311321    }
    312322
    313323    /* Check if UIMedium ID was changed: */
    314     const QString strUIMediumID = uimedium.id();
     324    const QUuid uUIMediumID = uimedium.id();
    315325    /* UIMedium ID was changed to nullID: */
    316     if (strUIMediumID == UIMedium::nullID())
     326    if (uUIMediumID == UIMedium::nullID())
    317327    {
    318328        /* 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()));
    321331
    322332        /* And notify listener about delete: */
    323         emit sigMediumDeleted(strUIMediumKey);
     333        emit sigMediumDeleted(uUIMediumKey);
    324334    }
    325335    /* UIMedium ID was changed to something proper: */
    326     else if (strUIMediumID != strUIMediumKey)
     336    else if (uUIMediumID != uUIMediumKey)
    327337    {
    328338        /* 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()));
    334344
    335345        /* And notify listener about delete/create: */
    336         emit sigMediumDeleted(strUIMediumKey);
    337         emit sigMediumCreated(strUIMediumID);
     346        emit sigMediumDeleted(uUIMediumKey);
     347        emit sigMediumCreated(uUIMediumID);
    338348    }
    339349    /* UIMedium ID was not changed: */
     
    341351    {
    342352        /* 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()));
    345355
    346356        /* And notify listener about update: */
    347         emit sigMediumEnumerated(strUIMediumID);
     357        emit sigMediumEnumerated(uUIMediumID);
    348358    }
    349359
     
    379389    /* Insert NULL uimedium to the passed uimedium map.
    380390     * Get existing one from the previous map if any. */
    381     QString 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);
    384394}
    385395
     
    395405
    396406        /* Prepare uimedium on the basis of current medium: */
    397         QString 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] :
    399409            UIMedium(medium, UIMediumDefs::mediumTypeToLocal(medium.GetDeviceType()));
    400410
     
    413423 * @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only.
    414424 */
    415 void UIMediumEnumerator::calculateCachedUsage(const QString &strMachineID, QStringList &previousUIMediumIDs, bool fTakeIntoAccountCurrentStateOnly) const
     425void UIMediumEnumerator::calculateCachedUsage(const QUuid &aMachineID, QList<QUuid> &previousUIMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const
    416426{
    417427    /* For each the UIMedium ID cache have: */
    418     foreach (const QString &strMediumID, mediumIDs())
     428    foreach (const QUuid &uMediumID, mediumIDs())
    419429    {
    420430        /* Get corresponding UIMedium: */
    421         const UIMedium &uimedium = m_media[strMediumID];
     431        const UIMedium &uimedium = m_media[uMediumID];
    422432        /* Get the list of the machines this UIMedium attached to.
    423433         * Take into account current-state only if necessary. */
    424         const QList<QString> &machineIDs = fTakeIntoAccountCurrentStateOnly ?
     434        const QList<QUuid> &machineIDs = fTakeIntoAccountCurrentStateOnly ?
    425435                                           uimedium.curStateMachineIds() : uimedium.machineIds();
    426436        /* 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);
    429439    }
    430440}
     
    437447 * @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only.
    438448 */
    439 void UIMediumEnumerator::calculateActualUsage(const QString &strMachineID, CMediumMap &currentCMediums, QStringList &currentCMediumIDs, bool fTakeIntoAccountCurrentStateOnly) const
     449void UIMediumEnumerator::calculateActualUsage(const QUuid &aMachineID, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const
    440450{
    441451    /* Search for corresponding machine: */
    442     CMachine machine = vboxGlobal().virtualBox().FindMachine(strMachineID);
     452    CMachine machine = vboxGlobal().virtualBox().FindMachine(aMachineID.toString());
    443453    if (machine.isNull())
    444454    {
     
    460470 * @param currentCMediumIDs receives CMedium IDs used in actual data.
    461471 */
    462 void UIMediumEnumerator::calculateActualUsage(const CSnapshot &snapshot, CMediumMap &currentCMediums, QStringList &currentCMediumIDs) const
     472void UIMediumEnumerator::calculateActualUsage(const CSnapshot &snapshot, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const
    463473{
    464474    /* Check passed snapshot: */
     
    480490 * @param currentCMediumIDs receives CMedium IDs used in actual data.
    481491 */
    482 void UIMediumEnumerator::calculateActualUsage(const CMachine &machine, CMediumMap &currentCMediums, QStringList &currentCMediumIDs) const
     492void UIMediumEnumerator::calculateActualUsage(const CMachine &machine, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const
    483493{
    484494    /* Check passed machine: */
     
    493503        {
    494504            /* Make sure that CMedium was not yet closed: */
    495             const QString strCMediumID = cmedium.GetId();
    496             if (cmedium.isOk() && !strCMediumID.isNull())
     505            const QUuid uCMediumID = cmedium.GetId();
     506            if (cmedium.isOk() && !uCMediumID.isNull())
    497507            {
    498508                /* Add this CMedium to current usage: */
    499                 currentCMediums.insert(strCMediumID, cmedium);
    500                 currentCMediumIDs << strCMediumID;
     509                currentCMediums.insert(uCMediumID, cmedium);
     510                currentCMediumIDs.append(uCMediumID);
    501511            }
    502512        }
     
    508518 * @param previousUIMediumIDs reflects UIMedium IDs used in cached data.
    509519 */
    510 void UIMediumEnumerator::recacheFromCachedUsage(const QStringList &previousUIMediumIDs)
     520void UIMediumEnumerator::recacheFromCachedUsage(const QList<QUuid> &previousUIMediumIDs)
    511521{
    512522    /* For each of previously used UIMedium ID: */
    513     foreach (const QString &strMediumID, previousUIMediumIDs)
     523    foreach (const QUuid &uMediumID, previousUIMediumIDs)
    514524    {
    515525        /* Make sure this ID still in our map: */
    516         if (m_media.contains(strMediumID))
     526        if (m_media.contains(uMediumID))
    517527        {
    518528            /* Get corresponding UIMedium: */
    519             UIMedium &uimedium = m_media[strMediumID];
     529            UIMedium &uimedium = m_media[uMediumID];
    520530
    521531            /* If corresponding CMedium still exists: */
     
    532542            {
    533543                /* 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()));
    536546
    537547                /* And notify listeners: */
    538                 emit sigMediumDeleted(strMediumID);
     548                emit sigMediumDeleted(uMediumID);
    539549            }
    540550        }
     
    547557 * @param currentCMediumIDs reflects CMedium IDs used in actual data.
    548558 */
    549 void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap &currentCMediums, const QStringList &currentCMediumIDs)
     559void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap &currentCMediums, const QList<QUuid> &currentCMediumIDs)
    550560{
    551561    /* For each of currently used CMedium ID: */
    552     foreach (const QString &strCMediumID, currentCMediumIDs)
     562    foreach (const QUuid &uCMediumID, currentCMediumIDs)
    553563    {
    554564        /* If that ID is not in our map: */
    555         if (!m_media.contains(strCMediumID))
     565        if (!m_media.contains(uCMediumID))
    556566        {
    557567            /* Create new UIMedium: */
    558             const CMedium &cmedium = currentCMediums[strCMediumID];
     568            const CMedium &cmedium = currentCMediums[uCMediumID];
    559569            UIMedium uimedium(cmedium, UIMediumDefs::mediumTypeToLocal(cmedium.GetDeviceType()));
    560             QString strUIMediumKey = uimedium.key();
     570            QUuid uUIMediumKey = uimedium.key();
    561571
    562572            /* 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()));
    565575
    566576            /* And notify listeners: */
    567             emit sigMediumCreated(strUIMediumKey);
     577            emit sigMediumCreated(uUIMediumKey);
    568578        }
    569579
    570580        /* Enumerate corresponding UIMedium: */
    571         createMediumEnumerationTask(m_media[strCMediumID]);
     581        createMediumEnumerationTask(m_media[uCMediumID]);
    572582    }
    573583}
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r73938 r74878  
    3333
    3434/* Typedefs: */
    35 typedef QMap<QString, CMedium> CMediumMap;
     35typedef QMap<QUuid, CMedium> CMediumMap;
    3636
    3737/* Medium-enumerator prototype.
     
    4444
    4545    /* Notifiers: Medium-operations stuff: */
    46     void sigMediumCreated(const QString &strMediumID);
    47     void sigMediumDeleted(const QString &strMediumID);
     46    void sigMediumCreated(const QUuid &aMediumID);
     47    void sigMediumDeleted(const QUuid &aMediumID);
    4848
    4949    /* Notifiers: Medium-enumeration stuff: */
    5050    void sigMediumEnumerationStarted();
    51     void sigMediumEnumerated(const QString &strMediumID);
     51    void sigMediumEnumerated(const QUuid &aMediumID);
    5252    void sigMediumEnumerationFinished();
    5353
     
    5858
    5959    /* API: Medium-access stuff: */
    60     QList<QString> mediumIDs() const;
    61     UIMedium medium(const QString &strMediumID);
     60    QList<QUuid> mediumIDs() const;
     61    UIMedium medium(const QUuid &aMediumID);
    6262    void createMedium(const UIMedium &medium);
    63     void deleteMedium(const QString &strMediumID);
     63    void deleteMedium(const QUuid &aMediumID);
    6464
    6565    /* API: Medium-enumeration stuff: */
     
    7171
    7272    /** Handles machine-data-change and snapshot-change events. */
    73     void sltHandleMachineUpdate(QString strMachineID);
     73    void sltHandleMachineUpdate(const QUuid &aMachineID);
    7474    /** Handles machine-[un]registration events. */
    75     void sltHandleMachineRegistration(QString strMachineID, bool fRegistered);
     75    void sltHandleMachineRegistration(const QUuid &aMachineID, const bool fRegistered);
    7676    /** Handles snapshot-deleted events. */
    77     void sltHandleSnapshotDeleted(QString strMachineID, QString strSnapshotID);
     77    void sltHandleSnapshotDeleted(const QUuid &aMachineID, const QUuid &aSnapshotID);
    7878
    7979    /* Handler: Medium-enumeration stuff: */
     
    9191
    9292    /* Helpers: Medium re-caching stuff: */
    93     void calculateCachedUsage(const QString &strMachineID, QStringList &previousUIMediumIDs, bool fTakeIntoAccountCurrentStateOnly) const;
    94     void calculateActualUsage(const QString &strMachineID, CMediumMap &currentCMediums, QStringList &currentCMediumIDs, bool fTakeIntoAccountCurrentStateOnly) const;
    95     void calculateActualUsage(const CSnapshot &snapshot, CMediumMap &currentCMediums, QStringList &currentCMediumIDs) const;
    96     void calculateActualUsage(const CMachine &machine, CMediumMap &currentCMediums, QStringList &currentCMediumIDs) const;
    97     void recacheFromCachedUsage(const QStringList &previousUIMediumIDs);
    98     void recacheFromActualUsage(const CMediumMap &currentCMediums, const QStringList &currentCMediumIDs);
     93    void calculateCachedUsage(const QUuid &aMachineID, QList<QUuid> &previousUIMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const;
     94    void calculateActualUsage(const QUuid &strMachineID, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs, const bool fTakeIntoAccountCurrentStateOnly) const;
     95    void calculateActualUsage(const CSnapshot &snapshot, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const;
     96    void calculateActualUsage(const CMachine &machine, CMediumMap &currentCMediums, QList<QUuid> &currentCMediumIDs) const;
     97    void recacheFromCachedUsage(const QList<QUuid> &previousUIMediumIDs);
     98    void recacheFromActualUsage(const CMediumMap &currentCMediums, const QList<QUuid> &currentCMediumIDs);
    9999
    100100    /* Variables: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp

    r74003 r74878  
    152152
    153153    /* Release: */
    154     foreach (const QString &strMachineId, medium().curStateMachineIds())
    155         if (!releaseFrom(strMachineId))
     154    foreach (const QUuid &uMachineId, medium().curStateMachineIds())
     155        if (!releaseFrom(uMachineId))
    156156            return false;
    157157
     
    231231                                    formatFieldText(QApplication::translate("UIMediumManager", "<i>Not&nbsp;Encrypted</i>"), false) :
    232232                                    formatFieldText(encryptionPasswordID()));
    233             m_details.m_aFields << id();
     233            m_details.m_aFields << id().toString();
    234234
    235235            break;
     
    244244                                    formatFieldText(QApplication::translate("UIMediumManager", "<i>Not&nbsp;Attached</i>"), false) :
    245245                                    formatFieldText(usage()));
    246             m_details.m_aFields << id();
     246            m_details.m_aFields << id().toString();
    247247            break;
    248248        }
     
    252252}
    253253
    254 bool UIMediumItem::releaseFrom(const QString &strMachineId)
     254bool UIMediumItem::releaseFrom(const QUuid &aMachineId)
    255255{
    256256    /* Open session: */
    257     CSession session = vboxGlobal().openSession(strMachineId);
     257    CSession session = vboxGlobal().openSession(aMachineId);
    258258    if (session.isNull())
    259259        return false;
     
    323323    /* Remember some of hard-disk attributes: */
    324324    CMedium hardDisk = medium().medium();
    325     QString strMediumID = id();
     325    QUuid uMediumID = id();
    326326
    327327    /* Propose to remove medium storage: */
     
    338338
    339339    /* Remove UIMedium finally: */
    340     vboxGlobal().deleteMedium(strMediumID);
     340    vboxGlobal().deleteMedium(uMediumID);
    341341
    342342    /* True by default: */
     
    450450    /* Remember some of optical-disk attributes: */
    451451    CMedium image = medium().medium();
    452     QString strMediumID = id();
     452    QUuid uMediumID = id();
    453453
    454454    /* Close optical-disk: */
     
    461461
    462462    /* Remove UIMedium finally: */
    463     vboxGlobal().deleteMedium(strMediumID);
     463    vboxGlobal().deleteMedium(uMediumID);
    464464
    465465    /* True by default: */
     
    521521    /* Remember some of floppy-disk attributes: */
    522522    CMedium image = medium().medium();
    523     QString strMediumID = id();
     523    QUuid uMediumID = id();
    524524
    525525    /* Close floppy-disk: */
     
    532532
    533533    /* Remove UIMedium finally: */
    534     vboxGlobal().deleteMedium(strMediumID);
     534    vboxGlobal().deleteMedium(uMediumID);
    535535
    536536    /* True by default: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.h

    r73953 r74878  
    6868
    6969    /** Returns QString <i>ID</i> of the wrapped UIMedium. */
    70     QString id() const { return m_guiMedium.id(); }
     70    QUuid id() const { return m_guiMedium.id(); }
    7171    /** Returns QString <i>location</i> of the wrapped UIMedium. */
    7272    QString location() const { return m_guiMedium.location(); }
     
    8686
    8787    /** Returns a vector of IDs of all machines wrapped UIMedium is attached to. */
    88     const QList<QString> &machineIds() const { return m_guiMedium.machineIds(); }
     88    const QList<QUuid> &machineIds() const { return m_guiMedium.machineIds(); }
    8989    /** Returns QString <i>usage</i> of the wrapped UIMedium. */
    9090    QString usage() const { return m_guiMedium.usage(); }
     
    111111
    112112    /** Releases UIMedium wrapped by <i>this</i> item from virtual machine with @a strMachineId. */
    113     bool releaseFrom(const QString &strMachineId);
     113    bool releaseFrom(const QUuid &aMachineId);
    114114
    115115    /** Formats field text. */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r74003 r74878  
    6868public:
    6969    /** Constructor accepting @a strID to compare with. */
    70     CheckIfSuitableByID(const QString &strID) : m_strID(strID) {}
     70    CheckIfSuitableByID(const QUuid &aID) : m_uID(aID) {}
    7171
    7272private:
    7373    /** 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; }
    7575    /** Holds the @a strID to compare to. */
    76     QString m_strID;
     76    QUuid m_uID;
    7777};
    7878
     
    383383}
    384384
    385 void UIMediumManagerWidget::sltHandleMediumCreated(const QString &strMediumID)
     385void UIMediumManagerWidget::sltHandleMediumCreated(const QUuid &aMediumID)
    386386{
    387387    /* Search for corresponding medium: */
    388     UIMedium medium = vboxGlobal().medium(strMediumID);
     388    UIMedium medium = vboxGlobal().medium(aMediumID);
    389389
    390390    /* Ignore non-interesting media: */
     
    414414}
    415415
    416 void UIMediumManagerWidget::sltHandleMediumDeleted(const QString &strMediumID)
     416void UIMediumManagerWidget::sltHandleMediumDeleted(const QUuid &aMediumID)
    417417{
    418418    /* Make sure corresponding medium-item deleted: */
    419     deleteMediumItem(strMediumID);
     419    deleteMediumItem(aMediumID);
    420420}
    421421
     
    459459}
    460460
    461 void UIMediumManagerWidget::sltHandleMediumEnumerated(const QString &strMediumID)
     461void UIMediumManagerWidget::sltHandleMediumEnumerated(const QUuid &aMediumID)
    462462{
    463463    /* Search for corresponding medium: */
    464     UIMedium medium = vboxGlobal().medium(strMediumID);
     464    UIMedium medium = vboxGlobal().medium(aMediumID);
    465465
    466466    /* Ignore non-interesting media: */
     
    920920    /* Remember current medium-items: */
    921921    if (UIMediumItem *pMediumItem = mediumItem(UIMediumDeviceType_HardDisk))
    922         m_strCurrentIdHD = pMediumItem->id();
     922        m_uCurrentIdHD = pMediumItem->id();
    923923    if (UIMediumItem *pMediumItem = mediumItem(UIMediumDeviceType_DVD))
    924         m_strCurrentIdCD = pMediumItem->id();
     924        m_uCurrentIdCD = pMediumItem->id();
    925925    if (UIMediumItem *pMediumItem = mediumItem(UIMediumDeviceType_Floppy))
    926         m_strCurrentIdFD = pMediumItem->id();
     926        m_uCurrentIdFD = pMediumItem->id();
    927927
    928928    /* Clear tree-widgets: */
     
    948948    /* Create medium-items (do not change current one): */
    949949    m_fPreventChangeCurrentItem = true;
    950     foreach (const QString &strMediumID, vboxGlobal().mediumIDs())
    951         sltHandleMediumCreated(strMediumID);
     950    foreach (const QUuid &uMediumID, vboxGlobal().mediumIDs())
     951        sltHandleMediumCreated(uMediumID);
    952952    m_fPreventChangeCurrentItem = false;
    953953
     
    11441144                if (!pMediumItem)
    11451145                    break;
    1146                 if (pMediumItem->id() == m_strCurrentIdHD)
     1146                if (pMediumItem->id() == m_uCurrentIdHD)
    11471147                {
    11481148                    setCurrentItem(pTreeWidget, pMediumItem);
    1149                     m_strCurrentIdHD = QString();
     1149                    m_uCurrentIdHD = QUuid();
    11501150                }
    11511151            }
     
    11641164                if (!pMediumItem)
    11651165                    break;
    1166                 LogRel2(("UIMediumManager: Optical medium-item with ID={%s} created.\n", medium.id().toUtf8().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)
    11681168                {
    11691169                    setCurrentItem(pTreeWidget, pMediumItem);
    1170                     m_strCurrentIdCD = QString();
     1170                    m_uCurrentIdCD = QUuid();
    11711171                }
    11721172            }
     
    11851185                if (!pMediumItem)
    11861186                    break;
    1187                 LogRel2(("UIMediumManager: Floppy medium-item with ID={%s} created.\n", medium.id().toUtf8().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)
    11891189                {
    11901190                    setCurrentItem(pTreeWidget, pMediumItem);
    1191                     m_strCurrentIdFD = QString();
     1191                    m_uCurrentIdFD = QUuid();
    11921192                }
    11931193            }
     
    12381238                    UIMedium parentMedium = vboxGlobal().medium(medium.parentID());
    12391239                    if (parentMedium.isNull())
    1240                         AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().toUtf8().constData()));
     1240                        AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().toString().toUtf8().constData()));
    12411241                    /* Try to create parent medium-item: */
    12421242                    else
     
    12471247                {
    12481248                    pMediumItem = new UIMediumItemHD(medium, pParentMediumItem);
    1249                     LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().toUtf8().constData()));
     1249                    LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData()));
    12501250                }
    12511251            }
     
    12541254            {
    12551255                pMediumItem = new UIMediumItemHD(medium, pTreeWidget);
    1256                 LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().toUtf8().constData()));
     1256                LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData()));
    12571257            }
    12581258        }
     
    12841284    /* Update medium-item: */
    12851285    pMediumItem->setMedium(medium);
    1286     LogRel2(("UIMediumManager: Medium-item with ID={%s} updated.\n", medium.id().toUtf8().constData()));
     1286    LogRel2(("UIMediumManager: Medium-item with ID={%s} updated.\n", medium.id().toString().toUtf8().constData()));
    12871287
    12881288    /* Update tab-icons: */
     
    12941294}
    12951295
    1296 void UIMediumManagerWidget::deleteMediumItem(const QString &strMediumID)
     1296void UIMediumManagerWidget::deleteMediumItem(const QUuid &aMediumID)
    12971297{
    12981298    /* Search for corresponding tree-widget: */
     
    13061306        pTreeWidget = treeWidget(type);
    13071307        /* Search for existing medium-item: */
    1308         pMediumItem = searchItem(pTreeWidget, CheckIfSuitableByID(strMediumID));
     1308        pMediumItem = searchItem(pTreeWidget, CheckIfSuitableByID(aMediumID));
    13091309        if (pMediumItem)
    13101310            break;
     
    13201320    /* Delete medium-item: */
    13211321    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()));
    13231323
    13241324    /* If there is no current medium-item now selected
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r73953 r74878  
    148148      * @{ */
    149149        /** Handles VBoxGlobal::sigMediumCreated signal. */
    150         void sltHandleMediumCreated(const QString &strMediumID);
     150        void sltHandleMediumCreated(const QUuid &aMediumID);
    151151        /** Handles VBoxGlobal::sigMediumDeleted signal. */
    152         void sltHandleMediumDeleted(const QString &strMediumID);
     152        void sltHandleMediumDeleted(const QUuid &aMediumID);
    153153    /** @} */
    154154
     
    158158        void sltHandleMediumEnumerationStart();
    159159        /** Handles VBoxGlobal::sigMediumEnumerated signal. */
    160         void sltHandleMediumEnumerated(const QString &strMediumID);
     160        void sltHandleMediumEnumerated(const QUuid &aMediumID);
    161161        /** Handles VBoxGlobal::sigMediumEnumerationFinished signal. */
    162162        void sltHandleMediumEnumerationFinish();
     
    249249        void updateMediumItem(const UIMedium &medium);
    250250        /** Deletes UIMediumItem for corresponding @a strMediumID. */
    251         void deleteMediumItem(const QString &strMediumID);
     251        void deleteMediumItem(const QUuid &aMediumID);
    252252
    253253        /** Returns tab for passed medium @a type. */
     
    327327        const QIcon                  m_iconFD;
    328328        /** Holds current hard-drive tree-view item ID. */
    329         QString                      m_strCurrentIdHD;
     329        QUuid                        m_uCurrentIdHD;
    330330        /** Holds current optical-disk tree-view item ID. */
    331         QString                      m_strCurrentIdCD;
     331        QUuid                        m_uCurrentIdCD;
    332332        /** Holds current floppy-disk tree-view item ID. */
    333         QString                      m_strCurrentIdFD;
     333        QUuid                        m_uCurrentIdFD;
    334334    /** @} */
    335335
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r74811 r74878  
    171171}
    172172
    173 QStringList UIMediumSelector::selectedMediumIds() const
    174 {
    175     QStringList selectedIds;
     173QList<QUuid> UIMediumSelector::selectedMediumIds() const
     174{
     175    QList<QUuid> selectedIds;
    176176    if (!m_pTreeWidget)
    177177        return selectedIds;
     
    365365            UIMedium parentMedium = vboxGlobal().medium(medium.parentID());
    366366            if (parentMedium.isNull())
    367                 AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().toUtf8().constData()));
     367                AssertMsgFailed(("Parent medium with ID={%s} was not found!\n", medium.parentID().toString().toUtf8().constData()));
    368368            /* Try to create parent medium-item: */
    369369            else
     
    373373        {
    374374            pMediumItem = new UIMediumItemHD(medium, pParentMediumItem);
    375             LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().toUtf8().constData()));
     375            LogRel2(("UIMediumManager: Child hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData()));
    376376        }
    377377        else
    378             AssertMsgFailed(("Parent medium with ID={%s} could not be created!\n", medium.parentID().toUtf8().constData()));
     378            AssertMsgFailed(("Parent medium with ID={%s} could not be created!\n", medium.parentID().toString().toUtf8().constData()));
    379379    }
    380380
     
    383383    {
    384384        pMediumItem = new UIMediumItemHD(medium, pParent);
    385         LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().toUtf8().constData()));
     385        LogRel2(("UIMediumManager: Root hard-disk medium-item with ID={%s} created.\n", medium.id().toString().toUtf8().constData()));
    386386    }
    387387    return pMediumItem;
    388388}
    389389
    390 void UIMediumSelector::restoreSelection(const QStringList &selectedMediums, QVector<UIMediumItem*> &mediumList)
     390void UIMediumSelector::restoreSelection(const QList<QUuid> &selectedMediums, QVector<UIMediumItem*> &mediumList)
    391391{
    392392    if (!m_pTreeWidget)
     
    475475{
    476476    QString strDefaultMachineFolder = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    477     QString strMediumID = vboxGlobal().openMediumWithFileOpenDialog(m_enmMediumType, this, strDefaultMachineFolder);
    478     if (strMediumID.isEmpty())
     477    QUuid uMediumID = vboxGlobal().openMediumWithFileOpenDialog(m_enmMediumType, this, strDefaultMachineFolder);
     478    if (uMediumID.isNull())
    479479        return;
    480480    repopulateTreeWidget();
    481     selectMedium(strMediumID);
     481    selectMedium(uMediumID);
    482482
    483483}
     
    545545}
    546546
    547 void UIMediumSelector::selectMedium(const QString &strMediumID)
     547void UIMediumSelector::selectMedium(const QUuid &aMediumID)
    548548{
    549549    if (!m_pTreeWidget)
    550550        return;
    551     UIMediumItem *pMediumItem = searchItem(0, strMediumID);
     551    UIMediumItem *pMediumItem = searchItem(0, aMediumID);
    552552    if (pMediumItem)
    553553    {
     
    623623    /* Cache the currently selected items: */
    624624    QList<QTreeWidgetItem*> selectedItems = m_pTreeWidget->selectedItems();
    625     QStringList selectedMedia = selectedMediumIds();
     625    QList<QUuid> selectedMedia = selectedMediumIds();
    626626    /* uuid list of selected items: */
    627627    /* Reset the related data structure: */
     
    632632    QVector<UIMediumItem*> menuItemVector;
    633633
    634     foreach (const QString &strMediumID, vboxGlobal().mediumIDs())
    635     {
    636         UIMedium medium = vboxGlobal().medium(strMediumID);
     634    foreach (const QUuid &uMediumID, vboxGlobal().mediumIDs())
     635    {
     636        UIMedium medium = vboxGlobal().medium(uMediumID);
    637637        //printf("name %s\n", qPrintable(medium.name()));
    638638        if (medium.type() == m_enmMediumType)
     
    697697}
    698698
    699 UIMediumItem* UIMediumSelector::searchItem(const QTreeWidgetItem *pParent, const QString &mediumId)
     699UIMediumItem* UIMediumSelector::searchItem(const QTreeWidgetItem *pParent, const QUuid &mediumId)
    700700{
    701701    if (!m_pTreeWidget)
     
    759759            strMedium = m_mediumItemList[i]->medium().name();
    760760        else if(searchType == UIMediumSearchWidget::SearchByUUID)
    761             strMedium = m_mediumItemList[i]->medium().id();
     761            strMedium = m_mediumItemList[i]->medium().id().toString();
    762762        if (strMedium.isEmpty())
    763763            continue;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h

    r73953 r74878  
    5050    UIMediumSelector(UIMediumDeviceType enmMediumType, const QString &machineName = QString(),
    5151                     const QString &machineSettigFilePath = QString(), QWidget *pParent = 0);
    52     QStringList selectedMediumIds() const;
     52    QList<QUuid> selectedMediumIds() const;
    5353
    5454protected:
     
    9393    void          updateOkButton();
    9494    UIMediumItem* addTreeItem(const UIMedium &medium, QITreeWidgetItem *pParent);
    95     void          restoreSelection(const QStringList &selectedMediums, QVector<UIMediumItem*> &mediumList);
     95    void          restoreSelection(const QList<QUuid> &selectedMediums, QVector<UIMediumItem*> &mediumList);
    9696    /** Recursively create the hard disk hierarchy under the tree widget */
    9797    UIMediumItem* createHardDiskItem(const UIMedium &medium, QITreeWidgetItem *pParent);
    98     UIMediumItem* searchItem(const QTreeWidgetItem *pParent, const QString &mediumId);
     98    UIMediumItem* searchItem(const QTreeWidgetItem *pParent, const QUuid &mediumId);
    9999    void          performMediumSearch();
    100100    /** Remember the default foreground brush of the tree so that we can reset tree items' foreground later */
    101101    void          saveDefaultForeground();
    102     void          selectMedium(const QString &strMediumID);
     102    void          selectMedium(const QUuid &aMediumID);
    103103
    104104    QVBoxLayout          *m_pMainLayout;
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/UIDesktopServices.h

    r69500 r74878  
    1919#define ___UIDesktopServices_h___
    2020
     21/* Qt includes */
     22#include <QUuid>
     23
    2124/* Qt forward declarations */
    2225class QString;
     
    2528{
    2629public:
    27     static bool createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const QString &strUuid);
     30    static bool createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const QUuid &aUuid);
    2831    static bool openInFileManager(const QString &strFile);
    2932};
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIDesktopServices_darwin.cpp

    r69500 r74878  
    2424#include <QString>
    2525
    26 bool UIDesktopServices::createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const QString &strUuid)
     26bool UIDesktopServices::createMachineShortcut(const QString &strSrcFile, const QString &strDstPath, const QString &strName, const QUuid &aUuid)
    2727{
    2828    return ::darwinCreateMachineShortcut(::darwinToNativeString(strSrcFile.toUtf8().constData()),
    2929                                         ::darwinToNativeString(strDstPath.toUtf8().constData()),
    3030                                         ::darwinToNativeString(strName.toUtf8().constData()),
    31                                          ::darwinToNativeString(strUuid.toUtf8().constData()));
     31                                         ::darwinToNativeString(aUuid.toString().toUtf8().constData()));
    3232}
    3333
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/win/UIDesktopServices_win.cpp

    r69500 r74878  
    2626# include <QDir>
    2727# include <QCoreApplication>
     28# include <QUuid>
    2829
    2930/* System includes */
     
    3334
    3435
    35 bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const QString &strUuid)
     36bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const QUuid &aUuid)
    3637{
    3738    IShellLink *pShl = NULL;
     
    5152        if (FAILED(rc))
    5253            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());
    5455        rc = pShl->SetArguments(strArgs.utf16());
    5556        if (FAILED(rc))
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/UIDesktopServices_x11.cpp

    r69500 r74878  
    3434
    3535
    36 bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const QString &strUuid)
     36bool UIDesktopServices::createMachineShortcut(const QString & /* strSrcFile */, const QString &strDstPath, const QString &strName, const QUuid &aUuid)
    3737{
    3838    QFile link(strDstPath + QDir::separator() + strName + ".desktop");
     
    4848            << "Comment=Starts the VirtualBox machine " << strName << endl
    4949            << "Type=Application" << endl
    50             << "Exec=" << QCoreApplication::applicationFilePath() << " --comment \"" << strName << "\" --startvm \"" << strUuid << "\"" << endl
     50            << "Exec=" << QCoreApplication::applicationFilePath() << " --comment \"" << strName << "\" --startvm \"" << aUuid.toString() << "\"" << endl
    5151            << "Icon=virtualbox-vbox.png" << endl;
    5252        /* 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  
    393393#endif /* Q_OS_WIN */
    394394     /** Identifier returned by AttachFramebuffer. Used in DetachFramebuffer. */
    395      QString m_strFramebufferId;
     395     QUuid m_uFramebufferId;
    396396};
    397397
     
    615615void UIFrameBufferPrivate::attach()
    616616{
    617     m_strFramebufferId = display().AttachFramebuffer(m_uScreenId, CFramebuffer(this));
     617    m_uFramebufferId = display().AttachFramebuffer(m_uScreenId, CFramebuffer(this));
    618618}
    619619
     
    623623    if (!frameBuffer.isNull())
    624624    {
    625         display().DetachFramebuffer(m_uScreenId, m_strFramebufferId);
    626         m_strFramebufferId.clear();
     625        display().DetachFramebuffer(m_uScreenId, m_uFramebufferId);
     626        m_uFramebufferId = QUuid();
    627627    }
    628628}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r73953 r74878  
    12671267}
    12681268
    1269 void UIIndicatorsPool::sltHandleConfigurationChange(const QString &strMachineID)
     1269void UIIndicatorsPool::sltHandleConfigurationChange(const QUuid &aMachineID)
    12701270{
    12711271    /* Skip unrelated machine IDs: */
    1272     if (vboxGlobal().managedVMUuid() != strMachineID)
     1272    if (vboxGlobal().managedVMUuid() != aMachineID)
    12731273        return;
    12741274
     
    13481348{
    13491349    /* Listen for the status-bar configuration changes: */
    1350     connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)),
    1351             this, SLOT(sltHandleConfigurationChange(const QString&)));
     1350    connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QUuid &)),
     1351            this, SLOT(sltHandleConfigurationChange(const QUuid &)));
    13521352}
    13531353
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h

    r71027 r74878  
    6767
    6868    /** Handles configuration change. */
    69     void sltHandleConfigurationChange(const QString &strMachineID);
     69    void sltHandleConfigurationChange(const QUuid &aMachineID);
    7070
    7171    /** Handles indicator-states auto-update. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r73946 r74878  
    4343
    4444/* static */
    45 bool UIMachine::startMachine(const QString &strID)
     45bool UIMachine::startMachine(const QUuid &aID)
    4646{
    4747    /* Make sure machine is not created: */
     
    5252    {
    5353        /* Create temporary session: */
    54         CSession session = vboxGlobal().openSession(strID, KLockType_VM);
     54        CSession session = vboxGlobal().openSession(aID, KLockType_VM);
    5555        if (session.isNull())
    5656            return false;
     
    8282    {
    8383        /* Get corresponding machine: */
    84         CMachine machine = vboxGlobal().virtualBox().FindMachine(vboxGlobal().managedVMUuid());
     84        CMachine machine = vboxGlobal().virtualBox().FindMachine(vboxGlobal().managedVMUuid().toString());
    8585        AssertMsgReturn(!machine.isNull(), ("VBoxGlobal::managedVMUuid() should have filter that case before!\n"), false);
    8686
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r72363 r74878  
    4949    /** Static factory to start machine with passed @a strID.
    5050      * @return true if machine was started, false otherwise. */
    51     static bool startMachine(const QString &strID);
     51    static bool startMachine(const QUuid &aID);
    5252    /** Static constructor. */
    5353    static bool create();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r73982 r74878  
    121121struct USBTarget
    122122{
    123     USBTarget() : attach(false), id(QString()) {}
    124     USBTarget(bool fAttach, const QString &strId)
    125         : attach(fAttach), id(strId) {}
     123    USBTarget() : attach(false), id(QUuid()) {}
     124    USBTarget(bool fAttach, const QUuid &aId)
     125        : attach(fAttach), id(aId) {}
    126126    bool attach;
    127     QString id;
     127    QUuid id;
    128128};
    129129Q_DECLARE_METATYPE(USBTarget);
     
    17511751    if (fDialogAccepted)
    17521752    {
    1753         QString strSnapshotId;
     1753        QUuid uSnapshotId;
    17541754        /* Prepare the take-snapshot progress: */
    1755         CProgress progress = machine().TakeSnapshot(strSnapshotName, strSnapshotDescription, true, strSnapshotId);
     1755        CProgress progress = machine().TakeSnapshot(strSnapshotName, strSnapshotDescription, true, uSnapshotId);
    17561756        if (machine().isOk())
    17571757        {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r74872 r74878  
    501501}
    502502
    503 void UIMachineView::sltHandleScaleFactorChange(const QString &strMachineID)
     503void UIMachineView::sltHandleScaleFactorChange(const QUuid &aMachineID)
    504504{
    505505    /* Skip unrelated machine IDs: */
    506     if (strMachineID != vboxGlobal().managedVMUuid())
     506    if (aMachineID != vboxGlobal().managedVMUuid())
    507507        return;
    508508
     
    549549}
    550550
    551 void UIMachineView::sltHandleScalingOptimizationChange(const QString &strMachineID)
     551void UIMachineView::sltHandleScalingOptimizationChange(const QUuid &aMachineID)
    552552{
    553553    /* Skip unrelated machine IDs: */
    554     if (strMachineID != vboxGlobal().managedVMUuid())
     554    if (aMachineID != vboxGlobal().managedVMUuid())
    555555        return;
    556556
     
    826826            SLOT(sltDesktopResized()));
    827827    /* Scale-factor change: */
    828     connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)),
    829             this, SLOT(sltHandleScaleFactorChange(const QString&)));
     828    connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QUuid &)),
     829            this, SLOT(sltHandleScaleFactorChange(const QUuid &)));
    830830    /* Scaling-optimization change: */
    831     connect(gEDataManager, SIGNAL(sigScalingOptimizationTypeChange(const QString&)),
    832             this, SLOT(sltHandleScalingOptimizationChange(const QString&)));
     831    connect(gEDataManager, SIGNAL(sigScalingOptimizationTypeChange(const QUuid &)),
     832            this, SLOT(sltHandleScalingOptimizationChange(const QUuid &)));
    833833}
    834834
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r71104 r74878  
    127127
    128128    /** Handles the scale-factor change. */
    129     void sltHandleScaleFactorChange(const QString &strMachineID);
     129    void sltHandleScaleFactorChange(const QUuid &aMachineID);
    130130
    131131    /** Handles the scaling-optimization change. */
    132     void sltHandleScalingOptimizationChange(const QString &strMachineID);
     132    void sltHandleScalingOptimizationChange(const QUuid &aMachineID);
    133133
    134134    /* Console callback handlers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r72887 r74878  
    323323    {
    324324        /* Execute asynchronously and leave: */
    325         QProcess::startDetached(strScript, QStringList() << machine().GetId());
     325        QProcess::startDetached(strScript, QStringList() << machine().GetId().toString());
    326326        return;
    327327    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r73953 r74878  
    204204    /* Apply ad-hoc reconfigurations from the command line: */
    205205    if (vboxGlobal().hasFloppyImageToMount())
    206         mountAdHocImage(KDeviceType_Floppy, UIMediumDeviceType_Floppy, vboxGlobal().getFloppyImage());
     206        mountAdHocImage(KDeviceType_Floppy, UIMediumDeviceType_Floppy, vboxGlobal().getFloppyImage().toString());
    207207    if (vboxGlobal().hasDvdImageToMount())
    208         mountAdHocImage(KDeviceType_DVD, UIMediumDeviceType_DVD, vboxGlobal().getDvdImage());
     208        mountAdHocImage(KDeviceType_DVD, UIMediumDeviceType_DVD, vboxGlobal().getDvdImage().toString());
    209209
    210210    /* Power UP if this is NOT separate process: */
     
    425425        /* Search for corresponding VM: */
    426426        CVirtualBox vbox = vboxGlobal().virtualBox();
    427         const QString strMachineID = vboxGlobal().managedVMUuid();
    428         const CMachine mach = vbox.FindMachine(strMachineID);
     427        const QUuid uMachineID = vboxGlobal().managedVMUuid();
     428        const CMachine mach = vbox.FindMachine(uMachineID.toString());
    429429        if (!vbox.isOk() || mach.isNull())
    430430        {
    431431            /* Unable to find VM: */
    432             msgCenter().cannotFindMachineById(vbox, strMachineID);
     432            msgCenter().cannotFindMachineById(vbox, uMachineID);
    433433            break;
    434434        }
     
    598598
    599599#ifdef RT_OS_DARWIN
    600 void UISession::sltHandleMenuBarConfigurationChange(const QString &strMachineID)
     600void UISession::sltHandleMenuBarConfigurationChange(const QUuid &aMachineID)
    601601{
    602602    /* Skip unrelated machine IDs: */
    603     if (vboxGlobal().managedVMUuid() != strMachineID)
     603    if (vboxGlobal().managedVMUuid() != aMachineID)
    604604        return;
    605605
     
    12541254    {
    12551255        /* Get machine ID: */
    1256         const QString strMachineID = vboxGlobal().managedVMUuid();
     1256        const QUuid uMachineID = vboxGlobal().managedVMUuid();
    12571257
    12581258        /* Prepare machine-window icon: */
     
    12721272#ifndef VBOX_WS_MAC
    12731273        /* Load user's machine-window name postfix: */
    1274         m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(strMachineID);
     1274        m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID);
    12751275#endif
    12761276
    12771277        /* Is there should be First RUN Wizard? */
    1278         m_fIsFirstTimeStarted = gEDataManager->machineFirstTimeStarted(strMachineID);
     1278        m_fIsFirstTimeStarted = gEDataManager->machineFirstTimeStarted(uMachineID);
    12791279
    12801280        /* Should guest autoresize? */
    12811281        QAction *pGuestAutoresizeSwitch = actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize);
    1282         pGuestAutoresizeSwitch->setChecked(gEDataManager->guestScreenAutoResizeEnabled(strMachineID));
     1282        pGuestAutoresizeSwitch->setChecked(gEDataManager->guestScreenAutoResizeEnabled(uMachineID));
    12831283
    12841284#ifndef VBOX_WS_MAC
     
    12861286        {
    12871287            const bool fEnabledGlobally = !gEDataManager->guiFeatureEnabled(GUIFeatureType_NoMenuBar);
    1288             const bool fEnabledForMachine = gEDataManager->menuBarEnabled(strMachineID);
     1288            const bool fEnabledForMachine = gEDataManager->menuBarEnabled(uMachineID);
    12891289            const bool fEnabled = fEnabledGlobally && fEnabledForMachine;
    12901290            QAction *pActionMenuBarSettings = actionPool()->action(UIActionIndexRT_M_View_M_MenuBar_S_Settings);
     
    13001300        {
    13011301            const bool fEnabledGlobally = !gEDataManager->guiFeatureEnabled(GUIFeatureType_NoStatusBar);
    1302             const bool fEnabledForMachine = gEDataManager->statusBarEnabled(strMachineID);
     1302            const bool fEnabledForMachine = gEDataManager->statusBarEnabled(uMachineID);
    13031303            const bool fEnabled = fEnabledGlobally && fEnabledForMachine;
    13041304            QAction *pActionStatusBarSettings = actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_S_Settings);
     
    13251325
    13261326        /* 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);
    13291329        m_fAllCloseActionsRestricted =  (!vboxGlobal().isSeparateProcess() || (m_restrictedCloseActions & MachineCloseAction_Detach))
    13301330                                     && (m_restrictedCloseActions & MachineCloseAction_SaveState)
     
    19261926
    19271927        /* Make sure medium ID is valid: */
    1928         const QString strMediumId = comMedium.GetId();
    1929         AssertReturn(!strMediumId.isNull(), false);
     1928        const QUuid uMediumId = comMedium.GetId();
     1929        AssertReturn(!uMediumId.isNull(), false);
    19301930
    19311931        /* Try to find UIMedium among cached: */
    1932         guiMedium = vboxGlobal().medium(strMediumId);
     1932        guiMedium = vboxGlobal().medium(uMediumId);
    19331933        if (guiMedium.isNull())
    19341934        {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r73953 r74878  
    347347#ifdef RT_OS_DARWIN
    348348    /** Mac OS X: Handles menu-bar configuration-change. */
    349     void sltHandleMenuBarConfigurationChange(const QString &strMachineID);
     349    void sltHandleMenuBarConfigurationChange(const QUuid &aMachineID);
    350350#endif /* RT_OS_DARWIN */
    351351
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r69500 r74878  
    138138
    139139#ifndef RT_OS_DARWIN
    140 void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange(const QString &strMachineID)
     140void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange(const QUuid &aMachineID)
    141141{
    142142    /* Skip unrelated machine IDs: */
    143     if (vboxGlobal().managedVMUuid() != strMachineID)
     143    if (vboxGlobal().managedVMUuid() != aMachineID)
    144144        return;
    145145
     
    172172#endif /* !RT_OS_DARWIN */
    173173
    174 void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange(const QString &strMachineID)
     174void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange(const QUuid &aMachineID)
    175175{
    176176    /* Skip unrelated machine IDs: */
    177     if (vboxGlobal().managedVMUuid() != strMachineID)
     177    if (vboxGlobal().managedVMUuid() != aMachineID)
    178178        return;
    179179
     
    306306        }
    307307        /* Post-configure status-bar: */
    308         connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)),
    309                 this, SLOT(sltHandleStatusBarConfigurationChange(const QString&)));
     308        connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QUuid &)),
     309                this, SLOT(sltHandleStatusBarConfigurationChange(const QUuid &)));
    310310#ifdef VBOX_WS_MAC
    311311        /* Make sure the status-bar is aware of action hovering: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r69500 r74878  
    6868#ifndef RT_OS_DARWIN
    6969    /** Handles menu-bar configuration-change. */
    70     void sltHandleMenuBarConfigurationChange(const QString &strMachineID);
     70    void sltHandleMenuBarConfigurationChange(const QUuid &aMachineID);
    7171    /** Handles menu-bar context-menu-request. */
    7272    void sltHandleMenuBarContextMenuRequest(const QPoint &position);
     
    7474
    7575    /** Handles status-bar configuration-change. */
    76     void sltHandleStatusBarConfigurationChange(const QString &strMachineID);
     76    void sltHandleStatusBarConfigurationChange(const QUuid &aMachineID);
    7777    /** Handles status-bar context-menu-request. */
    7878    void sltHandleStatusBarContextMenuRequest(const QPoint &position);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r74870 r74878  
    343343    /* Look for at least one inaccessible medium: */
    344344    bool fIsThereAnyInaccessibleMedium = false;
    345     foreach (const QString &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)
    348348        {
    349349            fIsThereAnyInaccessibleMedium = true;
     
    431431#endif /* VBOX_WS_MAC */
    432432
    433 void UISelectorWindow::sltHandleStateChange(QString)
     433void UISelectorWindow::sltHandleStateChange(const QUuid &)
    434434{
    435435    /* Get current item: */
     
    654654
    655655    /* Make sure this machine was NOT registered already: */
    656     CMachine oldMachine = vbox.FindMachine(newMachine.GetId());
     656    CMachine oldMachine = vbox.FindMachine(newMachine.GetId().toString());
    657657    if (!oldMachine.isNull())
    658658    {
     
    667667void UISelectorWindow::sltOpenMachineSettingsDialog(const QString &strCategoryRef /* = QString() */,
    668668                                                    const QString &strControlRef /* = QString() */,
    669                                                     const QString &strID /* = QString() */)
     669                                                    const QUuid &aID /* = QString() */)
    670670{
    671671    /* This slot should not be called when there is not selection: */
     
    705705    /* Create and execute corresponding VM settings window: */
    706706    UISettingsDialogMachine dialog(this,
    707                                    QUuid(strID).isNull() ? currentItem()->id() : strID,
     707                                   aID.isNull() ? currentItem()->id() : aID,
    708708                                   strCategory, strControl);
    709709    dialog.execute();
     
    11191119        QIManagerDialog *pLogViewerDialog = 0;
    11201120        /* Create and Show VM Log Viewer: */
    1121         if (!m_logViewers[pItem->machine().GetHardwareUUID()])
     1121        if (!m_logViewers[pItem->machine().GetHardwareUUID().toString()])
    11221122        {
    11231123            UIVMLogViewerDialogFactory dialogFactory(actionPool(), pItem->machine());
     
    11251125            if (pLogViewerDialog)
    11261126            {
    1127                 m_logViewers[pItem->machine().GetHardwareUUID()] = pLogViewerDialog;
     1127                m_logViewers[pItem->machine().GetHardwareUUID().toString()] = pLogViewerDialog;
    11281128                connect(pLogViewerDialog, &QIManagerDialog::sigClose,
    11291129                        this, &UISelectorWindow::sltCloseLogViewerWindow);
     
    11321132        else
    11331133        {
    1134             pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID()];
     1134            pLogViewerDialog = m_logViewers[pItem->machine().GetHardwareUUID().toString()];
    11351135        }
    11361136        if (pLogViewerDialog)
     
    22382238
    22392239    /* VM desktop connections: */
    2240     connect(m_pPaneToolsMachine, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)),
    2241             this, SLOT(sltOpenMachineSettingsDialog(const QString&, const QString&, const QString&)));
     2240    connect(m_pPaneToolsMachine, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)),
     2241            this, SLOT(sltOpenMachineSettingsDialog(const QString&, const QString&, const QUuid&)));
    22422242
    22432243    /* Global event handlers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r74868 r74878  
    118118      * @{ */
    119119        /** Handles CVirtualBox event about state change for machine with @a strID. */
    120         void sltHandleStateChange(QString strID);
     120        void sltHandleStateChange(const QUuid &aID);
    121121    /** @} */
    122122
     
    163163        void sltOpenMachineSettingsDialog(const QString &strCategory = QString(),
    164164                                          const QString &strControl = QString(),
    165                                           const QString &strID = QString());
     165                                          const QUuid &aID = QString());
    166166        /** Handles call to open Clone Machine wizard. */
    167167        void sltOpenCloneMachineWizard();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.h

    r70185 r74878  
    5353    void sigToggleFinished();
    5454    /** Redirects signal from UIGDetails to UISelectorWindow. */
    55     void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     55    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    5656
    5757public:
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp

    r72704 r74878  
    224224    bool needsResort = true;
    225225
    226     m_strId = m_machine.GetId();
     226    m_uId = m_machine.GetId();
    227227    m_strSettingsFile = m_machine.GetSettingsFilePath();
    228228
     
    270270        /* Also take restrictions into account: */
    271271        if (   m_configurationAccessLevel != ConfigurationAccessLevel_Null
    272             && !gEDataManager->machineReconfigurationEnabled(m_strId))
     272            && !gEDataManager->machineReconfigurationEnabled(m_uId))
    273273            m_configurationAccessLevel = ConfigurationAccessLevel_Null;
    274274
    275275        /* Should we show details for this item? */
    276         m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_strId);
     276        m_fHasDetails = gEDataManager->showMachineInSelectorDetails(m_uId);
    277277    }
    278278    else
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.h

    r72704 r74878  
    4747    QPixmap osPixmap(QSize *pLogicalSize = 0) const;
    4848    QString osTypeId() const { return m_strOSTypeId; }
    49     QString id() const { return m_strId; }
     49    QUuid   id() const { return m_uId; }
    5050
    5151    QString machineStateName() const;
     
    9393
    9494    /* Cached machine data (to minimize server requests) */
    95     QString m_strId;
     95    QUuid m_uId;
    9696    QString m_strSettingsFile;
    9797
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h

    r69500 r74878  
    115115    virtual bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const = 0;
    116116    virtual void clearItems(UIGChooserItemType type = UIGChooserItemType_Any) = 0;
    117     virtual void updateAll(const QString &strId) = 0;
    118     virtual void removeAll(const QString &strId) = 0;
     117    virtual void updateAll(const QUuid &aId) = 0;
     118    virtual void removeAll(const QUuid &aId) = 0;
    119119    virtual UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0;
    120120    virtual UIGChooserItemMachine* firstMachineItem() = 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp

    r72709 r74878  
    259259}
    260260
    261 bool UIGChooserItemGroup::isContainsMachine(const QString &strId) const
     261bool UIGChooserItemGroup::isContainsMachine(const QUuid &aId) const
    262262{
    263263    /* Check each machine-item: */
    264264    foreach (UIGChooserItem *pItem, m_machineItems)
    265         if (pItem->toMachineItem()->id() == strId)
     265        if (pItem->toMachineItem()->id() == aId)
    266266            return true;
    267267    /* Found nothing? */
     
    934934}
    935935
    936 void UIGChooserItemGroup::updateAll(const QString &strId)
     936void UIGChooserItemGroup::updateAll(const QUuid &aId)
    937937{
    938938    /* Update all the required items recursively: */
    939939    foreach (UIGChooserItem *pItem, items())
    940         pItem->updateAll(strId);
    941 }
    942 
    943 void UIGChooserItemGroup::removeAll(const QString &strId)
     940        pItem->updateAll(aId);
     941}
     942
     943void UIGChooserItemGroup::removeAll(const QUuid &aId)
    944944{
    945945    /* Remove all the required items recursively: */
    946946    foreach (UIGChooserItem *pItem, items())
    947         pItem->removeAll(strId);
     947        pItem->removeAll(aId);
    948948}
    949949
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h

    r72708 r74878  
    7979
    8080    /* API: Children stuff: */
    81     bool isContainsMachine(const QString &strId) const;
     81    bool isContainsMachine(const QUuid &aId) const;
    8282    bool isContainsLockedMachine();
    8383
     
    143143    bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const;
    144144    void clearItems(UIGChooserItemType type = UIGChooserItemType_Any);
    145     void updateAll(const QString &strId);
    146     void removeAll(const QString &strId);
     145    void updateAll(const QUuid &aId);
     146    void removeAll(const QUuid &aId);
    147147    UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
    148148    UIGChooserItemMachine* firstMachineItem();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r72709 r74878  
    544544}
    545545
    546 void UIGChooserItemMachine::updateAll(const QString &strId)
     546void UIGChooserItemMachine::updateAll(const QUuid &aId)
    547547{
    548548    /* Skip other ids: */
    549     if (id() != strId)
     549    if (id() != aId)
    550550        return;
    551551
     
    563563}
    564564
    565 void UIGChooserItemMachine::removeAll(const QString &strId)
     565void UIGChooserItemMachine::removeAll(const QUuid &aId)
    566566{
    567567    /* Skip wrong id: */
    568     if (id() != strId)
     568    if (id() != aId)
    569569        return;
    570570
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h

    r72708 r74878  
    125125    bool hasItems(UIGChooserItemType type) const;
    126126    void clearItems(UIGChooserItemType type);
    127     void updateAll(const QString &strId);
    128     void removeAll(const QString &strId);
     127    void updateAll(const QUuid &aId);
     128    void removeAll(const QUuid &aId);
    129129    UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
    130130    UIGChooserItemMachine* firstMachineItem();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r73926 r74878  
    678678}
    679679
    680 void UIGChooserModel::sltMachineStateChanged(QString strId, KMachineState)
     680void UIGChooserModel::sltMachineStateChanged(const QUuid &aId, const KMachineState)
    681681{
    682682    /* Update machine-items with passed id: */
    683     mainRoot()->updateAll(strId);
    684 }
    685 
    686 void UIGChooserModel::sltMachineDataChanged(QString strId)
     683    mainRoot()->updateAll(aId);
     684}
     685
     686void UIGChooserModel::sltMachineDataChanged(const QUuid &aId)
    687687{
    688688    /* 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
     692void UIGChooserModel::sltMachineRegistered(const QUuid &aId, const bool fRegistered)
    693693{
    694694    /* New VM registered? */
     
    696696    {
    697697        /* Search for corresponding machine: */
    698         CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);
     698        CMachine machine = vboxGlobal().virtualBox().FindMachine(aId.toString());
    699699        /* Should we show this machine? */
    700         if (gEDataManager->showMachineInSelectorChooser(strId))
     700        if (gEDataManager->showMachineInSelectorChooser(aId))
    701701        {
    702702            /* Add new machine-item: */
     
    706706            updateLayout();
    707707            /* Change current-item only if VM was created from the GUI side: */
    708             if (strId == m_strLastCreatedMachineId)
     708            if (aId == m_uLastCreatedMachineId)
    709709            {
    710710                setCurrentItem(mainRoot()->searchForItem(machine.GetName(),
     
    718718    {
    719719        /* Remove machine-items with passed id: */
    720         mainRoot()->removeAll(strId);
     720        mainRoot()->removeAll(aId);
    721721        /* Update model: */
    722722        cleanupGroupTree();
     
    734734}
    735735
    736 void UIGChooserModel::sltSessionStateChanged(QString strId, KSessionState)
     736void UIGChooserModel::sltSessionStateChanged(const QUuid &aId, const KSessionState)
    737737{
    738738    /* 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
     742void UIGChooserModel::sltSnapshotChanged(const QUuid &aId, const QUuid &)
    743743{
    744744    /* Update machine-items with passed id: */
    745     mainRoot()->updateAll(strId);
     745    mainRoot()->updateAll(aId);
    746746}
    747747
     
    936936     * on success for current-item handling: */
    937937    if (pWizard->exec() == QDialog::Accepted)
    938         m_strLastCreatedMachineId = pWizard->createdMachineId();
     938        m_uLastCreatedMachineId = pWizard->createdMachineId();
    939939
    940940    if (pWizard)
     
    997997}
    998998
    999 void UIGChooserModel::sltReloadMachine(const QString &strId)
     999void UIGChooserModel::sltReloadMachine(const QUuid &aId)
    10001000{
    10011001    /* Remove all the items first: */
    1002     mainRoot()->removeAll(strId);
     1002    mainRoot()->removeAll(aId);
    10031003    /* Wipe out empty groups: */
    10041004    cleanupGroupTree();
    10051005
    10061006    /* 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))
    10091009        addMachineIntoTheTree(machine);
    10101010
     
    10901090
    10911091    /* Prepare arrays: */
    1092     QMap<QString, bool> verdicts;
     1092    QMap<QUuid, bool> verdicts;
    10931093    QList<UIGChooserItem*> itemsToRemove;
    1094     QStringList machinesToUnregister;
     1094    QList<QUuid> machinesToUnregister;
    10951095
    10961096    /* For each selected machine-item: */
     
    10981098    {
    10991099        /* Get machine-item id: */
    1100         QString strId = pItem->toMachineItem()->id();
     1100        QUuid aId = pItem->toMachineItem()->id();
    11011101
    11021102        /* We already decided for that machine? */
    1103         if (verdicts.contains(strId))
     1103        if (verdicts.contains(aId))
    11041104        {
    11051105            /* To remove similar machine items? */
    1106             if (!verdicts[strId])
     1106            if (!verdicts[aId])
    11071107                itemsToRemove << pItem;
    11081108            continue;
     
    11121112        int iSelectedCopyCount = 0;
    11131113        foreach (UIGChooserItem *pSelectedItem, selectedMachineItemList)
    1114             if (pSelectedItem->toMachineItem()->id() == strId)
     1114            if (pSelectedItem->toMachineItem()->id() == aId)
    11151115                ++iSelectedCopyCount;
    11161116        /* Existing copy count: */
    11171117        int iExistingCopyCount = 0;
    11181118        foreach (UIGChooserItem *pExistingItem, existingMachineItemList)
    1119             if (pExistingItem->toMachineItem()->id() == strId)
     1119            if (pExistingItem->toMachineItem()->id() == aId)
    11201120                ++iExistingCopyCount;
    11211121        /* If selected copy count equal to existing copy count,
     
    11231123         * we will just propose to remove selected items: */
    11241124        bool fVerdict = iSelectedCopyCount == iExistingCopyCount;
    1125         verdicts.insert(strId, fVerdict);
     1125        verdicts.insert(aId, fVerdict);
    11261126        if (fVerdict)
    1127             machinesToUnregister << strId;
     1127            machinesToUnregister.append(aId);
    11281128        else
    11291129            itemsToRemove << pItem;
     
    13321332
    13331333    /* Setup global connections: */
    1334     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
    1335             this, SLOT(sltMachineStateChanged(QString, KMachineState)));
    1336     connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
    1337             this, SLOT(sltMachineDataChanged(QString)));
    1338     connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),
    1339             this, SLOT(sltMachineRegistered(QString, bool)));
    1340     connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)),
    1341             this, SLOT(sltSessionStateChanged(QString, KSessionState)));
    1342     connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QString, QString)),
    1343             this, SLOT(sltSnapshotChanged(QString, QString)));
    1344     connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QString, QString)),
    1345             this, SLOT(sltSnapshotChanged(QString, QString)));
    1346     connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)),
    1347             this, SLOT(sltSnapshotChanged(QString, QString)));
    1348     connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QString, QString)),
    1349             this, SLOT(sltSnapshotChanged(QString, 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)));
    13501350}
    13511351
     
    15441544}
    15451545
    1546 void UIGChooserModel::unregisterMachines(const QStringList &ids)
     1546void UIGChooserModel::unregisterMachines(const QList<QUuid> &ids)
    15471547{
    15481548    /* Populate machine list: */
    15491549    QList<CMachine> machines;
    15501550    CVirtualBox vbox = vboxGlobal().virtualBox();
    1551     foreach (const QString &strId, ids)
    1552     {
    1553         CMachine machine = vbox.FindMachine(strId);
     1551    foreach (const QUuid &uId, ids)
     1552    {
     1553        CMachine machine = vbox.FindMachine(uId.toString());
    15541554        if (!machine.isNull())
    15551555            machines << machine;
     
    17541754    foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines())
    17551755    {
    1756         const QString strMachineID = machine.GetId();
    1757         if (!strMachineID.isEmpty() && gEDataManager->showMachineInSelectorChooser(strMachineID))
     1756        const QUuid uMachineID = machine.GetId();
     1757        if (!uMachineID.isNull() && gEDataManager->showMachineInSelectorChooser(uMachineID))
    17581758            addMachineIntoTheTree(machine);
    17591759    }
     
    17691769
    17701770    /* Which VM we are loading: */
    1771     LogRelFlow(("UIGChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toUtf8().constData()));
     1771    LogRelFlow(("UIGChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toString().toUtf8().constData()));
    17721772    /* Is that machine accessible? */
    17731773    if (machine.GetAccessible())
     
    17931793        }
    17941794        /* Update group definitions: */
    1795         m_groups[machine.GetId()] = groupList;
     1795        m_groups[machine.GetId().toString()] = groupList;
    17961796    }
    17971797    /* Inaccessible machine: */
     
    17991799    {
    18001800        /* VM is accessible: */
    1801         LogRelFlow(("UIGChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toUtf8().constData()));
     1801        LogRelFlow(("UIGChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toString().toUtf8().constData()));
    18021802        /* Create machine-item with main-root group-item as parent: */
    18031803        createMachineItem(machine, mainRoot());
     
    18941894            /* Which position should be current item placed by definitions? */
    18951895            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() :
    18971897                                        QString();
    18981898            AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!"));
     
    19641964                              pParentItem, machine,
    19651965                              /* Which position new group-item should be placed in? */
    1966                               getDesiredPosition(pParentItem, UIGChooserItemType_Machine, machine.GetId()));
     1966                              getDesiredPosition(pParentItem, UIGChooserItemType_Machine, machine.GetId().toString()));
    19671967}
    19681968
     
    19801980    UIGroupDefinitionSaveThread::prepare();
    19811981    emit sigGroupSavingStateChanged();
    1982     connect(UIGroupDefinitionSaveThread::instance(), SIGNAL(sigReload(QString)),
    1983             this, SLOT(sltReloadMachine(QString)));
     1982    connect(UIGroupDefinitionSaveThread::instance(), SIGNAL(sigReload(QUuid)),
     1983            this, SLOT(sltReloadMachine(QUuid)));
    19841984    UIGroupDefinitionSaveThread::instance()->configure(this, m_groups, groups);
    19851985    UIGroupDefinitionSaveThread::instance()->start();
     
    20112011        if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem())
    20122012            if (pMachineItem->accessible())
    2013                 groups[pMachineItem->id()] << pParentGroup->fullName();
     2013                groups[pMachineItem->id().toString()] << pParentGroup->fullName();
    20142014    /* Iterate over all the group-items: */
    20152015    foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group))
     
    20312031    /* Iterate over all the machine-items: */
    20322032    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());
    20342034}
    20352035
     
    21302130        {
    21312131            /* 1. Open session: */
    2132             session = vboxGlobal().openSession(strId);
     2132            session = vboxGlobal().openSession(QUuid(strId));
    21332133            if (session.isNull())
    21342134                break;
     
    21582158        /* Cleanup if necessary: */
    21592159        if (machine.isNull() || !machine.isOk())
    2160             emit sigReload(strId);
     2160            emit sigReload(QUuid(strId));
    21612161        if (!session.isNull())
    21622162            session.UnlockMachine();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h

    r70552 r74878  
    2121/* Qt includes: */
    2222#include <QObject>
     23#include <QUuid>
    2324#include <QPointer>
    2425#include <QTransform>
     
    159160
    160161    /* 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);
    166167
    167168    /* Handler: Chooser-view stuff: */
     
    184185    void sltCreateNewMachine();
    185186    void sltGroupSelectedMachines();
    186     void sltReloadMachine(const QString &strId);
     187    void sltReloadMachine(const QUuid &aId);
    187188    void sltSortParentGroup();
    188189    void sltPerformRefreshAction();
     
    247248    /* Helpers: Machine-item stuff: */
    248249    void removeItems(const QList<UIGChooserItem*> &itemsToRemove);
    249     void unregisterMachines(const QStringList &ids);
     250    void unregisterMachines(const QList<QUuid> &ids);
    250251
    251252    /* Helpers: Context-menu stuff: */
     
    303304
    304305    /** Holds the Id of last VM created from the GUI side. */
    305     QString m_strLastCreatedMachineId;
     306    QUuid m_uLastCreatedMachineId;
    306307};
    307308
     
    314315
    315316    /* Notifier: Reload stuff: */
    316     void sigReload(QString strId);
     317    void sigReload(const QUuid &aId);
    317318
    318319    /* Notifier: Complete stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.cpp

    r69726 r74878  
    102102    connect(m_pDetailsModel, SIGNAL(sigRootItemMinimumHeightHintChanged(int)),
    103103            m_pDetailsView, SLOT(sltMinimumHeightHintChanged(int)));
    104     connect(m_pDetailsModel, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)),
    105             this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)));
     104    connect(m_pDetailsModel, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)),
     105            this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)));
    106106    connect(this, SIGNAL(sigSlidingStarted()),
    107107            m_pDetailsModel, SLOT(sltHandleSlidingStarted()));
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetails.h

    r69500 r74878  
    3636
    3737    /* Notifier: Link processing stuff: */
    38     void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     38    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    3939
    4040    /* Notifier: Sliding stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp

    r72710 r74878  
    470470    connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)),
    471471            model(), SLOT(sltToggleElements(DetailsElementType, bool)));
    472     connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)),
    473             model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)));
     472    connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)),
     473            model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QUuid&)));
    474474}
    475475
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.h

    r72710 r74878  
    5959
    6060    /* Notifier: Link-click stuff: */
    61     void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     61    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    6262
    6363public:
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.cpp

    r71355 r74878  
    7777
    7878    /* Generate new group-id: */
    79     m_strGroupId = QUuid::createUuid().toString();
     79    m_uGroupId = QUuid::createUuid();
    8080
    8181    /* Request to build first step: */
    82     emit sigBuildStep(m_strGroupId, 0);
     82    emit sigBuildStep(m_uGroupId, 0);
    8383}
    8484
     
    8686{
    8787    /* 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
     91void UIGDetailsGroup::sltBuildStep(const QUuid &aStepId, const int iStepNumber)
    9292{
    9393    /* Cleanup build-step: */
     
    9696
    9797    /* Is step id valid? */
    98     if (strStepId != m_strGroupId)
     98    if (aStepId != m_uGroupId)
    9999        return;
    100100
     
    111111
    112112        /* Create next build-step: */
    113         m_pBuildStep = new UIBuildStep(this, pSet, strStepId, iStepNumber + 1);
     113        m_pBuildStep = new UIBuildStep(this, pSet, aStepId, iStepNumber + 1);
    114114
    115115        /* Build set: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h

    r69500 r74878  
    5656
    5757    /* Handler: Build stuff: */
    58     void sltBuildStep(QString strStepId, int iStepNumber);
     58    void sltBuildStep(const QUuid &aStepId, const int iStepNumber);
    5959
    6060private:
     
    9696    QList<UIVMItem*> m_machineItems;
    9797    UIBuildStep *m_pBuildStep;
    98     QString m_strGroupId;
     98    QUuid m_uGroupId;
    9999
    100100    /* Friends: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.cpp

    r69500 r74878  
    271271}
    272272
    273 void UIGDetailsItem::sltBuildStep(QString, int)
     273void UIGDetailsItem::sltBuildStep(const QUuid &, const int)
    274274{
    275275    AssertMsgFailed(("This item doesn't support building!"));
     
    329329}
    330330
    331 UIBuildStep::UIBuildStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber)
     331UIBuildStep::UIBuildStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber)
    332332    : QObject(pParent)
    333     , m_strStepId(strStepId)
     333    , m_uStepId(aStepId)
    334334    , m_iStepNumber(iStepNumber)
    335335{
    336336    /* Prepare connections: */
    337337    connect(pBuildObject, SIGNAL(sigBuildDone()), this, SLOT(sltStepDone()), Qt::QueuedConnection);
    338     connect(this, SIGNAL(sigStepDone(QString, int)), pParent, SLOT(sltBuildStep(QString, int)), Qt::QueuedConnection);
     338    connect(this, SIGNAL(sigStepDone(QUuid, int)), pParent, SLOT(sltBuildStep(QUuid, int)), Qt::QueuedConnection);
    339339}
    340340
    341341void UIBuildStep::sltStepDone()
    342342{
    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  
    1818#ifndef __UIGDetailsItem_h__
    1919#define __UIGDetailsItem_h__
     20
     21/* Qt includes: */
     22#include <QUuid>
    2023
    2124/* GUI includes: */
     
    5053
    5154    /* Notifiers: Build stuff: */
    52     void sigBuildStep(QString strStepId, int iStepNumber);
     55    void sigBuildStep(const QUuid &aStepId, const int iStepNumber);
    5356    void sigBuildDone();
    5457
     
    8992
    9093    /* Handler: Build stuff: */
    91     virtual void sltBuildStep(QString strStepId, int iStepNumber);
     94    virtual void sltBuildStep(const QUuid & aStepId, const int iStepNumber);
    9295
    9396protected:
     
    118121
    119122    /* Notifier: Build stuff: */
    120     void sigStepDone(QString strStepId, int iStepNumber);
     123    void sigStepDone(const QUuid &aStepId, const int iStepNumber);
    121124
    122125public:
    123126
    124127    /* Constructor: */
    125     UIBuildStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber);
     128    UIBuildStep(QObject *pParent, QObject *pBuildObject, const QUuid &aStepId, int iStepNumber);
    126129
    127130private slots:
     
    133136
    134137    /* Variables: */
    135     QString m_strStepId;
     138    QUuid m_uStepId;
    136139    int m_iStepNumber;
    137140};
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h

    r69500 r74878  
    5454
    5555    /* Notifier: Link processing stuff: */
    56     void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
     56    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &aId);
    5757
    5858public:
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.cpp

    r71355 r74878  
    113113}
    114114
    115 void UIGDetailsSet::sltBuildStep(QString strStepId, int iStepNumber)
     115void UIGDetailsSet::sltBuildStep(const QUuid &aStepId, const int iStepNumber)
    116116{
    117117    /* Cleanup build-step: */
     
    120120
    121121    /* Is step id valid? */
    122     if (strStepId != m_strSetId)
     122    if (aStepId != m_uSetId)
    123123        return;
    124124
     
    173173        {
    174174            /* Create next build-step: */
    175             m_pBuildStep = new UIBuildStep(this, pElement, strStepId, iStepNumber + 1);
     175            m_pBuildStep = new UIBuildStep(this, pElement, aStepId, iStepNumber + 1);
    176176
    177177            /* Build element: */
     
    182182        {
    183183            /* Just build next step: */
    184             sltBuildStep(strStepId, iStepNumber + 1);
     184            sltBuildStep(aStepId, iStepNumber + 1);
    185185        }
    186186    }
     
    198198}
    199199
    200 void UIGDetailsSet::sltMachineStateChange(QString strId)
     200void UIGDetailsSet::sltMachineStateChange(const QUuid &aId)
    201201{
    202202    /* Is this our VM changed? */
    203     if (m_machine.GetId() != strId)
     203    if (m_machine.GetId() != aId)
    204204        return;
    205205
     
    208208}
    209209
    210 void UIGDetailsSet::sltMachineAttributesChange(QString strId)
     210void UIGDetailsSet::sltMachineAttributesChange(const QUuid &aId)
    211211{
    212212    /* Is this our VM changed? */
    213     if (m_machine.GetId() != strId)
     213    if (m_machine.GetId() != aId)
    214214        return;
    215215
     
    346346{
    347347    /* Global-events connections: */
    348     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChange(QString)));
    349     connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), this, SLOT(sltMachineAttributesChange(QString)));
    350     connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltMachineAttributesChange(QString)));
    351     connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QString, QString)), this, SLOT(sltMachineAttributesChange(QString)));
    352     connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QString, QString)), this, SLOT(sltMachineAttributesChange(QString)));
    353     connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltMachineAttributesChange(QString)));
    354     connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QString, 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)));
    355355
    356356    /* Meidum-enumeration connections: */
     
    567567
    568568    /* Generate new set-id: */
    569     m_strSetId = QUuid::createUuid().toString();
     569    m_uSetId = QUuid::createUuid();
    570570
    571571    /* Request to build first step: */
    572     emit sigBuildStep(m_strSetId, DetailsElementType_General);
     572    emit sigBuildStep(m_uSetId, DetailsElementType_General);
    573573}
    574574
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.h

    r69500 r74878  
    6363
    6464    /* Handler: Build stuff: */
    65     void sltBuildStep(QString strStepId, int iStepNumber);
     65    void sltBuildStep(const QUuid &aStepId, const int iStepNumber);
    6666
    6767    /* 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);
    7070
    7171    /* Handler: Update stuff: */
     
    124124    UIBuildStep *m_pBuildStep;
    125125    int m_iLastStepNumber;
    126     QString m_strSetId;
     126    QUuid m_uSetId;
    127127    QMap<DetailsElementType, bool> m_settings;
    128128};
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp

    r71355 r74878  
    170170}
    171171
    172 void UIGMachinePreview::sltMachineStateChange(QString strId)
     172void UIGMachinePreview::sltMachineStateChange(const QUuid &aId)
    173173{
    174174    /* 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)
    176176        return;
    177177
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.h

    r69708 r74878  
    6666
    6767    /* Handler: Global-event listener stuff: */
    68     void sltMachineStateChange(QString strId);
     68    void sltMachineStateChange(const QUuid &aId);
    6969
    7070    /* Handler: Preview recreator: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r72092 r74878  
    330330*********************************************************************************************************************************/
    331331
    332 UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, const QString &strMachineId,
     332UISettingsDialogMachine::UISettingsDialogMachine(QWidget *pParent, const QUuid &aMachineId,
    333333                                                 const QString &strCategory, const QString &strControl)
    334334    : UISettingsDialog(pParent)
    335     , m_strMachineId(strMachineId)
     335    , m_uMachineId(aMachineId)
    336336    , m_strCategory(strCategory)
    337337    , m_strControl(strControl)
     
    408408    /* Prepare session: */
    409409    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);
    412412    /* Check that session was created: */
    413413    if (m_session.isNull())
     
    434434    /* Prepare session: */
    435435    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);
    438438    /* Check that session was created: */
    439439    if (m_session.isNull())
     
    482482        /* Disable First RUN Wizard: */
    483483        if (m_fResetFirstRunFlag)
    484             gEDataManager->setMachineFirstTimeStarted(false, m_strMachineId);
     484            gEDataManager->setMachineFirstTimeStarted(false, m_uMachineId);
    485485
    486486        /* Save settings finally: */
     
    509509    QString strDialogTitle;
    510510    /* 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());
    512512    if (!machine.isNull())
    513513        strDialogTitle = tr("%1 - %2").arg(machine.GetName()).arg(titleExtension());
     
    603603}
    604604
    605 void UISettingsDialogMachine::sltSessionStateChanged(QString strMachineId, KSessionState enmSessionState)
     605void UISettingsDialogMachine::sltSessionStateChanged(const QUuid &aMachineId, const KSessionState enmSessionState)
    606606{
    607607    /* Ignore if serialization is in progress: */
     
    609609        return;
    610610    /* Ignore if thats NOT our VM: */
    611     if (strMachineId != m_strMachineId)
     611    if (aMachineId != m_uMachineId)
    612612        return;
    613613
     
    622622}
    623623
    624 void UISettingsDialogMachine::sltMachineStateChanged(QString strMachineId, KMachineState enmMachineState)
     624void UISettingsDialogMachine::sltMachineStateChanged(const QUuid &aMachineId, const KMachineState enmMachineState)
    625625{
    626626    /* Ignore if serialization is in progress: */
     
    628628        return;
    629629    /* Ignore if thats NOT our VM: */
    630     if (strMachineId != m_strMachineId)
     630    if (aMachineId != m_uMachineId)
    631631        return;
    632632
     
    641641}
    642642
    643 void UISettingsDialogMachine::sltMachineDataChanged(QString strMachineId)
     643void UISettingsDialogMachine::sltMachineDataChanged(const QUuid &aMachineId)
    644644{
    645645    /* Ignore if serialization is in progress: */
     
    647647        return;
    648648    /* Ignore if thats NOT our VM: */
    649     if (strMachineId != m_strMachineId)
     649    if (aMachineId != m_uMachineId)
    650650        return;
    651651
     
    689689
    690690    /* 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());
    692692    AssertMsg(!m_machine.isNull(), ("Can't find corresponding machine!\n"));
    693693    m_enmSessionState = m_machine.GetSessionState();
     
    695695
    696696    /* Creating settings pages: */
    697     QList<MachineSettingsPageType> restrictedMachineSettingsPages = gEDataManager->restrictedMachineSettingsPages(m_strMachineId);
     697    QList<MachineSettingsPageType> restrictedMachineSettingsPages = gEDataManager->restrictedMachineSettingsPages(m_uMachineId);
    698698    for (int iPageIndex = MachineSettingsPageType_General; iPageIndex < MachineSettingsPageType_Max; ++iPageIndex)
    699699    {
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h

    r72092 r74878  
    8181
    8282    /** Constructs settings dialog passing @a pParent to the base-class.
    83       * @param  strMachineId  Brings the machine ID.
     83      * @param  aMachineId    Brings the machine ID.
    8484      * @param  strCategory   Brings the name of category to be opened.
    8585      * @param  strControl    Brings the name of control to be focused. */
    86     UISettingsDialogMachine(QWidget *pParent, const QString &strMachineId,
     86    UISettingsDialogMachine(QWidget *pParent, const QUuid &aMachineId,
    8787                            const QString &strCategory, const QString &strControl);
    8888
     
    117117private slots:
    118118
    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);
    125125
    126126    /** Handles request to allow to reset first run flag. */
     
    144144
    145145    /** Holds the machine ID. */
    146     QString  m_strMachineId;
     146    QUuid    m_uMachineId;
    147147    /** Holds the name of category to be opened. */
    148148    QString  m_strCategory;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r74862 r74878  
    13911391
    13921392        /* Get machine ID for further activities: */
    1393         QString strMachineId;
     1393        QUuid uMachineId;
    13941394        if (fSuccess)
    13951395        {
    1396             strMachineId = m_machine.GetId();
     1396            uMachineId = m_machine.GetId();
    13971397            fSuccess = m_machine.isOk();
    13981398        }
     
    14051405        if (fSuccess && newDisplayData.m_scaleFactors != oldDisplayData.m_scaleFactors)
    14061406        {
    1407             gEDataManager->setScaleFactors(newDisplayData.m_scaleFactors, strMachineId);
     1407            gEDataManager->setScaleFactors(newDisplayData.m_scaleFactors, uMachineId);
    14081408        }
    14091409    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r73926 r74878  
    871871
    872872                    /* Get medium id for further activities: */
    873                     QString strMediumId;
     873                    QUuid aMediumId;
    874874                    if (fSuccess)
    875875                    {
    876                         strMediumId = comMedium.GetId();
     876                        aMediumId = comMedium.GetId();
    877877                        fSuccess = comMedium.isOk();
    878878                    }
     
    906906
    907907                        /* Check if old password exists/provided: */
    908                         const QString strOldPasswordId = encryptedMedium.key(strMediumId);
     908                        const QString strOldPasswordId = encryptedMedium.key(aMediumId);
    909909                        const QString strOldPassword = encryptionPasswords.value(strOldPasswordId);
    910910
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp

    r71027 r74878  
    134134
    135135
    136 UIMachineSettingsInterface::UIMachineSettingsInterface(const QString strMachineId)
    137     : m_strMachineId(strMachineId)
     136UIMachineSettingsInterface::UIMachineSettingsInterface(const QUuid &aMachineId)
     137    : m_uMachineId(aMachineId)
    138138    , m_pActionPool(0)
    139139    , m_pCache(0)
     
    319319            m_pActionPool = UIActionPool::create(UIActionPoolType_Runtime);
    320320            m_pMenuBarEditor->setActionPool(m_pActionPool);
    321             m_pMenuBarEditor->setMachineID(m_strMachineId);
     321            m_pMenuBarEditor->setMachineID(m_uMachineId);
    322322        }
    323323
     
    326326        {
    327327            /* Configure editor: */
    328             m_pStatusBarEditor->setMachineID(m_strMachineId);
     328            m_pStatusBarEditor->setMachineID(m_uMachineId);
    329329        }
    330330    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h

    r72109 r74878  
    3737
    3838    /** Constructs User Interface settings page. */
    39     UIMachineSettingsInterface(const QString strMachineId);
     39    UIMachineSettingsInterface(const QUuid &aMachineId);
    4040    /** Destructs User Interface settings page. */
    4141    ~UIMachineSettingsInterface();
     
    8383
    8484    /** Holds the machine ID copy. */
    85     const QString  m_strMachineId;
     85    const QUuid    m_uMachineId;
    8686    /** Holds the action-pool instance. */
    8787    UIActionPool  *m_pActionPool;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r73953 r74878  
    6969        , m_iAttachmentPort(-1)
    7070        , m_iAttachmentDevice(-1)
    71         , m_strAttachmentMediumId(QString())
     71        , m_uAttachmentMediumId(QUuid())
    7272        , m_fAttachmentPassthrough(false)
    7373        , m_fAttachmentTempEject(false)
     
    8383               && (m_iAttachmentPort == other.m_iAttachmentPort)
    8484               && (m_iAttachmentDevice == other.m_iAttachmentDevice)
    85                && (m_strAttachmentMediumId == other.m_strAttachmentMediumId)
     85               && (m_uAttachmentMediumId == other.m_uAttachmentMediumId)
    8686               && (m_fAttachmentPassthrough == other.m_fAttachmentPassthrough)
    8787               && (m_fAttachmentTempEject == other.m_fAttachmentTempEject)
     
    103103    LONG         m_iAttachmentDevice;
    104104    /** Holds the attachment medium ID. */
    105     QString      m_strAttachmentMediumId;
     105    QUuid        m_uAttachmentMediumId;
    106106    /** Holds whether the attachment being passed through. */
    107107    bool         m_fAttachmentPassthrough;
     
    604604}
    605605
    606 QString AbstractItem::machineId() const
     606QUuid AbstractItem::machineId() const
    607607{
    608608    return mMachineId;
    609609}
    610610
    611 void AbstractItem::setMachineId (const QString &aMachineId)
     611void AbstractItem::setMachineId (const QUuid &aMachineId)
    612612{
    613613    mMachineId = aMachineId;
     
    943943}
    944944
    945 QString AttachmentItem::attMediumId() const
     945QUuid AttachmentItem::attMediumId() const
    946946{
    947947    return mAttMediumId;
     
    983983}
    984984
    985 void AttachmentItem::setAttMediumId (const QString &aAttMediumId)
    986 {
    987     AssertMsg(!aAttMediumId.isEmpty(), ("Medium ID value can't be null/empty!\n"));
     985void AttachmentItem::setAttMediumId (const QUuid &aAttMediumId)
     986{
     987    /// @todo is this required?
     988    //AssertMsg(!aAttMediumId.isNull(), ("Medium ID value can't be null!\n"));
    988989    mAttMediumId = vboxGlobal().medium(aAttMediumId).id();
    989990    cache();
     
    12731274        {
    12741275            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
    1275                 return item->id().toString();
    1276             return QUuid().toString();
     1276                return item->id();
     1277            return QUuid();
    12771278        }
    12781279        case R_ItemPixmap:
     
    15111512                if (item->rtti() == AbstractItem::Type_AttachmentItem)
    15121513                    return static_cast <AttachmentItem*> (item)->attMediumId();
    1513             return QString();
     1514            return QUuid();
    15141515        }
    15151516        case R_AttIsHostDrive:
     
    17581759                if (item->rtti() == AbstractItem::Type_AttachmentItem)
    17591760                {
    1760                     static_cast <AttachmentItem*> (item)->setAttMediumId (aValue.toString());
     1761                    static_cast <AttachmentItem*> (item)->setAttMediumId (aValue.toUuid());
    17611762                    emit dataChanged (aIndex, aIndex);
    17621763                    return true;
     
    18341835}
    18351836
    1836 QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QString &strMediumId)
     1837QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QUuid &aMediumId)
    18371838{
    18381839    if (AbstractItem *parent = mRootItem->childItemById (aCtrId))
     
    18431844        AttachmentItem *pItem = new AttachmentItem (parent, aDeviceType);
    18441845        pItem->setAttIsHotPluggable(m_configurationAccessLevel != ConfigurationAccessLevel_Full);
    1845         pItem->setAttMediumId(strMediumId);
     1846        pItem->setAttMediumId(aMediumId);
    18461847        endInsertRows();
    18471848        return index (parent->childCount() - 1, 0, parentIndex);
     
    18651866}
    18661867
    1867 void StorageModel::setMachineId (const QString &aMachineId)
     1868void StorageModel::setMachineId (const QUuid &aMachineId)
    18681869{
    18691870    mRootItem->setMachineId (aMachineId);
     
    21202121    UIMediumIDHolder(QWidget *pParent) : QObject(pParent) {}
    21212122
    2122     QString id() const { return m_strId; }
    2123     void setId(const QString &strId) { m_strId = strId; emit sigChanged(); }
     2123    QUuid id() const { return m_uId; }
     2124    void setId(const QUuid &aId) { m_uId = aId; emit sigChanged(); }
    21242125
    21252126    UIMediumDeviceType type() const { return m_type; }
    21262127    void setType(UIMediumDeviceType type) { m_type = type; }
    21272128
    2128     bool isNull() const { return m_strId == UIMedium().id(); }
     2129    bool isNull() const { return m_uId == UIMedium().id(); }
    21292130
    21302131signals:
     
    21342135private:
    21352136
    2136     QString m_strId;
     2137    QUuid m_uId;
    21372138    UIMediumDeviceType m_type;
    21382139};
     
    21912192
    21922193    /* Gather old common data: */
    2193     m_strMachineId = m_machine.GetId();
     2194    m_uMachineId = m_machine.GetId();
    21942195    m_strMachineSettingsFilePath = m_machine.GetSettingsFilePath();
    21952196    m_strMachineName = m_machine.GetName();
     
    22492250                    oldAttachmentData.m_fAttachmentHotPluggable = comAttachment.GetHotPluggable();
    22502251                    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();
    22522253                    /* Override controller cache key: */
    22532254                    strAttachmentKey = QString("%1:%2").arg(oldAttachmentData.m_iAttachmentPort).arg(oldAttachmentData.m_iAttachmentDevice);
     
    22762277
    22772278    /* Load old common data from the cache: */
    2278     m_pModelStorage->setMachineId(m_strMachineId);
     2279    m_pModelStorage->setMachineId(m_uMachineId);
    22792280
    22802281    /* For each controller: */
     
    23052306            const QModelIndex attachmentIndex = m_pModelStorage->addAttachment(controllerId,
    23062307                                                                               oldAttachmentData.m_attachmentType,
    2307                                                                                oldAttachmentData.m_strAttachmentMediumId);
     2308                                                                               oldAttachmentData.m_uAttachmentMediumId);
    23082309            const StorageSlot attachmentStorageSlot(oldControllerData.m_controllerBus,
    23092310                                                    oldAttachmentData.m_iAttachmentPort,
     
    23682369            newAttachmentData.m_fAttachmentNonRotational = m_pModelStorage->data(attachmentIndex, StorageModel::R_AttIsNonRotational).toBool();
    23692370            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();
    23712372            const QString strAttachmentKey = QString("%1:%2").arg(newAttachmentData.m_iAttachmentPort).arg(newAttachmentData.m_iAttachmentDevice);
    23722373
     
    26272628}
    26282629
    2629 void UIMachineSettingsStorage::sltHandleMediumEnumerated(const QString &strMediumId)
     2630void UIMachineSettingsStorage::sltHandleMediumEnumerated(const QUuid &aMediumId)
    26302631{
    26312632    /* Search for corresponding medium: */
    2632     const UIMedium medium = vboxGlobal().medium(strMediumId);
     2633    const UIMedium medium = vboxGlobal().medium(aMediumId);
    26332634
    26342635    const QModelIndex rootIndex = m_pModelStorage->root();
     
    26392640        {
    26402641            const QModelIndex attIndex = ctrIndex.child(j, 0);
    2641             const QString attMediumId = m_pModelStorage->data(attIndex, StorageModel::R_AttMediumId).toString();
     2642            const QUuid attMediumId = m_pModelStorage->data(attIndex, StorageModel::R_AttMediumId).toString();
    26422643            if (attMediumId == medium.id())
    26432644            {
     
    26512652}
    26522653
    2653 void UIMachineSettingsStorage::sltHandleMediumDeleted(const QString &strMediumId)
     2654void UIMachineSettingsStorage::sltHandleMediumDeleted(const QUuid &aMediumId)
    26542655{
    26552656    QModelIndex rootIndex = m_pModelStorage->root();
     
    26602661        {
    26612662            QModelIndex attIndex = ctrIndex.child(j, 0);
    2662             QString attMediumId = 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)
    26642665            {
    26652666                m_pModelStorage->setData(attIndex, UIMedium().id(), StorageModel::R_AttMediumId);
     
    30883089void UIMachineSettingsStorage::sltCreateNewHardDisk()
    30893090{
    3090     const QString 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);
    30933094}
    30943095
     
    31013102{
    31023103    const QString strMachineFolder(QFileInfo(m_strMachineSettingsFilePath).absolutePath());
    3103     const QString 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);
    31063107}
    31073108
     
    31263127        const UIMediumDeviceType enmMediumType = (UIMediumDeviceType)mediumInfoList[0].toUInt();
    31273128        const QString strMediumLocation = mediumInfoList[1];
    3128         const QString 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);
    31313132    }
    31323133}
     
    36903691{
    36913692    /* Configure this: */
    3692     connect(&vboxGlobal(), SIGNAL(sigMediumEnumerated(const QString &)),
    3693             this, SLOT(sltHandleMediumEnumerated(const QString &)));
    3694     connect(&vboxGlobal(), SIGNAL(sigMediumDeleted(const QString &)),
    3695             this, SLOT(sltHandleMediumDeleted(const QString &)));
     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 &)));
    36963697
    36973698    /* Configure tree-view: */
     
    37953796}
    37963797
    3797 QString UIMachineSettingsStorage::openMediumSelectorDialog(UIMediumDeviceType  enmMediumType)
     3798QUuid UIMachineSettingsStorage::openMediumSelectorDialog(UIMediumDeviceType  enmMediumType)
    37983799{
    37993800    QWidget *pParent = windowManager().realParentWindow(this);
     
    38063807    if (pSelector->execute(true, false))
    38073808    {
    3808         QStringList selectedMediumIds = pSelector->selectedMediumIds();
     3809        QList<QUuid> selectedMediumIds = pSelector->selectedMediumIds();
    38093810        delete pSelector;
    38103811        /* Currently we only care about the 0th since we support single selection by intention: */
    38113812        if (selectedMediumIds.isEmpty())
    3812             return QString();
     3813            return QUuid();
    38133814        else
    38143815            return selectedMediumIds[0];
     
    38163817
    38173818    delete pSelector;
    3818     return QString();
     3819    return QUuid();
    38193820}
    38203821
     
    38273828    const QString strMachineFolder(QFileInfo(m_strMachineSettingsFilePath).absolutePath());
    38283829
    3829     QString strMediumId;
     3830    QUuid uMediumId;
    38303831    switch (enmDevice)
    38313832    {
     
    38343835            const int iAnswer = msgCenter().confirmHardDiskAttachmentCreation(strControllerName, this);
    38353836            if (iAnswer == AlertButton_Choice1)
    3836                 strMediumId = getWithNewHDWizard();
     3837                uMediumId = getWithNewHDWizard();
    38373838            else if (iAnswer == AlertButton_Choice2)
    3838                 strMediumId = openMediumSelectorDialog(UIMediumDeviceType_HardDisk);
     3839                uMediumId = openMediumSelectorDialog(UIMediumDeviceType_HardDisk);
    38393840            break;
    38403841        }
     
    38433844            int iAnswer = msgCenter().confirmOpticalAttachmentCreation(strControllerName, this);
    38443845            if (iAnswer == AlertButton_Choice1)
    3845                 strMediumId = vboxGlobal().medium(strMediumId).id();
     3846                uMediumId = vboxGlobal().medium(uMediumId).id();
    38463847            else if (iAnswer == AlertButton_Choice2)
    3847                 strMediumId = openMediumSelectorDialog(UIMediumDeviceType_DVD);
     3848                uMediumId = openMediumSelectorDialog(UIMediumDeviceType_DVD);
    38483849            break;
    38493850        }
     
    38523853            int iAnswer = msgCenter().confirmFloppyAttachmentCreation(strControllerName, this);
    38533854            if (iAnswer == AlertButton_Choice1)
    3854                 strMediumId = vboxGlobal().medium(strMediumId).id();
     3855                uMediumId = vboxGlobal().medium(uMediumId).id();
    38553856            else if (iAnswer == AlertButton_Choice2)
    3856                 strMediumId = openMediumSelectorDialog(UIMediumDeviceType_Floppy);
     3857                uMediumId = openMediumSelectorDialog(UIMediumDeviceType_Floppy);
    38573858            break;
    38583859        }
     
    38603861    }
    38613862
    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);
    38653866        m_pModelStorage->sort();
    38663867        emit sigStorageChanged();
     
    38713872}
    38723873
    3873 QString UIMachineSettingsStorage::getWithNewHDWizard()
     3874QUuid UIMachineSettingsStorage::getWithNewHDWizard()
    38743875{
    38753876    /* Initialize variables: */
     
    38793880    UISafePointerWizardNewVD pWizard = new UIWizardNewVD(this, QString(), fileInfo.absolutePath(), comGuestOSType.GetRecommendedHDD());
    38803881    pWizard->prepare();
    3881     const QString strResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QString();
     3882    const QUuid uResult = pWizard->exec() == QDialog::Accepted ? pWizard->virtualDisk().GetId() : QUuid();
    38823883    if (pWizard)
    38833884        delete pWizard;
    3884     return strResult;
     3885    return uResult;
    38853886}
    38863887
     
    39563957void UIMachineSettingsStorage::addChooseHostDriveActions(QMenu *pOpenMediumMenu)
    39573958{
    3958     foreach (const QString &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);
    39613962        if (medium.isHostDrive() && m_pMediumIdHolder->type() == medium.type())
    39623963        {
     
    43324333        {
    43334334            /* Create attachment: */
    4334             const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_strAttachmentMediumId);
     4335            const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_uAttachmentMediumId);
    43354336            const CMedium comMedium = vboxMedium.medium();
    43364337            m_machine.AttachDevice(newControllerData.m_strControllerName,
     
    44204421        {
    44214422            /* Remount attachment: */
    4422             const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_strAttachmentMediumId);
     4423            const UIMedium vboxMedium = vboxGlobal().medium(newAttachmentData.m_uAttachmentMediumId);
    44234424            const CMedium comMedium = vboxMedium.medium();
    44244425            m_machine.MountMedium(newControllerData.m_strControllerName,
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r73953 r74878  
    272272    AbstractItem* parent() const;
    273273    QUuid id() const;
    274     QString machineId() const;
    275 
    276     void setMachineId (const QString &aMchineId);
     274    QUuid machineId() const;
     275
     276    void setMachineId (const QUuid &aMchineId);
    277277
    278278    virtual ItemType rtti() const = 0;
     
    290290    AbstractItem *m_pParentItem;
    291291    QUuid         mId;
    292     QString       mMachineId;
     292    QUuid         mMachineId;
    293293};
    294294Q_DECLARE_METATYPE (AbstractItem::ItemType);
     
    381381    KDeviceType attDeviceType() const;
    382382    DeviceTypeList attDeviceTypes() const;
    383     QString attMediumId() const;
     383    QUuid attMediumId() const;
    384384    bool attIsHostDrive() const;
    385385    bool attIsPassthrough() const;
     
    390390    void setAttSlot (const StorageSlot &aAttSlot);
    391391    void setAttDevice (KDeviceType aAttDeviceType);
    392     void setAttMediumId (const QString &aAttMediumId);
     392    void setAttMediumId (const QUuid &aAttMediumId);
    393393    void setAttIsPassthrough (bool aPassthrough);
    394394    void setAttIsTempEject (bool aTempEject);
     
    422422
    423423    StorageSlot mAttSlot;
    424     QString mAttMediumId;
     424    QUuid mAttMediumId;
    425425    bool mAttIsHostDrive;
    426426    bool mAttIsPassthrough;
     
    542542    void delController (const QUuid &aCtrId);
    543543
    544     QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QString &strMediumId);
     544    QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType, const QUuid &aMediumId);
    545545    void delAttachment (const QUuid &aCtrId, const QUuid &aAttId);
    546546
    547     void setMachineId (const QString &aMachineId);
     547    void setMachineId (const QUuid &aMachineId);
    548548
    549549    void sort(int iColumn = 0, Qt::SortOrder order = Qt::AscendingOrder);
     
    655655
    656656    /** Handles enumeration of medium with @a strMediumId. */
    657     void sltHandleMediumEnumerated(const QString &strMediumId);
     657    void sltHandleMediumEnumerated(const QUuid &aMediumId);
    658658    /** Handles removing of medium with @a strMediumId. */
    659     void sltHandleMediumDeleted(const QString &strMediumId);
     659    void sltHandleMediumDeleted(const QUuid &aMediumId);
    660660
    661661    /** Handles command to add controller. */
     
    742742    void prepareConnections();
    743743    /** Opens medium selector dialog and retrieves uuid of a selected medium (if any). */
    744     QString openMediumSelectorDialog(UIMediumDeviceType  enmMediumType);
     744    QUuid openMediumSelectorDialog(UIMediumDeviceType  enmMediumType);
    745745    /** Cleanups all. */
    746746    void cleanup();
     
    752752
    753753    /** Creates new hard-drive. */
    754     QString getWithNewHDWizard();
     754    QUuid getWithNewHDWizard();
    755755
    756756    /** Updates additions details according to passed @a enmType. */
     
    794794
    795795    /** Holds the machine ID. */
    796     QString  m_strMachineId;
     796    QUuid  m_uMachineId;
    797797    /** Holds the machine settings file-path. */
    798798    QString  m_strMachineSettingsFilePath;
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r73783 r74878  
    9292    CSnapshot snapshot() const { return m_comSnapshot; }
    9393    /** Returns item snapshot ID. */
    94     QString snapshotID() const { return m_strSnapshotID; }
     94    QUuid snapshotID() const { return m_uSnapshotID; }
    9595
    9696    /** Returns whether this is the "current state" item. */
     
    137137
    138138    /** Holds the "current snapshot" ID. */
    139     QString  m_strSnapshotID;
     139    QUuid  m_uSnapshotID;
    140140    /** Holds whether the "current snapshot" is online one. */
    141     bool     m_fOnline;
     141    bool   m_fOnline;
    142142
    143143    /** Holds the item timestamp. */
     
    293293        /* Fetch snapshot information: */
    294294        AssertReturnVoid(m_comSnapshot.isNotNull());
    295         m_strSnapshotID = m_comSnapshot.GetId();
     295        m_uSnapshotID = m_comSnapshot.GetId();
    296296        m_strName = m_comSnapshot.GetName();
    297297        setText(Column_Name, m_strName);
     
    486486    if (m_comMachine.isNull())
    487487    {
    488         m_strMachineId = QString();
     488        m_uMachineId = QUuid();
    489489        m_enmSessionState = KSessionState_Null;
    490490        m_fShapshotOperationsAllowed = false;
     
    492492    else
    493493    {
    494         m_strMachineId = comMachine.GetId();
     494        m_uMachineId = comMachine.GetId();
    495495        m_enmSessionState = comMachine.GetSessionState();
    496         m_fShapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(m_strMachineId);
     496        m_fShapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(m_uMachineId);
    497497    }
    498498
     
    550550}
    551551
    552 void UISnapshotPane::sltHandleMachineDataChange(QString strMachineId)
     552void UISnapshotPane::sltHandleMachineDataChange(const QUuid &aMachineId)
    553553{
    554554    /* Make sure it's our VM: */
    555     if (strMachineId != m_strMachineId)
     555    if (aMachineId != m_uMachineId)
    556556        return;
    557557
     
    566566}
    567567
    568 void UISnapshotPane::sltHandleMachineStateChange(QString strMachineId, KMachineState enmState)
     568void UISnapshotPane::sltHandleMachineStateChange(const QUuid &aMachineId, const KMachineState enmState)
    569569{
    570570    /* Make sure it's our VM: */
    571     if (strMachineId != m_strMachineId)
     571    if (aMachineId != m_uMachineId)
    572572        return;
    573573
     
    580580}
    581581
    582 void UISnapshotPane::sltHandleSessionStateChange(QString strMachineId, KSessionState enmState)
     582void UISnapshotPane::sltHandleSessionStateChange(const QUuid &aMachineId, const KSessionState enmState)
    583583{
    584584    /* Make sure it's our VM: */
    585     if (strMachineId != m_strMachineId)
     585    if (aMachineId != m_uMachineId)
    586586        return;
    587587
     
    596596}
    597597
    598 void UISnapshotPane::sltHandleSnapshotTake(QString strMachineId, QString strSnapshotId)
     598void UISnapshotPane::sltHandleSnapshotTake(const QUuid &aMachineId, const QUuid &aSnapshotId)
    599599{
    600600    /* Make sure it's our VM: */
    601     if (strMachineId != m_strMachineId)
     601    if (aMachineId != m_uMachineId)
    602602        return;
    603603
    604604    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()));
    606606
    607607    /* Prepare result: */
     
    612612
    613613        /* Search for corresponding snapshot: */
    614         CSnapshot comSnapshot = m_comMachine.FindSnapshot(strSnapshotId);
     614        CSnapshot comSnapshot = m_comMachine.FindSnapshot(aSnapshotId.toString());
    615615        fSuccess = m_comMachine.isOk() && !comSnapshot.isNull();
    616616
    617617        /* Show error message if necessary: */
    618618        if (!fSuccess)
    619             msgCenter().cannotFindSnapshotById(m_comMachine, strSnapshotId, this);
     619            msgCenter().cannotFindSnapshotById(m_comMachine, aSnapshotId, this);
    620620        else
    621621        {
     
    628628            {
    629629                /* Acquire parent snapshot id: */
    630                 const QString strParentSnapshotId = comParentSnapshot.GetId();
     630                const QUuid uParentSnapshotId = comParentSnapshot.GetId();
    631631                fSuccess = comParentSnapshot.isOk();
    632632
     
    637637                {
    638638                    /* Search for an existing parent-item with such id: */
    639                     pParentItem = findItem(strParentSnapshotId);
     639                    pParentItem = findItem(uParentSnapshotId);
    640640                    fSuccess = pParentItem;
    641641                }
     
    692692}
    693693
    694 void UISnapshotPane::sltHandleSnapshotDelete(QString strMachineId, QString strSnapshotId)
     694void UISnapshotPane::sltHandleSnapshotDelete(const QUuid &aMachineId, const QUuid &aSnapshotId)
    695695{
    696696    /* Make sure it's our VM: */
    697     if (strMachineId != m_strMachineId)
     697    if (aMachineId != m_uMachineId)
    698698        return;
    699699
    700700    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()));
    702702
    703703    /* Prepare result: */
     
    708708
    709709        /* Search for an existing item with such id: */
    710         UISnapshotItem *pItem = findItem(strSnapshotId);
     710        UISnapshotItem *pItem = findItem(aSnapshotId);
    711711        fSuccess = pItem;
    712712
     
    774774}
    775775
    776 void UISnapshotPane::sltHandleSnapshotChange(QString strMachineId, QString strSnapshotId)
     776void UISnapshotPane::sltHandleSnapshotChange(const QUuid &aMachineId, const QUuid &aSnapshotId)
    777777{
    778778    /* Make sure it's our VM: */
    779     if (strMachineId != m_strMachineId)
     779    if (aMachineId != m_uMachineId)
    780780        return;
    781781
    782782    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()));
    784784
    785785    /* Prepare result: */
     
    790790
    791791        /* Search for an existing item with such id: */
    792         UISnapshotItem *pItem = findItem(strSnapshotId);
     792        UISnapshotItem *pItem = findItem(aSnapshotId);
    793793        fSuccess = pItem;
    794794
     
    814814}
    815815
    816 void UISnapshotPane::sltHandleSnapshotRestore(QString strMachineId, QString strSnapshotId)
     816void UISnapshotPane::sltHandleSnapshotRestore(const QUuid &aMachineId, const QUuid &aSnapshotId)
    817817{
    818818    /* Make sure it's our VM: */
    819     if (strMachineId != m_strMachineId)
     819    if (aMachineId != m_uMachineId)
    820820        return;
    821821
    822822    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()));
    824824
    825825    /* Prepare result: */
     
    830830
    831831        /* Search for an existing item with such id: */
    832         UISnapshotItem *pItem = findItem(strSnapshotId);
     832        UISnapshotItem *pItem = findItem(aSnapshotId);
    833833        fSuccess = pItem;
    834834
     
    924924        CSession comSession;
    925925        if (m_enmSessionState != KSessionState_Unlocked)
    926             comSession = vboxGlobal().openExistingSession(m_strMachineId);
     926            comSession = vboxGlobal().openExistingSession(m_uMachineId);
    927927        else
    928             comSession = vboxGlobal().openSession(m_strMachineId);
     928            comSession = vboxGlobal().openSession(m_uMachineId);
    929929        if (comSession.isNotNull())
    930930        {
     
    936936            {
    937937                /* Take snapshot: */
    938                 QString strSnapshotId;
     938                QUuid uSnapshotId;
    939939                CProgress comProgress = comMachine.TakeSnapshot(newData.m_strName,
    940940                                                                newData.m_strDescription,
    941                                                                 true, strSnapshotId);
     941                                                                true, uSnapshotId);
    942942                if (!comMachine.isOk())
    943943                {
     
    980980        CSession comSession;
    981981        if (m_enmSessionState != KSessionState_Unlocked)
    982             comSession = vboxGlobal().openExistingSession(m_strMachineId);
     982            comSession = vboxGlobal().openExistingSession(m_uMachineId);
    983983        else
    984             comSession = vboxGlobal().openSession(m_strMachineId);
     984            comSession = vboxGlobal().openSession(m_uMachineId);
    985985        if (comSession.isNotNull())
    986986        {
     
    13351335
    13361336    /* Remember the selected item and it's first child: */
    1337     QString strSelectedItem, strFirstChildOfSelectedItem;
     1337    QUuid uSelectedItem, uFirstChildOfSelectedItem;
    13381338    const UISnapshotItem *pSnapshotItem = UISnapshotItem::toSnapshotItem(m_pSnapshotTree->currentItem());
    13391339    if (pSnapshotItem)
    13401340    {
    1341         strSelectedItem = pSnapshotItem->snapshotID();
     1341        uSelectedItem = pSnapshotItem->snapshotID();
    13421342        if (pSnapshotItem->child(0))
    1343             strFirstChildOfSelectedItem = UISnapshotItem::toSnapshotItem(pSnapshotItem->child(0))->snapshotID();
     1343            uFirstChildOfSelectedItem = UISnapshotItem::toSnapshotItem(pSnapshotItem->child(0))->snapshotID();
    13441344    }
    13451345
     
    13631363
    13641364        /* Search for a previously selected item: */
    1365         UISnapshotItem *pCurrentItem = findItem(strSelectedItem);
     1365        UISnapshotItem *pCurrentItem = findItem(uSelectedItem);
    13661366        if (pCurrentItem == 0)
    1367             pCurrentItem = findItem(strFirstChildOfSelectedItem);
     1367            pCurrentItem = findItem(uFirstChildOfSelectedItem);
    13681368        if (pCurrentItem == 0)
    13691369            pCurrentItem = m_pCurrentStateItem;
     
    15131513        CSession comSession;
    15141514        if (m_enmSessionState != KSessionState_Unlocked)
    1515             comSession = vboxGlobal().openExistingSession(m_strMachineId);
     1515            comSession = vboxGlobal().openExistingSession(m_uMachineId);
    15161516        else
    1517             comSession = vboxGlobal().openSession(m_strMachineId);
     1517            comSession = vboxGlobal().openSession(m_uMachineId);
    15181518        if (comSession.isNull())
    15191519            break;
     
    15801580
    15811581            /* Take snapshot: */
    1582             QString strSnapshotId;
    1583             CProgress comProgress = comMachine.TakeSnapshot(strFinalName, strFinalDescription, true, strSnapshotId);
     1582            QUuid uSnapshotId;
     1583            CProgress comProgress = comMachine.TakeSnapshot(strFinalName, strFinalDescription, true, uSnapshotId);
    15841584            if (!comMachine.isOk())
    15851585            {
     
    16471647        CSession comSession;
    16481648        if (m_enmSessionState != KSessionState_Unlocked)
    1649             comSession = vboxGlobal().openExistingSession(m_strMachineId);
     1649            comSession = vboxGlobal().openExistingSession(m_uMachineId);
    16501650        else
    1651             comSession = vboxGlobal().openSession(m_strMachineId);
     1651            comSession = vboxGlobal().openSession(m_uMachineId);
    16521652        if (comSession.isNull())
    16531653            break;
     
    17271727
    17281728        /* Open a direct session (this call will handle all errors): */
    1729         CSession comSession = vboxGlobal().openSession(m_strMachineId);
     1729        CSession comSession = vboxGlobal().openSession(m_uMachineId);
    17301730        if (comSession.isNull())
    17311731            break;
     
    18131813}
    18141814
    1815 UISnapshotItem *UISnapshotPane::findItem(const QString &strSnapshotID) const
     1815UISnapshotItem *UISnapshotPane::findItem(const QUuid &aSnapshotID) const
    18161816{
    18171817    /* Search for the first item with required ID: */
     
    18201820    {
    18211821        UISnapshotItem *pSnapshotItem = UISnapshotItem::toSnapshotItem(*it);
    1822         if (pSnapshotItem->snapshotID() == strSnapshotID)
     1822        if (pSnapshotItem->snapshotID() == aSnapshotID)
    18231823            return pSnapshotItem;
    18241824        ++it;
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.h

    r73783 r74878  
    8787      * @{ */
    8888        /** Handles machine data change for machine with @a strMachineId. */
    89         void sltHandleMachineDataChange(QString strMachineId);
     89        void sltHandleMachineDataChange(const QUuid &aMachineId);
    9090        /** 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);
    9292
    9393        /** 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);
    9595
    9696        /** 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);
    9898        /** 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);
    100100        /** 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);
    102102        /** 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);
    104104    /** @} */
    105105
     
    189189
    190190        /** Searches for an item with corresponding @a strSnapshotID. */
    191         UISnapshotItem *findItem(const QString &strSnapshotID) const;
     191        UISnapshotItem *findItem(const QUuid &aSnapshotID) const;
    192192
    193193        /** Searches for smallest snapshot age starting with @a pItem as parent. */
     
    207207        CMachine       m_comMachine;
    208208        /** Holds the machine object ID. */
    209         QString        m_strMachineId;
     209        QUuid        m_uMachineId;
    210210        /** Holds the cached session state. */
    211211        KSessionState  m_enmSessionState;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.cpp

    r73926 r74878  
    5555};
    5656
     57template<class T>
     58static QStringList toStringList(const QList<T> &list)
     59{
     60    QStringList l;
     61    foreach(const T &t, list)
     62        l << t.toString();
     63    return l;
     64}
    5765
    5866/** QLineEdit extension used as
     
    315323            /* We are generating tool-tip here and not in retranslateUi() because of the tricky plural form handling,
    316324             * but be quiet, it's safe enough because the tool-tip being re-acquired every time on mouse-hovering. */
    317             const QStringList encryptedMedia = m_encryptedMedia.values(m_encryptionPasswords.keys().at(index.row()));
     325            const QList<QUuid> encryptedMedia = m_encryptedMedia.values(m_encryptionPasswords.keys().at(index.row()));
    318326            return UIAddDiskEncryptionPasswordDialog::tr("<nobr>Used by the following %n hard disk(s):</nobr><br>%1",
    319327                                                         "This text is never used with n == 0. "
     
    323331                                                         "and doesn't need to be told).",
    324332                                                         encryptedMedia.size())
    325                                                          .arg(encryptedMedia.join("<br>"));
     333                                                         .arg(toStringList(encryptedMedia).join("<br>"));
    326334        }
    327335        default:
     
    500508    foreach (const QString &strPasswordId, m_encryptedMedia.uniqueKeys())
    501509    {
    502         const QString strMediumId = m_encryptedMedia.values(strPasswordId).first();
     510        const QUuid uMediumId = m_encryptedMedia.values(strPasswordId).first();
    503511        const QString strPassword = m_pTableEncryptionData->encryptionPasswords().value(strPasswordId);
    504         if (!isPasswordValid(strMediumId, strPassword))
     512        if (!isPasswordValid(uMediumId, strPassword))
    505513        {
    506514            msgCenter().warnAboutInvalidEncryptionPassword(strPasswordId, this);
     
    569577
    570578/* static */
    571 bool UIAddDiskEncryptionPasswordDialog::isPasswordValid(const QString strMediumId, const QString strPassword)
     579bool UIAddDiskEncryptionPasswordDialog::isPasswordValid(const QUuid &aMediumId, const QString strPassword)
    572580{
    573581    /* Look for the medium with passed ID: */
    574     const UIMedium uimedium = vboxGlobal().medium(strMediumId);
     582    const UIMedium uimedium = vboxGlobal().medium(aMediumId);
    575583    if (!uimedium.isNull())
    576584    {
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.h

    r73926 r74878  
    3434
    3535/* Type definitions: */
    36 typedef QMultiMap<QString, QString> EncryptedMediumMap;
     36typedef QMultiMap<QString, QUuid> EncryptedMediumMap;
    3737typedef QMap<QString, QString> EncryptionPasswordMap;
    3838typedef QMap<QString, bool> EncryptionPasswordStatusMap;
     
    7676
    7777    /** Returns whether passed @a strPassword is valid for medium with passed @a strMediumId. */
    78     static bool isPasswordValid(const QString strMediumId, const QString strPassword);
     78    static bool isPasswordValid(const QUuid &aMediumId, const QString strPassword);
    7979
    8080    /** Holds the name of the machine we show this dialog for. */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.cpp

    r73953 r74878  
    3535    : QComboBox(pParent)
    3636    , m_enmMediaType(UIMediumDeviceType_Invalid)
    37     , m_strMachineId(QString())
    38     , m_strLastItemId(QString())
     37    , m_uMachineId(QUuid())
     38    , m_uLastItemId(QUuid())
    3939{
    4040    /* Prepare: */
     
    4848
    4949    /* Use the medium creation handler to add all the items:  */
    50     foreach (const QString &strMediumId, vboxGlobal().mediumIDs())
    51         sltHandleMediumCreated(strMediumId);
     50    foreach (const QUuid &uMediumId, vboxGlobal().mediumIDs())
     51        sltHandleMediumCreated(uMediumId);
    5252
    5353    /* If at least one real medium present, remove null medium: */
     
    7070}
    7171
    72 void UIMediaComboBox::setCurrentItem(const QString &strItemId)
    73 {
    74     m_strLastItemId = strItemId;
     72void UIMediaComboBox::setCurrentItem(const QUuid &aItemId)
     73{
     74    m_uLastItemId = aItemId;
    7575
    7676    int iIndex;
     
    7878    // Note that the media combo-box may be not populated here yet,
    7979    // so we don't assert..
    80     if (findMediaIndex(strItemId, iIndex))
     80    if (findMediaIndex(aItemId, iIndex))
    8181    {
    8282        QComboBox::setCurrentIndex(iIndex);
     
    8585}
    8686
    87 QString UIMediaComboBox::id(int iIndex /* = -1 */) const
     87QUuid 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
     98QString UIMediaComboBox::location(int iIndex /* = -1 */) const
    8899{
    89100    AssertReturn(iIndex == -1 ||
     
    93104    if (iIndex == -1)
    94105        iIndex = currentIndex();
    95     return iIndex == -1 ? QString() : m_media.at(iIndex).id;
    96 }
    97 
    98 QString UIMediaComboBox::location(int iIndex /* = -1 */) const
    99 {
    100     AssertReturn(iIndex == -1 ||
    101                  (iIndex >= 0 && iIndex < m_media.size()),
    102                   QString());
    103 
    104     if (iIndex == -1)
    105         iIndex = currentIndex();
    106106    return iIndex == -1 ? QString() : m_media.at(iIndex).location;
    107107}
    108108
    109 void UIMediaComboBox::sltHandleMediumCreated(const QString &strMediumId)
     109void UIMediaComboBox::sltHandleMediumCreated(const QUuid &aMediumId)
    110110{
    111111    /* Search for corresponding medium: */
    112     UIMedium guiMedium = vboxGlobal().medium(strMediumId);
     112    UIMedium guiMedium = vboxGlobal().medium(aMediumId);
    113113
    114114    /* Ignore media (and their children) which are
     
    129129
    130130    /* Activate the required item if any: */
    131     if (guiMedium.id() == m_strLastItemId)
     131    if (guiMedium.id() == m_uLastItemId)
    132132        setCurrentItem(guiMedium.id());
    133133    /* Select last added item if there is no item selected: */
     
    136136}
    137137
    138 void UIMediaComboBox::sltHandleMediumEnumerated(const QString &strMediumId)
     138void UIMediaComboBox::sltHandleMediumEnumerated(const QUuid &aMediumId)
    139139{
    140140    /* Search for corresponding medium: */
    141     UIMedium guiMedium = vboxGlobal().medium(strMediumId);
     141    UIMedium guiMedium = vboxGlobal().medium(aMediumId);
    142142
    143143    /* Add only 1. NULL medium and 2. media of required type: */
     
    157157}
    158158
    159 void UIMediaComboBox::sltHandleMediumDeleted(const QString &strMediumId)
     159void UIMediaComboBox::sltHandleMediumDeleted(const QUuid &aMediumId)
    160160{
    161161    /* Search for corresponding item index: */
    162162    int iIndex;
    163     if (!findMediaIndex(strMediumId, iIndex))
     163    if (!findMediaIndex(aMediumId, iIndex))
    164164        return;
    165165
     
    185185    AssertReturnVoid(iIndex >= 0 && iIndex < m_media.size());
    186186
    187     m_strLastItemId = m_media.at(iIndex).id;
     187    m_uLastItemId = m_media.at(iIndex).id;
    188188
    189189    updateToolTip(iIndex);
     
    256256}
    257257
    258 bool UIMediaComboBox::findMediaIndex(const QString &strId, int &iIndex)
     258bool UIMediaComboBox::findMediaIndex(const QUuid &aId, int &iIndex)
    259259{
    260260    iIndex = 0;
    261261
    262262    for (; iIndex < m_media.size(); ++ iIndex)
    263         if (m_media.at(iIndex).id == strId)
     263        if (m_media.at(iIndex).id == aId)
    264264            break;
    265265
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediaComboBox.h

    r73953 r74878  
    5151
    5252    /** Defines @a strMachineId. */
    53     void setMachineId(const QString &strMachineId) { m_strMachineId = strMachineId; }
     53    void setMachineId(const QUuid &aMachineId) { m_uMachineId = aMachineId; }
    5454
    5555    /** Defines current item through @a strItemId. */
    56     void setCurrentItem(const QString &strItemId);
     56    void setCurrentItem(const QUuid &aItemId);
    5757
    5858    /** Returns id of item with certain @a iIndex. */
    59     QString id(int iIndex = -1) const;
     59    QUuid id(int iIndex = -1) const;
    6060    /** Returns location of item with certain @a iIndex. */
    6161    QString location(int iIndex = -1) const;
     
    6464
    6565    /** Habdles medium-created signal for medium with @a strMediumId. */
    66     void sltHandleMediumCreated(const QString &strMediumId);
     66    void sltHandleMediumCreated(const QUuid &aMediumId);
    6767    /** Habdles medium-enumerated signal for medium with @a strMediumId. */
    68     void sltHandleMediumEnumerated(const QString &strMediumId);
     68    void sltHandleMediumEnumerated(const QUuid &aMediumId);
    6969    /** Habdles medium-deleted signal for medium with @a strMediumId. */
    70     void sltHandleMediumDeleted(const QString &strMediumId);
     70    void sltHandleMediumDeleted(const QUuid &aMediumId);
    7171
    7272    /** Handles medium enumeration start. */
     
    9393
    9494    /** Searches for a @a iIndex of medium with certain @a strId. */
    95     bool findMediaIndex(const QString &strId, int &iIndex);
     95    bool findMediaIndex(const QUuid &aId, int &iIndex);
    9696
    9797    /** Holds the media type. */
     
    9999
    100100    /** Holds the machine ID. */
    101     QString  m_strMachineId;
     101    QUuid  m_uMachineId;
    102102
    103103    /** Simplified media description. */
     
    105105    {
    106106        Medium() {}
    107         Medium(const QString &strId,
     107        Medium(const QUuid &aId,
    108108               const QString &strLocation,
    109109               const QString &strToolTip)
    110             : id(strId), location(strLocation), toolTip(strToolTip)
     110            : id(aId), location(strLocation), toolTip(strToolTip)
    111111        {}
    112112
    113         QString  id;
     113        QUuid    id;
    114114        QString  location;
    115115        QString  toolTip;
     
    122122
    123123    /** Holds the last chosen medium ID. */
    124     QString  m_strLastItemId;
     124    QUuid  m_uLastItemId;
    125125};
    126126
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuBarEditorWindow.cpp

    r73507 r74878  
    327327UIMenuBarEditorWidget::UIMenuBarEditorWidget(QWidget *pParent,
    328328                                             bool fStartedFromVMSettings /* = true */,
    329                                              const QString &strMachineID /* = QString() */,
     329                                             const QUuid &aMachineID /* = QUuid() */,
    330330                                             UIActionPool *pActionPool /* = 0 */)
    331331    : QIWithRetranslateUI2<QWidget>(pParent)
    332332    , m_fPrepared(false)
    333333    , m_fStartedFromVMSettings(fStartedFromVMSettings)
    334     , m_strMachineID(strMachineID)
     334    , m_uMachineID(aMachineID)
    335335    , m_pActionPool(pActionPool)
    336336    , m_pMainLayout(0)
     
    359359}
    360360
    361 void UIMenuBarEditorWidget::setMachineID(const QString &strMachineID)
     361void UIMenuBarEditorWidget::setMachineID(const QUuid &aMachineID)
    362362{
    363363    /* Remember new machine ID: */
    364     m_strMachineID = strMachineID;
     364    m_uMachineID = aMachineID;
    365365    /* Prepare: */
    366366    prepare();
     
    747747}
    748748
    749 void UIMenuBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID)
     749void UIMenuBarEditorWidget::sltHandleConfigurationChange(const QUuid &aMachineID)
    750750{
    751751    /* Skip unrelated machine IDs: */
    752     if (machineID() != strMachineID)
     752    if (machineID() != aMachineID)
    753753        return;
    754754
     
    963963
    964964    /* 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)
    966966        return;
    967967
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuBarEditorWindow.h

    r72025 r74878  
    2121/* Qt includes: */
    2222#include <QMap>
     23#include <QUuid>
    2324
    2425/* GUI includes: */
     
    7778    UIMenuBarEditorWidget(QWidget *pParent,
    7879                          bool fStartedFromVMSettings = true,
    79                           const QString &strMachineID = QString(),
     80                          const QUuid &aMachineID = QUuid(),
    8081                          UIActionPool *pActionPool = 0);
    8182
    8283    /** Returns the machine ID instance. */
    83     const QString &machineID() const { return m_strMachineID; }
     84    const QUuid &machineID() const { return m_uMachineID; }
    8485    /** Defines the @a strMachineID instance. */
    85     void setMachineID(const QString &strMachineID);
     86    void setMachineID(const QUuid &aMachineID);
    8687
    8788    /** Returns the action-pool reference. */
     
    154155
    155156    /** Handles configuration change. */
    156     void sltHandleConfigurationChange(const QString &strMachineID);
     157    void sltHandleConfigurationChange(const QUuid &aMachineID);
    157158
    158159    /** Handles menu-bar menu click. */
     
    210211        bool                m_fStartedFromVMSettings;
    211212        /** Holds the machine ID instance. */
    212         QString             m_strMachineID;
     213        QUuid               m_uMachineID;
    213214        /** Holds the action-pool reference. */
    214215        const UIActionPool *m_pActionPool;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp

    r71578 r74878  
    5959
    6060    /** 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);
    6262    /** Notifies about task complete for progress with @a strProgressId. */
    63     void sigProgressTaskComplete(QString strProgressId);
     63    void sigProgressTaskComplete(const QUuid &aProgressId);
    6464
    6565public:
     
    331331}
    332332
    333 void UIProgressDialog::sltHandleProgressPercentageChange(QString, int iPercent)
     333void UIProgressDialog::sltHandleProgressPercentageChange(const QUuid &, const int iPercent)
    334334{
    335335    /* New mode only: */
     
    341341}
    342342
    343 void UIProgressDialog::sltHandleProgressTaskComplete(QString)
     343void UIProgressDialog::sltHandleProgressTaskComplete(const QUuid &)
    344344{
    345345    /* New mode only: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.h

    r71630 r74878  
    8989
    9090    /** 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);
    9292    /** Handles task completed event for progress with @a strProgressId. */
    93     void sltHandleProgressTaskComplete(QString strProgressId);
     93    void sltHandleProgressTaskComplete(const QUuid &aProgressId);
    9494
    9595    /** Handles window stack changed signal. */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.cpp

    r72871 r74878  
    410410UIStatusBarEditorWidget::UIStatusBarEditorWidget(QWidget *pParent,
    411411                                                 bool fStartedFromVMSettings /* = true */,
    412                                                  const QString &strMachineID /* = QString() */)
     412                                                 const QUuid &aMachineID /* = QString() */)
    413413    : QIWithRetranslateUI2<QWidget>(pParent)
    414414    , m_fPrepared(false)
    415415    , m_fStartedFromVMSettings(fStartedFromVMSettings)
    416     , m_strMachineID(strMachineID)
     416    , m_uMachineID(aMachineID)
    417417    , m_pMainLayout(0), m_pButtonLayout(0)
    418418    , m_pButtonClose(0)
     
    425425}
    426426
    427 void UIStatusBarEditorWidget::setMachineID(const QString &strMachineID)
     427void UIStatusBarEditorWidget::setMachineID(const QUuid &aMachineID)
    428428{
    429429    /* Remember new machine ID: */
    430     m_strMachineID = strMachineID;
     430    m_uMachineID = aMachineID;
    431431    /* Prepare: */
    432432    prepare();
     
    690690}
    691691
    692 void UIStatusBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID)
     692void UIStatusBarEditorWidget::sltHandleConfigurationChange(const QUuid &aMachineID)
    693693{
    694694    /* Skip unrelated machine IDs: */
    695     if (machineID() != strMachineID)
     695    if (machineID() != aMachineID)
    696696        return;
    697697
     
    744744
    745745    /* Do not prepare if machine ID is not set: */
    746     if (m_strMachineID.isEmpty())
     746    if (m_uMachineID.isNull())
    747747        return;
    748748
     
    851851                                  gEDataManager->statusBarIndicatorOrder(machineID()));
    852852        /* And listen for the status-bar configuration changes after that: */
    853         connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)),
    854                 this, SLOT(sltHandleConfigurationChange(const QString&)));
     853        connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QUuid &)),
     854                this, SLOT(sltHandleConfigurationChange(const QUuid &)));
    855855    }
    856856}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIStatusBarEditorWindow.h

    r72026 r74878  
    2222#include <QList>
    2323#include <QMap>
     24#include <QUuid>
    2425
    2526/* GUI includes: */
     
    7576    UIStatusBarEditorWidget(QWidget *pParent,
    7677                            bool fStartedFromVMSettings = true,
    77                             const QString &strMachineID = QString());
     78                            const QUuid &aMachineID = QUuid());
    7879
    7980    /** Returns the machine ID instance. */
    80     const QString &machineID() const { return m_strMachineID; }
     81    const QUuid &machineID() const { return m_uMachineID; }
    8182    /** Defines the @a strMachineID instance. */
    82     void setMachineID(const QString &strMachineID);
     83    void setMachineID(const QUuid &aMachineID);
    8384
    8485    /** Returns whether the status-bar enabled. */
     
    114115
    115116    /** Handles configuration change. */
    116     void sltHandleConfigurationChange(const QString &strMachineID);
     117    void sltHandleConfigurationChange(const QUuid &aMachineID);
    117118
    118119    /** Handles button click. */
     
    141142        bool     m_fStartedFromVMSettings;
    142143        /** Holds the machine ID instance. */
    143         QString  m_strMachineID;
     144        QUuid  m_uMachineID;
    144145    /** @} */
    145146
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic1.cpp

    r73953 r74878  
    4545    const UIMediumDeviceType enmMediumType = UIMediumDefs::mediumTypeToLocal(sourceVirtualDisk().GetDeviceType());
    4646    /* Get source virtual-disk using file-open dialog: */
    47     QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(enmMediumType, thisImp());
    48     if (!strMediumId.isNull())
     47    QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(enmMediumType, thisImp());
     48    if (!uMediumId.isNull())
    4949    {
    5050        /* Update medium-combo if necessary: */
    51         m_pSourceDiskSelector->setCurrentItem(strMediumId);
     51        m_pSourceDiskSelector->setCurrentItem(uMediumId);
    5252        /* Focus on virtual-disk combo: */
    5353        m_pSourceDiskSelector->setFocus();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp

    r74576 r74878  
    8888        /* Take the snapshot: */
    8989        QString strSnapshotName = tr("Linked Base for %1 and %2").arg(m_machine.GetName()).arg(strName);
    90         QString strSnapshotId;
    91         CProgress progress = machine.TakeSnapshot(strSnapshotName, "", true, strSnapshotId);
     90        QUuid uSnapshotId;
     91        CProgress progress = machine.TakeSnapshot(strSnapshotName, "", true, uSnapshotId);
    9292
    9393        if (machine.isOk())
     
    112112
    113113        /* 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());
    115115        if (newSnapshot.isNull())
    116116        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r74769 r74878  
    239239    EncryptedMediumMap encryptedMedia;
    240240    foreach (const QString &strPasswordId, comAppliance.GetPasswordIds())
    241         foreach (const QString &strMediumId, comAppliance.GetMediumIdsForPasswordId(strPasswordId))
    242             encryptedMedia.insert(strPasswordId, strMediumId);
     241        foreach (const QUuid &uMediumId, comAppliance.GetMediumIdsForPasswordId(strPasswordId))
     242            encryptedMedia.insert(strPasswordId, uMediumId);
    243243
    244244    /* Ask for the disk encryption passwords if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppDefs.h

    r73349 r74878  
    3939      * @param  strUuid       Brings the machine ID.
    4040      * @param  fInSaveState  Brings whether machine is in Saved state. */
    41     UIVMListWidgetItem(QPixmap &pixIcon, QString &strText, QString strUuid, bool fInSaveState, QListWidget *pParent)
     41    UIVMListWidgetItem(QPixmap &pixIcon, QString &strText, QUuid aUuid, bool fInSaveState, QListWidget *pParent)
    4242        : QListWidgetItem(pixIcon, strText, pParent)
    43         , m_strUuid(strUuid)
     43        , m_uUuid(aUuid)
    4444        , m_fInSaveState(fInSaveState)
    4545    {}
     
    5252
    5353    /** Returns the machine ID. */
    54     QString uuid() const { return m_strUuid; }
     54    QUuid uuid() const { return m_uUuid; }
    5555    /** Returns whether machine is in Saved state. */
    5656    bool isInSaveState() const { return m_fInSaveState; }
     
    5959
    6060    /** Holds the machine ID. */
    61     QString  m_strUuid;
     61    QUuid    m_uUuid;
    6262    /** Holds whether machine is in Saved state. */
    6363    bool     m_fInSaveState;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp

    r73349 r74878  
    5353        QPixmap pixIcon;
    5454        QString strName;
    55         QString strUuid;
     55        QUuid uUuid;
    5656        bool fInSaveState = false;
    5757        bool fEnabled = false;
     
    6464                pixIcon = vboxGlobal().vmGuestOSTypePixmapDefault(machine.GetOSTypeId());
    6565            strName = machine.GetName();
    66             strUuid = machine.GetId();
     66            uUuid = machine.GetId();
    6767            fEnabled = machine.GetSessionState() == KSessionState_Unlocked;
    6868            fInSaveState = machine.GetState() == KMachineState_Saved;
     
    7575            pixIcon = QPixmap(":/os_other.png").scaled(iIconMetric, iIconMetric, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    7676        }
    77         QListWidgetItem *pItem = new UIVMListWidgetItem(pixIcon, strName, strUuid, fInSaveState, m_pVMSelector);
     77        QListWidgetItem *pItem = new UIVMListWidgetItem(pixIcon, strName, uUuid, fInSaveState, m_pVMSelector);
    7878        if (!fEnabled)
    7979            pItem->setFlags(0);
     
    107107}
    108108
    109 QStringList UIWizardExportAppPage1::machineIDs() const
     109QList<QUuid> UIWizardExportAppPage1::machineIDs() const
    110110{
    111111    /* Prepare list: */
    112     QStringList machineIDs;
     112    QList<QUuid> machineIDs;
    113113    /* Iterate over all the selected items: */
    114114    foreach (QListWidgetItem *pItem, m_pVMSelector->selectedItems())
    115         machineIDs << static_cast<UIVMListWidgetItem*>(pItem)->uuid();
     115        machineIDs.append(static_cast<UIVMListWidgetItem*>(pItem)->uuid());
    116116    /* Return result list: */
    117117    return machineIDs;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.h

    r73349 r74878  
    1818#ifndef ___UIWizardExportAppPageBasic1_h___
    1919#define ___UIWizardExportAppPageBasic1_h___
     20
     21/* Qt includes */
     22#include <QUuid>
    2023
    2124/* GUI includes: */
     
    4144    QStringList machineNames() const;
    4245    /** Returns a list of selected machine IDs. */
    43     QStringList machineIDs() const;
     46    QList<QUuid> machineIDs() const;
    4447
    4548    /** Holds the VM selector instance. */
     
    5356    Q_OBJECT;
    5457    Q_PROPERTY(QStringList machineNames READ machineNames);
    55     Q_PROPERTY(QStringList machineIDs READ machineIDs);
     58    Q_PROPERTY(QList<QUuid> machineIDs READ machineIDs);
    5659
    5760public:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r74842 r74878  
    439439}
    440440
    441 void UIWizardExportAppPage2::setProviderById(const QString &strId)
    442 {
    443     const int iIndex = m_pFormatComboBox->findData(strId, FormatData_ID);
     441void UIWizardExportAppPage2::setProviderById(const QUuid &aId)
     442{
     443    const int iIndex = m_pFormatComboBox->findData(aId, FormatData_ID);
    444444    AssertMsg(iIndex != -1, ("Data not found!"));
    445445    m_pFormatComboBox->setCurrentIndex(iIndex);
    446446}
    447447
    448 QString UIWizardExportAppPage2::providerId() const
     448QUuid UIWizardExportAppPage2::providerId() const
    449449{
    450450    const int iIndex = m_pFormatComboBox->currentIndex();
    451     return m_pFormatComboBox->itemData(iIndex, FormatData_ID).toString();
     451    return m_pFormatComboBox->itemData(iIndex, FormatData_ID).toUuid();
    452452}
    453453
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h

    r74769 r74878  
    137137
    138138    /** Defines provider by @a strId. */
    139     void setProviderById(const QString &strId);
     139    void setProviderById(const QUuid &strId);
    140140    /** Returns provider ID. */
    141     QString providerId() const;
     141    QUuid providerId() const;
    142142    /** Returns provider short name. */
    143143    QString providerShortName() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r74769 r74878  
    251251    {
    252252        /* Iterate over all the selected machine ids: */
    253         QStringList uuids = fieldImp("machineIDs").toStringList();
    254         foreach (const QString &uuid, uuids)
     253        QList<QUuid> uuids = fieldImp("machineIDs").value<QList<QUuid> >();
     254        foreach (const QUuid &uuid, uuids)
    255255        {
    256256            /* Get the machine with the uuid: */
    257             CMachine comMachine = comVBox.FindMachine(uuid);
     257            CMachine comMachine = comVBox.FindMachine(uuid.toString());
    258258            if (comVBox.isOk() && comMachine.isNotNull())
    259259            {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r74769 r74878  
    3535    Q_OBJECT;
    3636    Q_PROPERTY(QStringList machineNames READ machineNames);
    37     Q_PROPERTY(QStringList machineIDs READ machineIDs);
     37    Q_PROPERTY(QList<QUuid> machineIDs READ machineIDs);
    3838    Q_PROPERTY(QString format READ format WRITE setFormat);
    3939    Q_PROPERTY(bool isFormatCloudOne READ isFormatCloudOne);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRun.cpp

    r72696 r74878  
    8585
    8686    /* Get chosen 'dvd' medium to mount: */
    87     const QString 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);
    8989    const CMedium comMedium = guiMedium.medium();
    9090
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRunPageBasic.cpp

    r73953 r74878  
    4646{
    4747    /* Get opened vboxMedium id: */
    48     QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediaSelector->type(), thisImp());
     48    QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediaSelector->type(), thisImp());
    4949    /* Update medium-combo if necessary: */
    50     if (!strMediumId.isNull())
    51         m_pMediaSelector->setCurrentItem(strMediumId);
     50    if (!uMediumId.isNull())
     51        m_pMediaSelector->setCurrentItem(uMediumId);
    5252}
    5353
    54 QString UIWizardFirstRunPage::id() const
     54QUuid UIWizardFirstRunPage::id() const
    5555{
    5656    return m_pMediaSelector->id();
    5757}
    5858
    59 void UIWizardFirstRunPage::setId(const QString &strId)
     59void UIWizardFirstRunPage::setId(const QUuid &aId)
    6060{
    61     m_pMediaSelector->setCurrentItem(strId);
     61    m_pMediaSelector->setCurrentItem(aId);
    6262}
    6363
    64 UIWizardFirstRunPageBasic::UIWizardFirstRunPageBasic(const QString &strMachineId, bool fBootHardDiskWasSet)
     64UIWizardFirstRunPageBasic::UIWizardFirstRunPageBasic(const QUuid &aMachineId, bool fBootHardDiskWasSet)
    6565    : UIWizardFirstRunPage(fBootHardDiskWasSet)
    6666{
     
    7373            m_pMediaSelector = new UIMediaComboBox(this);
    7474            {
    75                 m_pMediaSelector->setMachineId(strMachineId);
     75                m_pMediaSelector->setMachineId(aMachineId);
    7676                m_pMediaSelector->setType(UIMediumDeviceType_DVD);
    7777                m_pMediaSelector->repopulate();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIWizardFirstRunPageBasic.h

    r71948 r74878  
    1818#ifndef __UIWizardFirstRunPageBasic_h__
    1919#define __UIWizardFirstRunPageBasic_h__
     20
     21/* Qt includes: */
     22#include <QUuid>
    2023
    2124/* GUI includes: */
     
    4043
    4144    /* Stuff for 'id' field: */
    42     QString id() const;
    43     void setId(const QString &strId);
     45    QUuid id() const;
     46    void setId(const QUuid &aId);
    4447
    4548    /* Variables: */
     
    5659    Q_OBJECT;
    5760    Q_PROPERTY(QString source READ source);
    58     Q_PROPERTY(QString id READ id WRITE setId);
     61    Q_PROPERTY(QUuid id READ id WRITE setId);
    5962
    6063public:
    6164
    6265    /* Constructor: */
    63     UIWizardFirstRunPageBasic(const QString &strMachineId, bool fBootHardDiskWasSet);
     66    UIWizardFirstRunPageBasic(const QUuid &aMachineId, bool fBootHardDiskWasSet);
    6467
    6568protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r73953 r74878  
    266266    {
    267267        bool success = false;
    268         QString strMachineId = m_machine.GetId();
    269         CSession session = vboxGlobal().openSession(strMachineId);
     268        QUuid uMachineId = m_machine.GetId();
     269        CSession session = vboxGlobal().openSession(uMachineId);
    270270        if (!session.isNull())
    271271        {
    272272            CMachine machine = session.GetMachine();
    273273
    274             QString strId = field("virtualDiskId").toString();
     274            QUuid uId = field("virtualDiskId").toUuid();
    275275            /* Boot virtual hard drive: */
    276             if (!strId.isNull())
     276            if (!uId.isNull())
    277277            {
    278                 UIMedium vmedium = vboxGlobal().medium(strId);
     278                UIMedium vmedium = vboxGlobal().medium(uId);
    279279                CMedium medium = vmedium.medium();              /// @todo r=dj can this be cached somewhere?
    280280                machine.AttachDevice(strHDName, 0, 0, KDeviceType_HardDisk, medium);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r71027 r74878  
    5454
    5555    /** Returns the Id of newly created VM. */
    56     QString createdMachineId() const { return m_machine.GetId(); }
     56    QUuid createdMachineId() const { return m_machine.GetId(); }
    5757
    5858protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp

    r73953 r74878  
    5353    if (m_pDiskSkip->isChecked())
    5454    {
    55         m_strVirtualDiskId = QString();
     55        m_uVirtualDiskId = QUuid();
    5656        m_strVirtualDiskName = QString();
    5757        m_strVirtualDiskLocation = QString();
     
    5959    else if (m_pDiskPresent->isChecked())
    6060    {
    61         m_strVirtualDiskId = m_pDiskSelector->id();
     61        m_uVirtualDiskId = m_pDiskSelector->id();
    6262        m_strVirtualDiskName = m_pDiskSelector->currentText();
    6363        m_strVirtualDiskLocation = m_pDiskSelector->location();
     
    6868{
    6969    /* Get opened medium id: */
    70     QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumDeviceType_HardDisk, thisImp());
    71     if (!strMediumId.isNull())
     70    QUuid uMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumDeviceType_HardDisk, thisImp());
     71    if (!uMediumId.isNull())
    7272    {
    7373        /* Update medium-combo if necessary: */
    74         m_pDiskSelector->setCurrentItem(strMediumId);
     74        m_pDiskSelector->setCurrentItem(uMediumId);
    7575        /* Update hard disk source: */
    7676        updateVirtualDiskSource();
     
    109109
    110110    /* Remember virtual-disk attributes: */
    111     QString strMediumID = m_virtualDisk.GetId();
     111    QUuid uMediumID = m_virtualDisk.GetId();
    112112    QString strLocation = m_virtualDisk.GetLocation();
    113113    /* Prepare delete storage progress: */
     
    124124
    125125    /* Inform VBoxGlobal about it: */
    126     vboxGlobal().deleteMedium(strMediumID);
     126    vboxGlobal().deleteMedium(uMediumID);
    127127
    128128    /* Detach virtual-disk anyway: */
     
    266266
    267267    /* 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()))
    269269        ensureNewVirtualDiskDeleted();
    270270
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h

    r71948 r74878  
    5353
    5454    /* Stuff for 'virtualDiskId' field: */
    55     QString virtualDiskId() const { return m_strVirtualDiskId; }
    56     void setVirtualDiskId(const QString &strVirtualDiskId) { m_strVirtualDiskId = strVirtualDiskId; }
     55    QUuid virtualDiskId() const { return m_uVirtualDiskId; }
     56    void setVirtualDiskId(const QUuid &aVirtualDiskId) { m_uVirtualDiskId = aVirtualDiskId; }
    5757
    5858    /* Stuff for 'virtualDiskName' field: */
     
    7272    /* Variables: */
    7373    CMedium m_virtualDisk;
    74     QString m_strVirtualDiskId;
     74    QUuid   m_uVirtualDiskId;
    7575    QString m_strVirtualDiskName;
    7676    QString m_strVirtualDiskLocation;
     
    8989    Q_OBJECT;
    9090    Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);
    91     Q_PROPERTY(QString virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
     91    Q_PROPERTY(QUuid virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
    9292    Q_PROPERTY(QString virtualDiskName READ virtualDiskName WRITE setVirtualDiskName);
    9393    Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r72185 r74878  
    3838    Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath);
    3939    Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);
    40     Q_PROPERTY(QString virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
     40    Q_PROPERTY(QUuid virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);
    4141    Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation);
    4242
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette