VirtualBox

Changeset 100905 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 18, 2023 11:23:20 AM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158841
Message:

FE/Qt: bugref:10496, bugref:6699. Adding missing toolbar action connections.

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

Legend:

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

    r100893 r100905  
    243243
    244244        m_pVerticalSplitter->addWidget(pTopWidget);
    245         /* Prepare operations and log panels and insert them into splitter: */
    246         prepareOperationsAndLogPanels(m_pVerticalSplitter);
    247245
    248246        for (int i = 0; i < m_pVerticalSplitter->count(); ++i)
     
    255253    m_pPanel = new UIFileManagerPanel(this, UIFileManagerOptions::instance());
    256254    AssertReturnVoid(m_pPanel);
     255
     256    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_FileManager_T_Preferences));
     257    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log));
     258    m_panelActions.insert(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations));
     259
     260    m_pActionPool->action(UIActionIndex_M_FileManager_T_Preferences)->setData(static_cast<int>(UIFileManagerPanel::Page_Preferences));
     261    m_pActionPool->action(UIActionIndex_M_FileManager_T_Log)->setData(static_cast<int>(UIFileManagerPanel::Page_Log));
     262    m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations)->setData(static_cast<int>(UIFileManagerPanel::Page_Operations));
     263
    257264    m_pVerticalSplitter->addWidget(m_pPanel);
     265    m_pPanel->hide();
    258266}
    259267
     
    388396    if (!pSenderAction)
    389397        return;
    390     UIDialogPanel* pPanel = 0;
    391     /* Look for the sender() within the m_panelActionMap's values: */
    392     for (QMap<UIDialogPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
    393         iterator != m_panelActionMap.end(); ++iterator)
    394     {
    395         if (iterator.value() == pSenderAction)
    396             pPanel = iterator.key();
    397     }
    398     if (!pPanel)
    399         return;
     398
     399    m_pPanel->setVisible(fChecked);
     400
    400401    if (fChecked)
    401         showPanel(pPanel);
    402     else
    403         hidePanel(pPanel);
     402    {
     403        /* Make sure only pSenderAction is toggled on. */
     404        for(QSet<QAction*>::iterator iter = m_panelActions.begin(); iter != m_panelActions.end(); ++iter)
     405        {
     406            QAction *pAction = *iter;
     407            if (!pAction || pAction == pSenderAction)
     408                continue;
     409            pAction->blockSignals(true);
     410            pAction->setChecked(false);
     411            pAction->blockSignals(false);
     412        }
     413        m_pPanel->setCurrentIndex(pSenderAction->data().toInt());
     414    }
     415
     416    // UIDialogPanel* pPanel = 0;
     417    // /* Look for the sender() within the m_panelActionMap's values: */
     418    // for (QMap<UIDialogPanel*, QAction*>::const_iterator iterator = m_panelActionMap.begin();
     419    //     iterator != m_panelActionMap.end(); ++iterator)
     420    // {
     421    //     if (iterator.value() == pSenderAction)
     422    //         pPanel = iterator.key();
     423    // }
     424    // if (!pPanel)
     425    //     return;
     426    // if (fChecked)
     427    //     showPanel(pPanel);
     428    // else
     429    //     hidePanel(pPanel);
    404430}
    405431
     
    555581    }
    556582}
    557 
    558 void UIFileManager::prepareOperationsAndLogPanels(QSplitter *pSplitter)
    559 {
    560     Q_UNUSED(pSplitter);
    561     // if (!pSplitter)
    562     //     return;
    563     // m_pPanel = new UIFileManagerOperationsPanel;
    564     // if (m_pPanel)
    565     // {
    566     //     m_pPanel->hide();
    567     //     connect(m_pPanel, &UIFileManagerOperationsPanel::sigFileOperationComplete,
    568     //             this, &UIFileManager::sltFileOperationComplete);
    569     //     connect(m_pPanel, &UIFileManagerOperationsPanel::sigFileOperationFail,
    570     //             this, &UIFileManager::sltReceieveLogOutput);
    571     // }
    572 }
    573 
    574583
    575584template<typename T>
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r100887 r100905  
    136136    void prepareVerticalToolBar(QHBoxLayout *layout);
    137137    void prepareToolBar();
    138     void prepareOperationsAndLogPanels(QSplitter *pSplitter);
    139138
    140139    /** Saves list of panels and file manager options to the extra data. */
     
    179178    QPointer<UIActionPool>  m_pActionPool;
    180179    const bool     m_fShowToolbar;
    181     QMap<UIDialogPanel*, QAction*> m_panelActionMap;
     180    QSet<QAction*> m_panelActions;
    182181    QList<UIDialogPanel*>          m_visiblePanelsList;
    183182    UIFileManagerLogPanel         *m_pLogPanel;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPanel.cpp

    r100901 r100905  
    627627    connect(pOperationsWidget, &UIFileOperationProgressWidget::sigFocusOut,
    628628            this, &UIFileManagerPanel::sltHandleWidgetFocusOut);
    629     //sigShowPanel(this);
     629}
     630
     631void UIFileManagerPanel::setCurrentIndex(int iIndex)
     632{
     633    if (!m_pTabWidget || iIndex >= m_pTabWidget->count() || iIndex < 0)
     634        return;
     635    m_pTabWidget->setCurrentIndex(iIndex);
    630636}
    631637
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPanel.h

    r100901 r100905  
    7070    void appendLog(const QString &strLog, const QString &strMachineName, FileManagerLogType eLogType);
    7171    void addNewProgress(const CProgress &comProgress, const QString &strSourceTableName);
    72 
     72    void setCurrentIndex(int iIndex);
    7373    enum Page
    7474    {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette