Changeset 4297 in vbox
- Timestamp:
- Aug 22, 2007 8:49:37 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 23820
- Location:
- trunk/src/VBox
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r4202 r4297 185 185 QPopupMenu *mMainMenu; 186 186 187 QActionGroup *runningActions; 187 QActionGroup *mRunningActions; 188 QActionGroup *mRunningOrPausedActions; 188 189 189 190 // Machine actions … … 231 232 QPopupMenu *devicesMountFloppyMenu; 232 233 QPopupMenu *devicesMountDVDMenu; 233 QPopupMenu *devicesS haredFolders;234 QPopupMenu *devicesSFMenu; 234 235 QPopupMenu *devicesNetworkMenu; 235 236 VBoxUSBMenu *devicesUSBMenu; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r4166 r4297 217 217 void remindAboutWrongColorDepth (ulong aRealBPP, ulong aWantedBPP); 218 218 219 bool remindAboutGuruMeditation (const CConsole &aConsole, 220 const QString &aLogFolder); 221 219 222 int remindAboutUnsetHD (QWidget *aParent); 220 223 -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ar.ts
r3829 r4297 495 495 </message> 496 496 <message> 497 <source>&Shared Folders </source>497 <source>&Shared Folders...</source> 498 498 <translation type="unfinished"></translation> 499 499 </message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts
r4205 r4297 453 453 </message> 454 454 <message> 455 <source>&Shared Folders </source>456 <translation>&Gemeinsame Ordner </translation>455 <source>&Shared Folders...</source> 456 <translation>&Gemeinsame Ordner...</translation> 457 457 </message> 458 458 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_es.ts
r3918 r4297 484 484 </message> 485 485 <message> 486 <source>&Shared Folders </source>487 <translation>&Directorios Compartidos </translation>486 <source>&Shared Folders...</source> 487 <translation>&Directorios Compartidos...</translation> 488 488 </message> 489 489 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fi.ts
r3829 r4297 456 456 </message> 457 457 <message> 458 <source>&Shared Folders </source>459 <translation>&Jaetut Kansiot </translation>458 <source>&Shared Folders...</source> 459 <translation>&Jaetut Kansiot...</translation> 460 460 </message> 461 461 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fr.ts
r3829 r4297 484 484 </message> 485 485 <message> 486 <source>&Shared Folders </source>487 <translation>Répertoire&s partagés </translation>486 <source>&Shared Folders...</source> 487 <translation>Répertoire&s partagés...</translation> 488 488 </message> 489 489 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts
r3829 r4297 461 461 </message> 462 462 <message> 463 <source>&Shared Folders </source>464 <translation>&Osztott mappák </translation>463 <source>&Shared Folders...</source> 464 <translation>&Osztott mappák...</translation> 465 465 </message> 466 466 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_it.ts
r3829 r4297 484 484 </message> 485 485 <message> 486 <source>&Shared Folders </source>487 <translation>Cartelle Condivi&se </translation>486 <source>&Shared Folders...</source> 487 <translation>Cartelle Condivi&se...</translation> 488 488 </message> 489 489 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ja.ts
r3829 r4297 456 456 </message> 457 457 <message> 458 <source>&Shared Folders </source>459 <translation>共有フォルダ(&S) </translation>458 <source>&Shared Folders...</source> 459 <translation>共有フォルダ(&S)...</translation> 460 460 </message> 461 461 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ko.ts
r3829 r4297 457 457 </message> 458 458 <message> 459 <source>&Shared Folders </source>460 <translation>공유 폴더(&S) </translation>459 <source>&Shared Folders...</source> 460 <translation>공유 폴더(&S)...</translation> 461 461 </message> 462 462 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pl.ts
r4139 r4297 457 457 </message> 458 458 <message> 459 <source>&Shared Folders </source>460 <translation>Udo&stępnione foldery </translation>459 <source>&Shared Folders...</source> 460 <translation>Udo&stępnione foldery...</translation> 461 461 </message> 462 462 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt_BR.ts
r3829 r4297 457 457 </message> 458 458 <message> 459 <source>&Shared Folders </source>460 <translation>Pastas Compartilhada&s </translation>459 <source>&Shared Folders...</source> 460 <translation>Pastas Compartilhada&s...</translation> 461 461 </message> 462 462 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ro.ts
r3829 r4297 484 484 </message> 485 485 <message> 486 <source>&Shared Folders </source>487 <translation>Directoare &partajate </translation>486 <source>&Shared Folders...</source> 487 <translation>Directoare &partajate...</translation> 488 488 </message> 489 489 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ru.ts
r4118 r4297 457 457 </message> 458 458 <message> 459 <source>&Shared Folders </source>460 <translation>О&бщие папки </translation>459 <source>&Shared Folders...</source> 460 <translation>О&бщие папки...</translation> 461 461 </message> 462 462 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sv.ts
r3829 r4297 457 457 </message> 458 458 <message> 459 <source>&Shared Folders </source>460 <translation>&Delade mappar </translation>459 <source>&Shared Folders...</source> 460 <translation>&Delade mappar...</translation> 461 461 </message> 462 462 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_xx_YY.ts
r3829 r4297 456 456 </message> 457 457 <message> 458 <source>&Shared Folders </source>458 <source>&Shared Folders...</source> 459 459 <translation type="unfinished"></translation> 460 460 </message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_CN.ts
r3829 r4297 484 484 </message> 485 485 <message> 486 <source>&Shared Folders </source>487 <translation>共享文件夹(&S) </translation>486 <source>&Shared Folders...</source> 487 <translation>共享文件夹(&S)...</translation> 488 488 </message> 489 489 <message> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_TW.ts
r3829 r4297 764 764 </message> 765 765 <message> 766 <source>&Shared Folders </source>767 <translation>分享資料夾(&S) </translation>766 <source>&Shared Folders...</source> 767 <translation>分享資料夾(&S)…</translation> 768 768 </message> 769 769 <message> -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r4255 r4297 2485 2485 } 2486 2486 } 2487 /* fall through */ 2488 } 2489 case CEnums::Stuck: 2490 { 2487 2491 /* reuse the focus event handler to uncapture everything */ 2488 2492 if (hasFocus()) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r4203 r4297 33 33 #include <qbuttongroup.h> 34 34 #include <qradiobutton.h> 35 #include <qfile.h> 35 36 #include <qdir.h> 36 37 #include <qpushbutton.h> … … 141 142 ///// Actions /////////////////////////////////////////////////////////// 142 143 143 /* 144 * a group for all actions that are enabled only when the VM is running. 145 * note that only actions whose enabled state depends exclusively on the 146 * running state of the VM are added to this group. 147 */ 148 runningActions = new QActionGroup (this); 149 runningActions->setExclusive (false); 144 /* a group for all actions that are enabled only when the VM is running. 145 * Note that only actions whose enabled state depends exclusively on the 146 * execution state of the VM are added to this group. */ 147 mRunningActions = new QActionGroup (this); 148 mRunningActions->setExclusive (false); 149 150 /* a group for all actions that are enabled when the VM is running or 151 * paused. Note that only actions whose enabled state depends exclusively 152 * on the execution state of the VM are added to this group. */ 153 mRunningOrPausedActions = new QActionGroup (this); 154 mRunningOrPausedActions->setExclusive (false); 150 155 151 156 /* VM menu actions */ … … 161 166 vmSeamlessAction->setToggleAction (true); 162 167 163 vmAutoresizeGuestAction = new QAction ( runningActions, "vmAutoresizeGuestAction");168 vmAutoresizeGuestAction = new QAction (mRunningActions, "vmAutoresizeGuestAction"); 164 169 vmAutoresizeGuestAction->setIconSet ( 165 170 VBoxGlobal::iconSet ("auto_resize_on_16px.png", "auto_resize_on_disabled_16px.png")); … … 172 177 "adjust_win_size_disabled_16px.png")); 173 178 174 vmTypeCADAction = new QAction ( runningActions, "vmTypeCADAction");179 vmTypeCADAction = new QAction (mRunningActions, "vmTypeCADAction"); 175 180 vmTypeCADAction->setIconSet (VBoxGlobal::iconSet ("hostkey_16px.png", 176 181 "hostkey_disabled_16px.png")); 177 182 178 183 #if defined(Q_WS_X11) 179 vmTypeCABSAction = new QAction ( runningActions, "vmTypeCABSAction");184 vmTypeCABSAction = new QAction (mRunningActions, "vmTypeCABSAction"); 180 185 vmTypeCABSAction->setIconSet (VBoxGlobal::iconSet ("hostkey_16px.png", 181 186 "hostkey_disabled_16px.png")); 182 187 #endif 183 188 184 vmResetAction = new QAction ( runningActions, "vmResetAction");189 vmResetAction = new QAction (mRunningActions, "vmResetAction"); 185 190 vmResetAction->setIconSet (VBoxGlobal::iconSet ("reset_16px.png", 186 "reset_disabled_16px.png"));187 188 vmPauseAction = new QAction ( this, "vmPauseAction");191 "reset_disabled_16px.png")); 192 193 vmPauseAction = new QAction (this, "vmPauseAction"); 189 194 vmPauseAction->setIconSet (VBoxGlobal::iconSet ("pause_16px.png")); 190 vmPauseAction->setToggleAction ( true);191 192 vmACPIShutdownAction = new QAction ( this, "vmACPIShutdownAction");195 vmPauseAction->setToggleAction (true); 196 197 vmACPIShutdownAction = new QAction (mRunningActions, "vmACPIShutdownAction"); 193 198 vmACPIShutdownAction->setIconSet ( 194 199 VBoxGlobal::iconSet ("acpi_16px.png", "acpi_disabled_16px.png")); … … 197 202 vmCloseAction->setIconSet (VBoxGlobal::iconSet ("exit_16px.png")); 198 203 199 vmTakeSnapshotAction = new QAction ( this, "vmTakeSnapshotAction");204 vmTakeSnapshotAction = new QAction (mRunningOrPausedActions, "vmTakeSnapshotAction"); 200 205 vmTakeSnapshotAction->setIconSet (VBoxGlobal::iconSet ( 201 206 "take_snapshot_16px.png", "take_snapshot_dis_16px.png")); … … 208 213 /* Devices menu actions */ 209 214 210 devicesMountFloppyImageAction = new QAction (runningActions, "devicesMountFloppyImageAction"); 215 devicesMountFloppyImageAction = new QAction (mRunningOrPausedActions, 216 "devicesMountFloppyImageAction"); 211 217 212 218 devicesUnmountFloppyAction = new QAction (this, "devicesUnmountFloppyAction"); 213 219 devicesUnmountFloppyAction->setIconSet (VBoxGlobal::iconSet ("fd_unmount_16px.png", 214 "fd_unmount_dis_16px.png")); 215 216 devicesMountDVDImageAction = new QAction (runningActions, "devicesMountISOImageAction"); 220 "fd_unmount_dis_16px.png")); 221 222 devicesMountDVDImageAction = new QAction (mRunningOrPausedActions, 223 "devicesMountISOImageAction"); 217 224 218 225 devicesUnmountDVDAction = new QAction (this, "devicesUnmountDVDAction"); … … 220 227 "cd_unmount_dis_16px.png")); 221 228 222 devicesSFDialogAction = new QAction (runningActions, "devicesSFDialogAction"); 229 devicesSFDialogAction = new QAction (mRunningOrPausedActions, 230 "devicesSFDialogAction"); 223 231 devicesSFDialogAction->setIconSet (VBoxGlobal::iconSet ("shared_folder_16px.png", 224 232 "shared_folder_disabled_16px.png")); 225 233 226 devicesSwitchVrdpAction = new QAction (runningActions, "devicesSwitchVrdpAction"); 234 devicesSwitchVrdpAction = new QAction (mRunningOrPausedActions, 235 "devicesSwitchVrdpAction"); 227 236 devicesSwitchVrdpAction->setIconSet (VBoxGlobal::iconSet ("vrdp_16px.png", 228 237 "vrdp_disabled_16px.png")); 229 238 devicesSwitchVrdpAction->setToggleAction (true); 230 239 231 devicesInstallGuestToolsAction = new QAction (runningActions, "devicesInstallGuestToolsAction"); 240 devicesInstallGuestToolsAction = new QAction (mRunningActions, 241 "devicesInstallGuestToolsAction"); 232 242 devicesInstallGuestToolsAction->setIconSet (VBoxGlobal::iconSet ("guesttools_16px.png", 233 243 "guesttools_disabled_16px.png")); … … 248 258 /* Help menu actions */ 249 259 250 helpWebAction = new QAction ( this, "helpWebAction");260 helpWebAction = new QAction (this, "helpWebAction"); 251 261 helpWebAction->setIconSet (VBoxGlobal::iconSet ("site_16px.png")); 252 helpAboutAction = new QAction ( this, "helpAboutAction");262 helpAboutAction = new QAction (this, "helpAboutAction"); 253 263 helpAboutAction->setIconSet (VBoxGlobal::iconSet ("about_16px.png")); 254 helpResetMessagesAction = new QAction ( this, "helpResetMessagesAction");264 helpResetMessagesAction = new QAction (this, "helpResetMessagesAction"); 255 265 helpResetMessagesAction->setIconSet (VBoxGlobal::iconSet ("reset_16px.png")); 256 266 … … 298 308 devicesMountFloppyMenu = new QPopupMenu (devicesMenu, "devicesMountFloppyMenu"); 299 309 devicesMountDVDMenu = new QPopupMenu (devicesMenu, "devicesMountDVDMenu"); 300 devicesS haredFolders = new QPopupMenu (devicesMenu, "devicesSharedFolders");310 devicesSFMenu = new QPopupMenu (devicesMenu, "devicesSFMenu"); 301 311 devicesNetworkMenu = new QPopupMenu (devicesMenu, "devicesNetworkMenu"); 302 312 devicesUSBMenu = new VBoxUSBMenu (devicesMenu); … … 307 317 devicesUnmountDVDAction->addTo (devicesMenu); 308 318 devicesMenu->insertSeparator(); 319 309 320 devicesMenu->insertItem (VBoxGlobal::iconSet ("fd_16px.png", "fd_disabled_16px.png"), 310 321 QString::null, devicesMountFloppyMenu, devicesMountFloppyMenuId); 311 322 devicesUnmountFloppyAction->addTo (devicesMenu); 312 323 devicesMenu->insertSeparator(); 324 313 325 devicesMenu->insertItem (VBoxGlobal::iconSet ("usb_16px.png", "usb_disabled_16px.png"), 314 326 QString::null, devicesUSBMenu, devicesUSBMenuId); 315 327 devicesUSBMenuSeparatorId = devicesMenu->insertSeparator(); 328 316 329 devicesSFDialogAction->addTo (devicesMenu); 317 330 devicesSFMenuSeparatorId = devicesMenu->insertSeparator(); 331 devicesSFDialogAction->addTo (devicesSFMenu); 332 318 333 devicesMenu->insertItem (VBoxGlobal::iconSet ("nw_16px.png", "nw_disabled_16px.png"), 319 334 QString::null, devicesNetworkMenu, devicesNetworkMenuId); 320 335 devicesMenu->insertSeparator(); 336 321 337 devicesSwitchVrdpAction->addTo (devicesMenu); 322 338 devicesVRDPMenuSeparatorId = devicesMenu->insertSeparator(); 339 323 340 devicesInstallGuestToolsAction->addTo (devicesMenu); 324 341 … … 477 494 connect (devicesMountDVDMenu, SIGNAL(activated(int)), this, SLOT(captureDVD(int))); 478 495 connect (devicesUSBMenu, SIGNAL(activated(int)), this, SLOT(switchUSB(int))); 479 connect (devicesSharedFolders, SIGNAL(activated(int)), this, SLOT(devicesOpenSFDialog()));480 496 connect (devicesNetworkMenu, SIGNAL(activated(int)), this, SLOT(activateNetworkMenu(int))); 481 497 … … 1061 1077 } 1062 1078 1063 if (machine_state > CEnums::Paused) 1079 if (machine_state > CEnums::Paused && 1080 machine_state != CEnums::Stuck) 1064 1081 { 1065 1082 /* … … 1091 1108 bool success = true; 1092 1109 1093 bool wasPaused = machine_state == CEnums::Paused; 1110 bool wasPaused = machine_state == CEnums::Paused || 1111 machine_state == CEnums::Stuck; 1094 1112 if (!wasPaused) 1095 1113 { … … 1108 1126 dlg.pmIcon->setPixmap (vboxGlobal().vmGuestOSTypeIcon (typeId)); 1109 1127 1110 /* read the last user's choice for the given VM */1111 QStringList lastAction = QStringList::split (',',1112 cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction));1113 AssertWrapperOk (cmachine);1114 if (lastAction [0] == PowerOff)1115 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbPowerOff));1116 else if (lastAction [0] == Save)1117 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbSave));1118 else1119 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbPowerOff));1120 dlg.cbDiscardCurState->setChecked (1121 lastAction.count() > 1 && lastAction [1] == DiscardCurState);1122 1123 1128 /* make the Discard checkbox invisible if there are no snapshots */ 1124 1129 dlg.cbDiscardCurState->setShown ((cmachine.GetSnapshotCount() > 0)); 1130 1131 if (machine_state != CEnums::Stuck) 1132 { 1133 /* read the last user's choice for the given VM */ 1134 QStringList lastAction = QStringList::split (',', 1135 cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction)); 1136 AssertWrapperOk (cmachine); 1137 if (lastAction [0] == PowerOff) 1138 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbPowerOff)); 1139 else if (lastAction [0] == Save) 1140 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbSave)); 1141 else 1142 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbPowerOff)); 1143 dlg.cbDiscardCurState->setChecked ( 1144 lastAction.count() > 1 && lastAction [1] == DiscardCurState); 1145 } 1146 else 1147 { 1148 /* The stuck VM can only be powered off; disable anything 1149 * else and choose PowerOff */ 1150 dlg.rbSave->setEnabled (false); 1151 dlg.buttonGroup->setButton (dlg.buttonGroup->id (dlg.rbPowerOff)); 1152 } 1125 1153 1126 1154 if (dlg.exec() == QDialog::Accepted) … … 1359 1387 tr ("Enable or disable remote desktop (RDP) connections to this machine")); 1360 1388 1361 devicesSharedFolders->insertItem (tr ("Open")); 1362 devicesSFDialogAction->setMenuText (tr ("&Shared Folders")); 1389 devicesSFDialogAction->setMenuText (tr ("&Shared Folders...")); 1363 1390 devicesSFDialogAction->setStatusTip ( 1364 1391 tr ("Open the dialog to operate on shared folders")); … … 1452 1479 CConsole cconsole = console->console(); 1453 1480 1481 bool isRunningOrPaused = machine_state == CEnums::Running || 1482 machine_state == CEnums::Paused; 1483 1454 1484 if (element & Caption) 1455 1485 { … … 1466 1496 if (element & FloppyStuff) 1467 1497 { 1468 devicesMountFloppyMenu->setEnabled ( machine_state == CEnums::Running);1498 devicesMountFloppyMenu->setEnabled (isRunningOrPaused); 1469 1499 CFloppyDrive floppy = cmachine.GetFloppyDrive(); 1470 1500 CEnums::DriveState state = floppy.GetState(); 1471 1501 bool mounted = state != CEnums::NotMounted; 1472 devicesUnmountFloppyAction->setEnabled ( machine_state == CEnums::Running&& mounted);1502 devicesUnmountFloppyAction->setEnabled (isRunningOrPaused && mounted); 1473 1503 fd_light->setState (mounted ? CEnums::DeviceIdle : CEnums::InvalidActivity); 1474 1504 QString tip = tr ("<qt><nobr>Indicates the activity of the floppy media:</nobr>" … … 1510 1540 if (element & DVDStuff) 1511 1541 { 1512 devicesMountDVDMenu->setEnabled ( machine_state == CEnums::Running);1542 devicesMountDVDMenu->setEnabled (isRunningOrPaused); 1513 1543 CDVDDrive dvd = cmachine.GetDVDDrive(); 1514 1544 CEnums::DriveState state = dvd.GetState(); 1515 1545 bool mounted = state != CEnums::NotMounted; 1516 devicesUnmountDVDAction->setEnabled ( machine_state == CEnums::Running&& mounted);1546 devicesUnmountDVDAction->setEnabled (isRunningOrPaused && mounted); 1517 1547 cd_light->setState (mounted ? CEnums::DeviceIdle : CEnums::InvalidActivity); 1518 1548 QString tip = tr ("<qt><nobr>Indicates the activity of the CD/DVD-ROM media:</nobr>" … … 1586 1616 count++; 1587 1617 net_light->setState (count > 0 ? CEnums::DeviceIdle 1588 : CEnums::InvalidActivity); 1618 : CEnums::InvalidActivity); 1619 1620 devicesNetworkMenu->setEnabled (isRunningOrPaused && count > 0); 1589 1621 1590 1622 /* update tooltip */ … … 1616 1648 if (element & USBStuff) 1617 1649 { 1618 /// @todo (r=dmik) do we really need to disable the control while1619 // in Pause? Check the same for CD/DVD above.1620 1650 if (!usb_light->isHidden()) 1621 1651 { 1622 devicesUSBMenu->setEnabled (machine_state == CEnums::Running);1623 1624 1652 /* update tooltip */ 1625 1653 QString ttip = tr ("<qt><nobr>Indicates the activity of the " … … 1629 1657 QString info; 1630 1658 1631 if (cmachine.GetUSBController().GetEnabled()) 1659 bool isUSBEnabled = cmachine.GetUSBController().GetEnabled(); 1660 if (isUSBEnabled) 1632 1661 { 1662 devicesUSBMenu->setEnabled (isRunningOrPaused); 1663 1633 1664 CUSBDeviceEnumerator en = cconsole.GetUSBDevices().Enumerate(); 1634 1665 while (en.HasMore()) … … 1643 1674 } 1644 1675 else 1676 { 1677 devicesUSBMenu->setEnabled (false); 1678 1645 1679 info = tr ("<br><nobr><b>USB Controller is disabled</b></nobr>", 1646 1680 "USB device tooltip"); 1681 } 1647 1682 1648 1683 QToolTip::add (usb_light, ttip.arg (info)); … … 1734 1769 tr ("Resume the execution of the virtual machine" ) ); 1735 1770 } 1736 vmPauseAction->setEnabled (machine_state == CEnums::Running || 1737 machine_state == CEnums::Paused); 1771 vmPauseAction->setEnabled (isRunningOrPaused); 1738 1772 } 1739 1773 if (element & DisableMouseIntegrAction) … … 2438 2472 tr ("Host Drive ") + fullName); 2439 2473 hostFloppyMap [id] = hostFloppy; 2440 if (machine_state != CEnums::Running )2474 if (machine_state != CEnums::Running && machine_state != CEnums::Paused) 2441 2475 devicesMountFloppyMenu->setItemEnabled (id, false); 2442 2476 else if (!selected.isNull()) … … 2484 2518 tr ("Host Drive ") + fullName); 2485 2519 hostDVDMap [id] = hostDVD; 2486 if (machine_state != CEnums::Running )2520 if (machine_state != CEnums::Running && machine_state != CEnums::Paused) 2487 2521 devicesMountDVDMenu->setItemEnabled (id, false); 2488 2522 else if (!selected.isNull()) … … 2720 2754 if (ind == sf_light) 2721 2755 { 2722 devicesSharedFolders->exec (e->globalPos()); 2756 /* Showing the context menu that always contains a single item is a 2757 * bit stupid; let's better execute this item's action directly. The 2758 * menu itself is kept just in case if we need more than one item in 2759 * the future. */ 2760 #if 0 2761 devicesSFMenu->exec (e->globalPos()); 2762 #else 2763 if (devicesSFDialogAction->isEnabled()) 2764 devicesSFDialogAction->activate(); 2765 #endif 2723 2766 } 2724 2767 else 2725 2768 if (ind == net_light) 2726 2769 { 2727 /* set "this is a context menu" flag */ 2728 devicesMenu->setItemParameter (devicesNetworkMenuId, 1); 2729 devicesNetworkMenu->exec (e->globalPos()); 2730 devicesMenu->setItemParameter (devicesNetworkMenuId, 0); 2770 if (devicesNetworkMenu->isEnabled()) 2771 { 2772 /* set "this is a context menu" flag */ 2773 devicesMenu->setItemParameter (devicesNetworkMenuId, 1); 2774 devicesNetworkMenu->exec (e->globalPos()); 2775 devicesMenu->setItemParameter (devicesNetworkMenuId, 0); 2776 } 2731 2777 } 2732 2778 } … … 2772 2818 void VBoxConsoleWnd::updateMachineState (CEnums::MachineState state) 2773 2819 { 2820 bool guruMeditation = false; 2821 2774 2822 if (console && machine_state != state) 2775 2823 { … … 2778 2826 switch (state) 2779 2827 { 2828 case CEnums::Stuck: 2829 { 2830 guruMeditation = true; 2831 break; 2832 } 2780 2833 case CEnums::Paused: 2781 2834 { … … 2795 2848 } 2796 2849 2797 runningActions->setEnabled (state == CEnums::Running); 2850 bool isRunningOrPaused = state == CEnums::Running || 2851 state == CEnums::Paused; 2852 2853 /* enable/disable actions that are not managed by 2854 * updateAppearanceOf() */ 2855 2856 mRunningActions->setEnabled (state == CEnums::Running); 2857 mRunningOrPausedActions->setEnabled (isRunningOrPaused); 2798 2858 2799 2859 machine_state = state; … … 2801 2861 updateAppearanceOf (Caption | FloppyStuff | DVDStuff | 2802 2862 USBStuff | VRDPStuff | PauseAction | 2803 DisableMouseIntegrAction 2863 DisableMouseIntegrAction); 2804 2864 2805 2865 if (state < CEnums::Running) … … 2812 2872 if (!no_auto_close) 2813 2873 tryClose(); 2874 } 2875 } 2876 2877 if (guruMeditation) 2878 { 2879 CConsole cconsole = console->console(); 2880 QString logFolder = cconsole.GetMachine().GetLogFolder(); 2881 2882 /* Take the screenshot for debugging purposes and save it */ 2883 QString fname = logFolder + "/VBox.png"; 2884 2885 /// @todo for some reason, IDisplay::takeScreenShot() may not work 2886 /// properly on a VM which is Stuck -- investigate it. 2887 CDisplay dsp = cconsole.GetDisplay(); 2888 QImage shot = QImage (dsp.GetWidth(), dsp.GetHeight(), 32, 0); 2889 dsp.TakeScreenShot (shot.bits(), shot.width(), shot.height()); 2890 shot.save (QFile::encodeName (fname), "PNG"); 2891 2892 if (vboxProblem().remindAboutGuruMeditation ( 2893 cconsole, QDir::convertSeparators (logFolder))) 2894 { 2895 cconsole.PowerDown(); 2896 if (!cconsole.isOk()) 2897 vboxProblem().cannotStopMachine (cconsole); 2814 2898 } 2815 2899 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r4294 r4297 1820 1820 machineStates [CEnums::Running] = tr ("Running", "MachineState"); 1821 1821 machineStates [CEnums::Paused] = tr ("Paused", "MachineState"); 1822 machineStates [CEnums::Stuck] = tr ("Stuck", "MachineState"); 1822 1823 machineStates [CEnums::Starting] = tr ("Starting", "MachineState"); 1823 1824 machineStates [CEnums::Stopping] = tr ("Stopping", "MachineState"); … … 3309 3310 {CEnums::Running, "state_running_16px.png"}, 3310 3311 {CEnums::Paused, "state_paused_16px.png"}, 3312 {CEnums::Stuck, "state_paused_16px.png"}, /// @todo (dmik) separate icon? 3311 3313 {CEnums::Starting, "state_running_16px.png"}, /// @todo (dmik) separate icon? 3312 3314 {CEnums::Stopping, "state_running_16px.png"}, /// @todo (dmik) separate icon? … … 3334 3336 vm_state_color.insert (CEnums::Running, &Qt::green); 3335 3337 vm_state_color.insert (CEnums::Paused, &Qt::darkGreen); 3338 vm_state_color.insert (CEnums::Stuck, &Qt::darkMagenta); 3336 3339 vm_state_color.insert (CEnums::Starting, &Qt::green); 3337 3340 vm_state_color.insert (CEnums::Stopping, &Qt::green); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r4204 r4297 1597 1597 } 1598 1598 1599 /** 1600 * Returns @c true if the user has selected to power off the machine. 1601 */ 1602 bool VBoxProblemReporter::remindAboutGuruMeditation (const CConsole &aConsole, 1603 const QString &aLogFolder) 1604 { 1605 Q_UNUSED (aConsole); 1606 1607 int rc = message (&vboxGlobal().consoleWnd(), Critical, 1608 tr ("<p>A critical error has been detected while running the virtual " 1609 "machine and the machine execution has been stopped.</p>" 1610 "" 1611 "<p>Please go to " 1612 "<a href=http://www.virtualbox.org>http://www.virtualbox.org</a> " 1613 "and search through forums and mailing lists for " 1614 "similar problems. If nothing similar is found, please open a " 1615 "new ticket and attach the <tt>VBox.log</tt> and <tt>VBox.png</tt> " 1616 "files which you can find in the <nobr><b>%1</b></nobr> directory " 1617 "to this ticket together with the description of what you were " 1618 "doing when this error happened. " 1619 "" 1620 "Note that you can also access the above files by selecting " 1621 "<b>Show Log</b> from the <b>Machine</b> menu of the main " 1622 "VirualBox window.</p>" 1623 "" 1624 "<p>Press <b>OK</b> if you want to power off the machine " 1625 "or press <b>Ignore</b> if you want to leave it as is for debugging. " 1626 "Please note that debugging requires special knowledge and tools, so " 1627 "it is recommended to press <b>OK</b> now.</p>") 1628 .arg (aLogFolder), 1629 0, /* autoConfirmId */ 1630 QIMessageBox::Ok | QIMessageBox::Default, 1631 QIMessageBox::Ignore | QIMessageBox::Escape); 1632 1633 return rc == QIMessageBox::Ok; 1634 } 1635 1599 1636 int VBoxProblemReporter::remindAboutUnsetHD (QWidget *aParent) 1600 1637 { -
trunk/src/VBox/Main/ConsoleImpl.cpp
r4270 r4297 1468 1468 1469 1469 if (mMachineState != MachineState_Running && 1470 mMachineState != MachineState_Paused) 1470 mMachineState != MachineState_Paused && 1471 mMachineState != MachineState_Stuck) 1471 1472 { 1472 1473 /* extra nice error message for a common case */ … … 1891 1892 // Paused, Starting, Saving, Stopping, etc? if not, we should make a 1892 1893 // stricter check (mMachineState != MachineState_Running). 1893 /* bird: It is not permitted to attach or detach while the VM is saving, is restoring 1894 * or has stopped - definintly not. 1894 // 1895 // I'm changing it to the semi-strict check for the time being. We'll 1896 // consider the below later. 1897 // 1898 /* bird: It is not permitted to attach or detach while the VM is saving, 1899 * is restoring or has stopped - definintly not. 1895 1900 * 1896 * Attaching while starting, well, if you don't create any deadlock it should work... 1897 * Paused should work I guess, but we shouldn't push our luck if we're pausing because an 1898 * runtime error condition was raised (which is one of the reasons there better be a separate 1899 * state for that in the VMM). 1901 * Attaching while starting, well, if you don't create any deadlock it 1902 * should work... Paused should work I guess, but we shouldn't push our 1903 * luck if we're pausing because an runtime error condition was raised 1904 * (which is one of the reasons there better be a separate state for that 1905 * in the VMM). 1900 1906 */ 1901 if (mMachineState < MachineState_Running) 1907 if (mMachineState != MachineState_Running && 1908 mMachineState != MachineState_Paused) 1902 1909 return setError (E_FAIL, 1903 tr ("Cannot attach a USB device to a machine which is not running " 1904 "(machine state: %d)"), mMachineState); 1910 tr ("Cannot attach a USB device to the machine which is not running" 1911 "(machine state: %d)"), 1912 mMachineState); 1905 1913 1906 1914 /* protect mpVM */ … … 1999 2007 AutoLock alock (this); 2000 2008 2009 /// @todo see @todo in AttachUSBDevice() about the Paused state 2001 2010 if (mMachineState == MachineState_Saved) 2002 2011 return setError (E_FAIL, 2003 tr ("Cannot create a transient shared folder on a"2012 tr ("Cannot create a transient shared folder on the " 2004 2013 "machine in the saved state")); 2014 if (mMachineState > MachineState_Paused) 2015 return setError (E_FAIL, 2016 tr ("Cannot create a transient shared folder on the " 2017 "machine while it is changing the state (machine state: %d)"), 2018 mMachineState); 2005 2019 2006 2020 ComObjPtr <SharedFolder> sharedFolder; … … 2065 2079 AutoLock alock (this); 2066 2080 2081 /// @todo see @todo in AttachUSBDevice() about the Paused state 2067 2082 if (mMachineState == MachineState_Saved) 2068 2083 return setError (E_FAIL, 2069 tr ("Cannot remove a transient shared folder when the " 2070 "machine is in the saved state.")); 2084 tr ("Cannot remove a transient shared folder from the " 2085 "machine in the saved state")); 2086 if (mMachineState > MachineState_Paused) 2087 return setError (E_FAIL, 2088 tr ("Cannot remove a transient shared folder from the " 2089 "machine while it is changing the state (machine state: %d)"), 2090 mMachineState); 2071 2091 2072 2092 ComObjPtr <SharedFolder> sharedFolder; … … 2124 2144 AutoLock alock (this); 2125 2145 2126 if (mMachineState > MachineState_Running && 2127 mMachineState != MachineState_Paused) 2146 if (mMachineState > MachineState_Paused) 2128 2147 { 2129 2148 return setError (E_FAIL, 2130 tr ("Cannot take a snapshot of a machine while it is changing state. (Machine state: %d)"), mMachineState); 2149 tr ("Cannot take a snapshot of the machine " 2150 "while it is changing the state (machine state: %d)"), 2151 mMachineState); 2131 2152 } 2132 2153 … … 2296 2317 if (mMachineState >= MachineState_Running) 2297 2318 return setError (E_FAIL, 2298 tr ("Cannot discard a snapshot on a running machine (Machine state: %d)"), mMachineState); 2319 tr ("Cannot discard a snapshot of the running machine " 2320 "(machine state: %d)"), 2321 mMachineState); 2299 2322 2300 2323 MachineState_T machineState = MachineState_InvalidMachineState; … … 2315 2338 if (mMachineState >= MachineState_Running) 2316 2339 return setError (E_FAIL, 2317 tr ("Cannot discard the current state of a running machine. (Machine state: %d)"), mMachineState); 2340 tr ("Cannot discard the current state of the running machine " 2341 "(nachine state: %d)"), 2342 mMachineState); 2318 2343 2319 2344 MachineState_T machineState = MachineState_InvalidMachineState; … … 2334 2359 if (mMachineState >= MachineState_Running) 2335 2360 return setError (E_FAIL, 2336 tr ("Cannot discard the current snapshot and state on a running machine. (Machine state: %d)"), mMachineState); 2361 tr ("Cannot discard the current snapshot and state of the " 2362 "running machine (machine state: %d)"), 2363 mMachineState); 2337 2364 2338 2365 MachineState_T machineState = MachineState_InvalidMachineState; … … 3869 3896 AssertMsg (mMachineState == MachineState_Running || 3870 3897 mMachineState == MachineState_Paused || 3898 mMachineState == MachineState_Stuck || 3871 3899 mMachineState == MachineState_Saving || 3872 3900 mMachineState == MachineState_Starting || … … 4548 4576 that->setMachineState (MachineState_Paused); 4549 4577 } 4578 4579 break; 4550 4580 } 4551 4581 … … 4572 4602 that->setMachineState (MachineState_Running); 4573 4603 } 4604 4605 break; 4606 } 4607 4608 case VMSTATE_GURU_MEDITATION: 4609 { 4610 AutoLock alock (that); 4611 4612 if (that->mVMStateChangeCallbackDisabled) 4613 break; 4614 4615 /* Guru respects only running VMs */ 4616 Assert ((that->mMachineState >= MachineState_Running)); 4617 4618 that->setMachineState (MachineState_Stuck); 4619 4620 break; 4574 4621 } 4575 4622 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r4269 r4297 111 111 <enum 112 112 name="MachineState" 113 uuid=" b8bb15f7-4fa2-4e84-87a8-b4677dd87deb"113 uuid="73bf04d0-7c4f-4684-9abf-d65a9ad74343" 114 114 > 115 115 <desc> … … 118 118 </desc> 119 119 120 <const name="InvalidMachineState" value="0"/> 120 <const name="InvalidMachineState" value="0"> 121 <desc> 122 Invalid machine state. This state is never used by the virtual machine 123 and may be used as a <tt>null</tt> value for state 124 variables. 125 </desc> 126 </const> 121 127 <const name="PoweredOff" value="1"> 122 128 <desc> … … 150 156 action). 151 157 </note> 158 <note> 159 For whoever decides to touch this enum: In order to keep the 160 aforementioned comparisons valid, this state must immediately 161 preceed the Paused state. 162 </note> 152 163 </desc> 153 164 </const> … … 156 167 The execution of the machine has been paused. 157 168 <note> 158 This value can be used in comparison expressions: 159 all state values above it represent unstable states of the 160 virtual machine. No any settings can be altered when the 161 VM is in one of the unstable sates. 169 This value can be used in comparison expressions: all state values 170 above it represent unstable states of the running virtual 171 machine. Unless explicitly stated otherwise, no machine settings can 172 be altered when it is in one of the unstable sates. 173 </note> 174 <note> 175 For whoever decides to touch this enum: In order to keep the 176 aforementioned comparisons valid, this state must immediately 177 follow the Running state. 162 178 </note> 163 179 </desc> 164 180 </const> 165 <const name="Starting" value="6"> 181 <const name="Stuck" value="6"> 182 <desc> 183 The execution of the machine has reached the Guru Meditaion 184 condition. This condition indicates an internal VMM failure which may 185 happen as a result of either an unhandled low-level virtual hardware 186 exception or one of the recompiler exceptions (such as 187 the <i>too-many-traps</i> condition). 188 </desc> 189 </const> 190 <const name="Starting" value="7"> 166 191 <desc> 167 192 The machine is being started after … … 170 195 </desc> 171 196 </const> 172 <const name="Stopping" value=" 7">197 <const name="Stopping" value="8"> 173 198 <desc> 174 199 The machine is being normally stopped … … 177 202 </desc> 178 203 </const> 179 <const name="Saving" value=" 8">204 <const name="Saving" value="9"> 180 205 <desc> 181 206 The machine is saving its execution state to a file as a … … 185 210 </desc> 186 211 </const> 187 <const name="Restoring" value=" 9">212 <const name="Restoring" value="10"> 188 213 <desc> 189 214 The execution state of the machine is being restored from a file … … 192 217 </desc> 193 218 </const> 194 <const name="Discarding" value="1 0">219 <const name="Discarding" value="11"> 195 220 <desc> 196 221 A snapshot of the machine is being discarded after calling
Note:
See TracChangeset
for help on using the changeset viewer.