VirtualBox

Changeset 92471 in vbox


Ignore:
Timestamp:
Nov 17, 2021 9:47:12 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10141. Using QGroupBox instead of QWidget as the base of the file browser controls.

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

Legend:

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

    r91242 r92471  
    150150
    151151UIVisoBrowserBase::UIVisoBrowserBase(QWidget *pParent /* = 0 */)
    152     : QIWithRetranslateUI<QWidget>(pParent)
     152    : QIWithRetranslateUI<QGroupBox>(pParent)
    153153    , m_pTreeView(0)
    154154    , m_pMainLayout(0)
     
    225225void UIVisoBrowserBase::resizeEvent(QResizeEvent *pEvent)
    226226{
    227     QIWithRetranslateUI<QWidget>::resizeEvent(pEvent);
     227    QIWithRetranslateUI<QGroupBox>::resizeEvent(pEvent);
    228228    if (m_pTreeView)
    229229        updateTreeViewGeometry(m_pTreeView->isVisible());
     
    235235    /* Handle only events sent to m_pTreeView only: */
    236236    if (pObj != m_pTreeView)
    237         return QIWithRetranslateUI<QWidget>::eventFilter(pObj, pEvent);
     237        return QIWithRetranslateUI<QGroupBox>::eventFilter(pObj, pEvent);
    238238
    239239    if (pEvent->type() == QEvent::KeyPress)
     
    253253
    254254    /* Call to base-class: */
    255     return QIWithRetranslateUI<QWidget>::eventFilter(pObj, pEvent);
     255    return QIWithRetranslateUI<QGroupBox>::eventFilter(pObj, pEvent);
    256256}
    257257
     
    264264
    265265    }
    266     QIWithRetranslateUI<QWidget>::keyPressEvent(pEvent);
     266    QIWithRetranslateUI<QGroupBox>::keyPressEvent(pEvent);
    267267}
    268268
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoBrowserBase.h

    r82968 r92471  
    2424/* Qt includes: */
    2525#include <QModelIndex>
    26 #include <QWidget>
     26#include <QGroupBox>
    2727
    2828/* GUI includes: */
     
    3636
    3737/** An abstract QWidget extension hosting a tree and table view. */
    38 class UIVisoBrowserBase : public QIWithRetranslateUI<QWidget>
     38class UIVisoBrowserBase : public QIWithRetranslateUI<QGroupBox>
    3939{
    4040    Q_OBJECT;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r92415 r92471  
    5858    , m_pMainLayout(0)
    5959    , m_pHostBrowser(0)
    60     , m_pVisoBrowser(0)
     60    , m_pVISOContentBrowser(0)
    6161    , m_pToolBar(0)
    6262    , m_pVerticalToolBar(0)
     
    7777QStringList UIVisoCreatorWidget::entryList() const
    7878{
    79     if (!m_pVisoBrowser)
     79    if (!m_pVISOContentBrowser)
    8080        return QStringList();
    81     return m_pVisoBrowser->entryList();
     81    return m_pVISOContentBrowser->entryList();
    8282}
    8383
     
    113113void UIVisoCreatorWidget::retranslateUi()
    114114{
     115    if (m_pHostBrowser)
     116        m_pHostBrowser->setTitle(UIVisoCreatorWidget::tr("Host File System"));
     117    if (m_pVISOContentBrowser)
     118        m_pVISOContentBrowser->setTitle(UIVisoCreatorWidget::tr("VISO Content"));
    115119}
    116120
    117121void UIVisoCreatorWidget::sltHandleAddObjectsToViso(QStringList pathList)
    118122{
    119     if (m_pVisoBrowser)
    120         m_pVisoBrowser->addObjectsToViso(pathList);
     123    if (m_pVISOContentBrowser)
     124        m_pVISOContentBrowser->addObjectsToViso(pathList);
    121125}
    122126
     
    147151        return;
    148152    m_visoOptions.m_strVisoName = strVisoName;
    149     if(m_pVisoBrowser)
    150         m_pVisoBrowser->setVisoName(m_visoOptions.m_strVisoName);
     153    if(m_pVISOContentBrowser)
     154        m_pVISOContentBrowser->setVisoName(m_visoOptions.m_strVisoName);
    151155}
    152156
     
    200204        menu.addAction(m_pAddAction);
    201205    }
    202     else if (sender() == m_pVisoBrowser)
     206    else if (sender() == m_pVISOContentBrowser)
    203207    {
    204208        menu.addAction(m_pRemoveAction);
     
    245249    {
    246250        m_pMainLayout->addWidget(m_pHostBrowser, 1, 0, 1, 2);
     251        m_pHostBrowser->setAlignment(Qt::AlignLeft);
     252
    247253        m_pMainLayout->setColumnStretch(m_pMainLayout->indexOf(m_pHostBrowser), 2);
    248254    }
     
    255261    }
    256262
    257     m_pVisoBrowser = new UIVisoContentBrowser;
    258     if (m_pVisoBrowser)
    259     {
    260         m_pMainLayout->addWidget(m_pVisoBrowser, 1, 3, 1, 2);
    261         m_pVisoBrowser->setVisoName(m_visoOptions.m_strVisoName);
    262         m_pMainLayout->setColumnStretch(m_pMainLayout->indexOf(m_pVisoBrowser), 2);
     263    m_pVISOContentBrowser = new UIVisoContentBrowser;
     264    if (m_pVISOContentBrowser)
     265    {
     266        m_pMainLayout->addWidget(m_pVISOContentBrowser, 1, 3, 1, 2);
     267        m_pVISOContentBrowser->setVisoName(m_visoOptions.m_strVisoName);
     268        m_pMainLayout->setColumnStretch(m_pMainLayout->indexOf(m_pVISOContentBrowser), 2);
    263269    }
    264270
     
    295301    }
    296302
    297     if (m_pVisoBrowser)
    298     {
    299         connect(m_pVisoBrowser, &UIVisoContentBrowser::sigTableSelectionChanged,
     303    if (m_pVISOContentBrowser)
     304    {
     305        connect(m_pVISOContentBrowser, &UIVisoContentBrowser::sigTableSelectionChanged,
    300306                this, &UIVisoCreatorWidget::sltHandleContentBrowserTableSelectionChanged);
    301         connect(m_pVisoBrowser, &UIVisoContentBrowser::sigCreateFileTableViewContextMenu,
     307        connect(m_pVISOContentBrowser, &UIVisoContentBrowser::sigCreateFileTableViewContextMenu,
    302308                this, &UIVisoCreatorWidget::sltHandleShowContextMenu);
    303309    }
     
    334340    if (m_pCreateNewDirectoryAction)
    335341        connect(m_pCreateNewDirectoryAction, &QAction::triggered,
    336                 m_pVisoBrowser, &UIVisoContentBrowser::sltHandleCreateNewDirectory);
     342                m_pVISOContentBrowser, &UIVisoContentBrowser::sltHandleCreateNewDirectory);
    337343    if (m_pRemoveAction)
    338344        connect(m_pRemoveAction, &QAction::triggered,
    339                 m_pVisoBrowser, &UIVisoContentBrowser::sltHandleRemoveItems);
     345                m_pVISOContentBrowser, &UIVisoContentBrowser::sltHandleRemoveItems);
    340346    if (m_pResetAction)
    341347        connect(m_pResetAction, &QAction::triggered,
    342                 m_pVisoBrowser, &UIVisoContentBrowser::sltHandleResetAction);
     348                m_pVISOContentBrowser, &UIVisoContentBrowser::sltHandleResetAction);
    343349    if (m_pRenameAction)
    344350        connect(m_pRenameAction, &QAction::triggered,
    345                 m_pVisoBrowser,&UIVisoContentBrowser::sltHandleItemRenameAction);
     351                m_pVISOContentBrowser,&UIVisoContentBrowser::sltHandleItemRenameAction);
    346352}
    347353
     
    440446    //    host and/or content browser is open. We use the escape key to close those first: */
    441447    // if ((m_pHostBrowser && m_pHostBrowser->isTreeViewVisible()) ||
    442     //     (m_pVisoBrowser && m_pVisoBrowser->isTreeViewVisible()))
     448    //     (m_pVISOContentBrowser && m_pVISOContentBrowser->isTreeViewVisible()))
    443449    // {
    444450    //     if (m_pButtonBox && m_pButtonBox->button(QDialogButtonBox::Cancel))
     
    590596{
    591597    if (!m_strMachineName.isEmpty())
    592         setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("VISO Creator")));
     598        setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(UIVisoCreatorWidget::tr("VISO Creator")));
    593599    else
    594         setWindowTitle(QString("%1").arg(tr("VISO Creator")));
     600        setWindowTitle(QString("%1").arg(UIVisoCreatorWidget::tr("VISO Creator")));
    595601    if (m_pButtonBox && m_pButtonBox->button(QDialogButtonBox::Ok))
    596602    {
    597         m_pButtonBox->button(QDialogButtonBox::Ok)->setText(QApplication::translate("UIVisoCreator", "C&reate"));
    598         m_pButtonBox->button(QDialogButtonBox::Ok)->setToolTip(QApplication::translate("UIVisoCreator", "Creates VISO file with the selected content"));
     603        m_pButtonBox->button(QDialogButtonBox::Ok)->setText(UIVisoCreatorWidget::tr("C&reate"));
     604        m_pButtonBox->button(QDialogButtonBox::Ok)->setToolTip(UIVisoCreatorWidget::tr("Creates VISO file with the selected content"));
    599605    }
    600606    if (m_pButtonBox && m_pButtonBox->button(QDialogButtonBox::Help))
    601         m_pButtonBox->button(QDialogButtonBox::Help)->setToolTip(QApplication::translate("UIVisoCreator", "Opens the help browser and navigates to the related section"));
    602 }
     607        m_pButtonBox->button(QDialogButtonBox::Help)->setToolTip(UIVisoCreatorWidget::tr("Opens the help browser and navigates to the related section"));
     608}
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r92467 r92471  
    152152    QGridLayout          *m_pMainLayout;
    153153    UIVisoHostBrowser    *m_pHostBrowser;
    154     UIVisoContentBrowser *m_pVisoBrowser;
     154    UIVisoContentBrowser *m_pVISOContentBrowser;
    155155
    156156    QIToolBar            *m_pToolBar;
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