VirtualBox

Ignore:
Timestamp:
May 10, 2016 10:23:29 AM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​​​​​​​​bugref:6769: Rework/cleanup file-path selector widget (part 08): More refactoring.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp

    r60831 r60917  
    4444#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4545
    46 enum
    47 {
    48     PathId = 0,
    49     SelectId,
    50     ResetId
    51 };
    52 
    5346
    5447/** Returns first position of difference between passed strings. */
     
    133126}
    134127
    135 bool UIFilePathSelector::isEditable() const
    136 {
    137     return m_fEditable;
    138 }
    139 
    140128void UIFilePathSelector::setResetEnabled(bool fEnabled)
    141129{
     
    148136    }
    149137    retranslateUi();
    150 }
    151 
    152 bool UIFilePathSelector::isResetEnabled() const
    153 {
    154     return (count() - 1  == ResetId);
    155 }
    156 
    157 bool UIFilePathSelector::isPathSelected() const
    158 {
    159     return (currentIndex() == PathId);
    160 }
    161 
    162 QString UIFilePathSelector::path() const
    163 {
    164     return m_strPath;
    165138}
    166139
     
    171144    if (fRefreshText)
    172145        refreshText();
    173 }
    174 
    175 void UIFilePathSelector::setHomeDir(const QString &strHomeDir)
    176 {
    177     m_strHomeDir = strHomeDir;
    178146}
    179147
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h

    r60829 r60917  
    5454    };
    5555
     56    /** Combo-box field IDs file-path selector uses. */
     57    enum
     58    {
     59        PathId = 0,
     60        SelectId,
     61        ResetId
     62    };
     63
    5664    /** Constructs file-path selector passing @a pParent to QComboBox base-class. */
    5765    UIFilePathSelector(QWidget *pParent = 0);
     
    6573    void setEditable(bool fEditable);
    6674    /** Returns whether the path is editable. */
    67     bool isEditable() const;
     75    bool isEditable() const { return m_fEditable; }
    6876
    6977    /** Defines whether the reseting to defauilt path is @a fEnabled. */
    7078    void setResetEnabled(bool fEnabled);
    7179    /** Returns whether the reseting to defauilt path is enabled. */
    72     bool isResetEnabled() const;
     80    bool isResetEnabled() const { return count() - 1  == ResetId; }
    7381
    7482    /** Defines the file-dialog @a strTitle. */
     
    92100    bool isModified() const { return m_fModified; }
    93101    /** Returns whether the path is selected. */
    94     bool isPathSelected() const;
     102    bool isPathSelected() const { return currentIndex() == PathId; }
    95103
    96104    /** Returns the path. */
    97     QString path() const;
     105    QString path() const { return m_strPath; }
    98106
    99107public slots:
     
    103111
    104112    /** Defines the @a strHomeDir. */
    105     void setHomeDir(const QString &strHomeDir);
     113    void setHomeDir(const QString &strHomeDir) { m_strHomeDir = strHomeDir; }
    106114
    107115protected:
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