VirtualBox

Changeset 85168 in vbox


Ignore:
Timestamp:
Jul 10, 2020 10:13:03 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. More improvements

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

Legend:

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

    r85150 r85168  
    504504}
    505505
     506void UIWizardNewVMPage1::retranslateWidgets()
     507{
     508    if (m_pButtonSimple)
     509    {
     510        m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty"));
     511        m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed thereby leaving the virtual machine's disk empty."));
     512    }
     513    if (m_pButtonUnattended)
     514    {
     515        m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install"));
     516        m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS installation will be started after this wizard is closed."));
     517    }
     518
     519    if (m_pISOSelectorLabel)
     520        m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Image:"));
     521
     522    if (m_pStartHeadlessLabel)
     523        m_pStartHeadlessLabel->setText(UIWizardNewVM::tr("Options:"));
     524    if (m_pStartHeadlessCheckBox)
     525    {
     526        m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("Start VM Headless"));
     527        m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual machine in headless mode."));
     528    }
     529
     530}
     531
    506532UIWizardNewVMPageBasic1::UIWizardNewVMPageBasic1(const QString &strGroup)
    507533    : UIWizardNewVMPage1(strGroup)
     
    596622void UIWizardNewVMPageBasic1::retranslateUi()
    597623{
     624    retranslateWidgets();
    598625    /* Translate page: */
    599626    setTitle(UIWizardNewVM::tr("Virtual machine name and operating system"));
     
    605632                                             "Additionally you can choose to start the unattended install as a headless vm process."));
    606633
    607     if (m_pButtonSimple)
    608     {
    609         m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty"));
    610         m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed"));
    611     }
    612     if (m_pButtonUnattended)
    613     {
    614         m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install"));
    615         m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS will be initialized after this wizard is closed"));
    616     }
    617 
    618     if (m_pISOSelectorLabel)
    619         m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Image:"));
    620 
    621     if (m_pStartHeadlessLabel)
    622         m_pStartHeadlessLabel->setText(UIWizardNewVM::tr("Options:"));
    623     if (m_pStartHeadlessCheckBox)
    624     {
    625         m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("Start VM Headless"));
    626         m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual machine headless"));
    627     }
    628634
    629635    if (m_pNameOSTypeLabel)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r85135 r85168  
    7979    /** Colors the widgets red if they cause isComplete to fail. */
    8080    void markWidgets() const;
    81 
    8281    bool isISOFileSelectorComplete() const;
     82    void retranslateWidgets();
    8383
    8484    /** @name Widgets
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp

    r85150 r85168  
    191191}
    192192
     193void UIWizardNewVMPage2::retranslateWidgets()
     194{
     195    if (m_pHostnameLabel)
     196        m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:"));
     197    if (m_pInstallGACheckBox)
     198        m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions"));
     199    if (m_pGAISOPathLabel)
     200        m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
     201    if (m_pGAISOFilePathSelector)
     202        m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
     203    if (m_pProductKeyLabel)
     204        m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:"));
     205}
     206
    193207UIWizardNewVMPageBasic2::UIWizardNewVMPageBasic2()
    194208    : m_pLabel(0)
     
    212226    }
    213227
    214     m_pToolBox->insertItem(ToolBoxItems_UserNameHostname, createUserNameHostNameWidgets(),
    215                            UIIconPool::iconSet(":/cloud_profile_manager_16px.png"), QString());
    216     m_pToolBox->insertItem(ToolBoxItems_GAInstall, createGAInstallWidgets(),
    217                            UIIconPool::iconSet(":/cloud_profile_manager_16px.png"), QString());
    218     m_pToolBox->insertItem(ToolBoxItems_ProductKey, createProductKeyWidgets(),
    219                            UIIconPool::iconSet(":/cloud_profile_manager_16px.png"), QString());
     228    m_pToolBox->insertItem(ToolBoxItems_UserNameHostname, createUserNameHostNameWidgets(), QString());
     229    m_pToolBox->insertItem(ToolBoxItems_GAInstall, createGAInstallWidgets(), QString());
     230    m_pToolBox->insertItem(ToolBoxItems_ProductKey, createProductKeyWidgets(), QString());
     231    m_pToolBox->setStyleSheet("QToolBox::tab:selected { font: bold; }");
    220232
    221233    registerField("userName", this, "userName");
     
    249261                                            "hostname. You can additionally enable guest additions install. "
    250262                                            "For Microsoft Windows guests it is possible to provide a product key..</p>"));
    251     if (m_pHostnameLabel)
    252         m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:"));
     263    retranslateWidgets();
    253264    if (m_pToolBox)
    254265    {
     
    257268        m_pToolBox->setItemText(ToolBoxItems_ProductKey, UIWizardNewVM::tr("Product key"));
    258269    }
    259     if (m_pInstallGACheckBox)
    260         m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions"));
    261     if (m_pGAISOPathLabel)
    262         m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
    263     if (m_pGAISOFilePathSelector)
    264         m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
    265     if (m_pProductKeyLabel)
    266         m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:"));
    267270}
    268271
     
    274277bool UIWizardNewVMPageBasic2::isComplete() const
    275278{
     279    AssertReturn(m_pToolBox, false);
     280
     281    m_pToolBox->setItemIcon(ToolBoxItems_UserNameHostname, QIcon());
     282    m_pToolBox->setItemIcon(ToolBoxItems_GAInstall, QIcon());
     283    m_pToolBox->setItemIcon(ToolBoxItems_ProductKey, QIcon());
     284
    276285    markWidgets();
     286    bool fIsComplete = true;
    277287    if (!checkGAISOFile())
    278         return false;
    279     if (m_pUserNamePasswordEditor)
    280         return m_pUserNamePasswordEditor->isComplete();
    281     return true;
     288    {
     289        m_pToolBox->setItemIcon(ToolBoxItems_GAInstall, UIIconPool::iconSet(":/warning.png"));
     290        fIsComplete = false;
     291    }
     292    if (m_pUserNamePasswordEditor && !m_pUserNamePasswordEditor->isComplete())
     293    {
     294        m_pToolBox->setItemIcon(ToolBoxItems_UserNameHostname, UIIconPool::iconSet(":/warning.png"));
     295        fIsComplete = false;
     296    }
     297    return fIsComplete;
    282298}
    283299
     
    289305{
    290306    if (m_pToolBox)
    291     {
    292         QWidget *pProductKeyWidget = m_pToolBox->widget(ToolBoxItems_ProductKey);
    293         if (pProductKeyWidget)
    294             pProductKeyWidget->setEnabled(isProductKeyWidgetEnabled());
    295     }
     307        m_pToolBox->setItemEnabled(ToolBoxItems_ProductKey, isProductKeyWidgetEnabled());
    296308    UIWizardPage::showEvent(pEvent);
    297309}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h

    r85150 r85168  
    7373    bool checkGAISOFile() const;
    7474    void markWidgets() const;
     75    void retranslateWidgets();
    7576
    7677    /** @name Widgets
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp

    r85090 r85168  
    156156}
    157157
     158void UIWizardNewVMPage3::retranslateWidgets()
     159{
     160    m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
     161    m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
     162    m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
     163    m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
     164}
     165
    158166QWidget *UIWizardNewVMPage3::createDiskWidgets()
    159167{
     
    222230    pMainLayout->addWidget(m_pToolBox);
    223231
    224     m_pToolBox->insertItem(ToolBoxItems_Disk, createDiskWidgets(),
    225                            UIIconPool::iconSet(":/cloud_profile_manager_16px.png"), QString());
    226     m_pToolBox->insertItem(ToolBoxItems_Hardware, createHardwareWidgets(),
    227                            UIIconPool::iconSet(":/cloud_profile_manager_16px.png"), QString());
     232    m_pToolBox->insertItem(ToolBoxItems_Disk, createDiskWidgets(), QString());
     233    m_pToolBox->insertItem(ToolBoxItems_Hardware, createHardwareWidgets(), QString());
     234    m_pToolBox->setStyleSheet("QToolBox::tab:selected { font: bold; }");
    228235
    229236    pMainLayout->addStretch();
     
    278285                                        "and virtual processors.</p>")
    279286                                        .arg(strRecommendedHDD));
    280 
    281     m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
    282     m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
    283     m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
    284     m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
    285 
     287    retranslateWidgets();
    286288    if (m_pToolBox)
    287289    {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h

    r85090 r85168  
    8282    /** Helpers. */
    8383    void ensureNewVirtualDiskDeleted();
     84    void retranslateWidgets();
    8485
    8586    /** Input. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r85157 r85168  
    187187void UIWizardNewVMPageExpert::retranslateUi()
    188188{
    189     if (m_pUnattendedLabel)
    190         m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install "
    191                                              "in which case you will have to select a valid installation medium. If not "
    192                                              "your virtual disk will have an empty virtual hard disk. "
    193                                              "Additionally you can choose to start the unattended install as a headless vm process."));
    194     if (m_pButtonSimple)
    195     {
    196         m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty"));
    197         m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed"));
    198     }
    199     if (m_pButtonUnattended)
    200     {
    201         m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install"));
    202         m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS will be initialized after this wizard is closed"));
    203     }
    204 
    205     if (m_pISOSelectorLabel)
    206         m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Image:"));
    207 
    208     if (m_pStartHeadlessLabel)
    209         m_pStartHeadlessLabel->setText(UIWizardNewVM::tr("Options:"));
    210     if (m_pStartHeadlessCheckBox)
    211     {
    212         m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("Start VM Headless"));
    213         m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual machine headless"));
    214     }
    215 
    216 
    217 
    218     m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
    219     m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
    220     m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
    221     m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
     189    UIWizardNewVMPage1::retranslateWidgets();
     190    UIWizardNewVMPage2::retranslateWidgets();
     191    UIWizardNewVMPage3::retranslateWidgets();
     192
    222193    if (m_pToolBox)
    223194    {
     
    229200        m_pToolBox->setItemText(ExpertToolboxItems_Hardware, UIWizardNewVM::tr("Hardware"));
    230201    }
    231 
    232     if (m_pHostnameLabel)
    233         m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:"));
    234     if (m_pInstallGACheckBox)
    235         m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions"));
    236     if (m_pGAISOPathLabel)
    237         m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
    238     if (m_pGAISOFilePathSelector)
    239         m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
    240     if (m_pProductKeyLabel)
    241         m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:"));
    242 
    243202}
    244203
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