VirtualBox

Ignore:
Timestamp:
Aug 7, 2008 9:24:58 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34291
Message:

Fe/Qt4: File/Folder path selector reworked. Global/VM Settings updated with new changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFilePathSelectorWidget.h

    r10780 r11229  
    2727
    2828/* Qt includes */
    29 #include <QWidget>
     29#include <QComboBox>
    3030
    31 #ifdef Q_WS_MAC
    32 #define VBOX_USE_COMBOBOX_PATH_SELECTOR
    33 #endif /* Q_WS_MAC */
     31class QFileIconProvider;
     32class QAction;
    3433
    35 class QLabel;
    36 class QToolButton;
    37 class QFileIconProvider;
    38 class QComboBox;
    39 class QILabel;
    40 
    41 class VBoxFilePathSelectorWidget: public QIWithRetranslateUI<QWidget>
     34class VBoxFilePathSelectorWidget: public QIWithRetranslateUI<QComboBox>
    4235{
    4336    Q_OBJECT;
     
    4538public:
    4639
    47     enum SelectorMode 
    48     { 
     40    enum SelectorMode
     41    {
    4942        PathMode = 0,
    5043        FileMode
    5144    };
    5245
    53     VBoxFilePathSelectorWidget (QWidget *aParent = NULL);
    54     ~VBoxFilePathSelectorWidget();
     46    VBoxFilePathSelectorWidget (QWidget *aParent = 0);
     47   ~VBoxFilePathSelectorWidget();
    5548
    5649    void setMode (SelectorMode aMode);
     
    6053    bool isResetEnabled () const;
    6154
    62     void setPathWhatsThis (const QString &aText);
    63     void setSelectorWhatsThis (const QString &aText);
    64     void setResetWhatsThis (const QString &aText);
     55    void setNoneToolTip (const QString &aText);
     56    void setSelectToolTip (const QString &aText);
     57    void setResetToolTip (const QString &aText);
    6558
    6659    bool isModified() const;
     
    7871protected:
    7972
     73    void resizeEvent (QResizeEvent *aEvent);
    8074    void retranslateUi();
    8175
    8276private slots:
    83      
    84     void cbActivated (int aIndex);
     77
     78    void onActivated (int aIndex);
     79    void copyToClipboard();
    8580
    8681private:
    8782
    88     void init();
    8983    QIcon defaultIcon() const;
    90     QString filePath (const QString &aName, bool bLast) const;
     84    QString filePath() const;
     85    QString shrinkText (int aWidth) const;
     86    void refreshText();
    9187
    9288    /* Private member vars */
     89    QFileIconProvider *mIconProvider;
     90    QAction *mCopyAction;
    9391    SelectorMode mMode;
    94     QString      mPath;
    95     QString      mNoneStr;
    96 
    97 #ifdef VBOX_USE_COMBOBOX_PATH_SELECTOR
    98     QComboBox   *mCbPath;
    99 #else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    100     QLabel      *mLbIcon;
    101     QILabel     *mLbPath;
    102     QToolButton *mTbSelect;
    103     QToolButton *mTbReset;
    104 #endif /* !VBOX_USE_COMBOBOX_PATH_SELECTOR */
    105 
    106     QFileIconProvider *mIconProvider;
     92    QString mPath;
     93    QString mNoneStr;
     94    QString mNoneTip;
    10795};
    10896
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette