VirtualBox

Changeset 88244 in vbox


Ignore:
Timestamp:
Mar 22, 2021 12:49:49 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI / Machine-window: Annoying assertion on VM shutdown/poweroff, let's convert it to a message-box when possible or ignore otherwise.

File:
1 edited

Legend:

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

    r87720 r88244  
    572572        strMachineName += " - " + (strUserProductName.isEmpty() ? defaultWindowTitle() : strUserProductName);
    573573#endif /* !VBOX_WS_MAC */
    574         if (machine().GetGraphicsAdapter().GetMonitorCount() > 1)
    575             strMachineName += QString(" : %1").arg(m_uScreenId + 1);
     574        /* Check if we can get graphics adapter: */
     575        CGraphicsAdapter comAdapter = machine().GetGraphicsAdapter();
     576        if (!machine().isOk())
     577        {
     578            // What can I say, we really want to notify user about this
     579            // one, but if that happens on VM shutdown/poweroff there
     580            // will no be a chance to do it, cause application got exited.
     581            msgCenter().cannotAcquireMachineParameter(machine());
     582        }
     583        else
     584        {
     585            /* Append screen number only if there are more than one present: */
     586            if (comAdapter.GetMonitorCount() > 1)
     587                strMachineName += QString(" : %1").arg(m_uScreenId + 1);
     588        }
    576589        setWindowTitle(strMachineName);
    577590    }
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