VirtualBox

Changeset 100156 in vbox


Ignore:
Timestamp:
Jun 12, 2023 3:25:05 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Renaming etc.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r100123 r100156  
    22922292};
    22932293
    2294 /** Toggle action extension, used to toggle 'VISO Creator options' panel in file manager. */
    2295 class UIActionMenuVISOCreatorToggleOptionsPanel : public UIActionToggle
    2296 {
    2297     Q_OBJECT;
    2298 
    2299 public:
    2300 
    2301     /** Constructs action passing @a pParent to the base-class. */
    2302     UIActionMenuVISOCreatorToggleOptionsPanel(UIActionPool *pParent)
     2294/** Toggle action extension, used to toggle 'VISO Creator settings' dialog in file manager. */
     2295class UIActionMenuVISOCreatorToggleSettingsDialog : public UIActionToggle
     2296{
     2297    Q_OBJECT;
     2298
     2299public:
     2300
     2301    /** Constructs action passing @a pParent to the base-class. */
     2302    UIActionMenuVISOCreatorToggleSettingsDialog(UIActionPool *pParent)
    23032303        : UIActionToggle(pParent)
    23042304    {
     
    23152315    virtual QString shortcutExtraDataID() const RT_OVERRIDE
    23162316    {
    2317         return QString("ToggleVISOCreatorOptionsPanel");
     2317        return QString("ToggleVISOCreatorSettingsDialog");
    23182318    }
    23192319
     
    23272327    virtual void retranslateUi() RT_OVERRIDE
    23282328    {
    2329         setName(QApplication::translate("UIActionPool", "Options"));
     2329        setName(QApplication::translate("UIActionPool", "Settings"));
    23302330        setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
    2331         setStatusTip(QApplication::translate("UIActionPool", "Open panel for VISO Creator options"));
    2332         setToolTip(QApplication::translate("UIActionPool", "Open Options Panel")
     2331        setStatusTip(QApplication::translate("UIActionPool", "Open VISO Creator settings dialog"));
     2332        setToolTip(QApplication::translate("UIActionPool", "Open Settings Dialog")
    23332333                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
    23342334    }
     
    31863186    /* Create VISO Creator actions: */
    31873187    m_pool[UIActionIndex_M_VISOCreator] = new UIActionMenuVISOCreator(this);
    3188     m_pool[UIActionIndex_M_VISOCreator_ToggleOptionsPanel] = new UIActionMenuVISOCreatorToggleOptionsPanel(this);
     3188    m_pool[UIActionIndex_M_VISOCreator_ToggleSettingsDialog] = new UIActionMenuVISOCreatorToggleSettingsDialog(this);
    31893189    m_pool[UIActionIndex_M_VISOCreator_Add] = new UIActionMenuVISOCreatorAdd(this);
    31903190    m_pool[UIActionIndex_M_VISOCreator_Remove] = new UIActionMenuVISOCreatorRemove(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r100123 r100156  
    151151    /* VISO Creator actions: */
    152152    UIActionIndex_M_VISOCreator,
    153     UIActionIndex_M_VISOCreator_ToggleOptionsPanel,
     153    UIActionIndex_M_VISOCreator_ToggleSettingsDialog,
    154154    UIActionIndex_M_VISOCreator_Add,
    155155    UIActionIndex_M_VISOCreator_Remove,
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100155 r100156  
    223223                                         bool fShowToolBar, const QString& strMachineName /* = QString() */)
    224224    : QIWithRetranslateUI<QWidget>(pParent)
    225     , m_pActionOptions(0)
     225    , m_pActionSettings(0)
    226226    , m_pAddAction(0)
    227227    , m_pRemoveAction(0)
     
    299299{
    300300    Q_UNUSED(pEvent);
    301     if (m_pSettingsWidget && m_pSettingsWidget->isVisible() != m_fShowSettingsDialog /*&& m_pOverlayWidget*/ && m_pOverlayBlurEffect)
    302     {
    303         QPixmap shot = m_pBrowserContainerWidget->grab();
    304         m_pOverlayWidget->setPixmap(shot);
    305 
    306         if (m_fShowSettingsDialog)
    307             m_pStackedLayout->setCurrentWidget(m_pOverlayWidget);
    308         else
    309             m_pStackedLayout->setCurrentWidget(m_pBrowserContainerWidget);
    310 
    311         m_pSettingsWidget->setVisible(m_fShowSettingsDialog);
    312 
    313         m_pOverlayBlurEffect->setEnabled(m_fShowSettingsDialog);
    314         m_pSettingsWidget->raise();
    315         if (m_fShowSettingsDialog)
    316         {
    317             int x = 0.5 * (m_pBrowserContainerWidget->width() - m_pSettingsWidget->width());
    318             int y = 0.5 * (m_pBrowserContainerWidget->height() - m_pSettingsWidget->height());
    319             m_pSettingsWidget->move(m_pBrowserContainerWidget->x() + x, m_pBrowserContainerWidget->y() + y);
    320         }
    321     }
    322301}
    323302
     
    328307}
    329308
    330 void UIVisoCreatorWidget::sltPanelActionToggled(bool fChecked)
     309void UIVisoCreatorWidget::sltSettingsActionToggled(bool fChecked)
    331310{
    332311    m_fShowSettingsDialog = fChecked;
    333     repaint();
    334     //update();
     312    toggleSettingsWidget();
    335313}
    336314
     
    505483    }
    506484
    507     if (m_pActionOptions)
    508         connect(m_pActionOptions, &QAction::triggered, this, &UIVisoCreatorWidget::sltPanelActionToggled);
     485    if (m_pActionSettings)
     486        connect(m_pActionSettings, &QAction::triggered, this, &UIVisoCreatorWidget::sltSettingsActionToggled);
    509487
    510488    if (m_pSettingsWidget)
     
    544522        return;
    545523
    546     m_pActionOptions = m_pActionPool->action(UIActionIndex_M_VISOCreator_ToggleOptionsPanel);
     524    m_pActionSettings = m_pActionPool->action(UIActionIndex_M_VISOCreator_ToggleSettingsDialog);
    547525
    548526    m_pAddAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_Add);
     
    564542    if (m_pToolBar)
    565543    {
    566         if (m_pActionOptions)
    567             m_pToolBar->addAction(m_pActionOptions);
     544        if (m_pActionSettings)
     545            m_pToolBar->addAction(m_pActionSettings);
    568546    }
    569547    if (m_pMainMenu)
    570548    {
    571         m_pMainMenu->addAction(m_pActionOptions);
     549        m_pMainMenu->addAction(m_pActionSettings);
    572550        m_pMainMenu->addSeparator();
    573551        if (m_pAddAction)
     
    608586
    609587        m_pVerticalToolBar->addWidget(bottomSpacerWidget);
     588    }
     589}
     590
     591void UIVisoCreatorWidget::toggleSettingsWidget()
     592{
     593    if (m_pSettingsWidget && m_pSettingsWidget->isVisible() != m_fShowSettingsDialog /*&& m_pOverlayWidget*/ && m_pOverlayBlurEffect)
     594    {
     595        QPixmap shot = m_pBrowserContainerWidget->grab();
     596        m_pOverlayWidget->setPixmap(shot);
     597
     598        if (m_fShowSettingsDialog)
     599            m_pStackedLayout->setCurrentWidget(m_pOverlayWidget);
     600        else
     601            m_pStackedLayout->setCurrentWidget(m_pBrowserContainerWidget);
     602
     603        m_pSettingsWidget->setVisible(m_fShowSettingsDialog);
     604
     605        m_pOverlayBlurEffect->setEnabled(m_fShowSettingsDialog);
     606        m_pSettingsWidget->raise();
     607        if (m_fShowSettingsDialog)
     608        {
     609            int x = 0.5 * (m_pBrowserContainerWidget->width() - m_pSettingsWidget->width());
     610            int y = 0.5 * (m_pBrowserContainerWidget->height() - m_pSettingsWidget->height());
     611            m_pSettingsWidget->move(m_pBrowserContainerWidget->x() + x, m_pBrowserContainerWidget->y() + y);
     612        }
    610613    }
    611614}
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r100155 r100156  
    9898
    9999    void sltAddObjectsToViso(QStringList pathList);
    100     void sltPanelActionToggled(bool fChecked);
     100    void sltSettingsActionToggled(bool fChecked);
    101101    void sltVisoNameChanged(const QString& strVisoName);
    102102    void sltCustomVisoOptionsChanged(const QStringList &customVisoOptions);
     
    134134     * Leave out the vertical toolbar which is handled in prepareVerticalToolBar. */
    135135    void populateMenuMainToolbar();
    136     /** Set the root index of the m_pTableModel to the current index of m_pTreeModel. */
    137     void setTableRootIndex(QModelIndex index = QModelIndex() );
    138     void setTreeCurrentIndex(QModelIndex index = QModelIndex() );
    139 
     136
     137     void toggleSettingsWidget();
    140138    /** @name Main toolbar (and main menu) actions
    141139      * @{ */
    142         QAction         *m_pActionOptions;
     140        QAction         *m_pActionSettings;
    143141    /** @} */
    144142
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