VirtualBox

Changeset 104273 in vbox for trunk/src


Ignore:
Timestamp:
Apr 10, 2024 12:24:28 PM (10 months ago)
Author:
vboxsync
Message:

FE/Qt. bugref:10622. Using new UITranslationEventListener in the cloud related UI classes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.cpp

    r98103 r104273  
    3939#include "UICloudConsoleDetailsWidget.h"
    4040#include "UICloudConsoleManager.h"
     41#include "UITranslationEventListener.h"
    4142
    4243/* Other VBox includes: */
     
    4546
    4647UICloudConsoleDetailsWidget::UICloudConsoleDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
    47     : QIWithRetranslateUI<QWidget>(pParent)
     48    : QWidget(pParent)
    4849    , m_enmEmbedding(enmEmbedding)
    4950    , m_pStackedLayout(0)
     
    111112}
    112113
    113 void UICloudConsoleDetailsWidget::retranslateUi()
     114void UICloudConsoleDetailsWidget::sltRetranslateUI()
    114115{
    115116    /* Translate editor labels: */
     
    226227
    227228    /* Apply language settings: */
    228     retranslateUi();
     229    sltRetranslateUI();
     230    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     231            this, &UICloudConsoleDetailsWidget::sltRetranslateUI);
    229232
    230233    /* Update button states finally: */
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.h

    r98103 r104273  
    3838/* GUI includes: */
    3939#include "QIManagerDialog.h"
    40 #include "QIWithRetranslateUI.h"
    4140
    4241/* Forward declarations: */
     
    124123
    125124/** Cloud Console details widget. */
    126 class UICloudConsoleDetailsWidget : public QIWithRetranslateUI<QWidget>
     125class UICloudConsoleDetailsWidget : public QWidget
    127126{
    128127    Q_OBJECT;
     
    155154    void clearData();
    156155
    157 protected:
    158 
    159     /** Handles translation event. */
    160     virtual void retranslateUi() RT_OVERRIDE;
    161 
    162156private slots:
    163157
     
    178172        void sltHandleButtonBoxClick(QAbstractButton *pButton);
    179173    /** @} */
     174
     175    /** Handles translation event. */
     176    void sltRetranslateUI();
    180177
    181178private:
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleManager.cpp

    r103710 r104273  
    4646#include "UICloudConsoleManager.h"
    4747#include "UIMessageCenter.h"
     48#include "UITranslationEventListener.h"
    4849#include "QIToolBar.h"
    4950
     
    122123
    123124/** QDialog extension used to acquire newly created console application parameters. */
    124 class UIInputDialogCloudConsoleApplication : public QIWithRetranslateUI<QDialog>
     125class UIInputDialogCloudConsoleApplication : public QDialog
    125126{
    126127    Q_OBJECT;
     
    138139    QString argument() const;
    139140
    140 protected:
     141private slots:
    141142
    142143    /** Handles translation event. */
    143     virtual void retranslateUi() RT_OVERRIDE;
     144    void sltRetranslateUI();
    144145
    145146private:
     
    166167
    167168/** QDialog extension used to acquire newly created console profile parameters. */
    168 class UIInputDialogCloudConsoleProfile : public QIWithRetranslateUI<QDialog>
     169class UIInputDialogCloudConsoleProfile : public QDialog
    169170{
    170171    Q_OBJECT;
     
    180181    QString argument() const;
    181182
    182 protected:
     183private slots:
    183184
    184185    /** Handles translation event. */
    185     virtual void retranslateUi() RT_OVERRIDE;
     186    void sltRetranslateUI();
    186187
    187188private:
     
    253254
    254255UIInputDialogCloudConsoleApplication::UIInputDialogCloudConsoleApplication(QWidget *pParent)
    255     : QIWithRetranslateUI<QDialog>(pParent)
     256    : QDialog(pParent)
    256257    , m_pLabelName(0)
    257258    , m_pEditorName(0)
     
    280281}
    281282
    282 void UIInputDialogCloudConsoleApplication::retranslateUi()
     283void UIInputDialogCloudConsoleApplication::sltRetranslateUI()
    283284{
    284285    setWindowTitle(UICloudConsoleManager::tr("Add Application"));
     
    358359
    359360    /* Apply language settings: */
    360     retranslateUi();
     361    sltRetranslateUI();
     362    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     363        this, &UIInputDialogCloudConsoleApplication::sltRetranslateUI);
    361364
    362365    /* Resize to suitable size: */
     
    371374
    372375UIInputDialogCloudConsoleProfile::UIInputDialogCloudConsoleProfile(QWidget *pParent)
    373     : QIWithRetranslateUI<QDialog>(pParent)
     376    : QDialog(pParent)
    374377    , m_pLabelName(0)
    375378    , m_pEditorName(0)
     
    391394}
    392395
    393 void UIInputDialogCloudConsoleProfile::retranslateUi()
     396void UIInputDialogCloudConsoleProfile::sltRetranslateUI()
    394397{
    395398    setWindowTitle(UICloudConsoleManager::tr("Add Profile"));
     
    456459
    457460    /* Apply language settings: */
    458     retranslateUi();
     461    sltRetranslateUI();
     462    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     463            this, &UIInputDialogCloudConsoleProfile::sltRetranslateUI);
    459464
    460465    /* Resize to suitable size: */
     
    470475UICloudConsoleManagerWidget::UICloudConsoleManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    471476                                                         bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */)
    472     : QIWithRetranslateUI<QWidget>(pParent)
     477    : QWidget(pParent)
    473478    , m_enmEmbedding(enmEmbedding)
    474479    , m_pActionPool(pActionPool)
     
    486491}
    487492
    488 void UICloudConsoleManagerWidget::retranslateUi()
     493void UICloudConsoleManagerWidget::sltRetranslateUI()
    489494{
    490495    /* Translate tree-widget: */
     
    781786
    782787    /* Apply language settings: */
    783     retranslateUi();
     788    sltRetranslateUI();
     789    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     790            this, &UICloudConsoleManagerWidget::sltRetranslateUI);
    784791
    785792    /* Load cloud console stuff: */
     
    11551162
    11561163UICloudConsoleManager::UICloudConsoleManager(QWidget *pCenterWidget, UIActionPool *pActionPool)
    1157     : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     1164    : QIManagerDialog(pCenterWidget)
    11581165    , m_pActionPool(pActionPool)
    11591166{
     
    11741181}
    11751182
    1176 void UICloudConsoleManager::retranslateUi()
     1183void UICloudConsoleManager::sltRetranslateUI()
    11771184{
    11781185    /* Translate window title: */
     
    12471254{
    12481255    /* Apply language settings: */
    1249     retranslateUi();
     1256    sltRetranslateUI();
     1257    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     1258            this, &UICloudConsoleManager::sltRetranslateUI);
    12501259}
    12511260
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleManager.h

    r98103 r104273  
    3434/* GUI includes: */
    3535#include "QIManagerDialog.h"
    36 #include "QIWithRetranslateUI.h"
    3736
    3837/* Forward declarations: */
     
    5150
    5251/** QWidget extension providing GUI with the pane to control cloud console related functionality. */
    53 class UICloudConsoleManagerWidget : public QIWithRetranslateUI<QWidget>
     52class UICloudConsoleManagerWidget : public QWidget
    5453{
    5554    Q_OBJECT;
     
    7877    QIToolBar *toolbar() const { return m_pToolBar; }
    7978#endif
    80 
    81 protected:
    82 
    83     /** @name Event-handling stuff.
    84       * @{ */
    85         /** Handles translation event. */
    86         virtual void retranslateUi() RT_OVERRIDE;
    87     /** @} */
    8879
    8980public slots:
     
    125116        /** Handles tree-widget @a pItem change. */
    126117        void sltHandleItemChange(QTreeWidgetItem *pItem);
     118    /** @} */
     119
     120    /** @name Event-handling stuff.
     121      * @{ */
     122        /** Handles translation event. */
     123        void sltRetranslateUI();
    127124    /** @} */
    128125
     
    236233
    237234/** QIManagerDialog extension providing GUI with the dialog to control cloud console related functionality. */
    238 class UICloudConsoleManager : public QIWithRetranslateUI<QIManagerDialog>
     235class UICloudConsoleManager : public QIManagerDialog
    239236{
    240237    Q_OBJECT;
     
    255252    /** @} */
    256253
     254    /** @name Event-handling stuff.
     255      * @{ */
     256        /** Handles translation event. */
     257        void sltRetranslateUI();
     258    /** @} */
     259
    257260private:
    258261
     
    261264      * @param  pActionPool    Brings the action-pool reference. */
    262265    UICloudConsoleManager(QWidget *pCenterWidget, UIActionPool *pActionPool);
    263 
    264     /** @name Event-handling stuff.
    265       * @{ */
    266         /** Handles translation event. */
    267         virtual void retranslateUi() RT_OVERRIDE;
    268     /** @} */
    269266
    270267    /** @name Prepare/cleanup cascade.
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialog.cpp

    r98103 r104273  
    3737#include "UIDesktopWidgetWatchdog.h"
    3838#include "UINotificationCenter.h"
     39#include "UITranslationEventListener.h"
    3940
    4041
    4142UICloudMachineSettingsDialog::UICloudMachineSettingsDialog(QWidget *pParent, const CCloudMachine &comCloudMachine)
    42     : QIWithRetranslateUI2<QWidget>(pParent, Qt::Window)
     43    : QWidget(pParent, Qt::Window)
    4344    , m_fPolished(false)
    4445    , m_fClosable(true)
     
    6364}
    6465
    65 void UICloudMachineSettingsDialog::retranslateUi()
     66void UICloudMachineSettingsDialog::sltRetranslateUI()
    6667{
    6768    /* Translate title: */
     
    8384
    8485    /* Call to base-class: */
    85     QIWithRetranslateUI2<QWidget>::showEvent(pEvent);
     86    QWidget::showEvent(pEvent);
    8687}
    8788
     
    155156
    156157    /* Apply language settings: */
    157     retranslateUi();
     158    sltRetranslateUI();
     159    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     160            this, &UICloudMachineSettingsDialog::sltRetranslateUI);
    158161}
    159162
     
    175178
    176179    /* Retranslate title: */
    177     retranslateUi();
     180    sltRetranslateUI();
    178181
    179182    /* Update form: */
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialog.h

    r103987 r104273  
    3737
    3838/* GUI includes: */
    39 #include "QIWithRetranslateUI.h"
    4039#include "UICloudMachineSettingsDialogPage.h"
    4140
     
    4948
    5049/** Cloud machine settings window. */
    51 class UICloudMachineSettingsDialog : public QIWithRetranslateUI2<QWidget>
     50class UICloudMachineSettingsDialog : public QWidget
    5251{
    5352    Q_OBJECT;
     
    7372protected:
    7473
    75     /** Handles translation event. */
    76     virtual void retranslateUi() RT_OVERRIDE RT_FINAL;
    7774    /** Handles show @a pEvent. */
    7875    virtual void showEvent(QShowEvent *pEvent) RT_OVERRIDE RT_FINAL;
     
    9087    /** Accepts the dialog. */
    9188    void accept() { save(); }
     89    /** Handles translation event. */
     90    void sltRetranslateUI();
    9291
    9392private:
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialogPage.cpp

    r98103 r104273  
    3333#include "UICloudMachineSettingsDialog.h"
    3434#include "UICloudMachineSettingsDialogPage.h"
     35#include "UITranslationEventListener.h"
    3536
    3637/* Other VBox includes: */
    3738#include "iprt/assert.h"
    3839
    39 
    4040UICloudMachineSettingsDialogPage::UICloudMachineSettingsDialogPage(QWidget *pParent,
    4141                                                                   bool fFullScale /* = true */)
    42     : QIWithRetranslateUI<QWidget>(pParent)
     42    : QWidget(pParent)
    4343    , m_pParent(qobject_cast<UICloudMachineSettingsDialog*>(pParent))
    4444    , m_fFullScale(fFullScale)
     
    6565}
    6666
    67 void UICloudMachineSettingsDialogPage::retranslateUi()
     67void UICloudMachineSettingsDialogPage::sltRetranslateUI()
    6868{
    6969    AssertPtrReturnVoid(m_pFormEditor.data());
     
    100100
    101101    /* Apply language settings: */
    102     retranslateUi();
     102    sltRetranslateUI();
     103    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     104            this, &UICloudMachineSettingsDialogPage::sltRetranslateUI);
    103105}
    104106
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/machinesettings/UICloudMachineSettingsDialogPage.h

    r103803 r104273  
    3737
    3838/* GUI includes: */
    39 #include "QIWithRetranslateUI.h"
    4039#include "UIFormEditorWidget.h"
    4140
     
    4746
    4847/** Cloud machine settings dialog page. */
    49 class UICloudMachineSettingsDialogPage : public QIWithRetranslateUI<QWidget>
     48class UICloudMachineSettingsDialogPage : public QWidget
    5049{
    5150    Q_OBJECT;
     
    7776    void makeSureDataCommitted();
    7877
    79 protected:
     78private slots:
    8079
    8180    /** Handles translation event. */
    82     virtual void retranslateUi() RT_OVERRIDE;
     81    void sltRetranslateUI();
    8382
    8483private:
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileDetailsWidget.cpp

    r98103 r104273  
    4040#include "UICloudProfileDetailsWidget.h"
    4141#include "UICloudProfileManager.h"
     42#include "UITranslationEventListener.h"
    4243
    4344/* Other VBox includes: */
     
    4647
    4748UICloudProfileDetailsWidget::UICloudProfileDetailsWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
    48     : QIWithRetranslateUI<QWidget>(pParent)
     49    : QWidget(pParent)
    4950    , m_enmEmbedding(enmEmbedding)
    5051    , m_pLabelName(0)
     
    7172}
    7273
    73 void UICloudProfileDetailsWidget::retranslateUi()
     74void UICloudProfileDetailsWidget::sltRetranslateUI()
    7475{
    7576    /// @todo add description tool-tips
     
    195196
    196197    /* Apply language settings: */
    197     retranslateUi();
     198    sltRetranslateUI();
     199    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     200        this, &UICloudProfileDetailsWidget::sltRetranslateUI);
    198201
    199202    /* Update button states finally: */
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileDetailsWidget.h

    r98103 r104273  
    3939/* GUI includes: */
    4040#include "QIManagerDialog.h"
    41 #include "QIWithRetranslateUI.h"
    4241
    4342/* Forward declarations: */
     
    124123
    125124/** Cloud Profile details widget. */
    126 class UICloudProfileDetailsWidget : public QIWithRetranslateUI<QWidget>
     125class UICloudProfileDetailsWidget : public QWidget
    127126{
    128127    Q_OBJECT;
     
    151150protected:
    152151
    153     /** Handles translation event. */
    154     virtual void retranslateUi() RT_OVERRIDE;
    155152    /** Handles editor translation. */
    156153    void retranslateEditor();
     
    171168    /** @} */
    172169
     170    /** Handles translation event. */
     171    void sltRetranslateUI();
     172
    173173private:
    174174
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.cpp

    r103578 r104273  
    4747#include "UINotificationCenter.h"
    4848#include "UIShortcutPool.h"
     49#include "UITranslationEventListener.h"
    4950#include "UIVirtualBoxEventHandler.h"
    5051
     
    183184UICloudProfileManagerWidget::UICloudProfileManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    184185                                                         bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */)
    185     : QIWithRetranslateUI<QWidget>(pParent)
     186    : QWidget(pParent)
    186187    , m_enmEmbedding(enmEmbedding)
    187188    , m_pActionPool(pActionPool)
     
    199200}
    200201
    201 void UICloudProfileManagerWidget::retranslateUi()
     202void UICloudProfileManagerWidget::sltRetranslateUI()
    202203{
    203204    /* Translate tree-widget: */
     
    568569
    569570    /* Apply language settings: */
    570     retranslateUi();
     571    sltRetranslateUI();
     572    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     573            this, &UICloudProfileManagerWidget::sltRetranslateUI);
    571574
    572575    /* Load cloud stuff: */
     
    931934
    932935UICloudProfileManager::UICloudProfileManager(QWidget *pCenterWidget, UIActionPool *pActionPool)
    933     : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     936    : QIManagerDialog(pCenterWidget)
    934937    , m_pActionPool(pActionPool)
    935938{
     
    950953}
    951954
    952 void UICloudProfileManager::retranslateUi()
     955void UICloudProfileManager::sltRetranslateUI()
    953956{
    954957    /* Translate window title: */
     
    10271030{
    10281031    /* Apply language settings: */
    1029     retranslateUi();
     1032    sltRetranslateUI();
     1033    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     1034            this, &UICloudProfileManager::sltRetranslateUI);
    10301035}
    10311036
     
    10411046    {
    10421047        /* Call to base class: */
    1043         QIWithRetranslateUI<QIManagerDialog>::closeEvent(pEvent);
     1048        QIManagerDialog::closeEvent(pEvent);
    10441049    }
    10451050    else
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.h

    r98103 r104273  
    3434/* GUI includes: */
    3535#include "QIManagerDialog.h"
    36 #include "QIWithRetranslateUI.h"
    3736
    3837/* Forward declarations: */
     
    5251
    5352/** QWidget extension providing GUI with the pane to control cloud profile related functionality. */
    54 class UICloudProfileManagerWidget : public QIWithRetranslateUI<QWidget>
     53class UICloudProfileManagerWidget : public QWidget
    5554{
    5655    Q_OBJECT;
     
    8483    bool makeSureChangesResolved();
    8584
    86 protected:
     85public slots:
    8786
    8887    /** @name Event-handling stuff.
    8988      * @{ */
    9089        /** Handles translation event. */
    91         virtual void retranslateUi() RT_OVERRIDE;
    92     /** @} */
    93 
    94 public slots:
     90        void sltRetranslateUI();
     91    /** @} */
    9592
    9693    /** @name Details-widget stuff.
     
    238235
    239236/** QIManagerDialog extension providing GUI with the dialog to control cloud profile related functionality. */
    240 class UICloudProfileManager : public QIWithRetranslateUI<QIManagerDialog>
     237class UICloudProfileManager : public QIManagerDialog
    241238{
    242239    Q_OBJECT;
     
    257254    /** @} */
    258255
     256    /** @name Event-handling stuff.
     257      * @{ */
     258        /** Handles translation event. */
     259        void sltRetranslateUI();
     260    /** @} */
     261
    259262private:
    260263
     
    263266      * @param  pActionPool    Brings the action-pool reference. */
    264267    UICloudProfileManager(QWidget *pCenterWidget, UIActionPool *pActionPool);
    265 
    266     /** @name Event-handling stuff.
    267       * @{ */
    268         /** Handles translation event. */
    269         virtual void retranslateUi() RT_OVERRIDE;
    270     /** @} */
    271268
    272269    /** @name Prepare/cleanup cascade.
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslationEventListener.cpp

    r104262 r104273  
    8282           && pObject == qApp)
    8383    {
    84         //&& (pObject == qApp || pObject == this))
    8584        emit sigRetranslateUI();
    8685    }
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