VirtualBox

Changeset 91278 in vbox


Ignore:
Timestamp:
Sep 16, 2021 12:11:05 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996. Some more refactoring on disk editor classes

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp

    r91277 r91278  
    5050*********************************************************************************************************************************/
    5151
    52 UIDiskEditorGroupBox::UIDiskEditorGroupBox(bool fExpertMode, QWidget *pParent /* = 0 */)
    53     : QIWithRetranslateUI<QGroupBox>(pParent)
    54     , m_fExpertMode(fExpertMode)
    55 {
    56     if (!m_fExpertMode)
    57         setFlat(true);
    58 }
    59 
    6052/* static */
    6153QString UIDiskEditorGroupBox::appendExtension(const QString &strName, const QString &strExtension)
     
    302294
    303295UIMediumSizeAndPathGroupBox::UIMediumSizeAndPathGroupBox(bool fExpertMode, QWidget *pParent, qulonglong uMinimumMediumSize)
    304     : UIDiskEditorGroupBox(fExpertMode, pParent)
     296    : QIWithRetranslateUI<QGroupBox>(pParent)
    305297    , m_pLocationEditor(0)
    306298    , m_pLocationOpenButton(0)
     
    308300    , m_pLocationLabel(0)
    309301    , m_pSizeLabel(0)
     302    , m_fExpertMode(fExpertMode)
    310303{
    311304    prepare(uMinimumMediumSize);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h

    r91272 r91278  
    5252#include "CMediumFormat.h"
    5353
    54 /** Base class for disk related group boxes. */
    55 class SHARED_LIBRARY_STUFF UIDiskEditorGroupBox : public QIWithRetranslateUI<QGroupBox>
    56 {
    57     Q_OBJECT;
    58 
    59 public:
    60 
    61     UIDiskEditorGroupBox(bool fExpertMode, QWidget *pParent = 0);
    62 
    63     static QString appendExtension(const QString &strName, const QString &strExtension);
    64     static QString constructMediumFilePath(const QString &strFileName, const QString &strPath);
    65     static bool checkFATSizeLimitation(const qulonglong uVariant, const QString &strMediumPath, const qulonglong uSize);
    66     static QString openFileDialogForDiskFile(const QString &strInitialPath, const CMediumFormat &comMediumFormat,
     54/** A set of static utility functions used by several wizard in the context of virtual media. */
     55namespace SHARED_LIBRARY_STUFF UIDiskEditorGroupBox
     56{
     57    QString appendExtension(const QString &strName, const QString &strExtension);
     58    QString constructMediumFilePath(const QString &strFileName, const QString &strPath);
     59    bool checkFATSizeLimitation(const qulonglong uVariant, const QString &strMediumPath, const qulonglong uSize);
     60    QString openFileDialogForDiskFile(const QString &strInitialPath, const CMediumFormat &comMediumFormat,
    6761                                             KDeviceType enmDeviceType, QWidget *pParent);
    6862    /** Attempts to find a file extention for the device type @p enmDeviceType within the extensions
    6963      * returned by CMediumFormat::DescribeFileExtensions(..). */
    70     static QString defaultExtension(const CMediumFormat &mediumFormatRef, KDeviceType enmDeviceType);
    71 
    72 protected:
    73 
    74     bool m_fExpertMode;
    75 };
    76 
     64    QString defaultExtension(const CMediumFormat &mediumFormatRef, KDeviceType enmDeviceType);
     65};
    7766
    7867class SHARED_LIBRARY_STUFF UIDiskVariantWidget : public QIWithRetranslateUI<QWidget>
     
    114103
    115104
    116 class SHARED_LIBRARY_STUFF UIMediumSizeAndPathGroupBox : public UIDiskEditorGroupBox
     105class SHARED_LIBRARY_STUFF UIMediumSizeAndPathGroupBox : public QIWithRetranslateUI<QGroupBox>
    117106{
    118107    Q_OBJECT;
     
    153142    QIRichTextLabel *m_pLocationLabel;
    154143    QIRichTextLabel *m_pSizeLabel;
     144    bool m_fExpertMode;
    155145};
    156146
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