VirtualBox

Changeset 73030 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 10, 2018 10:23:23 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123582
Message:

FE/Qt: bugref:9152: Export Appliance wizard: Storage and Expert pages: Refresh only required settings on corresponding triggers, not just everything.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r73025 r73030  
    107107}
    108108
    109 void UIWizardExportAppPage3::refreshCurrentSettings()
    110 {
    111     /* Compose file-name: */
    112     QString strName;
    113 
     109void UIWizardExportAppPage3::refreshFileSelectorName()
     110{
    114111    /* If it's one VM only, we use the VM name as file-name: */
    115112    if (fieldImp("machineNames").toStringList().size() == 1)
    116         strName = fieldImp("machineNames").toStringList()[0];
     113        m_strFileSelectorName = fieldImp("machineNames").toStringList()[0];
    117114    /* Otherwise => we use the default file-name: */
    118115    else
    119         strName = m_strDefaultApplianceName;
    120 
     116        m_strFileSelectorName = m_strDefaultApplianceName;
     117
     118    /* Cascade update for file selector path: */
     119    refreshFileSelectorPath();
     120}
     121
     122void UIWizardExportAppPage3::refreshFileSelectorExtension()
     123{
    121124    /* If the format is set to OPC: */
    122125    if (fieldImp("format").toString() == "opc-1.0")
    123126    {
    124127        /* We use .tar.gz extension: */
    125         strName += ".tar.gz";
     128        m_strFileSelectorExt = ".tar.gz";
    126129
    127130        /* Update file chooser accordingly: */
    128131        m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Oracle Public Cloud Format Archive (%1)").arg("*.tar.gz"));
    129 
    130         /* Disable manifest file creation: */
    131         m_pManifestCheckbox->setChecked(false);
    132         m_pManifestCheckbox->setEnabled(false);
    133132    }
    134133    /* Otherwise: */
     
    136135    {
    137136        /* We use the default (.ova) extension: */
    138         strName += ".ova";
     137        m_strFileSelectorExt = ".ova";
    139138
    140139        /* Update file chooser accordingly: */
    141140        m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" +
    142141                                        UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf"));
    143 
    144         /* Enable manifest file creation: */
     142    }
     143
     144    /* Cascade update for file selector path: */
     145    refreshFileSelectorPath();
     146}
     147
     148void UIWizardExportAppPage3::refreshFileSelectorPath()
     149{
     150    /* Compose file selector path: */
     151    const QString strPath = QDir::toNativeSeparators(QString("%1/%2")
     152                                                     .arg(vboxGlobal().documentsPath())
     153                                                     .arg(m_strFileSelectorName + m_strFileSelectorExt));
     154
     155    /* Assign the path: */
     156    m_pFileSelector->setPath(strPath);
     157}
     158
     159void UIWizardExportAppPage3::refreshManifestCheckBoxAccess()
     160{
     161    /* If the format is set to OPC: */
     162    if (fieldImp("format").toString() == "opc-1.0")
     163    {
     164        /* Disable manifest check-box: */
     165        m_pManifestCheckbox->setChecked(false);
     166        m_pManifestCheckbox->setEnabled(false);
     167    }
     168    /* Otherwise: */
     169    else
     170    {
     171        /* Enable manifest check-box: */
    145172        m_pManifestCheckbox->setEnabled(true);
    146173    }
    147 
    148     /* Copose file-path for 'LocalFilesystem' storage case: */
    149     const StorageType enmStorageType = fieldImp("storageType").value<StorageType>();
    150     if (enmStorageType == LocalFilesystem)
    151         strName = QDir::toNativeSeparators(QString("%1/%2").arg(vboxGlobal().documentsPath()).arg(strName));
    152 
    153     /* Assign file-path: */
    154     m_pFileSelector->setPath(strName);
    155174}
    156175
     
    437456    }
    438457
    439     /* Refresh current settings: */
    440     refreshCurrentSettings();
     458    /* Refresh file selector name: */
     459    refreshFileSelectorName();
    441460
    442461    /* Update page appearance: */
     
    452471    /* Translate page: */
    453472    retranslateUi();
     473
     474    /* Refresh file selector name: */
     475    // refreshFileSelectorName(); alreeady called from retranslateUi();
     476    /* Refresh file selector extension: */
     477    refreshFileSelectorExtension();
     478    /* Refresh manifest check-box access: */
     479    refreshManifestCheckBoxAccess();
    454480}
    455481
     
    526552    updateFormatComboToolTip();
    527553
    528     /* Refresh current settings: */
    529     refreshCurrentSettings();
     554    /* Refresh required settings: */
     555    refreshFileSelectorExtension();
     556    refreshManifestCheckBoxAccess();
    530557}
    531558
     
    534561    /* Update tool-tip: */
    535562    updateProviderComboToolTip();
    536 
    537     /* Refresh current settings: */
    538     refreshCurrentSettings();
    539 }
     563}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r73025 r73030  
    5151    virtual void updatePageAppearance();
    5252
    53     /** Refreshes current settings. */
    54     void refreshCurrentSettings();
     53    /** Refresh file selector name. */
     54    void refreshFileSelectorName();
     55    /** Refresh file selector extension. */
     56    void refreshFileSelectorExtension();
     57    /** Refresh file selector path. */
     58    void refreshFileSelectorPath();
     59    /** Refresh Manifest check-box access. */
     60    void refreshManifestCheckBoxAccess();
    5561
    5662    /** Updates format combo tool-tips. */
     
    8187    /** Holds the default appliance name. */
    8288    QString  m_strDefaultApplianceName;
     89
     90    /** Holds the file selector name. */
     91    QString  m_strFileSelectorName;
     92    /** Holds the file selector ext. */
     93    QString  m_strFileSelectorExt;
    8394
    8495    /** Holds the settings widget instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r73025 r73030  
    376376    }
    377377
    378     /* Refresh current settings: */
    379     refreshCurrentSettings();
     378    /* Refresh file selector name: */
     379    refreshFileSelectorName();
    380380
    381381    /* Update tool-tips: */
     
    389389    retranslateUi();
    390390
    391     /* Refresh current settings: */
    392     refreshCurrentSettings();
     391    /* Refresh file selector name: */
     392    // refreshFileSelectorName(); already called from retranslateUi();
     393    /* Refresh file selector extension: */
     394    refreshFileSelectorExtension();
     395    /* Refresh manifest check-box access: */
     396    refreshManifestCheckBoxAccess();
     397
    393398    /* Refresh appliance settings: */
    394399    refreshApplianceSettingsWidget();
     
    453458void UIWizardExportAppPageExpert::sltVMSelectionChangeHandler()
    454459{
    455     /* Refresh current settings: */
    456     refreshCurrentSettings();
     460    /* Refresh required settings: */
     461    refreshFileSelectorName();
    457462    refreshApplianceSettingsWidget();
    458463
     
    475480    updateFormatComboToolTip();
    476481
    477     /* Refresh current settings: */
    478     refreshCurrentSettings();
     482    /* Refresh required settings: */
     483    refreshFileSelectorExtension();
     484    refreshManifestCheckBoxAccess();
    479485}
    480486
     
    483489    /* Update tool-tip: */
    484490    updateProviderComboToolTip();
    485 
    486     /* Refresh current settings: */
    487     refreshCurrentSettings();
    488 }
     491}
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