VirtualBox

Changeset 104228 in vbox for trunk


Ignore:
Timestamp:
Apr 8, 2024 12:40:22 PM (10 months ago)
Author:
vboxsync
Message:

FE/Qt. bugref:10622. Using new UITranslationEventListener in file manager table class(es).

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

Legend:

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

    r103771 r104228  
    5252#include "QILineEdit.h"
    5353#include "QIToolBar.h"
     54#include "UITranslationEventListener.h"
    5455
    5556/* COM includes: */
     
    446447    setStateAndEnableWidgets();
    447448
    448     retranslateUi();
     449    sltRetranslateUI();
     450
     451    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     452            this, &UIFileManagerGuestTable::sltRetranslateUI);
    449453}
    450454
     
    463467}
    464468
    465 void UIFileManagerGuestTable::retranslateUi()
     469void UIFileManagerGuestTable::sltRetranslateUI()
    466470{
    467471    if (m_pLocationLabel)
     
    512516    }
    513517
    514     UIFileManagerTable::retranslateUi();
     518    UIFileManagerTable::sltRetranslateUI();
    515519}
    516520
     
    15231527    setState();
    15241528    setSessionDependentWidgetsEnabled();
    1525     retranslateUi();
     1529    sltRetranslateUI();
    15261530}
    15271531
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h

    r103982 r104228  
    8080protected:
    8181
    82     void            retranslateUi() RT_OVERRIDE RT_FINAL;
    8382    virtual bool    readDirectory(const QString& strPath, UIFileSystemItem *parent, bool isStartDir = false) RT_OVERRIDE RT_FINAL;
    8483    virtual void    deleteByItem(UIFileSystemItem *item) RT_OVERRIDE RT_FINAL;
     
    113112    void sltCommitDataSignalReceived();
    114113    void sltAdditionsStateChange();
     114    virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
    115115
    116116private:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerHostTable.cpp

    r102515 r104228  
    4141#include "UIPathOperations.h"
    4242#include "QIToolBar.h"
    43 
     43#include "UITranslationEventListener.h"
    4444
    4545/*********************************************************************************************************************************
     
    142142    prepareActionConnections();
    143143    determinePathSeparator();
    144     retranslateUi();
     144    sltRetranslateUI();
     145    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     146            this, &UIFileManagerHostTable::sltRetranslateUI);
    145147}
    146148
     
    184186}
    185187
    186 void UIFileManagerHostTable::retranslateUi()
     188void UIFileManagerHostTable::sltRetranslateUI()
    187189{
    188190    if (m_pLocationLabel)
    189191        m_pLocationLabel->setText(UIFileManager::tr("Host File System:"));
    190192    m_strTableName = UIFileManager::tr("Host");
    191     UIFileManagerTable::retranslateUi();
     193    UIFileManagerTable::sltRetranslateUI();
    192194}
    193195
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerHostTable.h

    r102515 r104228  
    6262    static bool scanDirectory(const QString& strPath, UIFileSystemItem *parent,
    6363                              QMap<QString, UIFileSystemItem*> &fileObjects);
    64     void            retranslateUi() override;
    6564    virtual bool    readDirectory(const QString& strPath, UIFileSystemItem *parent, bool isStartDir = false) override final;
    6665    virtual void    deleteByItem(UIFileSystemItem *item) override final;
     
    8382    /** @} */
    8483
     84protected slots:
     85
     86    virtual void sltRetranslateUI() RT_OVERRIDE;
     87
    8588private:
    8689
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp

    r103988 r104228  
    5050#include "UIPathOperations.h"
    5151#include "UITranslator.h"
     52#include "UITranslationEventListener.h"
    5253
    5354/* COM includes: */
     
    406407
    407408UIFileManagerTable::UIFileManagerTable(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
    408     :QIWithRetranslateUI<QWidget>(pParent)
     409    : QWidget(pParent)
    409410    , m_eFileOperationType(FileOperationType_None)
    410411    , m_pLocationLabel(0)
     
    542543                this, &UIFileManagerTable::sltSearchTextChanged);
    543544    }
     545
     546    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     547            this, &UIFileManagerTable::sltRetranslateUI);
     548
    544549    optionsUpdated();
    545550}
     
    10391044}
    10401045
    1041 void UIFileManagerTable::retranslateUi()
     1046void UIFileManagerTable::sltRetranslateUI()
    10421047{
    10431048    UIFileSystemItem *pRootItem = rootItem();
     
    10561061    /* Handle only events sent to m_pView: */
    10571062    if (pObject != m_pView)
    1058         return QIWithRetranslateUI<QWidget>::eventFilter(pObject, pEvent);
     1063        return QWidget::eventFilter(pObject, pEvent);
    10591064
    10601065    if (pEvent->type() == QEvent::KeyPress)
     
    11131118
    11141119    /* Call to base-class: */
    1115     return QIWithRetranslateUI<QWidget>::eventFilter(pObject, pEvent);
     1120    return QWidget::eventFilter(pObject, pEvent);
    11161121}
    11171122
     
    12021207{
    12031208    if (pEvent->type() == QEvent::EnabledChange)
    1204         retranslateUi();
    1205     return QIWithRetranslateUI<QWidget>::event(pEvent);
     1209        sltRetranslateUI();
     1210    return QWidget::event(pEvent);
    12061211}
    12071212
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h

    r103977 r104228  
    4545#include "QIDialog.h"
    4646#include "QITableView.h"
    47 #include "QIWithRetranslateUI.h"
    4847#include "UIGuestControlDefs.h"
    4948
     
    139138 *  populates the UIFileSystemModel by scanning the file system
    140139 *  differently. The file structure kept in this class as a tree. */
    141 class UIFileManagerTable : public QIWithRetranslateUI<QWidget>
     140class UIFileManagerTable : public QWidget
    142141{
    143142    Q_OBJECT;
     
    208207    };
    209208
    210     void retranslateUi() RT_OVERRIDE;
    211209    void updateCurrentLocationEdit(const QString& strLocation);
    212210    /* @p index is for model not for 'proxy' model */
     
    275273    /** Contains m_pBreadCrumbsWidget and m_pLocationComboBox. */
    276274    UIFileTableNavigationWidget   *m_pNavigationWidget;
     275
     276protected slots:
     277
     278    virtual void sltRetranslateUI();
    277279
    278280private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r103977 r104228  
    5252#include "UIPaneContainer.h"
    5353#include "UIShortcutPool.h"
     54#include "UITranslationEventListener.h"
    5455#include "UIVisoCreator.h"
    5556#include "UIVisoContentBrowser.h"
     
    105106    :UIFileManagerHostTable(pActionPool, pParent)
    106107{
     108    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     109            this, &UIVisoHostBrowser::sltRetranslateUI);
    107110}
    108111
     
    145148
    146149
    147 void UIVisoHostBrowser::retranslateUi()
    148 {
    149     UIFileManagerHostTable::retranslateUi();
     150void UIVisoHostBrowser::sltRetranslateUI()
     151{
     152    UIFileManagerHostTable::sltRetranslateUI();
    150153    if (m_pSubMenu)
    151154        m_pSubMenu->setTitle(QApplication::translate("UIVisoCreatorWidget", "VISO Browser"));
    152 
    153     //setFileTableLabelText(QApplication::translate("UIVisoCreatorWidget","VISO Content"));
    154155}
    155156
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r103988 r104228  
    5757{
    5858
     59    Q_OBJECT;
     60
    5961public:
    6062
     
    6264    void prepareMainMenu(QMenu *pMenu);
    6365
     66private slots:
     67
     68    virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
     69
    6470private:
    6571
    6672    virtual void createFileViewContextMenu(const QWidget *pWidget, const QPoint &point) RT_OVERRIDE RT_FINAL;
    67     virtual void retranslateUi() RT_OVERRIDE RT_FINAL;
    6873    QPointer<QMenu>        m_pSubMenu;
    6974};
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