VirtualBox

Changeset 76825 in vbox for trunk


Ignore:
Timestamp:
Jan 15, 2019 12:42:06 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128175
Message:

FE/Qt: bugref:9049: Wipe out VBoxGlobal::isVMConsoleProcess, there is better suitable stuff.

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

Legend:

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

    r76626 r76825  
    46994699    {
    47004700        /* Current VM only: */
    4701         if (   vboxGlobal().isVMConsoleProcess()
     4701        if (   vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI
    47024702            && uMachineID == vboxGlobal().managedVMUuid())
    47034703        {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r76606 r76825  
    29012901    if (!strAutoConfirmId.isEmpty())
    29022902    {
    2903         const QUuid uID = vboxGlobal().isVMConsoleProcess() ? vboxGlobal().managedVMUuid() : UIExtraDataManager::GlobalID;
     2903        const QUuid uID = vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI
     2904                        ? vboxGlobal().managedVMUuid()
     2905                        : UIExtraDataManager::GlobalID;
    29042906        confirmedMessageList = gEDataManager->suppressedMessages(uID);
    29052907        if (   confirmedMessageList.contains(strAutoConfirmId)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.cpp

    r76818 r76825  
    112112#ifndef VBOX_RUNTIME_UI
    113113
    114     /* Show Selector UI: */
    115     if (!vboxGlobal().isVMConsoleProcess())
     114    /* Make sure Selector UI is permitted, quit if not: */
     115    if (gEDataManager->guiFeatureEnabled(GUIFeatureType_NoSelector))
    116116    {
    117         /* Make sure Selector UI is permitted, quit if not: */
    118         if (gEDataManager->guiFeatureEnabled(GUIFeatureType_NoSelector))
    119         {
    120             msgCenter().cannotStartSelector();
    121             return QApplication::quit();
    122         }
     117        msgCenter().cannotStartSelector();
     118        return QApplication::quit();
     119    }
    123120
    124         /* Create/show manager-window: */
    125         UIVirtualBoxManager::create();
     121    /* Create/show manager-window: */
     122    UIVirtualBoxManager::create();
    126123
    127124# ifdef VBOX_BLEEDING_EDGE
    128         /* Show EXPERIMENTAL BUILD warning: */
    129         msgCenter().showExperimentalBuildWarning();
     125    /* Show EXPERIMENTAL BUILD warning: */
     126    msgCenter().showExperimentalBuildWarning();
    130127# else /* !VBOX_BLEEDING_EDGE */
    131128#  ifndef DEBUG
    132         /* Show BETA warning if necessary: */
    133         const QString vboxVersion(vboxGlobal().virtualBox().GetVersion());
    134         if (   vboxVersion.contains("BETA")
    135             && gEDataManager->preventBetaBuildWarningForVersion() != vboxVersion)
    136             msgCenter().showBetaBuildWarning();
     129    /* Show BETA warning if necessary: */
     130    const QString vboxVersion(vboxGlobal().virtualBox().GetVersion());
     131    if (   vboxVersion.contains("BETA")
     132        && gEDataManager->preventBetaBuildWarningForVersion() != vboxVersion)
     133        msgCenter().showBetaBuildWarning();
    137134#  endif /* !DEBUG */
    138135# endif /* !VBOX_BLEEDING_EDGE */
    139     }
    140136
    141137#else /* VBOX_RUNTIME_UI */
    142138
    143     /* Show Runtime UI: */
    144     if (vboxGlobal().isVMConsoleProcess())
    145     {
    146         /* Make sure machine is started, quit if not: */
    147         if (!UIMachine::startMachine(vboxGlobal().managedVMUuid()))
    148             return QApplication::quit();
    149     }
    150     /* Show the error message otherwise and quit: */
    151     else
     139    /* Make sure Runtime UI is even possible, quit if not: */
     140    if (vboxGlobal().managedVMUuid().isNull())
    152141    {
    153142        msgCenter().cannotStartRuntime();
    154143        return QApplication::quit();
    155144    }
     145
     146    /* Make sure machine is started, quit if not: */
     147    if (!UIMachine::startMachine(vboxGlobal().managedVMUuid()))
     148        return QApplication::quit();
    156149
    157150#endif /* VBOX_RUNTIME_UI */
     
    198191
    199192#ifdef VBOX_RUNTIME_UI
    200     /* For VM process: */
    201     if (vboxGlobal().isVMConsoleProcess())
    202     {
    203         /* Temporary override the default close action to 'SaveState' if necessary: */
    204         if (gpMachine->uisession()->defaultCloseAction() == MachineCloseAction_Invalid)
    205             gpMachine->uisession()->setDefaultCloseAction(MachineCloseAction_SaveState);
    206     }
     193    /* Temporary override the default close action to 'SaveState' if necessary: */
     194    if (gpMachine->uisession()->defaultCloseAction() == MachineCloseAction_Invalid)
     195        gpMachine->uisession()->setDefaultCloseAction(MachineCloseAction_SaveState);
    207196#endif
    208197}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r76818 r76825  
    22392239        && comMachine.CanShowConsoleWindow())
    22402240    {
    2241         /* For the Selector UI: */
    2242         if (!isVMConsoleProcess())
    2243         {
    2244             /* Just switch to existing VM window: */
    2245             return switchToMachine(comMachine);
    2246         }
    2247         /* For the Runtime UI: */
    2248         else
    2249         {
    2250             /* Only separate UI process can reach that place,
    2251              * switch to existing VM window and exit. */
    2252             switchToMachine(comMachine);
    2253             return false;
     2241        switch (uiType())
     2242        {
     2243            /* For Selector UI: */
     2244            case UIType_SelectorUI:
     2245            {
     2246                /* Just switch to existing VM window: */
     2247                return switchToMachine(comMachine);
     2248            }
     2249            /* For Runtime UI: */
     2250            case UIType_RuntimeUI:
     2251            {
     2252                /* Only separate UI process can reach that place.
     2253                 * Switch to existing VM window and exit. */
     2254                switchToMachine(comMachine);
     2255                return false;
     2256            }
    22542257        }
    22552258    }
     
    30173020        comMachine = comSession.GetMachine();
    30183021    }
    3019     /* Is it Selector UI call? */
    3020     else if (!isVMConsoleProcess())
     3022    /* Is this a Selector UI call? */
     3023    else if (uiType() == UIType_SelectorUI)
    30213024    {
    30223025        /* Open existing 'shared' session: */
     
    41234126    }
    41244127
    4125     /* After initializing *m_strManagedVMId* we already know if that is VM process or not: */
    4126     if (!isVMConsoleProcess())
     4128    /* For Selector UI: */
     4129    if (uiType() == UIType_SelectorUI)
    41274130    {
    41284131        /* We should create separate logging file for VM selector: */
     
    41554158
    41564159#ifdef VBOX_WITH_DEBUGGER_GUI
    4157     /* Setup the debugger gui if VM console process: */
    4158     if (isVMConsoleProcess())
    4159     {
     4160    /* For Runtime UI: */
     4161    if (uiType() == UIType_RuntimeUI)
     4162    {
     4163        /* Setup the debugger GUI: */
    41604164        if (RTEnvExist("VBOX_GUI_NO_DEBUGGER"))
    41614165            m_fDbgEnabled = m_fDbgAutoShow =  m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = false;
     
    43554359            comWrappersReinit();
    43564360
    4357             /* If that is Selector UI: */
    4358             if (!isVMConsoleProcess())
     4361            /* For Selector UI: */
     4362            if (uiType() == UIType_SelectorUI)
    43594363            {
    43604364                /* Recreate Main event listeners: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r76818 r76825  
    206206        /** Returns the --startvm option value (managed VM id). */
    207207        QUuid managedVMUuid() const { return m_strManagedVMId; }
    208         /** Returns whether this is VM console process. */
    209         bool isVMConsoleProcess() const { return !m_strManagedVMId.isNull(); }
    210208        /** Returns the --separate option value (whether GUI process is separate from VM process). */
    211209        bool isSeparateProcess() const { return m_fSeparateProcess; }
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp

    r76606 r76825  
    6565{
    6666    /* For Selector UI only: */
    67     AssertReturn(!vboxGlobal().isVMConsoleProcess(), 0);
     67    AssertReturn(vboxGlobal().uiType() == VBoxGlobal::UIType_SelectorUI, 0);
    6868
    6969    /* Create network-manager state-indicator: */
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r76606 r76825  
    528528
    529529#ifdef VBOX_WITH_UPDATE_REQUEST
    530     /* Ask updater to check for the first time: */
    531     if (gEDataManager->applicationUpdateEnabled() && !vboxGlobal().isVMConsoleProcess())
     530    /* Ask updater to check for the first time, for Selector UI only: */
     531    if (gEDataManager->applicationUpdateEnabled() && vboxGlobal().uiType() == VBoxGlobal::UIType_SelectorUI)
    532532        QTimer::singleShot(0, this, SLOT(sltCheckIfUpdateIsNecessary()));
    533533#endif /* VBOX_WITH_UPDATE_REQUEST */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r76606 r76825  
    11411141
    11421142        /* In the VM process we start by displaying the Runtime UI tab: */
    1143         if (VBoxGlobal::instance()->isVMConsoleProcess())
     1143        if (vboxGlobal().uiType() == VBoxGlobal::UIType_RuntimeUI)
    11441144            m_pTabWidget->setCurrentWidget(pMachineTab);
    11451145    }
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