VirtualBox

Changeset 98420 in vbox for trunk


Ignore:
Timestamp:
Feb 2, 2023 9:17:27 AM (2 years ago)
Author:
vboxsync
Message:

Merging r155509 and r155510 from gui4 branch: FE/Qt: Runtime UI: Cleanup for UISession preprocess/postprocess stuff; Small cleanup for UISession power up stuff.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3:79645-79692
        21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488,155509-155510
        2222/trunk/src:92342,154921
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3/src/VBox:79645-79692
        21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488,155509-155510
  • trunk/src/VBox/Frontends

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        1717/branches/dsen/gui3/src/VBox/Frontends:79645-79692
        18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438,155441,155443,155488,155509-155510
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98404 r98420  
    11311131    m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(uMachineID);
    11321132    m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID);
    1133 
    1134     /* Log whether HID LEDs sync is enabled: */
    1135 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
    1136     LogRel(("GUI: HID LEDs sync is %s\n", isHidLedsSyncEnabled() ? "enabled" : "disabled"));
    1137 #else
    1138     LogRel(("GUI: HID LEDs sync is not supported on this platform\n"));
    1139 #endif
    11401133}
    11411134
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98419 r98420  
    162162    }
    163163
    164     /* Postprocess initialization: */
    165     if (!postprocessInitialization())
    166         return false;
    167 
    168164    /* Fetch corresponding states: */
    169165    if (uiCommon().isSeparateProcess())
     
    191187{
    192188    /* Power UP machine: */
    193     CProgress progress = uiCommon().shouldStartPaused() ? console().PowerUpPaused() : console().PowerUp();
     189    CProgress comProgress = uiCommon().shouldStartPaused() ? console().PowerUpPaused() : console().PowerUp();
    194190
    195191    /* Check for immediate failure: */
    196     if (!console().isOk() || progress.isNull())
     192    if (!console().isOk() || comProgress.isNull())
    197193    {
    198194        if (uiCommon().showStartVMErrors())
     
    203199
    204200    /* Some logging right after we powered up: */
    205     LogRel(("Qt version: %s\n", UICommon::qtRTVersionString().toUtf8().constData()));
     201    LogRel(("GUI: Qt version: %s\n", UICommon::qtRTVersionString().toUtf8().constData()));
    206202#ifdef VBOX_WS_X11
    207     LogRel(("X11 Window Manager code: %d\n", (int)uiCommon().typeOfWindowManager()));
     203    LogRel(("GUI: X11 Window Manager code: %d\n", (int)uiCommon().typeOfWindowManager()));
     204#endif
     205#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
     206    LogRel(("GUI: HID LEDs sync is %s\n", uimachine()->isHidLedsSyncEnabled() ? "enabled" : "disabled"));
     207#else
     208    LogRel(("GUI: HID LEDs sync is not supported on this platform\n"));
    208209#endif
    209210
     
    216217    if (isSaved())
    217218    {
    218         msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_state_restore_90px.png", 0, 0);
     219        msgCenter().showModalProgressDialog(comProgress, machineName(), ":/progress_state_restore_90px.png", 0, 0);
    219220        /* After restoring from 'saved' state, machine-window(s) geometry should be adjusted: */
    220221        machineLogic()->adjustMachineWindowsGeometry();
     
    223224    {
    224225#ifdef VBOX_IS_QT6_OR_LATER /** @todo why is this any problem on qt6? */
    225         msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_start_90px.png", 0, 0);
     226        msgCenter().showModalProgressDialog(comProgress, machineName(), ":/progress_start_90px.png", 0, 0);
    226227#else
    227         msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_start_90px.png");
     228        msgCenter().showModalProgressDialog(comProgress, machineName(), ":/progress_start_90px.png");
    228229#endif
    229230        /* After VM start, machine-window(s) size-hint(s) should be sent: */
     
    232233
    233234    /* Check for progress failure: */
    234     if (!progress.isOk() || progress.GetResultCode() != 0)
     235    if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    235236    {
    236237        if (uiCommon().showStartVMErrors())
    237             msgCenter().cannotStartMachine(progress, machineName());
     238            msgCenter().cannotStartMachine(comProgress, machineName());
    238239        LogRel(("GUI: Aborting startup due to power up progress issue detected...\n"));
    239240        return false;
     
    639640{
    640641#ifdef VBOX_WITH_NETFLT
    641     /* Skip further checks if VM in saved state */
    642     if (isSaved())
    643         return true;
    644 
    645     /* Make sure all the attached and enabled network
    646      * adapters are present on the host. This check makes sense
    647      * in two cases only - when attachement type is Bridged Network
    648      * or Host-only Interface. NOTE: Only currently enabled
    649      * attachement type is checked (incorrect parameters check for
    650      * currently disabled attachement types is skipped). */
    651     QStringList failedInterfaceNames;
    652     QStringList availableInterfaceNames;
    653 
    654     /* Create host network interface names list */
    655     foreach (const CHostNetworkInterface &iface, uiCommon().host().GetNetworkInterfaces())
    656     {
    657         availableInterfaceNames << iface.GetName();
    658         availableInterfaceNames << iface.GetShortName();
    659     }
    660 
    661     ulong cCount = uiCommon().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine().GetChipsetType());
    662     for (ulong uAdapterIndex = 0; uAdapterIndex < cCount; ++uAdapterIndex)
    663     {
    664         CNetworkAdapter na = machine().GetNetworkAdapter(uAdapterIndex);
    665 
    666         if (na.GetEnabled())
     642    /* Skip network interface name checks if VM in saved state: */
     643    if (!isSaved())
     644    {
     645        /* Make sure all the attached and enabled network
     646         * adapters are present on the host. This check makes sense
     647         * in two cases only - when attachement type is Bridged Network
     648         * or Host-only Interface. NOTE: Only currently enabled
     649         * attachement type is checked (incorrect parameters check for
     650         * currently disabled attachement types is skipped). */
     651        QStringList failedInterfaceNames;
     652        QStringList availableInterfaceNames;
     653
     654        /* Create host network interface names list: */
     655        foreach (const CHostNetworkInterface &comNetIface, uiCommon().host().GetNetworkInterfaces())
    667656        {
    668             QString strIfName = QString();
    669 
    670             /* Get physical network interface name for currently
    671              * enabled network attachement type */
    672             switch (na.GetAttachmentType())
     657            availableInterfaceNames << comNetIface.GetName();
     658            availableInterfaceNames << comNetIface.GetShortName();
     659        }
     660
     661        /* Enumerate all the virtual network adapters: */
     662        const ulong cCount = uiCommon().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine().GetChipsetType());
     663        for (ulong uAdapterIndex = 0; uAdapterIndex < cCount; ++uAdapterIndex)
     664        {
     665            CNetworkAdapter comNetworkAdapter = machine().GetNetworkAdapter(uAdapterIndex);
     666            if (comNetworkAdapter.GetEnabled())
    673667            {
    674                 case KNetworkAttachmentType_Bridged:
    675                     strIfName = na.GetBridgedInterface();
    676                     break;
     668                /* Get physical network interface name for
     669                 * currently enabled network attachement type: */
     670                QString strInterfaceName;
     671                switch (comNetworkAdapter.GetAttachmentType())
     672                {
     673                    case KNetworkAttachmentType_Bridged:
     674                        strInterfaceName = comNetworkAdapter.GetBridgedInterface();
     675                        break;
    677676#ifndef VBOX_WITH_VMNET
    678                 case KNetworkAttachmentType_HostOnly:
    679                     strIfName = na.GetHostOnlyInterface();
    680                     break;
     677                    case KNetworkAttachmentType_HostOnly:
     678                        strInterfaceName = comNetworkAdapter.GetHostOnlyInterface();
     679                        break;
    681680#endif /* !VBOX_WITH_VMNET */
    682                 default: break; /* Shut up, MSC! */
    683             }
    684 
    685             if (!strIfName.isEmpty() &&
    686                 !availableInterfaceNames.contains(strIfName))
    687             {
    688                 LogFlow(("Found invalid network interface: %s\n", strIfName.toStdString().c_str()));
    689                 failedInterfaceNames << QString("%1 (adapter %2)").arg(strIfName).arg(uAdapterIndex + 1);
     681                    default:
     682                        break;
     683                }
     684
     685                if (   !strInterfaceName.isEmpty()
     686                    && !availableInterfaceNames.contains(strInterfaceName))
     687                {
     688                    LogRel(("GUI: Invalid network interface found: %s\n", strInterfaceName.toUtf8().constData()));
     689                    failedInterfaceNames << QString("%1 (adapter %2)").arg(strInterfaceName).arg(uAdapterIndex + 1);
     690                }
    690691            }
    691692        }
    692     }
    693 
    694     /* Check if non-existent interfaces found */
    695     if (!failedInterfaceNames.isEmpty())
    696     {
    697         if (msgCenter().warnAboutNetworkInterfaceNotFound(machineName(), failedInterfaceNames.join(", ")))
    698             machineLogic()->openNetworkSettingsDialog();
    699         else
     693
     694        /* Check if non-existent interfaces found: */
     695        if (!failedInterfaceNames.isEmpty())
    700696        {
    701             LogRel(("GUI: Aborting startup due to preprocess initialization issue detected...\n"));
    702             return false;
     697            if (msgCenter().warnAboutNetworkInterfaceNotFound(machineName(), failedInterfaceNames.join(", ")))
     698                machineLogic()->openNetworkSettingsDialog();
     699            else
     700            {
     701                LogRel(("GUI: Aborting startup due to preprocess initialization issue detected...\n"));
     702                return false;
     703            }
    703704        }
    704705    }
     
    815816}
    816817
    817 bool UISession::postprocessInitialization()
    818 {
    819     /* There used to be some raw-mode warnings here for raw-mode incompatible
    820        guests (64-bit ones and OS/2).  Nothing to do at present. */
    821     return true;
    822 }
    823 
    824818CMediumVector UISession::machineMedia() const
    825819{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98419 r98420  
    293293    bool preprocessInitialization();
    294294    bool mountAdHocImage(KDeviceType enmDeviceType, UIMediumDeviceType enmMediumType, const QString &strMediumName);
    295     bool postprocessInitialization();
    296295    /** Loads VM settings. */
    297296    void loadVMSettings();
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