VirtualBox

Changeset 100496 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 11, 2023 6:55:31 AM (17 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Adding the saveas aaction.

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

Legend:

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

    r100348 r100496  
    26172617};
    26182618
     2619class UIActionMenuVISOCreatorSaveAs : public UIActionSimple
     2620{
     2621    Q_OBJECT;
     2622
     2623public:
     2624    /** Constructs action passing @a pParent to the base-class. */
     2625    UIActionMenuVISOCreatorSaveAs(UIActionPool *pParent)
     2626        : UIActionSimple(pParent,
     2627                         ":/cd_remove_16px.png", ":/cd_remove_32px.png")
     2628    {
     2629        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     2630    }
     2631
     2632protected:
     2633
     2634    /** Returns shortcut extra-data ID. */
     2635    virtual QString shortcutExtraDataID() const RT_OVERRIDE
     2636    {
     2637        return QString("VISOSaveAs");
     2638    }
     2639
     2640    /** Handles translation event. */
     2641    virtual void retranslateUi() RT_OVERRIDE
     2642    {
     2643        setName(QApplication::translate("UIActionPool", "SaveAs"));
     2644        setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
     2645        setStatusTip(QApplication::translate("UIActionPool", "Select a file to save the VISO content."));
     2646        setToolTip(QApplication::translate("UIActionPool", "Select a file to save the VISO content.")
     2647                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     2648    }
     2649};
    26192650
    26202651class UIActionMenuVISOCreatorImportISO : public UIActionSimple
     
    34973528    m_pool[UIActionIndex_M_VISOCreator_Reset] = new UIActionMenuVISOCreatorReset(this);
    34983529    m_pool[UIActionIndex_M_VISOCreator_Open] = new UIActionMenuVISOCreatorOpen(this);
     3530    m_pool[UIActionIndex_M_VISOCreator_SaveAs] = new UIActionMenuVISOCreatorSaveAs(this);
    34993531    m_pool[UIActionIndex_M_VISOCreator_ImportISO] = new UIActionMenuVISOCreatorImportISO(this);
    35003532    m_pool[UIActionIndex_M_VISOCreator_RemoveISO] = new UIActionMenuVISOCreatorRemoveISO(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r100348 r100496  
    162162    UIActionIndex_M_VISOCreator_Reset,
    163163    UIActionIndex_M_VISOCreator_Open,
     164    UIActionIndex_M_VISOCreator_SaveAs,
    164165    UIActionIndex_M_VISOCreator_ImportISO,
    165166    UIActionIndex_M_VISOCreator_RemoveISO,
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100479 r100496  
    260260    , m_pAddAction(0)
    261261    , m_pOpenAction(0)
     262    , m_pSaveAsAction(0)
    262263    , m_pImportISOAction(0)
    263264    , m_pRemoveISOAction(0)
     
    416417}
    417418
     419void UIVisoCreatorWidget::sltSaveAsAction()
     420{
     421    // QString strSaveFileName = getSaveFileName(visoFileFullPath(), "VISO files (*.viso)", this,
     422    //                                           UIVisoCreatorWidget::tr("Select a file to save Viso content to"));
     423}
     424
    418425void UIVisoCreatorWidget::sltISOImportAction()
    419426{
     
    548555        connect(m_pOpenAction, &QAction::triggered,
    549556                this, &UIVisoCreatorWidget::sltOpenAction);
     557    if (m_pSaveAsAction)
     558        connect(m_pSaveAsAction, &QAction::triggered,
     559                this, &UIVisoCreatorWidget::sltSaveAsAction);
    550560    if (m_pImportISOAction)
    551561        connect(m_pImportISOAction, &QAction::triggered,
     
    567577        m_pAddAction->setEnabled(m_pHostBrowser->tableViewHasSelection());
    568578    m_pOpenAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_Open);
     579    m_pSaveAsAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_SaveAs);
    569580    m_pImportISOAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_ImportISO);
    570581    if (m_pImportISOAction)
     
    590601        if (m_pOpenAction)
    591602            m_pMainMenu->addAction(m_pOpenAction);
     603        if (m_pSaveAsAction)
     604            m_pMainMenu->addAction(m_pSaveAsAction);
    592605        if (m_pAddAction)
    593606            m_pMainMenu->addAction(m_pAddAction);
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r100479 r100496  
    117117    void sltContentBrowserTableSelectionChanged(bool fIsSelectionEmpty);
    118118    void sltOpenAction();
     119    void sltSaveAsAction();
    119120    void sltISOImportAction();
    120121    void sltISORemoveAction();
     
    143144        QAction              *m_pAddAction;
    144145        QAction              *m_pOpenAction;
     146        QAction              *m_pSaveAsAction;
    145147        QAction              *m_pImportISOAction;
    146148        QAction              *m_pRemoveISOAction;
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