VirtualBox

Changeset 103950 in vbox for trunk


Ignore:
Timestamp:
Mar 20, 2024 11:41:04 AM (10 months ago)
Author:
vboxsync
Message:

FE/Qt. bugref:10622. Using new UITranslationEventListener in wizard classes. part 3.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostnameDomainNameEditor.cpp

    r103710 r103950  
    4040#include "UIIconPool.h"
    4141#include "UIHostnameDomainNameEditor.h"
     42#include "UITranslationEventListener.h"
    4243
    4344/* Other VBox includes: */
     
    4647
    4748UIHostnameDomainNameEditor::UIHostnameDomainNameEditor(QWidget *pParent /*  = 0 */)
    48     : QIWithRetranslateUI<QWidget>(pParent)
     49    : QWidget(pParent)
    4950    , m_pHostnameLineEdit(0)
    5051    , m_pDomainNameLineEdit(0)
     
    123124}
    124125
    125 void UIHostnameDomainNameEditor::retranslateUi()
     126void UIHostnameDomainNameEditor::sltRetranslateUI()
    126127{
    127128    if (m_pHostnameLabel)
     
    180181            this, &UIHostnameDomainNameEditor::sltDomainChanged);
    181182
    182     retranslateUi();
     183    sltRetranslateUI();
     184    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     185            this, &UIHostnameDomainNameEditor::sltRetranslateUI);
    183186}
    184187
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostnameDomainNameEditor.h

    r98103 r103950  
    3636#include <QWidget>
    3737
    38 /* Local includes: */
    39 #include "QIWithRetranslateUI.h"
    40 
    4138/* Forward declarations: */
    4239class QGridLayout;
     
    4643class UIPasswordLineEdit;
    4744
    48 class UIHostnameDomainNameEditor : public QIWithRetranslateUI<QWidget>
     45class UIHostnameDomainNameEditor : public QWidget
    4946{
    5047
     
    7370    void setFirstColumnWidth(int iWidth);
    7471
    75 
    76 protected:
    77 
    78     void retranslateUi();
    79 
    8072private slots:
    8173
    8274    void sltHostnameChanged();
    8375    void sltDomainChanged();
     76    void sltRetranslateUI();
    8477
    8578private:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardCloneVMEditors.cpp

    r103803 r103950  
    3939#include "UIFilePathSelector.h"
    4040#include "UIGlobalSession.h"
     41#include "UITranslationEventListener.h"
    4142#include "UIWizardCloneVM.h"
    4243#include "UIWizardCloneVMEditors.h"
     
    5253
    5354UICloneVMNamePathEditor::UICloneVMNamePathEditor(const QString &strOriginalName, const QString &strDefaultPath, QWidget *pParent /* = 0 */)
    54     :QIWithRetranslateUI<QGroupBox>(pParent)
     55    : QGroupBox(pParent)
    5556    , m_pContainerLayout(0)
    5657    , m_pNameLineEdit(0)
     
    182183    }
    183184
    184     retranslateUi();
    185 }
    186 
    187 void UICloneVMNamePathEditor::retranslateUi()
     185    sltRetranslateUI();
     186    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     187            this, &UICloneVMNamePathEditor::sltRetranslateUI);
     188}
     189
     190void UICloneVMNamePathEditor::sltRetranslateUI()
    188191{
    189192    if (m_pNameLabel)
     
    204207
    205208UICloneVMAdditionalOptionsEditor::UICloneVMAdditionalOptionsEditor(QWidget *pParent /* = 0 */)
    206     :QIWithRetranslateUI<QGroupBox>(pParent)
     209    : QGroupBox(pParent)
    207210    , m_pContainerLayout(0)
    208211    , m_pMACComboBoxLabel(0)
     
    324327    }
    325328
    326 
    327     retranslateUi();
    328 }
    329 
    330 void UICloneVMAdditionalOptionsEditor::retranslateUi()
     329    sltRetranslateUI();
     330    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     331            this, &UICloneVMAdditionalOptionsEditor::sltRetranslateUI);
     332}
     333
     334void UICloneVMAdditionalOptionsEditor::sltRetranslateUI()
    331335{
    332336    m_pMACComboBoxLabel->setText(UIWizardCloneVM::tr("MAC Address P&olicy:"));
     
    431435
    432436UICloneVMCloneTypeGroupBox::UICloneVMCloneTypeGroupBox(QWidget *pParent /* = 0 */)
    433     :QIWithRetranslateUI<QGroupBox>(pParent)
     437    : QGroupBox(pParent)
    434438    , m_pButtonGroup(0)
    435439    , m_pFullCloneRadio(0)
     
    484488            this, &UICloneVMCloneTypeGroupBox::sltButtonClicked);
    485489
    486     retranslateUi();
    487 }
    488 
    489 void UICloneVMCloneTypeGroupBox::retranslateUi()
     490    sltRetranslateUI();
     491    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     492            this, &UICloneVMCloneTypeGroupBox::sltRetranslateUI);
     493}
     494
     495void UICloneVMCloneTypeGroupBox::sltRetranslateUI()
    490496{
    491497    if (m_pFullCloneRadio)
     
    512518
    513519UICloneVMCloneModeGroupBox::UICloneVMCloneModeGroupBox(bool fShowChildsOption, QWidget *pParent /* = 0 */)
    514     :QIWithRetranslateUI<QGroupBox>(pParent)
     520    : QGroupBox(pParent)
    515521    , m_fShowChildsOption(fShowChildsOption)
    516522    , m_pMachineRadio(0)
     
    553559            this, &UICloneVMCloneModeGroupBox::sltButtonClicked);
    554560
    555     retranslateUi();
    556 }
    557 
    558 void UICloneVMCloneModeGroupBox::retranslateUi()
     561    sltRetranslateUI();
     562    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     563            this, &UICloneVMCloneModeGroupBox::sltRetranslateUI);
     564}
     565
     566void UICloneVMCloneModeGroupBox::sltRetranslateUI()
    559567{
    560568    if (m_pMachineRadio)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardCloneVMEditors.h

    r103803 r103950  
    3434/* Qt includes: */
    3535#include <QGroupBox>
    36 
    37 /* Local includes: */
    38 #include "QIWithRetranslateUI.h"
    3936
    4037/* Other VBox includes: */
     
    6360Q_DECLARE_METATYPE(MACAddressClonePolicy);
    6461
    65 class UICloneVMNamePathEditor : public QIWithRetranslateUI<QGroupBox>
     62class UICloneVMNamePathEditor : public QGroupBox
    6663{
    6764    Q_OBJECT;
     
    8986    bool isComplete(const QString &strMachineGroup);
    9087
    91 private:
    92 
    93     void prepare();
    94     virtual void retranslateUi() /* override final */;
     88private slots:
     89
     90    void sltRetranslateUI();
     91
     92private:
     93
     94    void prepare();
    9595
    9696    QGridLayout *m_pContainerLayout;
     
    105105
    106106
    107 class UICloneVMAdditionalOptionsEditor : public QIWithRetranslateUI<QGroupBox>
     107class UICloneVMAdditionalOptionsEditor : public QGroupBox
    108108{
    109109    Q_OBJECT;
     
    135135
    136136    void sltMACAddressClonePolicyChanged();
    137 
    138 private:
    139 
    140     void prepare();
    141     virtual void retranslateUi() /* override final */;
     137    void sltRetranslateUI();
     138
     139private:
     140
     141    void prepare();
    142142    void populateMACAddressClonePolicies();
    143143    void updateMACAddressClonePolicyComboToolTip();
     
    151151};
    152152
    153 class UICloneVMCloneTypeGroupBox : public QIWithRetranslateUI<QGroupBox>
     153class UICloneVMCloneTypeGroupBox : public QGroupBox
    154154{
    155155    Q_OBJECT;
     
    167167
    168168    void sltButtonClicked(QAbstractButton *);
    169 
    170 private:
    171 
    172     void prepare();
    173     virtual void retranslateUi() /* override final */;
     169    void sltRetranslateUI();
     170
     171private:
     172
     173    void prepare();
    174174
    175175    QButtonGroup *m_pButtonGroup;
     
    179179
    180180
    181 class UICloneVMCloneModeGroupBox : public QIWithRetranslateUI<QGroupBox>
     181class UICloneVMCloneModeGroupBox : public QGroupBox
    182182{
    183183    Q_OBJECT;
     
    195195
    196196    void sltButtonClicked();
    197 
    198 private:
    199 
    200     void prepare();
    201     virtual void retranslateUi() /* override final */;
     197    void sltRetranslateUI();
     198
     199private:
     200
     201    void prepare();
    202202
    203203    bool m_fShowChildsOption;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h

    r103948 r103950  
    3939/* Local includes: */
    4040#include "QIComboBox.h"
    41 #include "QIWithRetranslateUI.h"
    42 
    4341
    4442/* Forward declarations: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.cpp

    r98103 r103950  
    3535#include "UIBaseMemoryEditor.h"
    3636#include "UICommon.h"
     37#include "UIFilePathSelector.h"
    3738#include "UIHostnameDomainNameEditor.h"
    38 #include "UIFilePathSelector.h"
     39#include "UITranslationEventListener.h"
    3940#include "UIUserNamePasswordEditor.h"
    4041#include "UIVirtualCPUEditor.h"
     
    5253
    5354UIUserNamePasswordGroupBox::UIUserNamePasswordGroupBox(QWidget *pParent /* = 0 */)
    54     : QIWithRetranslateUI<QGroupBox>(pParent)
     55    : QGroupBox(pParent)
    5556    , m_pUserNamePasswordEditor(0)
    5657{
     
    7172    connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigUserNameChanged,
    7273            this, &UIUserNamePasswordGroupBox::sigUserNameChanged);
    73     retranslateUi();
    74 }
    75 
    76 void UIUserNamePasswordGroupBox::retranslateUi()
     74    sltRetranslateUI();
     75    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     76            this, &UIUserNamePasswordGroupBox::sltRetranslateUI);
     77}
     78
     79void UIUserNamePasswordGroupBox::sltRetranslateUI()
    7780{
    7881    setTitle(UIWizardNewVM::tr("Username and Password"));
     
    124127
    125128UIGAInstallationGroupBox::UIGAInstallationGroupBox(QWidget *pParent /* = 0 */)
    126     : QIWithRetranslateUI<QGroupBox>(pParent)
     129    : QGroupBox(pParent)
    127130    , m_pGAISOPathLabel(0)
    128131    , m_pGAISOFilePathSelector(0)
     
    163166    connect(this, &UIGAInstallationGroupBox::toggled,
    164167            this, &UIGAInstallationGroupBox::sltToggleWidgetsEnabled);
    165     retranslateUi();
    166 }
    167 
    168 void UIGAInstallationGroupBox::retranslateUi()
     168    sltRetranslateUI();
     169    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     170            this, &UIGAInstallationGroupBox::sltRetranslateUI);
     171}
     172
     173void UIGAInstallationGroupBox::sltRetranslateUI()
    169174{
    170175    if (m_pGAISOFilePathSelector)
     
    218223
    219224UIAdditionalUnattendedOptions::UIAdditionalUnattendedOptions(QWidget *pParent /* = 0 */)
    220     :QIWithRetranslateUI<QGroupBox>(pParent)
     225    : QGroupBox(pParent)
    221226    , m_pProductKeyLabel(0)
    222227    , m_pProductKeyLineEdit(0)
     
    266271                this, &UIAdditionalUnattendedOptions::sigStartHeadlessChanged);
    267272
    268     retranslateUi();
    269 }
    270 
    271 void UIAdditionalUnattendedOptions::retranslateUi()
     273    sltRetranslateUI();
     274    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     275            this, &UIAdditionalUnattendedOptions::sltRetranslateUI);
     276}
     277
     278void UIAdditionalUnattendedOptions::sltRetranslateUI()
    272279{
    273280    setTitle(UIWizardNewVM::tr("Additional Options"));
     
    362369
    363370UINewVMHardwareContainer::UINewVMHardwareContainer(QWidget *pParent /* = 0 */)
    364     : QIWithRetranslateUI<QWidget>(pParent)
     371    : QWidget(pParent)
    365372    , m_pBaseMemoryEditor(0)
    366373    , m_pVirtualCPUEditor(0)
     
    411418                this, &UINewVMHardwareContainer::sigEFIEnabledChanged);
    412419
    413 
    414     retranslateUi();
    415 }
    416 
    417 void UINewVMHardwareContainer::retranslateUi()
     420    sltRetranslateUI();
     421    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     422            this, &UINewVMHardwareContainer::sltRetranslateUI);
     423}
     424
     425void UINewVMHardwareContainer::sltRetranslateUI()
    418426{
    419427    if (m_pEFICheckBox)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.h

    r98103 r103950  
    3636#include <QGroupBox>
    3737
    38 /* Local includes: */
    39 #include "QIWithRetranslateUI.h"
    40 
    4138/* Forward declarations: */
    4239class QCheckBox;
     
    5249class UIVirtualCPUEditor;
    5350
    54 class UIUserNamePasswordGroupBox : public QIWithRetranslateUI<QGroupBox>
     51class UIUserNamePasswordGroupBox : public QGroupBox
    5552{
    5653    Q_OBJECT;
     
    7673    /** @} */
    7774
     75private slots:
     76
     77    void sltRetranslateUI();
     78
    7879private:
    7980
    8081    void prepare();
    81     virtual void retranslateUi() /* override final */;
    8282
    8383    UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
     
    8585
    8686
    87 class UIGAInstallationGroupBox : public QIWithRetranslateUI<QGroupBox>
     87class UIGAInstallationGroupBox : public QGroupBox
    8888{
    8989    Q_OBJECT;
     
    108108
    109109    void sltToggleWidgetsEnabled(bool fEnabled);
     110    void sltRetranslateUI();
    110111
    111112private:
    112113
    113     virtual void retranslateUi() /* override final */;
    114114    void prepare();
    115115
     
    118118};
    119119
    120 class UIAdditionalUnattendedOptions : public QIWithRetranslateUI<QGroupBox>
     120class UIAdditionalUnattendedOptions : public QGroupBox
    121121{
    122122    Q_OBJECT;
     
    145145    /** @} */
    146146
     147private slots:
     148
     149    void sltRetranslateUI();
     150
    147151private:
    148152
    149153    void prepare();
    150     virtual void retranslateUi() /* override final */;
    151154
    152155    QLabel *m_pProductKeyLabel;
     
    158161
    159162
    160 class UINewVMHardwareContainer : public QIWithRetranslateUI<QWidget>
     163class UINewVMHardwareContainer : public QWidget
    161164{
    162165    Q_OBJECT;
     
    179182    /** @} */
    180183
     184private slots:
     185
     186    void sltRetranslateUI();
     187
    181188private:
    182189
    183190    void prepare();
    184     virtual void retranslateUi() /* override final */;
    185191
    186192    UIBaseMemoryEditor *m_pBaseMemoryEditor;
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