VirtualBox

Ignore:
Timestamp:
May 10, 2016 4:34:28 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​​​​​​​bugref:6769: Rework for New VM wizard (part 04): Overriding the machine name/path editor tool-tip.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r60930 r60932  
    3131# include "UIMessageCenter.h"
    3232# include "UINameAndSystemEditor.h"
     33# include "UIFilePathSelector.h"
    3334# include "QIRichTextLabel.h"
    3435
     
    204205}
    205206
     207void UIWizardNewVMPage1::adjustToolTip(const QString &strNewName /* = QString() */)
     208{
     209    /* Compose tool-tip: */
     210    QString strToolTip;
     211    /* If name is empty: */
     212    if (strNewName.isEmpty())
     213    {
     214        /* We are just reseting the tool-tip to default: */
     215        strToolTip = UIWizardNewVM::tr("<p><nobr>Holds the name or full path to the virtual "
     216                                       "machine folder you are about to create.</nobr></p>");
     217    }
     218    /* If name is NOT empty: */
     219    else
     220    {
     221        /* Compose the machine file-path, acquire the machine folder from it: */
     222        const QString strMachineFilePath = composeMachineFilePath(strNewName);
     223        const QString strMachineFolder = QDir::toNativeSeparators(QFileInfo(strMachineFilePath).absolutePath());
     224        /* And compose the location-editor tool-tip accordingly: */
     225        strToolTip = UIWizardNewVM::tr("<p><nobr>You are about to create the virtual machine in the "
     226                                       "following folder:</nobr><br><nobr><b>%1</b></nobr></p>")
     227                                       .arg(strMachineFolder);
     228    }
     229    /* Assign tool-tip: */
     230    m_pNameAndSystemEditor->locationEditor()->setToolTip(strToolTip);
     231}
     232
    206233bool UIWizardNewVMPage1::machineFolderCreated()
    207234{
     
    291318    /* Setup connections: */
    292319    connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltNameChanged(const QString &)));
     320    connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltAdjustToolTip(const QString &)));
    293321    connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(sltOsTypeChanged()));
    294322
     
    299327    registerField("machineBaseName", this, "machineBaseName");
    300328    registerField("machineFilePath", this, "machineFilePath");
     329
     330    /* Initialize tool-tip: */
     331    adjustToolTip();
    301332}
    302333
     
    305336    /* Call to base-class: */
    306337    onNameChanged(strNewName);
     338}
     339
     340void UIWizardNewVMPageBasic1::sltAdjustToolTip(const QString &strNewName)
     341{
     342    /* Call to base-class: */
     343    adjustToolTip(strNewName);
    307344}
    308345
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r60930 r60932  
    3737    void onNameChanged(QString strNewName);
    3838    void onOsTypeChanged();
     39
     40    /** Adjusts tool-tip according to @a strNewName. */
     41    void adjustToolTip(const QString &strNewName = QString());
    3942
    4043    /* Helping stuff: */
     
    101104    void sltOsTypeChanged();
    102105
     106    /** Adjusts tool-tip according to @a strNewName. */
     107    void sltAdjustToolTip(const QString &strNewName);
     108
    103109private:
    104110
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r60839 r60932  
    139139    /* Setup connections: */
    140140    connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltNameChanged(const QString &)));
     141    connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltAdjustToolTip(const QString &)));
    141142    connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(sltOsTypeChanged()));
    142143    connect(m_pRamSlider, SIGNAL(valueChanged(int)), this, SLOT(sltRamSliderValueChanged()));
     
    160161    registerField("virtualDiskId", this, "virtualDiskId");
    161162    registerField("virtualDiskLocation", this, "virtualDiskLocation");
     163
     164    /* Initialize tool-tip: */
     165    adjustToolTip();
    162166}
    163167
     
    174178    /* Broadcast complete-change: */
    175179    emit completeChanged();
     180}
     181
     182void UIWizardNewVMPageExpert::sltAdjustToolTip(const QString &strNewName)
     183{
     184    /* Call to base-class: */
     185    adjustToolTip(strNewName);
    176186}
    177187
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r60839 r60932  
    6565    void sltGetWithFileOpenDialog();
    6666
     67    /** Adjusts tool-tip according to @a strNewName. */
     68    void sltAdjustToolTip(const QString &strNewName);
     69
    6770private:
    6871
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