VirtualBox

Changeset 104297 in vbox for trunk


Ignore:
Timestamp:
Apr 11, 2024 1:20:43 PM (9 months ago)
Author:
vboxsync
Message:

FE/Qt. bugref:10622. Using new UITranslationEventListener in the guest control related GUI classes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r103771 r104297  
    123123UIFileManager::UIFileManager(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    124124                             const CMachine &comMachine, QWidget *pParent, bool fShowToolbar)
    125     : QIWithRetranslateUI<QWidget>(pParent)
     125    : QWidget(pParent)
    126126    , m_pMainLayout(0)
    127127    , m_pVerticalSplitter(0)
     
    141141    prepareObjects();
    142142    prepareConnections();
    143     retranslateUi();
    144143    restorePanelVisibility();
    145144    UIFileManagerOptions::create();
     
    169168        return 0;
    170169    return m_pActionPool->action(UIActionIndex_M_FileManager)->menu();
    171 }
    172 
    173 void UIFileManager::retranslateUi()
    174 {
    175170}
    176171
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r103977 r104297  
    4040/* GUI includes: */
    4141#include "QIManagerDialog.h"
    42 #include "QIWithRetranslateUI.h"
    4342#include "UIGuestControlDefs.h"
    4443
     
    8887 *  one host and one guest file table views, a log viewer
    8988 *  and some other file manager related widgets. */
    90 class SHARED_LIBRARY_STUFF UIFileManager : public QIWithRetranslateUI<QWidget>
     89class SHARED_LIBRARY_STUFF UIFileManager : public QWidget
    9190{
    9291    Q_OBJECT;
     
    109108
    110109    void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
    111 
    112 protected:
    113 
    114     virtual void retranslateUi() RT_OVERRIDE;
    115110
    116111private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp

    r103803 r104297  
    3939#include "UILoggingDefs.h"
    4040#include "UIShortcutPool.h"
     41#include "UITranslationEventListener.h"
    4142#ifdef VBOX_WS_MAC
    4243# include "VBoxUtils-darwin.h"
     
    7879                                         const QUuid &uMachineId,
    7980                                         const QString &strMachineName)
    80     : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     81    : QIManagerDialog(pCenterWidget)
    8182    , m_pActionPool(pActionPool)
    8283    , m_uMachineId(uMachineId)
     
    8990}
    9091
    91 void UIFileManagerDialog::retranslateUi()
     92void UIFileManagerDialog::sltRetranslateUI()
    9293{
    9394    if (!m_strMachineName.isEmpty())
     
    151152{
    152153    /* Apply language settings: */
    153     retranslateUi();
     154    sltRetranslateUI();
     155    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     156        this, &UIFileManagerDialog::sltRetranslateUI);
    154157    manageEscapeShortCut();
    155158}
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.h

    r98103 r104297  
    3838/* GUI includes: */
    3939#include "QIManagerDialog.h"
    40 #include "QIWithRetranslateUI.h"
    41 
    4240
    4341
     
    6967
    7068/** QIManagerDialog extension providing GUI with the dialog displaying file manager releated logs. */
    71 class UIFileManagerDialog : public QIWithRetranslateUI<QIManagerDialog>
     69class UIFileManagerDialog : public QIManagerDialog
    7270{
    7371    Q_OBJECT;
     
    8381
    8482protected:
    85 
    86     /** @name Event-handling stuff.
    87       * @{ */
    88         /** Handles translation event. */
    89         virtual void retranslateUi() RT_OVERRIDE;
    90     /** @} */
    9183
    9284    /** @name Prepare/cleanup cascade.
     
    114106
    115107    void sltSetCloseButtonShortCut(QKeySequence shortcut);
     108    /** @name Event-handling stuff.
     109      * @{ */
     110        /** Handles translation event. */
     111        void sltRetranslateUI();
     112    /** @} */
    116113
    117114private:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp

    r104228 r104297  
    7070/** A QWidget extension containing text entry fields for password and username and buttons to
    7171  *  start/stop a guest session. */
    72 class UIGuestSessionWidget : public QIWithRetranslateUI<QWidget>
     72class UIGuestSessionWidget : public QWidget
    7373{
    7474    Q_OBJECT;
     
    9292protected:
    9393
    94     void retranslateUi() RT_OVERRIDE;
    9594    void keyPressEvent(QKeyEvent * pEvent) RT_OVERRIDE;
    9695    void showEvent(QShowEvent *pEvent) RT_OVERRIDE;
     
    9897private slots:
    9998
     99    void sltRetranslateUI();
    100100    void sltButtonClick();
    101101    void sltHandleTextChanged(const QString &strText);
     
    129129
    130130UIGuestSessionWidget::UIGuestSessionWidget(QWidget *pParent /* = 0 */)
    131     : QIWithRetranslateUI<QWidget>(pParent)
     131    : QWidget(pParent)
    132132    , m_enmButtonMode(ButtonMode_Open)
    133133    , m_pUserNameEdit(0)
     
    187187    m_pMainLayout->insertStretch(-1, 1);
    188188    switchSessionOpenMode();
    189     retranslateUi();
     189    sltRetranslateUI();
     190    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     191            this, &UIGuestSessionWidget::sltRetranslateUI);
    190192}
    191193
     
    204206}
    205207
    206 void UIGuestSessionWidget::retranslateUi()
     208void UIGuestSessionWidget::sltRetranslateUI()
    207209{
    208210    if (m_pUserNameEdit)
     
    247249void UIGuestSessionWidget::showEvent(QShowEvent *pEvent)
    248250{
    249     QIWithRetranslateUI<QWidget>::showEvent(pEvent);
     251    QWidget::showEvent(pEvent);
    250252    if (m_pUserNameEdit)
    251253        m_pUserNameEdit->setFocus();
     
    259261        m_pPasswordEdit->setEnabled(true);
    260262    m_enmButtonMode = ButtonMode_Open;
    261     retranslateUi();
     263    sltRetranslateUI();
    262264}
    263265
     
    269271        m_pPasswordEdit->setEnabled(false);
    270272    m_enmButtonMode = ButtonMode_Close;
    271     retranslateUi();
     273    sltRetranslateUI();
    272274}
    273275
     
    448450
    449451    sltRetranslateUI();
    450 
    451452    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
    452453            this, &UIFileManagerGuestTable::sltRetranslateUI);
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPaneContainer.cpp

    r103987 r104297  
    2727
    2828/* Qt includes: */
     29#include <QApplication>
    2930#include <QCheckBox>
    3031#include <QHBoxLayout>
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlDialog.cpp

    r103710 r104297  
    3939#include "UIMachine.h"
    4040#include "UISession.h"
     41#include "UITranslationEventListener.h"
    4142
    4243
     
    6061
    6162UIGuestProcessControlDialog::UIGuestProcessControlDialog(QWidget *pCenterWidget)
    62     : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     63    : QIManagerDialog(pCenterWidget)
    6364    , m_comGuest(gpMachine->uisession()->guest())
    6465    , m_strMachineName(gpMachine->machineName())
     
    6667}
    6768
    68 void UIGuestProcessControlDialog::retranslateUi()
     69void UIGuestProcessControlDialog::sltRetranslateUI()
    6970{
    7071    /* Translate window title: */
     
    103104{
    104105    /* Apply language settings: */
    105     retranslateUi();
     106    sltRetranslateUI();
     107    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     108            this, &UIGuestProcessControlDialog::sltRetranslateUI);
    106109}
    107110
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlDialog.h

    r103803 r104297  
    3737/* GUI includes: */
    3838#include "QIManagerDialog.h"
    39 #include "QIWithRetranslateUI.h"
    4039
    4140/* COM includes: */
     
    5857
    5958/** QIManagerDialog extension providing GUI with the dialog displaying guest control releated logs. */
    60 class UIGuestProcessControlDialog : public QIWithRetranslateUI<QIManagerDialog>
     59class UIGuestProcessControlDialog : public QIManagerDialog
    6160{
    6261    Q_OBJECT;
     
    6867
    6968protected:
    70 
    71     /** @name Event-handling stuff.
    72       * @{ */
    73         /** Handles translation event. */
    74         virtual void retranslateUi() RT_OVERRIDE;
    75     /** @} */
    7669
    7770    /** @name Prepare/cleanup cascade.
     
    9992
    10093    void sltSetCloseButtonShortCut(QKeySequence shortcut);
     94    /** @name Event-handling stuff.
     95      * @{ */
     96        /** Handles translation event. */
     97        void sltRetranslateUI();
     98    /** @} */
    10199
    102100private:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.cpp

    r103987 r104297  
    4040#include "UIGuestProcessControlWidget.h"
    4141#include "UIIconPool.h"
     42#include "UITranslationEventListener.h"
    4243
    4344/* COM includes: */
     
    295296                                                         QWidget *pParent, QString strMachineName /* = QString()*/,
    296297                                                         bool fShowToolbar /* = false */)
    297     :QIWithRetranslateUI<QWidget>(pParent)
     298    : QWidget(pParent)
    298299    , m_comGuest(comGuest)
    299300    , m_pMainLayout(0)
     
    310311    prepareToolBar();
    311312    initGuestSessionTree();
    312     retranslateUi();
     313    sltRetranslateUI();
     314    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     315            this, &UIGuestProcessControlWidget::sltRetranslateUI);
    313316}
    314317
     
    318321}
    319322
    320 void UIGuestProcessControlWidget::retranslateUi()
     323void UIGuestProcessControlWidget::sltRetranslateUI()
    321324{
    322325    if (m_pTreeWidget)
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.h

    r103977 r104297  
    4040
    4141/* GUI includes: */
    42 #include "QIWithRetranslateUI.h"
    4342#include "QIManagerDialog.h"
    4443#include "UIMainEventListener.h"
     
    5150/** QWidget extension
    5251  * providing GUI with guest session information and control tab in session-information window. */
    53 class UIGuestProcessControlWidget : public QIWithRetranslateUI<QWidget>
     52class UIGuestProcessControlWidget : public QWidget
    5453{
    5554    Q_OBJECT;
     
    6362    static const bool  s_fDeleteAfterUnregister;
    6463
    65 protected:
    66 
    67     virtual void retranslateUi() RT_OVERRIDE;
    68 
    6964private slots:
    7065
     66    void sltRetranslateUI();
    7167    void sltGuestSessionsUpdated();
    7268    void sltGuestSessionRegistered(CGuestSession guestSession);
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