Opened 17 years ago
Closed 8 years ago
#973 closed enhancement (obsolete)
Supress dialog box when closing a VM Guest
Reported by: | bigmudcake | Owned by: | |
---|---|---|---|
Component: | GUI | Version: | VirtualBox 1.5.2 |
Keywords: | Cc: | ||
Guest type: | other | Host type: | other |
Description (last modified by )
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 } 1204 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); } 1206 1207 if (dialogAccepted) 1208 { 1209 CConsole cconsole = console->console(); 1210 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 (2)
comment:1 by , 16 years ago
Component: | other → GUI |
---|
comment:2 by , 8 years ago
Description: | modified (diff) |
---|---|
Resolution: | → obsolete |
Status: | new → closed |
Please reopen if still relevant with a recent VirtualBox release.