VirtualBox

Changeset 100601 in vbox


Ignore:
Timestamp:
Jul 17, 2023 12:13:50 PM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158431
Message:

FE/Qt: bugref:9080. Setting tooltips of parent items when a file object is removed.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.cpp

    r100593 r100601  
    290290}
    291291
     292void UICustomFileSystemItem::setToolTip(const QString &strToolTip)
     293{
     294    m_strToolTip = strToolTip;
     295}
     296
     297const QString &UICustomFileSystemItem::toolTip() const
     298{
     299    return m_strToolTip;
     300}
     301
    292302
    293303/*********************************************************************************************************************************
     
    500510            else
    501511                return QIcon(":/file_manager_folder_16px.png");
    502 
    503512        }
    504513        else if (item->isFile())
     
    521530    if (role == Qt::ToolTipRole)
    522531    {
    523         return QString(item->path());
     532        if (!item->toolTip().isEmpty())
     533            return QString(item->toolTip());
    524534    }
    525535    return QVariant();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.h

    r100539 r100601  
    119119    bool isRemovedFromViso() const;
    120120
     121    void setToolTip(const QString &strToolTip);
     122    const QString &toolTip() const;
     123
    121124private:
    122125
     
    135138    /** True if the file object is hidden in the file system. */
    136139    bool             m_fIsHidden;
     140    QString          m_strToolTip;
    137141};
    138142
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp

    r100593 r100601  
    521521            createVisoEntry(pItem->path(), pItem->data(UICustomFileSystemModelData_LocalPath).toString(), true /* bool bRemove */);
    522522
    523         pItem->setRemovedFromViso(true);
     523        markRemovedUnremovedItemParents(pItem, true);
    524524    }
    525525    if (m_pTableProxyModel)
     
    527527}
    528528
     529void UIVisoContentBrowser::markRemovedUnremovedItemParents(UICustomFileSystemItem *pItem, bool fRemoved)
     530{
     531    Q_UNUSED(fRemoved);
     532    pItem->setRemovedFromViso(true);
     533    UICustomFileSystemItem *pParent = pItem->parentItem();
     534    while (pParent)
     535    {
     536        pParent->setToolTip(QApplication::translate("UIVisoCreatorWidget", "Child/children removed"));
     537        pParent = pParent->parentItem();
     538    }
     539}
    529540
    530541void UIVisoContentBrowser::restoreItems(const QList<UICustomFileSystemItem*> itemList)
     
    905916void UIVisoContentBrowser::processRemovedEntries(const QStringList &removedEntries)
    906917{
     918    QList<UICustomFileSystemItem*> itemList;
    907919    foreach (const QString &strPath, removedEntries)
    908920    {
     
    910922        UICustomFileSystemItem *pItem = searchItemByPath(strPath);
    911923        if (pItem)
    912         {
    913             pItem->setRemovedFromViso(true);
    914             createVisoEntry(strPath,  QString(), true);
    915         }
    916     }
     924            itemList << pItem;
     925    }
     926    removeItems(itemList);
    917927}
    918928
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h

    r100583 r100601  
    146146    void                           processRemovedEntries(const QStringList &removedEntries);
    147147    const UICustomFileSystemItem*  currentDirectoryItem() const;
     148    void                           markRemovedUnremovedItemParents(UICustomFileSystemItem *pItem, bool fRemoved);
    148149    UIVisoContentTableView        *m_pTableView;
    149150    UICustomFileSystemModel       *m_pModel;
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