Ticket #973 (closed enhancement: obsolete)

Opened 10 years ago

Last modified 21 months ago

Supress dialog box when closing a VM Guest

Reported by: bigmudcake Owned by:
Priority: major Component: GUI
Version: VirtualBox 1.5.2 Keywords:
Cc: Guest type: other
Host type: other

Description (last modified by aeichner) (diff)

The code below is designed to achive the following

"Close the virtual machine window (or shutdown the host OS) and the virtual machine's guest OS shuts down or suspends gracefully, then the vm window closes automatically."

In other words prevent the dialog box from appearing when closing a VM session.

Here is a suggested change in the file trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp (R5923)

1199                    /* The stuck VM can only be powered off; disable anything
1200                     * else and choose PowerOff */
1201                    dlg.rbSave->setEnabled (false);
1202                    dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbPowerOff));
1203                }
1205                bool wasShutdown = false;
                    bool dialogAccepted = true;
                    QStringList suppressCloseDialog =
                           QStringList::split (',', cmachine.GetExtraData (VBoxDefs::GUI_SupressCloseDialog));
                    if (supressCloseDialog [0] != 'Yes')
                        dialogAccepted = (dlg.exec() == QDialog::Accepted);
1207                if (dialogAccepted)
1208                {
1209                    CConsole cconsole = console->console();
1211                    if (dlg.rbSave->isChecked()) 

Not sure if the code is correct as I havent done much c++ coding, but what it achieves is that if "GUI_SupressCloseDialog" is set to "Yes" then do not show the dialog box but instead close VM according to the action set in "GUI_LastCloseAction" or the default close action if its not set.

Change History

comment:1 Changed 10 years ago by frank

  • Component changed from other to GUI

comment:2 Changed 21 months ago by aeichner

  • Status changed from new to closed
  • Resolution set to obsolete
  • Description modified (diff)

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use