VirtualBox

Changeset 100094 in vbox


Ignore:
Timestamp:
Jun 7, 2023 1:30:53 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Some more refactoring.

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

Legend:

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

    r100064 r100094  
    16751675            break;
    16761676        case UIMediumDeviceType_DVD:
    1677             uMediumId = UIVisoCreatorWidget::createViso(pActionPool, pParent, strDefaultFolder, strMachineName);
     1677            uMediumId = UIVisoCreatorDialog::createViso(pActionPool, pParent, strDefaultFolder, strMachineName);
    16781678            break;
    16791679        case UIMediumDeviceType_Floppy:
     
    19081908                }
    19091909                else if(target.type == UIMediumTarget::UIMediumTargetType_CreateAdHocVISO)
    1910                     uMediumID = UIVisoCreatorWidget::createViso(pActionPool, windowManager().mainWindowShown(),
     1910                    uMediumID = UIVisoCreatorDialog::createViso(pActionPool, windowManager().mainWindowShown(),
    19111911                                                                strMachineFolder, comConstMachine.GetName());
    19121912
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100093 r100094  
    2828/* Qt includes: */
    2929#include <QGridLayout>
     30#include <QLabel>
    3031#include <QMenuBar>
    3132#include <QPushButton>
    3233#include <QStyle>
     34#include <QStatusBar>
    3335#include <QTextStream>
    3436
     
    6264
    6365UIVisoCreatorWidget::UIVisoCreatorWidget(UIActionPool *pActionPool, QWidget *pParent,
    64                                          bool fShowToolBar,const QString& strMachineName /* = QString() */)
     66                                         bool fShowToolBar, const QString& strMachineName /* = QString() */)
    6567    : QIWithRetranslateUI<QWidget>(pParent)
    6668    , m_pActionConfiguration(0)
     
    7880    , m_pVerticalToolBar(0)
    7981    , m_pMainMenu(0)
    80     , m_strMachineName(strMachineName)
    8182    , m_pCreatorOptionsPanel(0)
    8283    , m_pConfigurationPanel(0)
     
    528529
    529530/* static */
    530 QUuid UIVisoCreatorWidget::createViso(UIActionPool *pActionPool, QWidget *pParent,
     531QUuid UIVisoCreatorDialog::createViso(UIActionPool *pActionPool, QWidget *pParent,
    531532                                      const QString &strDefaultFolder /* = QString() */,
    532533                                      const QString &strMachineName /* = QString() */)
     
    585586UIVisoCreatorDialog::UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName /* = QString() */)
    586587    : QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> >(pParent)
    587     , m_strMachineName(strMachineName)
    588588    , m_pVisoCreatorWidget(0)
    589589    , m_pButtonBox(0)
     590    , m_pStatusBar(0)
     591    , m_pStatusLabel(0)
    590592    , m_pActionPool(pActionPool)
    591593    , m_iGeometrySaveTimerId(-1)
     
    594596       we manage escape key here with special casing: */
    595597    setRejectByEscape(false);
    596     prepareWidgets();
     598    prepareWidgets(strMachineName);
    597599    prepareConnections();
    598600    loadSettings();
     
    633635}
    634636
    635 void UIVisoCreatorDialog::prepareWidgets()
     637void UIVisoCreatorDialog::prepareWidgets(const QString &strMachineName)
    636638{
    637639    QWidget *pCentralWidget = new QWidget;
     
    641643
    642644
    643     m_pVisoCreatorWidget = new UIVisoCreatorWidget(m_pActionPool, this, true /* show toolbar */, m_strMachineName);
     645    m_pVisoCreatorWidget = new UIVisoCreatorWidget(m_pActionPool, this, true /* show toolbar */, strMachineName);
    644646    if (m_pVisoCreatorWidget)
    645647    {
     
    665667
    666668        uiCommon().setHelpKeyword(m_pButtonBox->button(QIDialogButtonBox::Help), "create-optical-disk-image");
     669    }
     670
     671    m_pStatusLabel = new QLabel;
     672    m_pStatusBar = new QStatusBar(this);
     673    if (m_pButtonBox && m_pStatusLabel)
     674    {
     675        pMainLayout->addWidget(m_pStatusBar);
     676        m_pStatusBar->addPermanentWidget(m_pStatusLabel);
    667677    }
    668678    retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r100093 r100094  
    4343
    4444/* Forward declarations: */
     45class QGridLayout;
     46class QLabel;
    4547class QMenu;
    46 class QGridLayout;
     48class QStatusBar;
    4749class QIDialogButtonBox;
    48 class UIDialogPanel;
    4950class QIToolBar;
    5051class UIActionPool;
     52class UIDialogPanel;
    5153class UIVisoHostBrowser;
    5254class UIVisoContentBrowser;
     
    6567    void sigSetCancelButtonShortCut(QKeySequence keySequence);
    6668    void sigVisoNameChanged(const QString &strVisoName);
     69    void sigVisoFilePathChanged(const QString &strPath);
    6770
    6871public:
     
    7982    void    setCurrentPath(const QString &strPath);
    8083    QMenu *menu() const;
    81 
    82     /** Creates a VISO by using the VISO creator dialog.
    83       * @param  pParent           Passes the dialog parent.
    84       * @param  strDefaultFolder  Passes the folder to save the VISO file.
    85       * @param  strMachineName    Passes the name of the machine,
    86       * returns the UUID of the created medium or a null QUuid. */
    87     static QUuid createViso(UIActionPool *pActionPool, QWidget *pParent,
    88                             const QString &strDefaultFolder = QString(),
    89                             const QString &strMachineName  = QString());
    9084
    9185#ifdef VBOX_WS_MAC
     
    176170    BrowserOptions        m_browserOptions;
    177171    QMenu                *m_pMainMenu;
    178     QString               m_strMachineName;
    179172    UIVisoCreatorOptionsPanel *m_pCreatorOptionsPanel;
    180173    UIVisoConfigurationPanel  *m_pConfigurationPanel;
     
    200193    void    setCurrentPath(const QString &strPath);
    201194
     195    /** Creates a VISO by using the VISO creator dialog.
     196      * @param  pParent           Passes the dialog parent.
     197      * @param  strDefaultFolder  Passes the folder to save the VISO file.
     198      * @param  strMachineName    Passes the name of the machine,
     199      * returns the UUID of the created medium or a null QUuid. */
     200    static QUuid createViso(UIActionPool *pActionPool, QWidget *pParent,
     201                            const QString &strDefaultFolder = QString(),
     202                            const QString &strMachineName  = QString());
     203
    202204protected:
    203205
     
    210212
    211213private:
    212     void prepareWidgets();
     214    void prepareWidgets(const QString &strMachineName);
    213215    void prepareConnections();
    214216    virtual void retranslateUi() final override;
     
    217219    void updateWindowTitle();
    218220
    219     QString m_strMachineName;
    220221    UIVisoCreatorWidget *m_pVisoCreatorWidget;
    221     QIDialogButtonBox    *m_pButtonBox;
     222    QIDialogButtonBox   *m_pButtonBox;
     223    QStatusBar          *m_pStatusBar;
     224    QLabel              *m_pStatusLabel;
    222225    QPointer<UIActionPool> m_pActionPool;
    223226    int                   m_iGeometrySaveTimerId;
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