VirtualBox

Changeset 78010 in vbox for trunk/src


Ignore:
Timestamp:
Apr 4, 2019 7:27:13 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Reimplementing the bread crumbs widget.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r77932 r78010  
    207207const char *UIExtraDataDefs::GUI_GuestControl_FileManagerShowHumanReadableSizes = "ShowHumanReadableSizes";
    208208const char *UIExtraDataDefs::GUI_GuestControl_FileManagerShowHiddenObjects = "ShowHiddenObjects";
    209 const char *UIExtraDataDefs::GUI_GuestControl_FileManagerShowBreadCrumbs = "ShowBreadCrumbs";
    210209
    211210/* Virtual Machine: Close dialog: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r77932 r78010  
    383383        extern const char *GUI_GuestControl_FileManagerShowHumanReadableSizes;
    384384        extern const char *GUI_GuestControl_FileManagerShowHiddenObjects;
    385         extern const char *GUI_GuestControl_FileManagerShowBreadCrumbs;
    386385    /** @} */
    387386
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r77932 r78010  
    42744274                                               bool fShowDeleteConfirmation,
    42754275                                               bool fShowHumanReadableSizes,
    4276                                                bool fShowHiddenObjects,
    4277                                                bool fShowBreadCrumbs)
     4276                                               bool fShowHiddenObjects)
    42784277{
    42794278    /* Serialize passed values: */
     
    42884287    if (fShowHiddenObjects)
    42894288        data << GUI_GuestControl_FileManagerShowHiddenObjects;
    4290     if (fShowBreadCrumbs)
    4291         data << GUI_GuestControl_FileManagerShowBreadCrumbs;
    42924289
    42934290    /* Re-cache corresponding extra-data: */
     
    43344331    {
    43354332        if (data[i] == GUI_GuestControl_FileManagerShowHiddenObjects)
    4336             return true;
    4337     }
    4338     return false;
    4339 }
    4340 
    4341 bool UIExtraDataManager::fileManagerShowBreadCrumbs()
    4342 {
    4343     const QStringList data = extraDataStringList(GUI_GuestControl_FileManagerOptions);
    4344     for (int i = 0; i < data.size(); ++i)
    4345     {
    4346         if (data[i] == GUI_GuestControl_FileManagerShowBreadCrumbs)
    43474333            return true;
    43484334    }
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r77932 r78010  
    670670                                   bool fShowDeleteConfirmation,
    671671                                   bool fshowHumanReadableSizes,
    672                                    bool fShowHiddenObjects,
    673                                    bool fShowBreadCrumbs);
     672                                   bool fShowHiddenObjects);
    674673        bool fileManagerListDirectoriesFirst();
    675674        bool fileManagerShowDeleteConfirmation();
    676675        bool fileManagerShowHumanReadableSizes();
    677676        bool fileManagerShowHiddenObjects();
    678         bool fileManagerShowBreadCrumbs();
    679677    /** @} */
    680678
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r77932 r78010  
    9494    , fShowHumanReadableSizes(true)
    9595    , fShowHiddenObjects(true)
    96     , fShowBreadCrumbs(false)
    9796{
    9897}
     
    691690                                             pOptions->fAskDeleteConfirmation,
    692691                                             pOptions->fShowHumanReadableSizes,
    693                                              pOptions->fShowHiddenObjects,
    694                                              pOptions->fShowBreadCrumbs);
     692                                             pOptions->fShowHiddenObjects);
    695693    }
    696694}
     
    735733        pOptions->fShowHumanReadableSizes = gEDataManager->fileManagerShowHumanReadableSizes();
    736734        pOptions->fShowHiddenObjects = gEDataManager->fileManagerShowHiddenObjects();
    737         pOptions->fShowBreadCrumbs = gEDataManager->fileManagerShowBreadCrumbs();
    738735    }
    739736}
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r77932 r78010  
    6868    bool fShowHumanReadableSizes;
    6969    bool fShowHiddenObjects;
    70     bool fShowBreadCrumbs;
    7170
    7271private:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerOptionsPanel.cpp

    r77932 r78010  
    3131    , m_pHumanReabableSizesCheckBox(0)
    3232    , m_pShowHiddenObjectsCheckBox(0)
    33     , m_pShowBreadCrumbsCheckBox(0)
    3433    , m_pFileManagerOptions(pFileManagerOptions)
    3534{
     
    9796        mainLayout()->addWidget(m_pShowHiddenObjectsCheckBox, 0, Qt::AlignLeft);
    9897
    99     m_pShowBreadCrumbsCheckBox = new QCheckBox;
    100     if (m_pShowBreadCrumbsCheckBox)
    101         mainLayout()->addWidget(m_pShowBreadCrumbsCheckBox, 0, Qt::AlignLeft);
    102 
    10398    /* Set initial checkbox status wrt. options: */
    10499    if (m_pFileManagerOptions)
     
    112107        if (m_pShowHiddenObjectsCheckBox)
    113108            m_pShowHiddenObjectsCheckBox->setChecked(m_pFileManagerOptions->fShowHiddenObjects);
    114         if (m_pShowBreadCrumbsCheckBox)
    115             m_pShowBreadCrumbsCheckBox->setChecked(m_pFileManagerOptions->fShowBreadCrumbs);
    116109
    117110    }
     
    152145}
    153146
    154 void UIFileManagerOptionsPanel::sltShowBreadCrumbsCheckBoxToggled(bool bChecked)
    155 {
    156     if (!m_pFileManagerOptions)
    157         return;
    158     m_pFileManagerOptions->fShowBreadCrumbs = bChecked;
    159     emit sigOptionsChanged();
    160 }
    161 
    162147void UIFileManagerOptionsPanel::prepareConnections()
    163148{
     
    175160        connect(m_pShowHiddenObjectsCheckBox, &QCheckBox::toggled,
    176161                this, &UIFileManagerOptionsPanel::sltShowHiddenObjectsCheckBoxToggled);
    177 
    178     if (m_pShowBreadCrumbsCheckBox)
    179         connect(m_pShowBreadCrumbsCheckBox, &QCheckBox::toggled,
    180                 this, &UIFileManagerOptionsPanel::sltShowBreadCrumbsCheckBoxToggled);
    181162}
    182163
     
    209190        m_pShowHiddenObjectsCheckBox->setToolTip(UIFileManager::tr("Show hidden files/directories"));
    210191    }
    211 
    212     if (m_pShowBreadCrumbsCheckBox)
    213     {
    214         m_pShowBreadCrumbsCheckBox->setText(UIFileManager::tr("Bread crumbs instead of location widget"));
    215         m_pShowBreadCrumbsCheckBox->setToolTip(UIFileManager::tr("Bread crumbs instead of location widget"));
    216     }
    217192}
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerOptionsPanel.h

    r77932 r78010  
    6363    void sltHumanReabableSizesCheckBoxToogled(bool bChecked);
    6464    void sltShowHiddenObjectsCheckBoxToggled(bool bChecked);
    65     void sltShowBreadCrumbsCheckBoxToggled(bool bChecked);
    6665
    6766private:
     
    7170    QCheckBox  *m_pHumanReabableSizesCheckBox;
    7271    QCheckBox  *m_pShowHiddenObjectsCheckBox;
    73     QCheckBox  *m_pShowBreadCrumbsCheckBox;
    7472    UIFileManagerOptions *m_pFileManagerOptions;
    7573};
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp

    r78002 r78010  
    5151
    5252/*********************************************************************************************************************************
     53*   UIFileManagerHistoryComboBox definition.                                                                                     *
     54*********************************************************************************************************************************/
     55/** A QCombo extension used as location history list in the UIFileManagerNavigationWidget. */
     56class UIFileManagerHistoryComboBox : public QComboBox
     57{
     58    Q_OBJECT;
     59
     60signals:
     61
     62    void  sigHidePopup();
     63
     64public:
     65
     66    UIFileManagerHistoryComboBox(QWidget *pParent = 0);
     67    /** Emit sigHidePopup as the popup is hidded. */
     68    virtual void hidePopup() /* override */;
     69};
     70
     71
     72/*********************************************************************************************************************************
    5373*   UIFileManagerBreadCrumbs definition.                                                                                         *
    5474*********************************************************************************************************************************/
    55 /** A QLineEdit extension. It shows the current path as text and hightligts the folder name
     75/** A QLabel extension. It shows the current path as text and hightligts the folder name
    5676  *  as the mouse hovers over it. Clicking on the highlighted folder name make the file table tp
    5777  *  navigate to that folder. */
    58 class UIFileManagerBreadCrumbs : public QLineEdit
     78class UIFileManagerBreadCrumbs : public QLabel
    5979{
    6080    Q_OBJECT;
    6181
     82public:
     83
     84    UIFileManagerBreadCrumbs(QWidget *pParent = 0);
     85    void setPath(const QString &strPath, bool fUnderlineLast = false);
     86};
     87
     88
     89/*********************************************************************************************************************************
     90*   UIFileManagerNavigationWidget definition.                                                                                    *
     91*********************************************************************************************************************************/
     92
     93class UIFileManagerNavigationWidget : public QWidget
     94{
     95    Q_OBJECT;
     96
    6297signals:
    6398
    64     void sigNavitatePath(const QString &strPath);
     99    void sigPathChanged(const QString &strPath);
    65100
    66101public:
    67102
    68     UIFileManagerBreadCrumbs(QWidget *pParent = 0);
    69     void setPath(const QString &strPath);
    70 
    71 protected:
    72 
    73     virtual void mouseMoveEvent(QMouseEvent *pEvent) /* override */;
    74     virtual void mousePressEvent(QMouseEvent *pEvent) /* override */;
    75     virtual bool event(QEvent *pEvent) /* override */;
     103    UIFileManagerNavigationWidget(QWidget *pParent = 0);
     104    void setPath(const QString &strLocation);
     105    void reset();
     106
     107private slots:
     108
     109    void sltHandleSwitch();
     110    /* Makes sure that we switch to breadcrumbs widget as soon as the combo box popup is hidden. */
     111    void sltHandleHidePopup();
    76112
    77113private:
     114
     115    void prepare();
     116
     117    QStackedWidget *m_pContainer;
     118    UIFileManagerBreadCrumbs *m_pBreadCrumbs;
     119    UIFileManagerHistoryComboBox *m_pHistoryComboBox;
     120    QToolButton    *m_pSwitchButton;
    78121};
    79122
     
    172215
    173216/*********************************************************************************************************************************
     217*   UIFileManagerHistoryComboBox implementation.                                                                                 *
     218*********************************************************************************************************************************/
     219
     220UIFileManagerHistoryComboBox::UIFileManagerHistoryComboBox(QWidget *pParent /* = 0 */)
     221    :QComboBox(pParent)
     222{
     223
     224}
     225
     226void UIFileManagerHistoryComboBox::hidePopup()
     227{
     228    QComboBox::hidePopup();
     229    emit sigHidePopup();
     230}
     231
     232
     233/*********************************************************************************************************************************
     234*   UIFileManagerNavigationWidget implementation.                                                                                *
     235*********************************************************************************************************************************/
     236
     237UIFileManagerNavigationWidget::UIFileManagerNavigationWidget(QWidget *pParent /* = 0 */)
     238    :QWidget(pParent)
     239    , m_pContainer(0)
     240    , m_pSwitchButton(0)
     241{
     242    prepare();
     243}
     244
     245void UIFileManagerNavigationWidget::setPath(const QString &strLocation)
     246{
     247    if (m_pBreadCrumbs)
     248        m_pBreadCrumbs->setPath(strLocation);
     249
     250    if (m_pHistoryComboBox)
     251    {
     252        int itemIndex = m_pHistoryComboBox->findText(strLocation,
     253                                                      Qt::MatchExactly | Qt::MatchCaseSensitive);
     254        if (itemIndex == -1)
     255        {
     256            m_pHistoryComboBox->insertItem(m_pHistoryComboBox->count(), strLocation);
     257            itemIndex = m_pHistoryComboBox->count() - 1;
     258        }
     259        m_pHistoryComboBox->setCurrentIndex(itemIndex);
     260    }
     261}
     262
     263void UIFileManagerNavigationWidget::reset()
     264{
     265    if (m_pHistoryComboBox)
     266    {
     267        /** @todo disconnect here. */
     268        m_pHistoryComboBox->clear();
     269    }
     270}
     271
     272void UIFileManagerNavigationWidget::prepare()
     273{
     274    QHBoxLayout *pLayout = new QHBoxLayout;
     275    if (!pLayout)
     276        return;
     277    pLayout->setSpacing(0);
     278    pLayout->setContentsMargins(0, 0, 0, 0);
     279
     280    m_pContainer = new QStackedWidget;
     281
     282    if (m_pContainer)
     283    {
     284        m_pBreadCrumbs = new UIFileManagerBreadCrumbs;
     285        m_pHistoryComboBox = new UIFileManagerHistoryComboBox;
     286
     287        connect(m_pBreadCrumbs, &UIFileManagerBreadCrumbs::linkActivated,
     288                this, &UIFileManagerNavigationWidget::sigPathChanged);
     289
     290        connect(m_pHistoryComboBox, &UIFileManagerHistoryComboBox::sigHidePopup,
     291                this, &UIFileManagerNavigationWidget::sltHandleHidePopup);
     292
     293        connect(m_pHistoryComboBox, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
     294                this, &UIFileManagerNavigationWidget::sigPathChanged);
     295
     296        m_pContainer->addWidget(m_pBreadCrumbs);
     297        m_pContainer->addWidget(m_pHistoryComboBox);
     298        m_pContainer->setCurrentIndex(0);
     299
     300        pLayout->addWidget(m_pContainer);
     301    }
     302
     303    m_pSwitchButton = new QToolButton;
     304
     305    if (m_pSwitchButton)
     306    {
     307
     308        QStyle *pStyle = QApplication::style();
     309        QIcon buttonIcon;
     310        if (pStyle)
     311        {
     312            buttonIcon = pStyle->standardIcon(QStyle::SP_TitleBarUnshadeButton);
     313            m_pSwitchButton->setIcon(buttonIcon);
     314        }
     315
     316        pLayout->addWidget(m_pSwitchButton);
     317        connect(m_pSwitchButton, &QToolButton::clicked,
     318                this, &UIFileManagerNavigationWidget::sltHandleSwitch);
     319    }
     320
     321    setLayout(pLayout);
     322}
     323
     324void UIFileManagerNavigationWidget::sltHandleHidePopup()
     325{
     326    m_pContainer->setCurrentIndex(0);
     327}
     328
     329void UIFileManagerNavigationWidget::sltHandleSwitch()
     330{
     331    if (m_pContainer->currentIndex() == 0)
     332    {
     333        m_pContainer->setCurrentIndex(1);
     334        m_pHistoryComboBox->showPopup();
     335    }
     336    else
     337    {
     338        m_pContainer->setCurrentIndex(0);
     339        m_pHistoryComboBox->hidePopup();
     340    }
     341}
     342
     343
     344/*********************************************************************************************************************************
    174345*   UIFileManagerBreadCrumbs implementation.                                                                                     *
    175346*********************************************************************************************************************************/
    176347
    177348UIFileManagerBreadCrumbs::UIFileManagerBreadCrumbs(QWidget *pParent /* = 0 */)
    178     :QLineEdit(pParent)
    179 {
    180 
    181 }
    182 
    183 void UIFileManagerBreadCrumbs::setPath(const QString &strPath)
    184 {
     349    :QLabel(pParent)
     350{
     351    float fFontMult = 1.2f;
     352    QFont mFont = font();
     353    if (mFont.pixelSize() == -1)
     354        mFont.setPointSize(fFontMult * mFont.pointSize());
     355    else
     356        mFont.setPixelSize(fFontMult * mFont.pixelSize());
     357    setFont(mFont);
     358
     359}
     360
     361void UIFileManagerBreadCrumbs::setPath(const QString &strPath, bool fUnderlineLast /* = false */)
     362{
     363    const QChar separator('/');
    185364    clear();
    186     setText(strPath);
    187 }
    188 
    189 void UIFileManagerBreadCrumbs::mouseMoveEvent(QMouseEvent *pEvent)
    190 {
    191     QChar cSeparator('/');
    192     int iCharPos = this->cursorPositionAt(pEvent->pos());
    193     QString strLeft = text().left(iCharPos);
    194     int iLeftSeparator = strLeft.lastIndexOf(cSeparator);
    195     int iRightSeparator = text().indexOf(cSeparator, iLeftSeparator + 1);
    196     if (iRightSeparator == -1)
    197         iRightSeparator = text().length();
    198     /* A special case for leading sperator aka. root folder: */
    199     if (iRightSeparator == 0)
    200         setSelection(iLeftSeparator + 1, 1);
    201     else
    202         setSelection(iLeftSeparator + 1, iRightSeparator - iLeftSeparator - 1);
    203 }
    204 
    205 void UIFileManagerBreadCrumbs::mousePressEvent(QMouseEvent *pEvent)
    206 {
    207     QChar cSeparator('/');
    208     int iCharPos = this->cursorPositionAt(pEvent->pos());
    209     // QString strLeft = text().left(iCharPos);
    210     // int iLeftSeparator = strLeft.lastIndexOf(cSeparator);
    211     int iRightSeparator = text().indexOf(cSeparator, iCharPos);
    212     QString strPath;
    213     if (iRightSeparator == 0)
    214         strPath = cSeparator;
    215     else
    216         strPath = text().left(iRightSeparator);
    217     emit sigNavitatePath(strPath);
    218 }
    219 
    220 bool UIFileManagerBreadCrumbs::event(QEvent *pEvent)
    221 {
    222     if (!pEvent)
    223         return false;
    224     if (pEvent->type() == QEvent::Leave)
    225         deselect();
    226     return QLineEdit::event(pEvent);
     365    QStringList folderList = UIPathOperations::pathTrail(strPath);
     366    folderList.push_front(separator);
     367    QString strLabelText;
     368    QString strPathUpto;
     369    for (int i = 0; i < folderList.size(); ++i)
     370    {
     371        QString strFolder = UIPathOperations::removeTrailingDelimiters(folderList.at(i));
     372        if (i == 0 || i == folderList.size() - 1)
     373            strPathUpto.append(QString("%1").arg(strFolder));
     374        else
     375            strPathUpto.append(QString("%1%2").arg(strFolder).arg(separator));
     376        if (fUnderlineLast && i == folderList.size() - 1)
     377            strLabelText.append(QString("<a href=\"%1\" style=\"color:black;text-decoration:underline;\">%2</a>").arg(strPathUpto).arg(strFolder));
     378        else
     379            strLabelText.append(QString("<a href=\"%1\" style=\"color:black;text-decoration:none;\">%2</a>").arg(strPathUpto).arg(strFolder));
     380        if (i < folderList.size() - 1)
     381            strLabelText.append("<b> > </b>");
     382    }
     383    setText(strLabelText);
     384
    227385}
    228386
     
    343501    if (m_pInfoEdit)
    344502    {
    345         m_pInfoEdit->setReadOnly(true);
     503        //m_pInfoEdit->setReadOnly(true);
    346504        m_pInfoEdit->setFrameStyle(QFrame::NoFrame);
    347505    }
     
    465623    , m_pProxyModel(0)
    466624    , m_pMainLayout(0)
    467     , m_pLocationComboBox(0)
    468625    , m_pWarningLabel(0)
    469     , m_pNavigationWidgetWidget(0)
    470     , m_pBreadCrumbsWidget(0)
     626    , m_pNavigationWidget(0)
    471627{
    472628    prepareObjects();
     
    482638        m_pModel->reset();
    483639
    484     if (m_pLocationComboBox)
    485     {
    486         disconnect(m_pLocationComboBox, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
    487                    this, &UIFileManagerTable::sltLocationComboCurrentChange);
    488         m_pLocationComboBox->clear();
    489         connect(m_pLocationComboBox, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
    490                 this, &UIFileManagerTable::sltLocationComboCurrentChange);
    491     }
     640    if (m_pNavigationWidget)
     641        m_pNavigationWidget->reset();
    492642}
    493643
     
    518668    }
    519669
    520     m_pNavigationWidgetWidget = new QStackedWidget;
    521     if (m_pNavigationWidgetWidget)
    522     {
    523         m_pNavigationWidgetWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    524 
    525         m_pLocationComboBox = new QComboBox;
    526         if (m_pLocationComboBox)
    527         {
    528             m_pNavigationWidgetWidget->addWidget(m_pLocationComboBox);
    529             m_pLocationComboBox->setEditable(false);
    530             connect(m_pLocationComboBox, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
    531                     this, &UIFileManagerTable::sltLocationComboCurrentChange);
    532         }
    533 
    534         m_pBreadCrumbsWidget = new UIFileManagerBreadCrumbs;
    535         if (m_pBreadCrumbsWidget)
    536         {
    537             m_pNavigationWidgetWidget->addWidget(m_pBreadCrumbsWidget);
    538             m_pBreadCrumbsWidget->setReadOnly(true);
    539             connect(m_pBreadCrumbsWidget, &UIFileManagerBreadCrumbs::sigNavitatePath,
    540                     this, &UIFileManagerTable::sltHandleBreadCrumbsClick);
    541         }
    542         m_pMainLayout->addWidget(m_pNavigationWidgetWidget, 1, 1, 1, 4);
    543     }
    544     UIFileManagerOptions *pOptions = UIFileManagerOptions::instance();
    545     if (pOptions)
    546         showHideBreadCrumbs(pOptions->fShowBreadCrumbs);
    547     else
    548         showHideBreadCrumbs(false);
     670    m_pNavigationWidget = new UIFileManagerNavigationWidget;
     671    if (m_pNavigationWidget)
     672    {
     673        m_pNavigationWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
     674        connect(m_pNavigationWidget, &UIFileManagerNavigationWidget::sigPathChanged,
     675                this, &UIFileManagerTable::sltHandleNavigationWidgetPathChange);
     676        m_pMainLayout->addWidget(m_pNavigationWidget, 1, 1, 1, 4);
     677    }
     678
    549679    m_pModel = new UICustomFileSystemModel(this);
    550680    if (!m_pModel)
     
    618748void UIFileManagerTable::updateCurrentLocationEdit(const QString& strLocation)
    619749{
    620     if (!m_pLocationComboBox)
    621         return;
    622     int itemIndex = m_pLocationComboBox->findText(strLocation,
    623                                                   Qt::MatchExactly | Qt::MatchCaseSensitive);
    624     if (itemIndex == -1)
    625     {
    626         m_pLocationComboBox->insertItem(m_pLocationComboBox->count(), strLocation);
    627         itemIndex = m_pLocationComboBox->count() - 1;
    628     }
    629     m_pLocationComboBox->setCurrentIndex(itemIndex);
    630 
    631     if (m_pBreadCrumbsWidget)
    632     {
    633         m_pBreadCrumbsWidget->setPath(strLocation);
     750    if (m_pNavigationWidget)
     751    {
     752        m_pNavigationWidget->setPath(strLocation);
    634753    }
    635754}
     
    9701089}
    9711090
    972 void UIFileManagerTable::sltLocationComboCurrentChange(const QString &strLocation)
    973 {
    974     QString comboLocation(UIPathOperations::sanitize(strLocation));
    975     if (comboLocation == currentDirectoryPath())
    976         return;
    977     goIntoDirectory(UIPathOperations::pathTrail(comboLocation));
    978 }
    979 
    9801091void UIFileManagerTable::sltSelectAll()
    9811092{
     
    10111122}
    10121123
    1013 void UIFileManagerTable::sltHandleBreadCrumbsClick(const QString& strPath)
    1014 {
    1015     goIntoDirectory(UIPathOperations::pathTrail(strPath));
    1016 }
    1017 
    10181124void UIFileManagerTable::sltCreateFileViewContextMenu(const QPoint &point)
    10191125{
     
    10221128        return;
    10231129    createFileViewContextMenu(pSender, point);
     1130}
     1131
     1132void UIFileManagerTable::sltHandleNavigationWidgetPathChange(const QString& strPath)
     1133{
     1134    goIntoDirectory(UIPathOperations::pathTrail(strPath));
    10241135}
    10251136
     
    12931404        if (m_pModel)
    12941405            m_pModel->setShowHumanReadableSizes(pOptions->fShowHumanReadableSizes);
    1295         showHideBreadCrumbs(pOptions->fShowBreadCrumbs);
    12961406    }
    12971407    relist();
    12981408}
    1299 
    13001409
    13011410void UIFileManagerTable::sltReceiveDirectoryStatistics(UIDirectoryStatistics statistics)
     
    13801489}
    13811490
    1382 void UIFileManagerTable::showHideBreadCrumbs(bool fShow)
    1383 {
    1384     if (!m_pNavigationWidgetWidget)
    1385         return;
    1386     if (!fShow)
    1387         m_pNavigationWidgetWidget->setCurrentIndex(0);
    1388     else
    1389         m_pNavigationWidgetWidget->setCurrentIndex(1);
    1390 }
    1391 
    13921491#include "UIFileManagerTable.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h

    r77935 r78010  
    5353class UICustomFileSystemModel;
    5454class UICustomFileSystemProxyModel;
    55 class UIFileManagerBreadCrumbs;
     55class UIFileManagerNavigationWidget;
    5656class UIGuestControlFileView;
    5757class UIToolBar;
     
    254254    void sltCreateFileViewContextMenu(const QPoint &point);
    255255    void sltSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
    256     void sltLocationComboCurrentChange(const QString &strLocation);
    257256    void sltSearchTextChanged(const QString &strText);
    258257    /** m_pModel signals when an tree item is renamed. we try to apply this rename to the file system.
     
    260259     *  sltRename() for more details. */
    261260    void sltHandleItemRenameAttempt(UICustomFileSystemItem *pItem, QString strOldName, QString strNewName);
    262     void sltHandleBreadCrumbsClick(const QString& strPath);
     261    void sltHandleNavigationWidgetPathChange(const QString& strPath);
    263262
    264263private:
     
    285284     *  if deletion can continue */
    286285    bool            checkIfDeleteOK();
    287     void            showHideBreadCrumbs(bool fShow);
    288286
    289287    UICustomFileSystemModel      *m_pModel;
     
    292290
    293291    QGridLayout     *m_pMainLayout;
    294     QComboBox       *m_pLocationComboBox;
    295292    QILineEdit      *m_pSearchLineEdit;
    296293    QILabel         *m_pWarningLabel;
    297294
    298295    /** Contains m_pBreadCrumbsWidget and m_pLocationComboBox. */
    299     QStackedWidget           *m_pNavigationWidgetWidget;
    300     UIFileManagerBreadCrumbs *m_pBreadCrumbsWidget;
     296    UIFileManagerNavigationWidget           *m_pNavigationWidget;
     297    //UIFileManagerBreadCrumbs *m_pBreadCrumbsWidget;
    301298
    302299    friend class     UICustomFileSystemModel;
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