VirtualBox

Changeset 104223 in vbox


Ignore:
Timestamp:
Apr 8, 2024 10:30:04 AM (8 months ago)
Author:
vboxsync
Message:

FE/Qt. bugref:10622. Using new UITranslationEventListener in metwork manager classes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetCloudNetwork.cpp

    r101563 r104223  
    5050#include "UINetworkManagerUtils.h"
    5151#include "UINotificationCenter.h"
    52 
     52#include "UITranslationEventListener.h"
    5353
    5454UISubnetSelectionDialog::UISubnetSelectionDialog(QWidget *pParent,
     
    5656                                                 const QString &strProfileName,
    5757                                                 const QString &strSubnetId)
    58     : QIWithRetranslateUI<QDialog>(pParent)
     58    : QDialog(pParent)
    5959    , m_strProviderShortName(strShortProviderName)
    6060    , m_strProfileName(strProfileName)
     
    9090
    9191    /* Call to base-class: */
    92     return QIWithRetranslateUI<QDialog>::accept();
     92    return QDialog::accept();
    9393}
    9494
     
    9999
    100100    /* Call to base-class: */
    101     return QIWithRetranslateUI<QDialog>::exec();
    102 }
    103 
    104 void UISubnetSelectionDialog::retranslateUi()
     101    return QDialog::exec();
     102}
     103
     104void UISubnetSelectionDialog::sltRetranslateUI()
    105105{
    106106    setWindowTitle(UINetworkManager::tr("Select Subnet"));
     
    166166
    167167    /* Apply language settings: */
    168     retranslateUi();
     168    sltRetranslateUI();
     169
     170    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     171            this, &UISubnetSelectionDialog::sltRetranslateUI);
    169172}
    170173
     
    178181
    179182UIDetailsWidgetCloudNetwork::UIDetailsWidgetCloudNetwork(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
    180     : QIWithRetranslateUI<QWidget>(pParent)
     183    : QWidget(pParent)
    181184    , m_enmEmbedding(enmEmbedding)
    182185    , m_pLabelNetworkName(0)
     
    249252}
    250253
    251 void UIDetailsWidgetCloudNetwork::retranslateUi()
     254void UIDetailsWidgetCloudNetwork::sltRetranslateUI()
    252255{
    253256    if (m_pLabelNetworkName)
     
    363366
    364367    /* Apply language settings: */
    365     retranslateUi();
     368    sltRetranslateUI();
     369
     370    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     371            this, &UIDetailsWidgetCloudNetwork::sltRetranslateUI);
    366372
    367373    /* Update button states finally: */
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetCloudNetwork.h

    r103982 r104223  
    3737/* GUI includes: */
    3838#include "QIManagerDialog.h"
    39 #include "QIWithRetranslateUI.h"
    4039#include "UIPortForwardingTable.h"
    4140
     
    6261
    6362/** QDialog subclass for subnet selection functionality. */
    64 class UISubnetSelectionDialog : public QIWithRetranslateUI<QDialog>
     63class UISubnetSelectionDialog : public QDialog
    6564{
    6665    Q_OBJECT;
     
    9089    virtual int exec() RT_OVERRIDE RT_FINAL;
    9190
    92 protected:
    93 
    94     /** Handles translation event. */
    95     virtual void retranslateUi() RT_OVERRIDE RT_FINAL;
    96 
    9791private slots:
    9892
     
    10296    /** Handles notification about subnet selection @a comForm being created. */
    10397    void sltHandleVSDFormCreated(const CVirtualSystemDescriptionForm &comForm);
     98
     99    /** Handles translation event. */
     100    void sltRetranslateUI();
    104101
    105102private:
     
    179176
    180177/** Network Manager: Cloud network details-widget. */
    181 class UIDetailsWidgetCloudNetwork : public QIWithRetranslateUI<QWidget>
     178class UIDetailsWidgetCloudNetwork : public QWidget
    182179{
    183180    Q_OBJECT;
     
    215212        void updateButtonStates();
    216213    /** @} */
    217 
    218 protected:
    219 
    220     /** Handles translation event. */
    221     virtual void retranslateUi() RT_OVERRIDE;
    222214
    223215private slots:
     
    239231        void sltHandleButtonBoxClick(QAbstractButton *pButton);
    240232    /** @} */
     233
     234    /** Handles translation event. */
     235    void sltRetranslateUI();
    241236
    242237private:
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.cpp

    r103712 r104223  
    4444#include "UINetworkManagerUtils.h"
    4545#include "UINotificationCenter.h"
     46#include "UITranslationEventListener.h"
    4647
    4748/* Other VBox includes: */
     
    5253
    5354UIDetailsWidgetHostNetwork::UIDetailsWidgetHostNetwork(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
    54     : QIWithRetranslateUI<QWidget>(pParent)
     55    : QWidget(pParent)
    5556    , m_enmEmbedding(enmEmbedding)
    5657#ifdef VBOX_WS_MAC
     
    267268}
    268269
    269 void UIDetailsWidgetHostNetwork::retranslateUi()
     270void UIDetailsWidgetHostNetwork::sltRetranslateUI()
    270271{
    271272#ifdef VBOX_WS_MAC
     
    526527
    527528    /* Apply language settings: */
    528     retranslateUi();
     529    sltRetranslateUI();
     530
     531    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     532            this, &UIDetailsWidgetHostNetwork::sltRetranslateUI);
    529533
    530534    /* Update button states finally: */
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.h

    r98103 r104223  
    3737/* GUI includes: */
    3838#include "QIManagerDialog.h"
    39 #include "QIWithRetranslateUI.h"
    4039
    4140/* Forward declarations: */
     
    219218
    220219/** Network Manager: Host network details-widget. */
    221 class UIDetailsWidgetHostNetwork : public QIWithRetranslateUI<QWidget>
     220class UIDetailsWidgetHostNetwork : public QWidget
    222221{
    223222    Q_OBJECT;
     
    259258        void updateButtonStates();
    260259    /** @} */
    261 
    262 protected:
    263 
    264     /** Handles translation event. */
    265     virtual void retranslateUi() RT_OVERRIDE;
    266260
    267261private slots:
     
    310304    /** @} */
    311305
     306    /** Handles translation event. */
     307    void sltRetranslateUI();
     308
    312309private:
    313310
     
    456453
    457454#endif /* !FEQT_INCLUDED_SRC_networkmanager_UIDetailsWidgetHostNetwork_h */
    458 
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetNATNetwork.cpp

    r103711 r104223  
    4545#include "UINetworkManagerUtils.h"
    4646#include "UINotificationCenter.h"
     47#include "UITranslationEventListener.h"
    4748
    4849/* Other VBox includes: */
     
    5152
    5253UIDetailsWidgetNATNetwork::UIDetailsWidgetNATNetwork(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
    53     : QIWithRetranslateUI<QWidget>(pParent)
     54    : QWidget(pParent)
    5455    , m_enmEmbedding(enmEmbedding)
    5556    , m_pTabWidget(0)
     
    151152}
    152153
    153 void UIDetailsWidgetNATNetwork::retranslateUi()
     154void UIDetailsWidgetNATNetwork::sltRetranslateUI()
    154155{
    155156    /* Translate tab-widget: */
     
    304305
    305306    /* Apply language settings: */
    306     retranslateUi();
     307    sltRetranslateUI();
     308
     309    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     310            this, &UIDetailsWidgetNATNetwork::sltRetranslateUI);
    307311
    308312    /* Update button states finally: */
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetNATNetwork.h

    r98103 r104223  
    3737/* GUI includes: */
    3838#include "QIManagerDialog.h"
    39 #include "QIWithRetranslateUI.h"
    4039#include "UIPortForwardingTable.h"
    4140
     
    108107
    109108/** Network Manager: NAT network details-widget. */
    110 class UIDetailsWidgetNATNetwork : public QIWithRetranslateUI<QWidget>
     109class UIDetailsWidgetNATNetwork : public QWidget
    111110{
    112111    Q_OBJECT;
     
    147146        void updateButtonStates();
    148147    /** @} */
    149 
    150 protected:
    151 
    152     /** Handles translation event. */
    153     virtual void retranslateUi() RT_OVERRIDE;
    154148
    155149private slots:
     
    178172        void sltHandleButtonBoxClick(QAbstractButton *pButton);
    179173    /** @} */
     174    /** Handles translation event. */
     175    void sltRetranslateUI();
    180176
    181177private:
     
    262258
    263259#endif /* !FEQT_INCLUDED_SRC_networkmanager_UIDetailsWidgetNATNetwork_h */
    264 
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp

    r103771 r104223  
    5555# include "UIWindowMenuManager.h"
    5656#endif
     57#include "UITranslationEventListener.h"
    5758
    5859/* COM includes: */
     
    377378UINetworkManagerWidget::UINetworkManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    378379                                               bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */)
    379     : QIWithRetranslateUI<QWidget>(pParent)
     380    : QWidget(pParent)
    380381    , m_enmEmbedding(enmEmbedding)
    381382    , m_pActionPool(pActionPool)
     
    405406}
    406407
    407 void UINetworkManagerWidget::retranslateUi()
     408void UINetworkManagerWidget::sltRetranslateUI()
    408409{
    409410    /* Translate tab-widget: */
     
    462463{
    463464    /* Call to base-class: */
    464     QIWithRetranslateUI<QWidget>::resizeEvent(pEvent);
     465    QWidget::resizeEvent(pEvent);
    465466
    466467    /* Adjust tree-widgets: */
     
    471472{
    472473    /* Call to base-class: */
    473     QIWithRetranslateUI<QWidget>::showEvent(pEvent);
     474    QWidget::showEvent(pEvent);
    474475
    475476    /* Adjust tree-widgets: */
     
    17281729
    17291730    /* Apply language settings: */
    1730     retranslateUi();
     1731    sltRetranslateUI();
     1732
     1733    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     1734            this, &UINetworkManagerWidget::sltRetranslateUI);
    17311735
    17321736    /* Load networks: */
     
    25402544
    25412545UINetworkManager::UINetworkManager(QWidget *pCenterWidget, UIActionPool *pActionPool)
    2542     : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     2546    : QIManagerDialog(pCenterWidget)
    25432547    , m_pActionPool(pActionPool)
    25442548{
     
    25592563}
    25602564
    2561 void UINetworkManager::retranslateUi()
     2565void UINetworkManager::sltRetranslateUI()
    25622566{
    25632567    /* Translate window title: */
     
    26432647{
    26442648    /* Apply language settings: */
    2645     retranslateUi();
     2649    sltRetranslateUI();
     2650
     2651    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     2652            this, &UINetworkManager::sltRetranslateUI);
    26462653}
    26472654
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h

    r98103 r104223  
    3737/* GUI includes: */
    3838#include "QIManagerDialog.h"
    39 #include "QIWithRetranslateUI.h"
    4039
    4140/* Forward declarations: */
     
    6766
    6867/** QWidget extension providing GUI with the pane to control network related functionality. */
    69 class UINetworkManagerWidget : public QIWithRetranslateUI<QWidget>
     68class UINetworkManagerWidget : public QWidget
    7069{
    7170    Q_OBJECT;
     
    104103    /** @name Event-handling stuff.
    105104      * @{ */
    106         /** Handles translation event. */
    107         virtual void retranslateUi() RT_OVERRIDE;
    108 
    109105        /** Handles resize @a pEvent. */
    110106        virtual void resizeEvent(QResizeEvent *pEvent) RT_OVERRIDE;
     
    187183        /** Handles command to apply cloud network details changes. */
    188184        void sltApplyDetailsChangesCloudNetwork();
     185    /** @} */
     186
     187    /** @name Event-handling stuff.
     188      * @{ */
     189        /** Handles translation event. */
     190        void sltRetranslateUI();
    189191    /** @} */
    190192
     
    353355
    354356/** QIManagerDialog extension providing GUI with the dialog to control network related functionality. */
    355 class UINetworkManager : public QIWithRetranslateUI<QIManagerDialog>
     357class UINetworkManager : public QIManagerDialog
    356358{
    357359    Q_OBJECT;
     
    372374    /** @} */
    373375
     376    /** @name Event-handling stuff.
     377      * @{ */
     378        /** Handles translation event. */
     379        void sltRetranslateUI();
     380    /** @} */
     381
    374382private:
    375383
     
    378386      * @param  pActionPool    Brings the action-pool reference. */
    379387    UINetworkManager(QWidget *pCenterWidget, UIActionPool *pActionPool);
    380 
    381     /** @name Event-handling stuff.
    382       * @{ */
    383         /** Handles translation event. */
    384         virtual void retranslateUi() RT_OVERRIDE;
    385     /** @} */
    386388
    387389    /** @name Prepare/cleanup cascade.
     
    414416
    415417#endif /* !FEQT_INCLUDED_SRC_networkmanager_UINetworkManager_h */
    416 
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