Changeset 4297 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 22, 2007 8:49:37 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 23820
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 23 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 {
Note:
See TracChangeset
for help on using the changeset viewer.