VirtualBox

Changeset 104232 in vbox


Ignore:
Timestamp:
Apr 8, 2024 2:20:52 PM (8 months ago)
Author:
vboxsync
Message:

FE/Qt. bugref:10622. Using new UITranslationEventListener in the VISO dialog classes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r104228 r104232  
    7878
    7979    UIVisoSettingWidget(QWidget *pParent);
    80     virtual void retranslateUi();
    8180    void setVisoName(const QString &strName);
    8281    void setSettings(const UIVisoCreatorWidget::Settings &settings);
     
    8483
    8584private slots:
     85
     86    void sltRetranslateUI();
    8687
    8788private:
     
    228229    ++iRow;
    229230    pDialogSettingsContainerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), iRow, 0, 1, 2);
    230     retranslateUi();
    231 }
    232 
    233 void UIVisoSettingWidget::retranslateUi()
     231    sltRetranslateUI();
     232    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     233            this, &UIVisoSettingWidget::sltRetranslateUI);
     234}
     235
     236void UIVisoSettingWidget::sltRetranslateUI()
    234237{
    235238    int iLabelWidth = 0;
     
    304307UIVisoCreatorWidget::UIVisoCreatorWidget(UIActionPool *pActionPool, QWidget *pParent,
    305308                                         bool fShowToolBar, const QString& strVisoFilePath, const QString& strMachineName)
    306     : QIWithRetranslateUI<QWidget>(pParent)
     309    : QWidget(pParent)
    307310    , m_pActionSettings(0)
    308311    , m_pAddAction(0)
     
    328331    populateMenuMainToolbar();
    329332    prepareConnections();
    330     retranslateUi();
    331333    if (m_pActionSettings)
    332334        sltSettingsActionToggled(m_pActionSettings->isChecked());
     
    396398{
    397399    return m_pMainMenu;
    398 }
    399 
    400 void UIVisoCreatorWidget::retranslateUi()
    401 {
    402400}
    403401
     
    742740UIVisoCreatorDialog::UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent,
    743741                                         const QString& strVisoFilePath, const QString& strMachineName /* = QString() */)
    744     : QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> >(pParent)
     742    : QIWithRestorableGeometry<QIMainDialog>(pParent)
    745743    , m_pVisoCreatorWidget(0)
    746744    , m_pButtonBox(0)
     
    841839    uiCommon().setHelpKeyword(m_pButtonBox->button(QIDialogButtonBox::Help), "create-optical-disk-image");
    842840
    843     retranslateUi();
    844 }
    845 
    846 void UIVisoCreatorDialog::retranslateUi()
     841    sltRetranslateUI();
     842    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     843            this, &UIVisoCreatorDialog::sltRetranslateUI);
     844}
     845
     846void UIVisoCreatorDialog::sltRetranslateUI()
    847847{
    848848    updateWindowTitle();
     
    875875        }
    876876    }
    877     return QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> >::event(pEvent);
     877    return QIWithRestorableGeometry<QIMainDialog>::event(pEvent);
    878878}
    879879
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r104228 r104232  
    3838#include "QIMainDialog.h"
    3939#include "QIWithRestorableGeometry.h"
    40 #include "QIWithRetranslateUI.h"
    4140#include "UIFileManagerHostTable.h"
    4241
     
    7877  * for VISO file system. It has the main menu, main toolbar, and a vertical toolbar and corresponding
    7978  * actions. */
    80 class SHARED_LIBRARY_STUFF UIVisoCreatorWidget : public QIWithRetranslateUI<QWidget>
     79class SHARED_LIBRARY_STUFF UIVisoCreatorWidget : public QWidget
    8180{
    8281    Q_OBJECT;
     
    123122#endif
    124123
    125 protected:
    126 
    127     virtual void retranslateUi() RT_OVERRIDE RT_FINAL;
    128 
    129124private slots:
    130125
     
    189184
    190185
    191 class SHARED_LIBRARY_STUFF UIVisoCreatorDialog : public QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> >
     186class SHARED_LIBRARY_STUFF UIVisoCreatorDialog : public QIWithRestorableGeometry<QIMainDialog>
    192187{
    193188    Q_OBJECT;
     
    224219    void sltVisoFilePathChanged(const QString &strPath);
    225220    void sltSave();
     221    void sltRetranslateUI();
    226222
    227223private:
     
    229225    bool saveVISOFile();
    230226    void prepareWidgets(const QString& strVisoSavePath, const QString &strMachineName);
    231     virtual void retranslateUi() RT_OVERRIDE RT_FINAL;
    232227    void loadSettings();
    233228    void saveDialogGeometry();
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