VirtualBox

Changeset 98124 in vbox for trunk/src


Ignore:
Timestamp:
Jan 19, 2023 12:07:16 AM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: Made UIIndicatorHardDrive update the tooltip on StorageDeviceChange events to account for hotplugging (USB MSDs and others), making it unhide not just hide based on fAttachmentsPresent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r98103 r98124  
    202202        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/hd_write_16px.png"));
    203203        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/hd_disabled_16px.png"));
     204        /* Configure connection: */
     205        connect(pSession, &UISession::sigStorageDeviceChange,
     206                this, &UIIndicatorHardDrive::sltStorageDeviceChange);
    204207        /* Translate finally: */
    205208        retranslateUi();
     209    }
     210
     211private slots:
     212
     213    /** Refresh the tooltip if the device config changes at runtime (hotplugging,
     214     *  USB storage). */
     215    void sltStorageDeviceChange(const CMediumAttachment &attachment, bool fRemoved, bool fSilent)
     216    {
     217        RT_NOREF(attachment, fRemoved, fSilent);
     218        updateAppearance();
    206219    }
    207220
     
    240253
    241254        /* Hide indicator if there are no attachments: */
    242         if (!fAttachmentsPresent)
    243             hide();
     255        setVisible(fAttachmentsPresent);
    244256
    245257        /* Update tool-tip: */
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