VirtualBox

Changeset 79940 in vbox for trunk


Ignore:
Timestamp:
Jul 23, 2019 6:21:43 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7720: VirtualBox Manager: Details pane: Possibility to edit VM path on-the-fly.

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

Legend:

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

    r79923 r79940  
    8181    /* Settings file location: */
    8282    if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location)
     83    {
     84        /* Configure hovering anchor: */
     85        const QString strAnchorType = QString("machine_location");
     86        const QString strMachineLocation = comMachine.GetSettingsFilePath();
    8387        table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"),
    84                                  QDir::toNativeSeparators(QFileInfo(comMachine.GetSettingsFilePath()).absolutePath()));
     88                                 QString("<a href=#%1,%2>%3</a>").arg(strAnchorType,
     89                                                                      strMachineLocation,
     90                                                                      QDir::toNativeSeparators(QFileInfo(strMachineLocation).absolutePath())));
     91    }
    8592
    8693    /* Groups: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp

    r79936 r79940  
    5555                break;
    5656            }
     57            case MachineAttribute_Location:
     58            {
     59                /* Do not save machine settings: */
     60                fSaveSettings = false;
     61                /* Prepare machine move progress: */
     62                CProgress comProgress = comMachine.MoveTo(guiAttribute.toString(), "basic");
     63                if (!comMachine.isOk())
     64                {
     65                    msgCenter().cannotMoveMachine(comMachine);
     66                    fErrorHappened = true;
     67                    break;
     68                }
     69                /* Show machine move progress: */
     70                msgCenter().showModalProgressDialog(comProgress, comMachine.GetName(), ":/progress_clone_90px.png");
     71                if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     72                {
     73                    msgCenter().cannotMoveMachine(comProgress, comMachine.GetName());
     74                    fErrorHappened = true;
     75                    break;
     76                }
     77                break;
     78            }
    5779            case MachineAttribute_OSType:
    5880            {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.h

    r79923 r79940  
    3232    MachineAttribute_Name,
    3333    MachineAttribute_OSType,
     34    MachineAttribute_Location,
    3435};
    3536
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp

    r79939 r79940  
    4646    AnchorRole_Invalid,
    4747    AnchorRole_MachineName,
     48    AnchorRole_MachineLocation,
    4849    AnchorRole_OSType,
    4950    AnchorRole_Storage,
     
    147148    ConfigurationAccessLevel cal = m_pSet->configurationAccessLevel();
    148149    m_pTextPane->setAnchorRoleRestricted("#machine_name", cal != ConfigurationAccessLevel_Full);
     150    m_pTextPane->setAnchorRoleRestricted("#machine_location", cal != ConfigurationAccessLevel_Full);
    149151    m_pTextPane->setAnchorRoleRestricted("#os_type", cal != ConfigurationAccessLevel_Full);
    150152    m_pTextPane->setAnchorRoleRestricted("#mount", cal == ConfigurationAccessLevel_Null);
     
    428430    QMap<QString, AnchorRole> roles;
    429431    roles["#machine_name"] = AnchorRole_MachineName;
     432    roles["#machine_location"] = AnchorRole_MachineLocation;
    430433    roles["#os_type"] = AnchorRole_OSType;
    431434    roles["#mount"] = AnchorRole_Storage;
     
    441444    {
    442445        case AnchorRole_MachineName:
     446        case AnchorRole_MachineLocation:
    443447        case AnchorRole_OSType:
    444448        {
     
    451455                    new UINameAndSystemEditor(pPopup,
    452456                                              enmRole == AnchorRole_MachineName /* choose name? */,
    453                                               false /* choose path? */,
     457                                              enmRole == AnchorRole_MachineLocation /* choose path? */,
    454458                                              enmRole == AnchorRole_OSType /* choose type? */);
    455459                if (pEditor)
     
    458462                    {
    459463                        case AnchorRole_MachineName: pEditor->setName(strData.section(',', 0, 0)); break;
     464                        case AnchorRole_MachineLocation: pEditor->setPath(strData.section(',', 0, 0)); break;
    460465                        case AnchorRole_OSType: pEditor->setTypeId(strData.section(',', 0, 0)); break;
    461466                        default: break;
     
    481486                    {
    482487                        case AnchorRole_MachineName: setMachineAttribute(machine(), MachineAttribute_Name, QVariant::fromValue(pEditor->name())); break;
     488                        case AnchorRole_MachineLocation: setMachineAttribute(machine(), MachineAttribute_Location, QVariant::fromValue(pEditor->path())); break;
    483489                        case AnchorRole_OSType: setMachineAttribute(machine(), MachineAttribute_OSType, QVariant::fromValue(pEditor->typeId())); break;
    484490                        default: break;
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