VirtualBox

Ignore:
Timestamp:
May 15, 2018 2:20:58 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122654
Message:

FE/Qt bugref:6769 Trying to make clone vm wizard 'group' aware

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

Legend:

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

    r71644 r72215  
    682682    /* Use the "safe way" to open stack of Mac OS X Sheets: */
    683683    QWidget *pWizardParent = windowManager().realParentWindow(this);
    684     UISafePointerWizard pWizard = new UIWizardCloneVM(pWizardParent, pItem->machine());
     684
     685    const QStringList &machineGroupNames = pItem->groups();
     686    QString strGroup = !machineGroupNames.isEmpty() ? machineGroupNames.at(0) : QString();
     687    UISafePointerWizard pWizard = new UIWizardCloneVM(pWizardParent, pItem->machine(), strGroup);
    685688    windowManager().registerNewParent(pWizard, pWizardParent);
    686689    pWizard->prepare();
     
    27722775    return false;
    27732776}
    2774 
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp

    r71460 r72215  
    18381838
    18391839    /* Show Clone VM wizard: */
    1840     UISafePointerWizard pWizard = new UIWizardCloneVM(this, comMachine, comSnapshot);
     1840    UISafePointerWizard pWizard = new UIWizardCloneVM(this, comMachine, QString(), comSnapshot);
    18411841    pWizard->prepare();
    18421842    pWizard->exec();
     
    19081908
    19091909#include "UISnapshotPane.moc"
    1910 
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp

    r71355 r72215  
    215215}
    216216
     217const QStringList& UIVMItem::groups()
     218{
     219    return m_groups;
     220}
     221
    217222bool UIVMItem::recache()
    218223{
     
    241246        if (m_pixmap.isNull())
    242247            m_pixmap = vboxGlobal().vmGuestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
     248
     249        m_groups = m_machine.GetGroups().toList();
    243250
    244251        if (   m_machineState == KMachineState_PoweredOff
     
    291298
    292299        m_pixmap = vboxGlobal().vmGuestOSTypePixmapDefault("Other", &m_logicalPixmapSize);
    293 
     300        m_groups.clear();
    294301        m_pid = (ULONG) ~0;
    295302    /// @todo Remove. See @c todo in #switchTo() below.
     
    543550    return m_type;
    544551}
    545 
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.h

    r69500 r72215  
    6565
    6666    QString settingsFile() const { return m_strSettingsFile; }
    67 
     67    const QStringList &groups();
    6868    bool recache();
    6969
     
    111111    bool m_fHasDetails;
    112112
     113    QStringList m_groups;
    113114    /** Holds configuration access level. */
    114115    ConfigurationAccessLevel m_configurationAccessLevel;
     
    140141
    141142#endif /* __UIVMItem_h__ */
    142 
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp

    r72199 r72215  
    3636
    3737
    38 UIWizardCloneVM::UIWizardCloneVM(QWidget *pParent, const CMachine &machine, CSnapshot snapshot /* = CSnapshot() */)
     38UIWizardCloneVM::UIWizardCloneVM(QWidget *pParent, const CMachine &machine,
     39                                 const QString &strGroup, CSnapshot snapshot /* = CSnapshot() */)
    3940    : UIWizard(pParent, WizardType_CloneVM)
    4041    , m_machine(machine)
    4142    , m_snapshot(snapshot)
     43    , m_strGroup(strGroup)
    4244{
    4345#ifndef VBOX_WS_MAC
     
    5456    /* Get the clone name: */
    5557    QString strName = field("cloneName").toString();
    56     /* Get the clone path: */
    57     QString strPath = field("clonePath").toString();
     58    /* Get the clone setting file path: */
    5859    QString strSettingsFile = field("cloneFilePath").toString();
    5960
     
    185186        case WizardMode_Basic:
    186187        {
    187             setPage(Page1, new UIWizardCloneVMPageBasic1(m_machine.GetName(), strDefaultMachineFolder));
     188            setPage(Page1, new UIWizardCloneVMPageBasic1(m_machine.GetName(), strDefaultMachineFolder, m_strGroup));
    188189            setPage(Page2, new UIWizardCloneVMPageBasic2(m_snapshot.isNull()));
    189190            if (m_machine.GetSnapshotCount() > 0)
     
    196197                                                              strDefaultMachineFolder,
    197198                                                              m_snapshot.isNull(),
    198                                                               m_snapshot.isNull() ? false : m_snapshot.GetChildrenCount() > 0));
     199                                                              m_snapshot.isNull() ? false : m_snapshot.GetChildrenCount() > 0,
     200                                                              m_strGroup));
    199201            break;
    200202        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.h

    r69500 r72215  
    4949
    5050    /* Constructor: */
    51     UIWizardCloneVM(QWidget *pParent, const CMachine &machine, CSnapshot snapshot = CSnapshot());
     51    UIWizardCloneVM(QWidget *pParent, const CMachine &machine,
     52                    const QString &strGroup, CSnapshot snapshot = CSnapshot());
    5253
    5354protected:
     
    7071
    7172    /* Variables: */
    72     CMachine m_machine;
     73    CMachine  m_machine;
    7374    CSnapshot m_snapshot;
     75    QString   m_strGroup;
    7476};
    7577
    7678#endif // __UIWizardCloneVM_h__
    77 
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.cpp

    r72199 r72215  
    3838
    3939
    40 UIWizardCloneVMPage1::UIWizardCloneVMPage1(const QString &strOriginalName, const QString &strDefaultPath)
     40UIWizardCloneVMPage1::UIWizardCloneVMPage1(const QString &strOriginalName, const QString &strDefaultPath, const QString &strGroup)
    4141    : m_strOriginalName(strOriginalName)
    4242    , m_strDefaultPath(strDefaultPath)
     43    , m_strGroup(strGroup)
    4344{
    4445}
     
    8889    CVirtualBox vbox = vboxGlobal().virtualBox();
    8990    setCloneFilePath(vbox.ComposeMachineFilename(m_pNamePathSelector->name(),
    90                                                  QString::null,
     91                                                 m_strGroup,
    9192                                                 QString::null,
    9293                                                 m_pNamePathSelector->path()));
     
    9798}
    9899
    99 UIWizardCloneVMPageBasic1::UIWizardCloneVMPageBasic1(const QString &strOriginalName, const QString &strDefaultPath)
    100     : UIWizardCloneVMPage1(strOriginalName, strDefaultPath)
     100UIWizardCloneVMPageBasic1::UIWizardCloneVMPageBasic1(const QString &strOriginalName, const QString &strDefaultPath, const QString &strGroup)
     101    : UIWizardCloneVMPage1(strOriginalName, strDefaultPath, strGroup)
    101102{
    102103    /* Create widgets: */
     
    135136    /* Register fields: */
    136137    registerField("cloneName", this, "cloneName");
    137     registerField("clonePath", this, "clonePath");
     138    registerField("cloneFilePath", this, "cloneFilePath");
    138139    registerField("reinitMACs", this, "reinitMACs");
    139140}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.h

    r72199 r72215  
    3333protected:
    3434
    35     UIWizardCloneVMPage1(const QString &strOriginalName, const QString &strDefaultPath);
     35    UIWizardCloneVMPage1(const QString &strOriginalName, const QString &strDefaultPath, const QString &strGroup);
    3636
    3737    QString cloneName() const;
     
    5050    QString    m_strOriginalName;
    5151    QString    m_strDefaultPath;
     52    QString    m_strGroup;
    5253    /** Full, non-native path of the clone machines setting file. Generated by CVirtualBox::ComposeMachineFilename(...) */
    5354    QString    m_strCloneFilePath;
     
    6566    Q_OBJECT;
    6667    Q_PROPERTY(QString cloneName READ cloneName WRITE setCloneName);
    67     Q_PROPERTY(QString clonePath READ clonePath WRITE setClonePath);
    6868    Q_PROPERTY(QString cloneFilePath READ cloneFilePath WRITE setCloneFilePath);
    6969    Q_PROPERTY(bool reinitMACs READ isReinitMACsChecked);
     
    7171public:
    7272
    73     UIWizardCloneVMPageBasic1(const QString &strOriginalName, const QString &strDefaultPath);
     73    UIWizardCloneVMPageBasic1(const QString &strOriginalName, const QString &strDefaultPath, const QString &strGroup);
    7474
    7575private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.cpp

    r72199 r72215  
    3636
    3737
    38 UIWizardCloneVMPageExpert::UIWizardCloneVMPageExpert(const QString &strOriginalName, const QString &strDefaultPath, bool fAdditionalInfo, bool fShowChildsOption)
    39     : UIWizardCloneVMPage1(strOriginalName, strDefaultPath)
     38UIWizardCloneVMPageExpert::UIWizardCloneVMPageExpert(const QString &strOriginalName, const QString &strDefaultPath,
     39                                                     bool fAdditionalInfo, bool fShowChildsOption, const QString &strGroup)
     40    : UIWizardCloneVMPage1(strOriginalName, strDefaultPath, strGroup)
    4041    , UIWizardCloneVMPage2(fAdditionalInfo)
    4142    , UIWizardCloneVMPage3(fShowChildsOption)
     
    117118    /* Register fields: */
    118119    registerField("cloneName", this, "cloneName");
    119     registerField("clonePath", this, "clonePath");
     120    registerField("cloneFilePath", this, "cloneFilePath");
    120121    registerField("reinitMACs", this, "reinitMACs");
    121122    registerField("linkedClone", this, "linkedClone");
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.h

    r72199 r72215  
    3535    Q_OBJECT;
    3636    Q_PROPERTY(QString cloneName READ cloneName WRITE setCloneName);
    37     Q_PROPERTY(QString clonePath READ clonePath WRITE setClonePath);
     37    Q_PROPERTY(QString cloneFilePath READ cloneFilePath WRITE setCloneFilePath);
    3838    Q_PROPERTY(bool reinitMACs READ isReinitMACsChecked);
    3939    Q_PROPERTY(bool linkedClone READ isLinkedClone);
     
    4444    /* Constructor: */
    4545    UIWizardCloneVMPageExpert(const QString &strOriginalName, const QString &strDefaultPath,
    46                               bool fAdditionalInfo, bool fShowChildsOption);
     46                              bool fAdditionalInfo, bool fShowChildsOption, const QString &strGroup);
    4747
    4848private slots:
Note: See TracChangeset for help on using the changeset viewer.

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