VirtualBox

Ignore:
Timestamp:
Jul 21, 2008 2:29:49 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: Change the QLineEdit to a QILabel in the classical file selector widget.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
5 edited

Legend:

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

    r10741 r10780  
    3434
    3535class QLabel;
    36 class QLineEdit;
    3736class QToolButton;
    3837class QFileIconProvider;
    3938class QComboBox;
     39class QILabel;
    4040
    4141class VBoxFilePathSelectorWidget: public QIWithRetranslateUI<QWidget>
     
    6060    bool isResetEnabled () const;
    6161
    62     void setLineEditWhatsThis (const QString &aText);
     62    void setPathWhatsThis (const QString &aText);
    6363    void setSelectorWhatsThis (const QString &aText);
    6464    void setResetWhatsThis (const QString &aText);
     
    9999#else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    100100    QLabel      *mLbIcon;
    101     QLineEdit   *mLePath;
     101    QILabel     *mLbPath;
    102102    QToolButton *mTbSelect;
    103103    QToolButton *mTbReset;
  • trunk/src/VBox/Frontends/VirtualBox4/src/QILabel.cpp

    r9968 r10780  
    268268/* Some constant predefines */
    269269const QRegExp QILabelPrivate::mCopyRegExp = QRegExp ("<[^>]*>");
    270 QRegExp QILabelPrivate::mElideRegExp = QRegExp ("(<compact\\s+elipsis=\"(start|middle|end)\"?>([^<]+)</compact>)");
     270QRegExp QILabelPrivate::mElideRegExp = QRegExp ("(<compact\\s+elipsis=\"(start|middle|end)\"?>([^<]*)</compact>)");
    271271
    272272#define HOR_PADDING 1
     
    425425    /* Only set the tooltip if the text is shortened in any way. */
    426426    if (removeHtmlTags (comp) != removeHtmlTags (mText))
    427         setToolTip (mText);
     427        setToolTip (removeHtmlTags (mText));
    428428    else
    429429        setToolTip ("");
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFilePathSelectorWidget.cpp

    r10741 r10780  
    2323#include "VBoxFilePathSelectorWidget.h"
    2424#include "VBoxGlobal.h"
     25#include "QILabel.h"
    2526
    2627/* Qt includes */
     
    3233#else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    3334# include <QLabel>
    34 # include <QLineEdit>
    3535# include <QToolButton>
    3636#endif /* !VBOX_USE_COMBOBOX_PATH_SELECTOR */
     
    9090}
    9191
    92 void VBoxFilePathSelectorWidget::setLineEditWhatsThis (const QString &aText)
     92void VBoxFilePathSelectorWidget::setPathWhatsThis (const QString &aText)
    9393{
    9494#ifdef VBOX_USE_COMBOBOX_PATH_SELECTOR
    9595    NOREF (aText);
    9696#else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    97     mLePath->setWhatsThis (aText);
     97    mLbPath->setWhatsThis (aText);
    9898#endif /* !VBOX_USE_COMBOBOX_PATH_SELECTOR */
    9999}
     
    119119bool VBoxFilePathSelectorWidget::isModified() const
    120120{
    121 #ifdef VBOX_USE_COMBOBOX_PATH_SELECTOR
    122121    return true;
    123 #else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    124     return mLePath->isModified();
    125 #endif /* !VBOX_USE_COMBOBOX_PATH_SELECTOR */
    126122}
    127123
     
    142138    mCbPath->setItemIcon (PathId, icon);
    143139#else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    144     /* Do this instead of le->setText (folder) to cause
    145      * isModified() return true */
    146     mLePath->selectAll();
    147     mLePath->insert (filePath (tmpPath, false));
     140    mLbPath->setText (QString ("<compact elipsis=\"start\">%1</compact>").arg (tmpPath));
    148141    mLbIcon->setPixmap (icon.pixmap (16, 16));
    149142#endif /* !VBOX_USE_COMBOBOX_PATH_SELECTOR */
     
    203196#else /* VBOX_USE_COMBOBOX_PATH_SELECTOR */
    204197    mLbIcon = new QLabel();
    205     mLePath = new QLineEdit();
    206     mLePath->setMinimumWidth (180);
    207     mLePath->setReadOnly (true);
     198    mLbPath = new QILabel();
     199    mLbPath->setSizePolicy (QSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed));
     200    mLbPath->setMinimumWidth (180);
     201    mLbPath->setFullSizeSelection (true);
    208202    mTbSelect = new QToolButton();
    209203    mTbSelect->setIcon (QIcon (":/select_file_16px.png"));
     
    218212   
    219213    layout->addWidget (mLbIcon);
    220     layout->addWidget (mLePath);
     214    layout->addWidget (mLbPath);
    221215    layout->addWidget (mTbSelect);
    222216    layout->addWidget (mTbReset);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGLSettingsGeneral.cpp

    r10658 r10780  
    7676    Ui::VBoxGLSettingsGeneral::retranslateUi (this);
    7777
    78     mPsVdi->setLineEditWhatsThis (tr ("Displays the path to the default VDI folder. This folder is used, if not explicitly specified otherwise, when adding existing or creating new virtual hard disks."));
     78    mPsVdi->setPathWhatsThis (tr ("Displays the path to the default VDI folder. This folder is used, if not explicitly specified otherwise, when adding existing or creating new virtual hard disks."));
    7979    mPsVdi->setSelectorWhatsThis (tr ("Opens a dialog to select the default VDI folder."));
    8080    mPsVdi->setResetWhatsThis (tr ("Resets the VDI folder path to the default value. The actual default path will be displayed after accepting the changes and opening this dialog again."));
    8181
    82     mPsMach->setLineEditWhatsThis (tr ("Displays the path to the default virtual machine folder. This folder is used, if not explicitly specified otherwise, when creating new virtual machines."));
     82    mPsMach->setPathWhatsThis (tr ("Displays the path to the default virtual machine folder. This folder is used, if not explicitly specified otherwise, when creating new virtual machines."));
    8383    mPsMach->setSelectorWhatsThis (tr ("Opens a dialog to select the default virtual machine folder."));
    8484    mPsMach->setResetWhatsThis (tr ("Resets the virtual machine folder path to the default value. The actual default path will be displayed after accepting the changes and opening this dialog again."));
    8585
    86     mPsVRDP->setLineEditWhatsThis (tr ("Displays the path to the library that provides authentication for Remote Display (VRDP) clients."));
     86    mPsVRDP->setPathWhatsThis (tr ("Displays the path to the library that provides authentication for Remote Display (VRDP) clients."));
    8787    mPsVRDP->setSelectorWhatsThis (tr ("Opens a dialog to select the VRDP authentication library file."));
    8888    mPsVRDP->setResetWhatsThis (tr ("Resets the authentication library file to the default value. The actual default library file will be displayed after accepting the changes and opening this dialog again."));
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp

    r10670 r10780  
    377377
    378378    /* Path selector */
    379     mPsSnapshot->setLineEditWhatsThis (tr ("Displays the path where snapshots of this virtual machine will be stored. Note that snapshots can take quite a lot of disk space."));
     379    mPsSnapshot->setPathWhatsThis (tr ("Displays the path where snapshots of this virtual machine will be stored. Note that snapshots can take quite a lot of disk space."));
    380380    mPsSnapshot->setSelectorWhatsThis (tr ("Selects the snapshot folder path."));
    381381    mPsSnapshot->setResetWhatsThis (tr ("Resets the snapshot folder path to the default value. The actual default path will be displayed after accepting the changes and opening this dialog again."));
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