- Timestamp:
- Aug 2, 2012 10:31:28 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 31 added
- 50 edited
-
. (modified) (1 prop)
-
doc/manual/en_US/user_Glossary.xml (modified) (1 prop)
-
doc/manual/en_US/user_Introduction.xml (modified) (1 prop)
-
doc/manual/en_US/user_Troubleshooting.xml (modified) (1 prop)
-
include/VBox/vmm/cpumctx-v1_6.h (modified) (1 prop)
-
src/VBox/Devices/PC/DevApic.h (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/Makefile.kmk (modified) (9 diffs)
-
src/VBox/Frontends/VirtualBox/src/converter/UIConverter.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/converter/UIConverter.h (modified) (1 diff, 1 prop)
-
src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h (modified) (2 diffs, 1 prop)
-
src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp (modified) (2 diffs, 1 prop)
-
src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedToolBar.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedToolBar.h (added)
-
src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.h (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp (modified) (5 diffs)
-
src/VBox/Frontends/VirtualBox/src/extensions/graphics (added)
-
src/VBox/Frontends/VirtualBox/src/extensions/graphics/QIGraphicsWidget.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/extensions/graphics/QIGraphicsWidget.h (added)
-
src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp (modified) (26 diffs)
-
src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h (modified) (11 diffs)
-
src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h (modified) (2 diffs)
-
src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp (modified) (2 diffs)
-
src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.h (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.h (modified) (1 prop)
-
src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp (modified) (74 diffs)
-
src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp (modified) (5 diffs)
-
src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp (modified) (24 diffs)
-
src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp (modified) (60 diffs)
-
src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h (modified) (12 diffs)
-
src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp (modified) (2 diffs)
-
src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.h (modified) (3 diffs)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGSelectorItem.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGSelectorItem.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGSelectorItemGroup.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGSelectorItemGroup.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGSelectorItemMachine.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGSelectorItemMachine.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorKeyboardHandler.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorKeyboardHandler.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorModel.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorModel.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorMouseHandler.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorMouseHandler.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorView.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsSelectorView.h (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsViewChooser.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/selector/graphics/UIGraphicsViewChooser.h (added)
-
src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp (modified) (1 diff)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsButton.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsButton.h (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsRotatorButton.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsRotatorButton.h (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsToolBar.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsToolBar.h (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsZoomButton.cpp (added)
-
src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsZoomButton.h (added)
-
src/VBox/GuestHost/OpenGL/LICENSE (modified) (1 prop)
-
src/VBox/HostServices/SharedOpenGL/LICENSE (modified) (1 prop)
-
src/VBox/Main/glue/tests (modified) (1 prop)
-
src/VBox/Main/glue/tests/Makefile (modified) (1 prop)
-
src/VBox/Main/include/MediumLock.h (modified) (1 prop)
-
src/VBox/Runtime/testcase/tstRTMemEf.cpp (modified) (1 prop)
-
src/libs/libxml2-2.6.31 (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/doc/manual/en_US/user_Glossary.xml
- Property svn:mergeinfo changed
-
trunk/doc/manual/en_US/user_Introduction.xml
- Property svn:mergeinfo changed
-
trunk/doc/manual/en_US/user_Troubleshooting.xml
- Property svn:mergeinfo changed
-
trunk/include/VBox/vmm/cpumctx-v1_6.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/PC/DevApic.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r42312 r42526 148 148 ./src/converter \ 149 149 ./src/extensions \ 150 ./src/extensions/graphics \ 150 151 ./src/globals \ 151 152 ./src/net \ … … 161 162 ./src/runtime/seamless \ 162 163 ./src/selector \ 164 ./src/selector/graphics/chooser \ 165 ./src/selector/graphics/details \ 163 166 ./src/settings \ 164 167 ./src/settings/global \ 165 168 ./src/settings/machine \ 166 169 ./src/widgets \ 170 ./src/widgets/graphics \ 167 171 ./src/wizards \ 168 172 ./src/wizards/newvm \ … … 271 275 src/extensions/QITreeWidget.h \ 272 276 src/extensions/QIWidgetValidator.h \ 277 src/extensions/QIAdvancedToolBar.h \ 278 src/extensions/graphics/QIGraphicsWidget.h \ 273 279 src/globals/UIActionPool.h \ 274 280 src/globals/UIExtraDataEventHandler.h \ … … 325 331 src/selector/UISelectorWindow.h \ 326 332 src/selector/VBoxSnapshotsWgt.h \ 333 src/selector/graphics/chooser/UIGChooser.h \ 334 src/selector/graphics/chooser/UIGChooserModel.h \ 335 src/selector/graphics/chooser/UIGChooserView.h \ 336 src/selector/graphics/chooser/UIGChooserHandlerMouse.h \ 337 src/selector/graphics/chooser/UIGChooserHandlerKeyboard.h \ 338 src/selector/graphics/chooser/UIGChooserItem.h \ 339 src/selector/graphics/chooser/UIGChooserItemGroup.h \ 340 src/selector/graphics/chooser/UIGChooserItemMachine.h \ 341 src/selector/graphics/details/UIGDetails.h \ 342 src/selector/graphics/details/UIGDetailsModel.h \ 343 src/selector/graphics/details/UIGDetailsView.h \ 344 src/selector/graphics/details/UIGDetailsItem.h \ 345 src/selector/graphics/details/UIGDetailsGroup.h \ 346 src/selector/graphics/details/UIGDetailsSet.h \ 347 src/selector/graphics/details/UIGDetailsElement.h \ 348 src/selector/graphics/details/UIGDetailsElements.h \ 349 src/selector/graphics/details/UIGMachinePreview.h \ 327 350 src/settings/UISettingsDialog.h \ 328 351 src/settings/UISettingsDialogSpecific.h \ … … 368 391 src/widgets/UINameAndSystemEditor.h \ 369 392 src/widgets/VBoxWarningPane.h \ 393 src/widgets/graphics/UIGraphicsButton.h \ 394 src/widgets/graphics/UIGraphicsRotatorButton.h \ 395 src/widgets/graphics/UIGraphicsZoomButton.h \ 396 src/widgets/graphics/UIGraphicsToolBar.h \ 370 397 src/wizards/UIWizard.h \ 371 398 src/wizards/UIWizardPage.h \ … … 411 438 src/UIVMLogViewer.cpp \ 412 439 src/extensions/QISplitter.cpp \ 440 src/extensions/QIAdvancedToolBar.cpp \ 413 441 src/globals/UIActionPool.cpp \ 414 442 src/globals/UIExtraDataEventHandler.cpp \ … … 474 502 src/extensions/QITreeWidget.cpp \ 475 503 src/extensions/QIWidgetValidator.cpp \ 504 src/extensions/QIAdvancedToolBar.cpp \ 505 src/extensions/graphics/QIGraphicsWidget.cpp \ 476 506 src/globals/UIDefs.cpp \ 477 507 src/globals/COMDefs.cpp \ … … 540 570 src/selector/UIVirtualBoxEventHandler.cpp \ 541 571 src/selector/UISelectorWindow.cpp \ 572 src/selector/graphics/chooser/UIGChooser.cpp \ 573 src/selector/graphics/chooser/UIGChooserModel.cpp \ 574 src/selector/graphics/chooser/UIGChooserView.cpp \ 575 src/selector/graphics/chooser/UIGChooserHandlerMouse.cpp \ 576 src/selector/graphics/chooser/UIGChooserHandlerKeyboard.cpp \ 577 src/selector/graphics/chooser/UIGChooserItem.cpp \ 578 src/selector/graphics/chooser/UIGChooserItemGroup.cpp \ 579 src/selector/graphics/chooser/UIGChooserItemMachine.cpp \ 580 src/selector/graphics/details/UIGDetails.cpp \ 581 src/selector/graphics/details/UIGDetailsModel.cpp \ 582 src/selector/graphics/details/UIGDetailsView.cpp \ 583 src/selector/graphics/details/UIGDetailsItem.cpp \ 584 src/selector/graphics/details/UIGDetailsGroup.cpp \ 585 src/selector/graphics/details/UIGDetailsSet.cpp \ 586 src/selector/graphics/details/UIGDetailsElement.cpp \ 587 src/selector/graphics/details/UIGDetailsElements.cpp \ 588 src/selector/graphics/details/UIGMachinePreview.cpp \ 542 589 src/selector/VBoxSnapshotsWgt.cpp \ 543 590 src/settings/UISettingsDefs.cpp \ … … 586 633 src/widgets/UINameAndSystemEditor.cpp \ 587 634 src/widgets/VBoxWarningPane.cpp \ 635 src/widgets/graphics/UIGraphicsButton.cpp \ 636 src/widgets/graphics/UIGraphicsRotatorButton.cpp \ 637 src/widgets/graphics/UIGraphicsZoomButton.cpp \ 638 src/widgets/graphics/UIGraphicsToolBar.cpp \ 588 639 src/wizards/UIWizard.cpp \ 589 640 src/wizards/UIWizardPage.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.h
- Property svn:mergeinfo changed
r41850 r42526 66 66 } 67 67 68 /* QString <= template class: */ 69 template<class T> QString toInternalString(const T &data) const 70 { 71 if (canConvert<T>()) 72 return ::toInternalString(data); 73 Assert(0); return QString(); 74 } 75 /* Template class <= QString: */ 76 template<class T> T fromInternalString(const QString &strData) const 77 { 78 if (canConvert<T>()) 79 return ::fromInternalString<T>(strData); 80 Assert(0); return T(); 81 } 82 68 83 private: 69 84 -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
- Property svn:mergeinfo changed
r42261 r42526 47 47 template<class X> X fromString(const QString & /* strData */) { Assert(0); return X(); } 48 48 49 /* Converts passed 'Object of type X' to non-translated QString. 50 * This function returns null QString for any object type until re-determined for specific one. */ 51 template<class X> QString toInternalString(const X & /* xobject */) { Assert(0); return QString(); } 52 /* Converts passed non-translated QString to 'Object of type X'. 53 * This function returns default constructed object for any object type until re-determined for specific one. */ 54 template<class X> X fromInternalString(const QString & /* strData */) { Assert(0); return X(); } 55 49 56 /* Declare global canConvert specializations: */ 50 57 template<> bool canConvert<StorageSlot>(); 58 template<> bool canConvert<DetailsElementType>(); 51 59 52 60 /* Declare COM canConvert specializations: */ … … 75 83 template<> QString toString(const StorageSlot &storageSlot); 76 84 template<> StorageSlot fromString<StorageSlot>(const QString &strStorageSlot); 85 template<> QString toString(const DetailsElementType &detailsElementType); 86 template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType); 87 template<> QString toInternalString(const DetailsElementType &detailsElementType); 88 template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType); 77 89 78 90 /* Declare COM conversion specializations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
- Property svn:mergeinfo changed
r41850 r42526 32 32 * These functions returns 'true' for all allowed conversions. */ 33 33 template<> bool canConvert<StorageSlot>() { return true; } 34 template<> bool canConvert<DetailsElementType>() { return true; } 34 35 35 36 /* QString <= StorageSlot: */ … … 261 262 } 262 263 264 /* QString <= DetailsElementType: */ 265 template<> QString toString(const DetailsElementType &detailsElementType) 266 { 267 QString strResult; 268 switch (detailsElementType) 269 { 270 case DetailsElementType_General: strResult = QApplication::translate("VBoxGlobal", "General", "DetailsElementType"); break; 271 case DetailsElementType_Preview: strResult = QApplication::translate("VBoxGlobal", "Preview", "DetailsElementType"); break; 272 case DetailsElementType_System: strResult = QApplication::translate("VBoxGlobal", "System", "DetailsElementType"); break; 273 case DetailsElementType_Display: strResult = QApplication::translate("VBoxGlobal", "Display", "DetailsElementType"); break; 274 case DetailsElementType_Storage: strResult = QApplication::translate("VBoxGlobal", "Storage", "DetailsElementType"); break; 275 case DetailsElementType_Audio: strResult = QApplication::translate("VBoxGlobal", "Audio", "DetailsElementType"); break; 276 case DetailsElementType_Network: strResult = QApplication::translate("VBoxGlobal", "Network", "DetailsElementType"); break; 277 case DetailsElementType_Serial: strResult = QApplication::translate("VBoxGlobal", "Serial ports", "DetailsElementType"); break; 278 #ifdef VBOX_WITH_PARALLEL_PORTS 279 case DetailsElementType_Parallel: strResult = QApplication::translate("VBoxGlobal", "Parallel ports", "DetailsElementType"); break; 280 #endif /* VBOX_WITH_PARALLEL_PORTS */ 281 case DetailsElementType_USB: strResult = QApplication::translate("VBoxGlobal", "USB", "DetailsElementType"); break; 282 case DetailsElementType_SF: strResult = QApplication::translate("VBoxGlobal", "Shared folders", "DetailsElementType"); break; 283 case DetailsElementType_Description: strResult = QApplication::translate("VBoxGlobal", "Description", "DetailsElementType"); break; 284 default: 285 { 286 AssertMsgFailed(("No text for details element type=%d", detailsElementType)); 287 break; 288 } 289 } 290 return strResult; 291 } 292 293 /* DetailsElementType <= QString: */ 294 template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType) 295 { 296 QHash<QString, DetailsElementType> list; 297 list.insert(QApplication::translate("VBoxGlobal", "General", "DetailsElementType"), DetailsElementType_General); 298 list.insert(QApplication::translate("VBoxGlobal", "Preview", "DetailsElementType"), DetailsElementType_Preview); 299 list.insert(QApplication::translate("VBoxGlobal", "System", "DetailsElementType"), DetailsElementType_System); 300 list.insert(QApplication::translate("VBoxGlobal", "Display", "DetailsElementType"), DetailsElementType_Display); 301 list.insert(QApplication::translate("VBoxGlobal", "Storage", "DetailsElementType"), DetailsElementType_Storage); 302 list.insert(QApplication::translate("VBoxGlobal", "Audio", "DetailsElementType"), DetailsElementType_Audio); 303 list.insert(QApplication::translate("VBoxGlobal", "Network", "DetailsElementType"), DetailsElementType_Network); 304 list.insert(QApplication::translate("VBoxGlobal", "Serial ports", "DetailsElementType"), DetailsElementType_Serial); 305 #ifdef VBOX_WITH_PARALLEL_PORTS 306 list.insert(QApplication::translate("VBoxGlobal", "Parallel ports", "DetailsElementType"), DetailsElementType_Parallel); 307 #endif /* VBOX_WITH_PARALLEL_PORTS */ 308 list.insert(QApplication::translate("VBoxGlobal", "USB", "DetailsElementType"), DetailsElementType_USB); 309 list.insert(QApplication::translate("VBoxGlobal", "Shared folders", "DetailsElementType"), DetailsElementType_SF); 310 list.insert(QApplication::translate("VBoxGlobal", "Description", "DetailsElementType"), DetailsElementType_Description); 311 if (!list.contains(strDetailsElementType)) 312 { 313 AssertMsgFailed(("No value for '%s'", strDetailsElementType.toAscii().constData())); 314 } 315 return list.value(strDetailsElementType); 316 } 317 318 /* QString <= DetailsElementType: */ 319 template<> QString toInternalString(const DetailsElementType &detailsElementType) 320 { 321 QString strResult; 322 switch (detailsElementType) 323 { 324 case DetailsElementType_General: strResult = "general"; break; 325 case DetailsElementType_Preview: strResult = "preview"; break; 326 case DetailsElementType_System: strResult = "system"; break; 327 case DetailsElementType_Display: strResult = "display"; break; 328 case DetailsElementType_Storage: strResult = "storage"; break; 329 case DetailsElementType_Audio: strResult = "audio"; break; 330 case DetailsElementType_Network: strResult = "network"; break; 331 case DetailsElementType_Serial: strResult = "serialPorts"; break; 332 #ifdef VBOX_WITH_PARALLEL_PORTS 333 case DetailsElementType_Parallel: strResult = "parallelPorts"; break; 334 #endif /* VBOX_WITH_PARALLEL_PORTS */ 335 case DetailsElementType_USB: strResult = "usb"; break; 336 case DetailsElementType_SF: strResult = "sharedFolders"; break; 337 case DetailsElementType_Description: strResult = "description"; break; 338 default: 339 { 340 AssertMsgFailed(("No text for details element type=%d", detailsElementType)); 341 break; 342 } 343 } 344 return strResult; 345 } 346 347 /* DetailsElementType <= QString: */ 348 template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType) 349 { 350 QHash<QString, DetailsElementType> list; 351 list.insert("general", DetailsElementType_General); 352 list.insert("preview", DetailsElementType_Preview); 353 list.insert("system", DetailsElementType_System); 354 list.insert("display", DetailsElementType_Display); 355 list.insert("storage", DetailsElementType_Storage); 356 list.insert("audio", DetailsElementType_Audio); 357 list.insert("network", DetailsElementType_Network); 358 list.insert("serialPorts", DetailsElementType_Serial); 359 #ifdef VBOX_WITH_PARALLEL_PORTS 360 list.insert("parallelPorts", DetailsElementType_Parallel); 361 #endif /* VBOX_WITH_PARALLEL_PORTS */ 362 list.insert("usb", DetailsElementType_USB); 363 list.insert("sharedFolders", DetailsElementType_SF); 364 list.insert("description", DetailsElementType_Description); 365 if (!list.contains(strDetailsElementType)) 366 { 367 AssertMsgFailed(("No value for '%s'", strDetailsElementType.toAscii().constData())); 368 } 369 return list.value(strDetailsElementType); 370 } 371 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp
r42261 r42526 18 18 */ 19 19 20 /* Local includes */ 21 #include "QISplitter.h" 22 23 /* Global includes */ 20 /* Qt includes: */ 24 21 #include <QApplication> 25 22 #include <QEvent> … … 27 24 #include <QPaintEvent> 28 25 29 /* A simple shaded line. */ 26 /* GUI includes: */ 27 #include "QISplitter.h" 28 29 /* A simple shaded line: */ 30 30 class QIShadeSplitterHandle: public QSplitterHandle 31 31 { … … 34 34 public: 35 35 36 QIShadeSplitterHandle(Qt::Orientation aOrientation, QISplitter *aParent)37 :QSplitterHandle(aOrientation, aParent)36 QIShadeSplitterHandle(Qt::Orientation orientation, QISplitter *pParent) 37 : QSplitterHandle(orientation, pParent) 38 38 {} 39 39 40 40 protected: 41 41 42 void paintEvent(QPaintEvent * aEvent)42 void paintEvent(QPaintEvent *pEvent) 43 43 { 44 44 QPainter painter(this); 45 45 QLinearGradient gradient; 46 QColor color = palette().color(QPalette::Window); 47 QGradientStop point1(0, color); 48 QGradientStop point2(0.5, color.darker(115)); 49 QGradientStop point3(1, color); 50 QGradientStops stops; 51 stops << point1 << point2 << point3; 52 gradient.setStops(stops); 46 53 if (orientation() == Qt::Horizontal) 47 54 { 48 gradient.setStart(rect().left(), rect().height() / 2);49 gradient.setFinalStop(rect().right(), rect().height() / 2);55 gradient.setStart(rect().left(), 0); 56 gradient.setFinalStop(rect().right(), 0); 50 57 } 51 58 else 52 59 { 53 gradient.setStart( rect().width() / 2, rect().top());54 gradient.setFinalStop( rect().width() / 2, rect().bottom());55 } 56 painter.fillRect( aEvent->rect(), QBrush (gradient));60 gradient.setStart(0, rect().top()); 61 gradient.setFinalStop(0, rect().bottom()); 62 } 63 painter.fillRect(pEvent->rect(), gradient); 57 64 } 58 65 }; … … 66 73 public: 67 74 68 QIDarwinSplitterHandle(Qt::Orientation aOrientation, QISplitter *aParent)69 :QSplitterHandle(aOrientation, aParent)75 QIDarwinSplitterHandle(Qt::Orientation orientation, QISplitter *pParent) 76 : QSplitterHandle(orientation, pParent) 70 77 {} 71 78 … … 81 88 protected: 82 89 83 void paintEvent(QPaintEvent * /* aEvent */)90 void paintEvent(QPaintEvent*) 84 91 { 85 92 QPainter painter(this); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r41689 r42526 7 7 8 8 /* 9 * Copyright (C) 2010-201 1Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 44 44 }; 45 45 46 /* UIAction Interfacestuff: */47 UIAction Interface::UIActionInterface(QObject *pParent, UIActionType type)46 /* UIAction stuff: */ 47 UIAction::UIAction(QObject *pParent, UIActionType type) 48 48 : QIWithRetranslateUI3<QAction>(pParent) 49 49 , m_type(type) … … 54 54 } 55 55 56 QString UIAction Interface::menuText(const QString &strText)56 QString UIAction::menuText(const QString &strText) 57 57 { 58 58 return vboxGlobal().isVMConsoleProcess() ? VBoxGlobal::removeAccelMark(strText) : strText; 59 59 } 60 60 61 /* UIMenu Interfacestuff: */62 UIMenu Interface::UIMenuInterface()61 /* UIMenu stuff: */ 62 UIMenu::UIMenu() 63 63 : m_fShowToolTips(false) 64 64 { 65 65 } 66 66 67 bool UIMenu Interface::event(QEvent *pEvent)67 bool UIMenu::event(QEvent *pEvent) 68 68 { 69 69 /* Handle particular event-types: */ … … 89 89 } 90 90 91 /* UI SimpleActionstuff: */92 UI SimpleAction::UISimpleAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)93 : UIAction Interface(pParent, UIActionType_Simple)91 /* UIActionSimple stuff: */ 92 UIActionSimple::UIActionSimple(QObject *pParent, const QString &strIcon, const QString &strIconDis) 93 : UIAction(pParent, UIActionType_Simple) 94 94 { 95 95 if (!strIcon.isNull()) … … 97 97 } 98 98 99 UI SimpleAction::UISimpleAction(QObject *pParent,99 UIActionSimple::UIActionSimple(QObject *pParent, 100 100 const QSize &normalSize, const QSize &smallSize, 101 101 const QString &strNormalIcon, const QString &strSmallIcon, 102 102 const QString &strNormalIconDis, const QString &strSmallIconDis) 103 : UIAction Interface(pParent, UIActionType_Simple)103 : UIAction(pParent, UIActionType_Simple) 104 104 { 105 105 setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis)); 106 106 } 107 107 108 UI SimpleAction::UISimpleAction(QObject *pParent, const QIcon& icon)109 : UIAction Interface(pParent, UIActionType_Simple)108 UIActionSimple::UIActionSimple(QObject *pParent, const QIcon& icon) 109 : UIAction(pParent, UIActionType_Simple) 110 110 { 111 111 if (!icon.isNull()) … … 113 113 } 114 114 115 /* UI StateActionstuff: */116 UI StateAction::UIStateAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)117 : UIAction Interface(pParent, UIActionType_State)115 /* UIActionState stuff: */ 116 UIActionState::UIActionState(QObject *pParent, const QString &strIcon, const QString &strIconDis) 117 : UIAction(pParent, UIActionType_State) 118 118 { 119 119 if (!strIcon.isNull()) … … 121 121 } 122 122 123 UI StateAction::UIStateAction(QObject *pParent,123 UIActionState::UIActionState(QObject *pParent, 124 124 const QSize &normalSize, const QSize &smallSize, 125 125 const QString &strNormalIcon, const QString &strSmallIcon, 126 126 const QString &strNormalIconDis, const QString &strSmallIconDis) 127 : UIAction Interface(pParent, UIActionType_State)127 : UIAction(pParent, UIActionType_State) 128 128 { 129 129 setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis)); 130 130 } 131 131 132 UI StateAction::UIStateAction(QObject *pParent, const QIcon& icon)133 : UIAction Interface(pParent, UIActionType_State)132 UIActionState::UIActionState(QObject *pParent, const QIcon& icon) 133 : UIAction(pParent, UIActionType_State) 134 134 { 135 135 if (!icon.isNull()) … … 137 137 } 138 138 139 /* UI ToggleActionstuff: */140 UI ToggleAction::UIToggleAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)141 : UIAction Interface(pParent, UIActionType_Toggle)139 /* UIActionToggle stuff: */ 140 UIActionToggle::UIActionToggle(QObject *pParent, const QString &strIcon, const QString &strIconDis) 141 : UIAction(pParent, UIActionType_Toggle) 142 142 { 143 143 if (!strIcon.isNull()) … … 146 146 } 147 147 148 UI ToggleAction::UIToggleAction(QObject *pParent,148 UIActionToggle::UIActionToggle(QObject *pParent, 149 149 const QSize &normalSize, const QSize &smallSize, 150 150 const QString &strNormalIcon, const QString &strSmallIcon, 151 151 const QString &strNormalIconDis, const QString &strSmallIconDis) 152 : UIAction Interface(pParent, UIActionType_Toggle)152 : UIAction(pParent, UIActionType_Toggle) 153 153 { 154 154 setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis)); … … 156 156 } 157 157 158 UI ToggleAction::UIToggleAction(QObject *pParent,158 UIActionToggle::UIActionToggle(QObject *pParent, 159 159 const QString &strIconOn, const QString &strIconOff, 160 160 const QString &strIconOnDis, const QString &strIconOffDis) 161 : UIAction Interface(pParent, UIActionType_Toggle)161 : UIAction(pParent, UIActionType_Toggle) 162 162 { 163 163 setIcon(UIIconPool::iconSetOnOff(strIconOn, strIconOff, strIconOnDis, strIconOffDis)); … … 165 165 } 166 166 167 UI ToggleAction::UIToggleAction(QObject *pParent, const QIcon &icon)168 : UIAction Interface(pParent, UIActionType_Toggle)167 UIActionToggle::UIActionToggle(QObject *pParent, const QIcon &icon) 168 : UIAction(pParent, UIActionType_Toggle) 169 169 { 170 170 if (!icon.isNull()) … … 173 173 } 174 174 175 void UI ToggleAction::sltUpdateAppearance()175 void UIActionToggle::sltUpdateAppearance() 176 176 { 177 177 retranslateUi(); 178 178 } 179 179 180 void UI ToggleAction::init()180 void UIActionToggle::init() 181 181 { 182 182 setCheckable(true); … … 184 184 } 185 185 186 /* UI MenuActionstuff: */187 UI MenuAction::UIMenuAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)188 : UIAction Interface(pParent, UIActionType_Menu)186 /* UIActionMenu stuff: */ 187 UIActionMenu::UIActionMenu(QObject *pParent, const QString &strIcon, const QString &strIconDis) 188 : UIAction(pParent, UIActionType_Menu) 189 189 { 190 190 if (!strIcon.isNull()) 191 191 setIcon(UIIconPool::iconSet(strIcon, strIconDis)); 192 setMenu(new UIMenu Interface);193 } 194 195 UI MenuAction::UIMenuAction(QObject *pParent, const QIcon &icon)196 : UIAction Interface(pParent, UIActionType_Menu)192 setMenu(new UIMenu); 193 } 194 195 UIActionMenu::UIActionMenu(QObject *pParent, const QIcon &icon) 196 : UIAction(pParent, UIActionType_Menu) 197 197 { 198 198 if (!icon.isNull()) 199 199 setIcon(icon); 200 setMenu(new UIMenuInterface); 201 } 202 203 class UISimpleActionLogDialog : public UISimpleAction 204 { 205 Q_OBJECT; 206 207 public: 208 209 UISimpleActionLogDialog(QObject *pParent) 210 : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16), 200 setMenu(new UIMenu); 201 } 202 203 204 class UIActionSimpleLogDialog : public UIActionSimple 205 { 206 Q_OBJECT; 207 208 public: 209 210 UIActionSimpleLogDialog(QObject *pParent) 211 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 211 212 ":/vm_show_logs_32px.png", ":/show_logs_16px.png", 212 213 ":/vm_show_logs_disabled_32px.png", ":/show_logs_disabled_16px.png") … … 227 228 void retranslateUi() 228 229 { 229 setText(QApplication::translate("UIActionPool", "Show & Log..."));230 setText(QApplication::translate("UIActionPool", "Show &log...")); 230 231 setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machine")); 231 232 } 232 233 }; 233 234 234 class MenuHelpAction : public UIMenuAction235 { 236 Q_OBJECT; 237 238 public: 239 240 MenuHelpAction(QObject *pParent)241 : UI MenuAction(pParent)235 class UIActionMenuHelp : public UIActionMenu 236 { 237 Q_OBJECT; 238 239 public: 240 241 UIActionMenuHelp(QObject *pParent) 242 : UIActionMenu(pParent) 242 243 { 243 244 retranslateUi(); … … 252 253 }; 253 254 254 class ShowHelpAction : public UISimpleAction255 { 256 Q_OBJECT; 257 258 public: 259 260 ShowHelpAction(QObject *pParent)261 : UI SimpleAction(pParent, UIIconPool::defaultIcon(UIIconPool::DialogHelpIcon))255 class UIActionSimpleContents : public UIActionSimple 256 { 257 Q_OBJECT; 258 259 public: 260 261 UIActionSimpleContents(QObject *pParent) 262 : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::DialogHelpIcon)) 262 263 { 263 264 switch (gActionPool->type()) … … 277 278 void retranslateUi() 278 279 { 279 setText(menuText(QApplication::translate("UI MessageCenter", "&Contents...")));280 setStatusTip(QApplication::translate("UI MessageCenter", "Show the onlinehelp contents"));281 } 282 }; 283 284 class ShowWebAction : public UISimpleAction285 { 286 Q_OBJECT; 287 288 public: 289 290 ShowWebAction(QObject *pParent)291 : UI SimpleAction(pParent, ":/site_16px.png")280 setText(menuText(QApplication::translate("UIActionPool", "&Contents..."))); 281 setStatusTip(QApplication::translate("UIActionPool", "Show help contents")); 282 } 283 }; 284 285 class UIActionSimpleWebSite : public UIActionSimple 286 { 287 Q_OBJECT; 288 289 public: 290 291 UIActionSimpleWebSite(QObject *pParent) 292 : UIActionSimple(pParent, ":/site_16px.png") 292 293 { 293 294 switch (gActionPool->type()) … … 307 308 void retranslateUi() 308 309 { 309 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UI MessageCenter", "&VirtualBox Web Site...")), gMS->shortcut(UIMachineShortcuts::WebShortcut)));310 setStatusTip(QApplication::translate("UI MessageCenter", "Open the browser and go to the VirtualBox product web site"));311 } 312 }; 313 314 class PerformResetWarningsAction : public UISimpleAction315 { 316 Q_OBJECT; 317 318 public: 319 320 PerformResetWarningsAction(QObject *pParent)321 : UI SimpleAction(pParent, ":/reset_16px.png")310 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&VirtualBox web site...")), gMS->shortcut(UIMachineShortcuts::WebShortcut))); 311 setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site")); 312 } 313 }; 314 315 class UIActionSimpleResetWarnings : public UIActionSimple 316 { 317 Q_OBJECT; 318 319 public: 320 321 UIActionSimpleResetWarnings(QObject *pParent) 322 : UIActionSimple(pParent, ":/reset_16px.png") 322 323 { 323 324 switch (gActionPool->type()) … … 337 338 void retranslateUi() 338 339 { 339 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UI MessageCenter", "&Reset All Warnings")), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut)));340 setStatusTip(QApplication::translate("UI MessageCenter", "Go back to showing all suppressed warnings and messages"));341 } 342 }; 343 344 class ShowNetworkAccessManagerAction : public UISimpleAction345 { 346 Q_OBJECT; 347 348 public: 349 350 ShowNetworkAccessManagerAction(QObject *pParent)351 : UI SimpleAction(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")340 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Reset all warnings")), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut))); 341 setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages")); 342 } 343 }; 344 345 class UIActionSimpleNetworkAccessManager : public UIActionSimple 346 { 347 Q_OBJECT; 348 349 public: 350 351 UIActionSimpleNetworkAccessManager(QObject *pParent) 352 : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png") 352 353 { 353 354 switch (gActionPool->type()) … … 367 368 void retranslateUi() 368 369 { 369 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "&Network Operations Manager...")), gMS->shortcut(UIMachineShortcuts::NetworkAccessManager))); 370 setStatusTip(QApplication::translate("UIMessageCenter", "Show Network Operations Manager")); 371 } 372 }; 373 374 #ifdef VBOX_WITH_REGISTRATION 375 class PerformRegisterAction : public UISimpleAction 376 { 377 Q_OBJECT; 378 379 public: 380 381 PerformRegisterAction(QObject *pParent) 382 : UISimpleAction(pParent, ":/register_16px.png", ":/register_disabled_16px.png") 383 { 384 setEnabled(vboxGlobal().virtualBox(). 385 GetExtraData(GUI_RegistrationDlgWinID).isEmpty()); 386 switch (gActionPool->type()) 387 { 388 case UIActionPoolType_Selector: 389 setShortcut(gSS->keySequence(UISelectorShortcuts::RegisterShortcut)); 390 break; 391 case UIActionPoolType_Runtime: 392 setShortcut(gMS->keySequence(UIMachineShortcuts::RegisterShortcut)); 393 break; 394 } 395 retranslateUi(); 396 } 397 398 protected: 399 400 void retranslateUi() 401 { 402 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "R&egister VirtualBox...")), gMS->shortcut(UIMachineShortcuts::RegisterShortcut))); 403 setStatusTip(QApplication::translate("UIMessageCenter", "Open VirtualBox registration form")); 404 } 405 }; 406 #endif /* VBOX_WITH_REGISTRATION */ 407 408 class PerformUpdateAction : public UISimpleAction 409 { 410 Q_OBJECT; 411 412 public: 413 414 PerformUpdateAction(QObject *pParent) 415 : UISimpleAction(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png") 370 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Network Operations Manager...")), gMS->shortcut(UIMachineShortcuts::NetworkAccessManager))); 371 setStatusTip(QApplication::translate("UIActionPool", "Show Network Operations Manager")); 372 } 373 }; 374 375 class UIActionSimpleCheckForUpdates : public UIActionSimple 376 { 377 Q_OBJECT; 378 379 public: 380 381 UIActionSimpleCheckForUpdates(QObject *pParent) 382 : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png") 416 383 { 417 384 setMenuRole(QAction::ApplicationSpecificRole); … … 432 399 void retranslateUi() 433 400 { 434 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UI MessageCenter", "C&heck for Updates...")), gMS->shortcut(UIMachineShortcuts::UpdateShortcut)));435 setStatusTip(QApplication::translate("UI MessageCenter", "Check for a new VirtualBox version"));436 } 437 }; 438 439 class ShowAboutAction : public UISimpleAction440 { 441 Q_OBJECT; 442 443 public: 444 445 ShowAboutAction(QObject *pParent)446 : UI SimpleAction(pParent, ":/about_16px.png")401 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "C&heck for updates...")), gMS->shortcut(UIMachineShortcuts::UpdateShortcut))); 402 setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version")); 403 } 404 }; 405 406 class UIActionSimpleAbout : public UIActionSimple 407 { 408 Q_OBJECT; 409 410 public: 411 412 UIActionSimpleAbout(QObject *pParent) 413 : UIActionSimple(pParent, ":/about_16px.png") 447 414 { 448 415 setMenuRole(QAction::AboutRole); … … 463 430 void retranslateUi() 464 431 { 465 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "&About VirtualBox...")), gMS->shortcut(UIMachineShortcuts::AboutShortcut))); 466 setStatusTip(QApplication::translate("UIMessageCenter", "Show a dialog with product information")); 467 } 468 }; 432 setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&About VirtualBox...")), gMS->shortcut(UIMachineShortcuts::AboutShortcut))); 433 setStatusTip(QApplication::translate("UIActionPool", "Show a dialog with product information")); 434 } 435 }; 436 469 437 470 438 /* UIActionPool stuff: */ … … 514 482 { 515 483 /* Get current action: */ 516 UIAction Interface*pAction = m_pool[keys[i]];484 UIAction *pAction = m_pool[keys[i]]; 517 485 /* Skip menus/separators: */ 518 486 if (pAction->type() == UIActionType_Menu) … … 542 510 { 543 511 /* Various dialog actions: */ 544 m_pool[UIActionIndex_Simple_LogDialog] = new UI SimpleActionLogDialog(this);512 m_pool[UIActionIndex_Simple_LogDialog] = new UIActionSimpleLogDialog(this); 545 513 /* 'Help' actions: */ 546 m_pool[UIActionIndex_Simple_Help] = new ShowHelpAction(this); 547 m_pool[UIActionIndex_Simple_Web] = new ShowWebAction(this); 548 m_pool[UIActionIndex_Simple_ResetWarnings] = new PerformResetWarningsAction(this); 549 m_pool[UIActionIndex_Simple_NetworkAccessManager] = new ShowNetworkAccessManagerAction(this); 550 #ifdef VBOX_WITH_REGISTRATION 551 m_pool[UIActionIndex_Simple_Register] = new PerformRegisterAction(this); 552 #endif /* VBOX_WITH_REGISTRATION */ 553 m_pool[UIActionIndex_Simple_Update] = new PerformUpdateAction(this); 554 m_pool[UIActionIndex_Simple_About] = new ShowAboutAction(this); 514 m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this); 515 m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this); 516 m_pool[UIActionIndex_Simple_ResetWarnings] = new UIActionSimpleResetWarnings(this); 517 m_pool[UIActionIndex_Simple_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this); 518 m_pool[UIActionIndex_Simple_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this); 519 m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this); 555 520 } 556 521 … … 563 528 /* Recreate 'help' menu items as well. 564 529 * This makes sure they are removed also from the Application menu: */ 565 if (m_pool[UIActionIndex_Simple_ Help])566 delete m_pool[UIActionIndex_Simple_ Help];567 m_pool[UIActionIndex_Simple_ Help] = new ShowHelpAction(this);568 if (m_pool[UIActionIndex_Simple_Web ])569 delete m_pool[UIActionIndex_Simple_Web ];570 m_pool[UIActionIndex_Simple_Web ] = new ShowWebAction(this);530 if (m_pool[UIActionIndex_Simple_Contents]) 531 delete m_pool[UIActionIndex_Simple_Contents]; 532 m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this); 533 if (m_pool[UIActionIndex_Simple_WebSite]) 534 delete m_pool[UIActionIndex_Simple_WebSite]; 535 m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this); 571 536 if (m_pool[UIActionIndex_Simple_ResetWarnings]) 572 537 delete m_pool[UIActionIndex_Simple_ResetWarnings]; 573 m_pool[UIActionIndex_Simple_ResetWarnings] = new PerformResetWarningsAction(this);538 m_pool[UIActionIndex_Simple_ResetWarnings] = new UIActionSimpleResetWarnings(this); 574 539 if (m_pool[UIActionIndex_Simple_NetworkAccessManager]) 575 540 delete m_pool[UIActionIndex_Simple_NetworkAccessManager]; 576 m_pool[UIActionIndex_Simple_NetworkAccessManager] = new ShowNetworkAccessManagerAction(this); 577 #ifdef VBOX_WITH_REGISTRATION 578 if (m_pool[UIActionIndex_Simple_Register]) 579 delete m_pool[UIActionIndex_Simple_Register] 580 m_pool[UIActionIndex_Simple_Register] = new PerformRegisterAction(this); 581 #endif /* VBOX_WITH_REGISTRATION */ 541 m_pool[UIActionIndex_Simple_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this); 582 542 #if defined(Q_WS_MAC) && (QT_VERSION >= 0x040700) 583 543 /* For whatever reason, Qt doesn't fully remove items with a … … 585 545 * itself is deleted, a dummy entry is leaved back in the menu. 586 546 * Hiding before deletion helps. */ 587 m_pool[UIActionIndex_Simple_ Update]->setVisible(false);547 m_pool[UIActionIndex_Simple_CheckForUpdates]->setVisible(false); 588 548 #endif 589 549 #if !(defined(Q_WS_MAC) && (QT_VERSION < 0x040700)) 590 if (m_pool[UIActionIndex_Simple_ Update])591 delete m_pool[UIActionIndex_Simple_ Update];592 m_pool[UIActionIndex_Simple_ Update] = new PerformUpdateAction(this);550 if (m_pool[UIActionIndex_Simple_CheckForUpdates]) 551 delete m_pool[UIActionIndex_Simple_CheckForUpdates]; 552 m_pool[UIActionIndex_Simple_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this); 593 553 if (m_pool[UIActionIndex_Simple_About]) 594 554 delete m_pool[UIActionIndex_Simple_About]; 595 m_pool[UIActionIndex_Simple_About] = new ShowAboutAction(this);555 m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this); 596 556 #endif 597 557 … … 599 559 if (m_pool[UIActionIndex_Menu_Help]) 600 560 delete m_pool[UIActionIndex_Menu_Help]; 601 m_pool[UIActionIndex_Menu_Help] = new MenuHelpAction(this);561 m_pool[UIActionIndex_Menu_Help] = new UIActionMenuHelp(this); 602 562 } 603 563 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r41047 r42526 6 6 7 7 /* 8 * Copyright (C) 2010-201 1Oracle Corporation8 * Copyright (C) 2010-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 44 44 /* 'Help' menu actions: */ 45 45 UIActionIndex_Menu_Help, 46 UIActionIndex_Simple_ Help,47 UIActionIndex_Simple_Web ,46 UIActionIndex_Simple_Contents, 47 UIActionIndex_Simple_WebSite, 48 48 UIActionIndex_Simple_ResetWarnings, 49 49 UIActionIndex_Simple_NetworkAccessManager, 50 #ifdef VBOX_WITH_REGISTRATION 51 UIActionIndex_Simple_Register, 52 #endif /* VBOX_WITH_REGISTRATION */ 53 UIActionIndex_Simple_Update, 50 UIActionIndex_Simple_CheckForUpdates, 54 51 UIActionIndex_Simple_About, 55 52 … … 59 56 60 57 /* Basic abstract QAction reimplemetation, extending interface: */ 61 class UIAction Interface: public QIWithRetranslateUI3<QAction>58 class UIAction : public QIWithRetranslateUI3<QAction> 62 59 { 63 60 Q_OBJECT; … … 71 68 protected: 72 69 73 UIAction Interface(QObject *pParent, UIActionType type);70 UIAction(QObject *pParent, UIActionType type); 74 71 75 72 QString menuText(const QString &strText); … … 81 78 82 79 /* Basic QMenu reimplemetation, extending interface: */ 83 class UIMenu Interface: public QMenu80 class UIMenu : public QMenu 84 81 { 85 82 Q_OBJECT; … … 87 84 public: 88 85 89 UIMenu Interface();86 UIMenu(); 90 87 91 88 void setShowToolTips(bool fShowToolTips) { m_fShowToolTips = fShowToolTips; } … … 99 96 }; 100 97 101 /* Abstract extention for UIAction Interface, describing 'simple' action type: */102 class UI SimpleAction : public UIActionInterface103 { 104 Q_OBJECT; 105 106 protected: 107 108 UI SimpleAction(QObject *pParent,98 /* Abstract extention for UIAction, describing 'simple' action type: */ 99 class UIActionSimple : public UIAction 100 { 101 Q_OBJECT; 102 103 protected: 104 105 UIActionSimple(QObject *pParent, 109 106 const QString &strIcon = QString(), const QString &strIconDis = QString()); 110 UI SimpleAction(QObject *pParent,107 UIActionSimple(QObject *pParent, 111 108 const QSize &normalSize, const QSize &smallSize, 112 109 const QString &strNormalIcon, const QString &strSmallIcon, 113 110 const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString()); 114 UI SimpleAction(QObject *pParent, const QIcon& icon);115 }; 116 117 /* Abstract extention for UIAction Interface, describing 'state' action type: */118 class UI StateAction : public UIActionInterface119 { 120 Q_OBJECT; 121 122 protected: 123 124 UI StateAction(QObject *pParent,111 UIActionSimple(QObject *pParent, const QIcon& icon); 112 }; 113 114 /* Abstract extention for UIAction, describing 'state' action type: */ 115 class UIActionState : public UIAction 116 { 117 Q_OBJECT; 118 119 protected: 120 121 UIActionState(QObject *pParent, 125 122 const QString &strIcon = QString(), const QString &strIconDis = QString()); 126 UI StateAction(QObject *pParent,123 UIActionState(QObject *pParent, 127 124 const QSize &normalSize, const QSize &smallSize, 128 125 const QString &strNormalIcon, const QString &strSmallIcon, 129 126 const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString()); 130 UI StateAction(QObject *pParent, const QIcon& icon);127 UIActionState(QObject *pParent, const QIcon& icon); 131 128 void setState(int iState) { m_iState = iState; retranslateUi(); } 132 129 … … 134 131 }; 135 132 136 /* Abstract extention for UIAction Interface, describing 'toggle' action type: */137 class UI ToggleAction : public UIActionInterface138 { 139 Q_OBJECT; 140 141 protected: 142 143 UI ToggleAction(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());144 UI ToggleAction(QObject *pParent,133 /* Abstract extention for UIAction, describing 'toggle' action type: */ 134 class UIActionToggle : public UIAction 135 { 136 Q_OBJECT; 137 138 protected: 139 140 UIActionToggle(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString()); 141 UIActionToggle(QObject *pParent, 145 142 const QSize &normalSize, const QSize &smallSize, 146 143 const QString &strNormalIcon, const QString &strSmallIcon, 147 144 const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString()); 148 UI ToggleAction(QObject *pParent, const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);149 UI ToggleAction(QObject *pParent, const QIcon &icon);145 UIActionToggle(QObject *pParent, const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis); 146 UIActionToggle(QObject *pParent, const QIcon &icon); 150 147 void updateAppearance() { sltUpdateAppearance(); } 151 148 … … 159 156 }; 160 157 161 /* Abstract extention for UIAction Interface, describing 'menu' action type: */162 class UI MenuAction : public UIActionInterface163 { 164 Q_OBJECT; 165 166 protected: 167 168 UI MenuAction(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());169 UI MenuAction(QObject *pParent, const QIcon &icon);158 /* Abstract extention for UIAction, describing 'menu' action type: */ 159 class UIActionMenu : public UIAction 160 { 161 Q_OBJECT; 162 163 protected: 164 165 UIActionMenu(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString()); 166 UIActionMenu(QObject *pParent, const QIcon &icon); 170 167 }; 171 168 … … 196 193 197 194 /* Return corresponding action: */ 198 UIAction Interface* action(int iIndex) const { return m_pool[iIndex]; }195 UIAction* action(int iIndex) const { return m_pool[iIndex]; } 199 196 200 197 /* Helping stuff: */ … … 222 219 223 220 /* Actions pool itself: */ 224 QMap<int, UIAction Interface*> m_pool;221 QMap<int, UIAction*> m_pool; 225 222 }; 226 223 227 224 #define gActionPool UIActionPool::instance() 228 225 229 #endif / / __UIActionPool_h__230 226 #endif /* __UIActionPool_h__ */ 227 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r41695 r42526 43 43 const char* UIDefs::GUI_SelectorVMPositions = "GUI/SelectorVMPositions"; 44 44 const char* UIDefs::GUI_LastVMSelected = "GUI/LastVMSelected"; 45 const char* UIDefs::GUI_LastItemSelected = "GUI/LastItemSelected"; 46 const char* UIDefs::GUI_GroupDefinitions = "GUI/GroupDefinitions"; 45 47 46 48 /* Machine-window definitions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r41819 r42526 120 120 extern const char* GUI_SelectorVMPositions; 121 121 extern const char* GUI_LastVMSelected; 122 extern const char* GUI_LastItemSelected; 123 extern const char* GUI_GroupDefinitions; 122 124 123 125 /* Machine-window declarations: */ … … 229 231 Q_DECLARE_METATYPE(StorageSlot); 230 232 233 /* Details element type: */ 234 enum DetailsElementType 235 { 236 DetailsElementType_General, 237 DetailsElementType_System, 238 DetailsElementType_Preview, 239 DetailsElementType_Display, 240 DetailsElementType_Storage, 241 DetailsElementType_Audio, 242 DetailsElementType_Network, 243 DetailsElementType_Serial, 244 #ifdef VBOX_WITH_PARALLEL_PORTS 245 DetailsElementType_Parallel, 246 #endif /* VBOX_WITH_PARALLEL_PORTS */ 247 DetailsElementType_USB, 248 DetailsElementType_SF, 249 DetailsElementType_Description 250 }; 251 Q_DECLARE_METATYPE(DetailsElementType); 252 231 253 #endif // __UIDefs_h__ 232 254 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r42261 r42526 1245 1245 } 1246 1246 1247 int UIMessageCenter::confirmMachineItemRemoval(const QStringList &names) 1248 { 1249 return message(&vboxGlobal().selectorWnd(), 1250 Question, 1251 tr("<p>You are about to remove following virtual " 1252 "machine items from the machine list:</p>" 1253 "<p><b>%1</b></p>" 1254 "<p>Do you wish to proceed?</p>").arg(names.join(", ")), 1255 0, /* auto-confirm id */ 1256 QIMessageBox::Ok, 1257 QIMessageBox::Cancel | QIMessageBox::Escape | QIMessageBox::Default, 1258 0, 1259 tr("Remove")); 1260 } 1261 1247 1262 int UIMessageCenter::confirmMachineDeletion(const QList<CMachine> &machines) 1248 1263 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r41615 r42526 255 255 int cannotEnterSeamlessMode(); 256 256 257 int confirmMachineItemRemoval(const QStringList &names); 257 258 int confirmMachineDeletion(const QList<CMachine> &machines); 258 259 bool confirmDiscardSavedState(const CMachine &machine); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r42382 r42526 1109 1109 * @todo in UIMedium::details()). 1110 1110 */ 1111 QString VBoxGlobal::details (const CMedium &aMedium, bool aPredictDiff )1111 QString VBoxGlobal::details (const CMedium &aMedium, bool aPredictDiff, bool fUseHtml /* = true */) 1112 1112 { 1113 1113 CMedium cmedium (aMedium); … … 1123 1123 } 1124 1124 1125 return medium.detailsHTML (true /* aNoDiffs */, aPredictDiff); 1125 return fUseHtml ? medium.detailsHTML (true /* aNoDiffs */, aPredictDiff) : 1126 medium.details(true /* aNoDiffs */, aPredictDiff); 1126 1127 } 1127 1128 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r42382 r42526 224 224 /* details generators */ 225 225 226 QString details (const CMedium &aHD, bool aPredictDiff );226 QString details (const CMedium &aHD, bool aPredictDiff, bool fUseHtml = true); 227 227 228 228 QString details (const CUSBDevice &aDevice) const; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r40537 r42526 23 23 #include "VBoxGlobal.h" 24 24 25 class MenuMachineAction : public UI MenuAction25 class MenuMachineAction : public UIActionMenu 26 26 { 27 27 Q_OBJECT; … … 30 30 31 31 MenuMachineAction(QObject *pParent) 32 : UI MenuAction(pParent)32 : UIActionMenu(pParent) 33 33 { 34 34 retranslateUi(); … … 43 43 }; 44 44 45 class ShowSettingsDialogAction : public UI SimpleAction45 class ShowSettingsDialogAction : public UIActionSimple 46 46 { 47 47 Q_OBJECT; … … 50 50 51 51 ShowSettingsDialogAction(QObject *pParent) 52 : UI SimpleAction(pParent, ":/settings_16px.png", ":/settings_dis_16px.png")52 : UIActionSimple(pParent, ":/settings_16px.png", ":/settings_dis_16px.png") 53 53 { 54 54 retranslateUi(); … … 64 64 }; 65 65 66 class PerformTakeSnapshotAction : public UI SimpleAction66 class PerformTakeSnapshotAction : public UIActionSimple 67 67 { 68 68 Q_OBJECT; … … 71 71 72 72 PerformTakeSnapshotAction(QObject *pParent) 73 : UI SimpleAction(pParent, ":/take_snapshot_16px.png", ":/take_snapshot_dis_16px.png")73 : UIActionSimple(pParent, ":/take_snapshot_16px.png", ":/take_snapshot_dis_16px.png") 74 74 { 75 75 retranslateUi(); … … 85 85 }; 86 86 87 class PerformTakeScreenshotAction : public UI SimpleAction87 class PerformTakeScreenshotAction : public UIActionSimple 88 88 { 89 89 Q_OBJECT; … … 92 92 93 93 PerformTakeScreenshotAction(QObject *pParent) 94 : UI SimpleAction(pParent, ":/take_screenshot_16px.png", ":/take_screenshot_disabled_16px.png")94 : UIActionSimple(pParent, ":/take_screenshot_16px.png", ":/take_screenshot_disabled_16px.png") 95 95 { 96 96 retranslateUi(); … … 106 106 }; 107 107 108 class ShowInformationDialogAction : public UI SimpleAction108 class ShowInformationDialogAction : public UIActionSimple 109 109 { 110 110 Q_OBJECT; … … 113 113 114 114 ShowInformationDialogAction(QObject *pParent) 115 : UI SimpleAction(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png")115 : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png") 116 116 { 117 117 retranslateUi(); … … 127 127 }; 128 128 129 class MenuMouseIntegrationAction : public UI MenuAction129 class MenuMouseIntegrationAction : public UIActionMenu 130 130 { 131 131 Q_OBJECT; … … 134 134 135 135 MenuMouseIntegrationAction(QObject *pParent) 136 : UI MenuAction(pParent)136 : UIActionMenu(pParent) 137 137 { 138 138 retranslateUi(); … … 144 144 }; 145 145 146 class ToggleMouseIntegrationAction : public UI ToggleAction146 class ToggleMouseIntegrationAction : public UIActionToggle 147 147 { 148 148 Q_OBJECT; … … 151 151 152 152 ToggleMouseIntegrationAction(QObject *pParent) 153 : UI ToggleAction(pParent,153 : UIActionToggle(pParent, 154 154 ":/mouse_can_seamless_on_16px.png", ":/mouse_can_seamless_16px.png", 155 155 ":/mouse_can_seamless_on_disabled_16px.png", ":/mouse_can_seamless_disabled_16px.png") … … 167 167 }; 168 168 169 class PerformTypeCADAction : public UI SimpleAction169 class PerformTypeCADAction : public UIActionSimple 170 170 { 171 171 Q_OBJECT; … … 174 174 175 175 PerformTypeCADAction(QObject *pParent) 176 : UI SimpleAction(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")176 : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") 177 177 { 178 178 retranslateUi(); … … 189 189 190 190 #ifdef Q_WS_X11 191 class PerformTypeCABSAction : public UI SimpleAction191 class PerformTypeCABSAction : public UIActionSimple 192 192 { 193 193 Q_OBJECT; … … 196 196 197 197 PerformTypeCABSAction(QObject *pParent) 198 : UI SimpleAction(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")198 : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png") 199 199 { 200 200 retranslateUi(); … … 211 211 #endif /* Q_WS_X11 */ 212 212 213 class TogglePauseAction : public UI ToggleAction213 class TogglePauseAction : public UIActionToggle 214 214 { 215 215 Q_OBJECT; … … 218 218 219 219 TogglePauseAction(QObject *pParent) 220 : UI ToggleAction(pParent, ":/pause_16px.png", ":/pause_disabled_16px.png")220 : UIActionToggle(pParent, ":/pause_16px.png", ":/pause_disabled_16px.png") 221 221 { 222 222 retranslateUi(); … … 232 232 }; 233 233 234 class PerformResetAction : public UI SimpleAction234 class PerformResetAction : public UIActionSimple 235 235 { 236 236 Q_OBJECT; … … 239 239 240 240 PerformResetAction(QObject *pParent) 241 : UI SimpleAction(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")241 : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png") 242 242 { 243 243 retranslateUi(); … … 253 253 }; 254 254 255 class PerformShutdownAction : public UI SimpleAction255 class PerformShutdownAction : public UIActionSimple 256 256 { 257 257 Q_OBJECT; … … 260 260 261 261 PerformShutdownAction(QObject *pParent) 262 : UI SimpleAction(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")262 : UIActionSimple(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png") 263 263 { 264 264 retranslateUi(); … … 274 274 }; 275 275 276 class PerformCloseAction : public UI SimpleAction276 class PerformCloseAction : public UIActionSimple 277 277 { 278 278 Q_OBJECT; … … 281 281 282 282 PerformCloseAction(QObject *pParent) 283 : UI SimpleAction(pParent, ":/exit_16px.png")283 : UIActionSimple(pParent, ":/exit_16px.png") 284 284 { 285 285 setMenuRole(QAction::QuitRole); … … 296 296 }; 297 297 298 class MenuViewAction : public UI MenuAction298 class MenuViewAction : public UIActionMenu 299 299 { 300 300 Q_OBJECT; … … 303 303 304 304 MenuViewAction(QObject *pParent) 305 : UI MenuAction(pParent)305 : UIActionMenu(pParent) 306 306 { 307 307 retranslateUi(); … … 316 316 }; 317 317 318 class ToggleFullscreenModeAction : public UI ToggleAction318 class ToggleFullscreenModeAction : public UIActionToggle 319 319 { 320 320 Q_OBJECT; … … 323 323 324 324 ToggleFullscreenModeAction(QObject *pParent) 325 : UI ToggleAction(pParent,325 : UIActionToggle(pParent, 326 326 ":/fullscreen_on_16px.png", ":/fullscreen_16px.png", 327 327 ":/fullscreen_on_disabled_16px.png", ":/fullscreen_disabled_16px.png") … … 339 339 }; 340 340 341 class ToggleSeamlessModeAction : public UI ToggleAction341 class ToggleSeamlessModeAction : public UIActionToggle 342 342 { 343 343 Q_OBJECT; … … 346 346 347 347 ToggleSeamlessModeAction(QObject *pParent) 348 : UI ToggleAction(pParent,348 : UIActionToggle(pParent, 349 349 ":/seamless_on_16px.png", ":/seamless_16px.png", 350 350 ":/seamless_on_disabled_16px.png", ":/seamless_disabled_16px.png") … … 362 362 }; 363 363 364 class ToggleScaleModeAction : public UI ToggleAction364 class ToggleScaleModeAction : public UIActionToggle 365 365 { 366 366 Q_OBJECT; … … 369 369 370 370 ToggleScaleModeAction(QObject *pParent) 371 : UI ToggleAction(pParent,371 : UIActionToggle(pParent, 372 372 ":/scale_on_16px.png", ":/scale_16px.png", 373 373 ":/scale_on_disabled_16px.png", ":/scale_disabled_16px.png") … … 385 385 }; 386 386 387 class ToggleGuestAutoresizeAction : public UI ToggleAction387 class ToggleGuestAutoresizeAction : public UIActionToggle 388 388 { 389 389 Q_OBJECT; … … 392 392 393 393 ToggleGuestAutoresizeAction(QObject *pParent) 394 : UI ToggleAction(pParent,394 : UIActionToggle(pParent, 395 395 ":/auto_resize_on_on_16px.png", ":/auto_resize_on_16px.png", 396 396 ":/auto_resize_on_on_disabled_16px.png", ":/auto_resize_on_disabled_16px.png") … … 408 408 }; 409 409 410 class PerformWindowAdjustAction : public UI SimpleAction410 class PerformWindowAdjustAction : public UIActionSimple 411 411 { 412 412 Q_OBJECT; … … 415 415 416 416 PerformWindowAdjustAction(QObject *pParent) 417 : UI SimpleAction(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png")417 : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png") 418 418 { 419 419 retranslateUi(); … … 429 429 }; 430 430 431 class MenuDevicesAction : public UI MenuAction431 class MenuDevicesAction : public UIActionMenu 432 432 { 433 433 Q_OBJECT; … … 436 436 437 437 MenuDevicesAction(QObject *pParent) 438 : UI MenuAction(pParent)438 : UIActionMenu(pParent) 439 439 { 440 440 retranslateUi(); … … 449 449 }; 450 450 451 class MenuOpticalDevicesAction : public UI MenuAction451 class MenuOpticalDevicesAction : public UIActionMenu 452 452 { 453 453 Q_OBJECT; … … 456 456 457 457 MenuOpticalDevicesAction(QObject *pParent) 458 : UI MenuAction(pParent, ":/cd_16px.png", ":/cd_disabled_16px.png")459 { 460 qobject_cast<UIMenu Interface*>(menu())->setShowToolTips(true);458 : UIActionMenu(pParent, ":/cd_16px.png", ":/cd_disabled_16px.png") 459 { 460 qobject_cast<UIMenu*>(menu())->setShowToolTips(true); 461 461 retranslateUi(); 462 462 } … … 470 470 }; 471 471 472 class MenuFloppyDevicesAction : public UI MenuAction472 class MenuFloppyDevicesAction : public UIActionMenu 473 473 { 474 474 Q_OBJECT; … … 477 477 478 478 MenuFloppyDevicesAction(QObject *pParent) 479 : UI MenuAction(pParent, ":/fd_16px.png", ":/fd_disabled_16px.png")480 { 481 qobject_cast<UIMenu Interface*>(menu())->setShowToolTips(true);479 : UIActionMenu(pParent, ":/fd_16px.png", ":/fd_disabled_16px.png") 480 { 481 qobject_cast<UIMenu*>(menu())->setShowToolTips(true); 482 482 retranslateUi(); 483 483 } … … 491 491 }; 492 492 493 class MenuUSBDevicesAction : public UI MenuAction493 class MenuUSBDevicesAction : public UIActionMenu 494 494 { 495 495 Q_OBJECT; … … 498 498 499 499 MenuUSBDevicesAction(QObject *pParent) 500 : UI MenuAction(pParent, ":/usb_16px.png", ":/usb_disabled_16px.png")501 { 502 qobject_cast<UIMenu Interface*>(menu())->setShowToolTips(true);500 : UIActionMenu(pParent, ":/usb_16px.png", ":/usb_disabled_16px.png") 501 { 502 qobject_cast<UIMenu*>(menu())->setShowToolTips(true); 503 503 retranslateUi(); 504 504 } … … 512 512 }; 513 513 514 class MenuNetworkAdaptersAction : public UI MenuAction514 class MenuNetworkAdaptersAction : public UIActionMenu 515 515 { 516 516 Q_OBJECT; … … 519 519 520 520 MenuNetworkAdaptersAction(QObject *pParent) 521 : UI MenuAction(pParent)521 : UIActionMenu(pParent) 522 522 { 523 523 retranslateUi(); … … 529 529 }; 530 530 531 class ShowNetworkAdaptersDialogAction : public UI SimpleAction531 class ShowNetworkAdaptersDialogAction : public UIActionSimple 532 532 { 533 533 Q_OBJECT; … … 536 536 537 537 ShowNetworkAdaptersDialogAction(QObject *pParent) 538 : UI SimpleAction(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")538 : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png") 539 539 { 540 540 retranslateUi(); … … 550 550 }; 551 551 552 class MenuSharedFoldersAction : public UI MenuAction552 class MenuSharedFoldersAction : public UIActionMenu 553 553 { 554 554 Q_OBJECT; … … 557 557 558 558 MenuSharedFoldersAction(QObject *pParent) 559 : UI MenuAction(pParent)559 : UIActionMenu(pParent) 560 560 { 561 561 retranslateUi(); … … 567 567 }; 568 568 569 class ShowSharedFoldersDialogAction : public UI SimpleAction569 class ShowSharedFoldersDialogAction : public UIActionSimple 570 570 { 571 571 Q_OBJECT; … … 574 574 575 575 ShowSharedFoldersDialogAction(QObject *pParent) 576 : UI SimpleAction(pParent, ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png")576 : UIActionSimple(pParent, ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png") 577 577 { 578 578 retranslateUi(); … … 588 588 }; 589 589 590 class ToggleVRDEServerAction : public UI ToggleAction590 class ToggleVRDEServerAction : public UIActionToggle 591 591 { 592 592 Q_OBJECT; … … 595 595 596 596 ToggleVRDEServerAction(QObject *pParent) 597 : UI ToggleAction(pParent,597 : UIActionToggle(pParent, 598 598 ":/vrdp_on_16px.png", ":/vrdp_16px.png", 599 599 ":/vrdp_on_disabled_16px.png", ":/vrdp_disabled_16px.png") … … 611 611 }; 612 612 613 class PerformInstallGuestToolsAction : public UI SimpleAction613 class PerformInstallGuestToolsAction : public UIActionSimple 614 614 { 615 615 Q_OBJECT; … … 618 618 619 619 PerformInstallGuestToolsAction(QObject *pParent) 620 : UI SimpleAction(pParent, ":/guesttools_16px.png", ":/guesttools_disabled_16px.png")620 : UIActionSimple(pParent, ":/guesttools_16px.png", ":/guesttools_disabled_16px.png") 621 621 { 622 622 retranslateUi(); … … 633 633 634 634 #ifdef VBOX_WITH_DEBUGGER_GUI 635 class MenuDebugAction : public UI MenuAction635 class MenuDebugAction : public UIActionMenu 636 636 { 637 637 Q_OBJECT; … … 640 640 641 641 MenuDebugAction(QObject *pParent) 642 : UI MenuAction(pParent)642 : UIActionMenu(pParent) 643 643 { 644 644 retranslateUi(); … … 653 653 }; 654 654 655 class ShowStatisticsAction : public UI SimpleAction655 class ShowStatisticsAction : public UIActionSimple 656 656 { 657 657 Q_OBJECT; … … 660 660 661 661 ShowStatisticsAction(QObject *pParent) 662 : UI SimpleAction(pParent)662 : UIActionSimple(pParent) 663 663 { 664 664 retranslateUi(); … … 673 673 }; 674 674 675 class ShowCommandLineAction : public UI SimpleAction675 class ShowCommandLineAction : public UIActionSimple 676 676 { 677 677 Q_OBJECT; … … 680 680 681 681 ShowCommandLineAction(QObject *pParent) 682 : UI SimpleAction(pParent)682 : UIActionSimple(pParent) 683 683 { 684 684 retranslateUi(); … … 693 693 }; 694 694 695 class ToggleLoggingAction : public UI ToggleAction695 class ToggleLoggingAction : public UIActionToggle 696 696 { 697 697 Q_OBJECT; … … 700 700 701 701 ToggleLoggingAction(QObject *pParent) 702 : UI ToggleAction(pParent)702 : UIActionToggle(pParent) 703 703 { 704 704 retranslateUi(); … … 715 715 716 716 #ifdef RT_OS_DARWIN 717 class DockMenuAction : public UI MenuAction717 class DockMenuAction : public UIActionMenu 718 718 { 719 719 Q_OBJECT; … … 722 722 723 723 DockMenuAction(QObject *pParent) 724 : UI MenuAction(pParent)724 : UIActionMenu(pParent) 725 725 { 726 726 retranslateUi(); … … 732 732 }; 733 733 734 class DockSettingsMenuAction : public UI MenuAction734 class DockSettingsMenuAction : public UIActionMenu 735 735 { 736 736 Q_OBJECT; … … 739 739 740 740 DockSettingsMenuAction(QObject *pParent) 741 : UI MenuAction(pParent)741 : UIActionMenu(pParent) 742 742 { 743 743 retranslateUi(); … … 752 752 }; 753 753 754 class ToggleDockPreviewMonitorAction : public UI ToggleAction754 class ToggleDockPreviewMonitorAction : public UIActionToggle 755 755 { 756 756 Q_OBJECT; … … 759 759 760 760 ToggleDockPreviewMonitorAction(QObject *pParent) 761 : UI ToggleAction(pParent)761 : UIActionToggle(pParent) 762 762 { 763 763 retranslateUi(); … … 772 772 }; 773 773 774 class ToggleDockDisableMonitorAction : public UI ToggleAction774 class ToggleDockDisableMonitorAction : public UIActionToggle 775 775 { 776 776 Q_OBJECT; … … 779 779 780 780 ToggleDockDisableMonitorAction(QObject *pParent) 781 : UI ToggleAction(pParent)781 : UIActionToggle(pParent) 782 782 { 783 783 retranslateUi(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r41819 r42526 1109 1109 1110 1110 /* Open VM settings : Shared folders page: */ 1111 sltOpenVMSettingsDialog("#s folders");1111 sltOpenVMSettingsDialog("#sharedFolders"); 1112 1112 } 1113 1113 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r41610 r42526 39 39 /* Helper QMenu reimplementation which allows 40 40 * to highlight first menu item for popped up menu: */ 41 class UIMenu : public QMenu41 class QIMenu : public QMenu 42 42 { 43 43 Q_OBJECT; … … 45 45 public: 46 46 47 UIMenu() : QMenu(0) {}47 QIMenu() : QMenu(0) {} 48 48 49 49 private slots: … … 108 108 { 109 109 /* Create empty menu: */ 110 QMenu *pMenu = new UIMenu;110 QMenu *pMenu = new QIMenu; 111 111 112 112 /* Fill menu with prepared items: */ … … 269 269 270 270 /* Help submenu: */ 271 pMenu->addAction(gActionPool->action(UIActionIndex_Simple_ Help));272 pMenu->addAction(gActionPool->action(UIActionIndex_Simple_Web ));271 pMenu->addAction(gActionPool->action(UIActionIndex_Simple_Contents)); 272 pMenu->addAction(gActionPool->action(UIActionIndex_Simple_WebSite)); 273 273 pMenu->addSeparator(); 274 274 pMenu->addAction(gActionPool->action(UIActionIndex_Simple_ResetWarnings)); … … 300 300 #endif 301 301 302 VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_ Help), SIGNAL(triggered()),302 VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_Contents), SIGNAL(triggered()), 303 303 &msgCenter(), SLOT(sltShowHelpHelpDialog())); 304 VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_Web ), SIGNAL(triggered()),304 VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()), 305 305 &msgCenter(), SLOT(sltShowHelpWebDialog())); 306 306 VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()), -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp
r41047 r42526 7 7 8 8 /* 9 * Copyright (C) 2010-201 1Oracle Corporation9 * Copyright (C) 2010-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 22 22 #include "UISelectorShortcuts.h" 23 23 24 class UI MenuActionFile : public UIMenuAction25 { 26 Q_OBJECT; 27 28 public: 29 30 UI MenuActionFile(QObject *pParent)31 : UI MenuAction(pParent)24 class UIActionMenuFile : public UIActionMenu 25 { 26 Q_OBJECT; 27 28 public: 29 30 UIActionMenuFile(QObject *pParent) 31 : UIActionMenu(pParent) 32 32 { 33 33 retranslateUi(); … … 46 46 }; 47 47 48 class UI SimpleActionMediumManagerDialog : public UISimpleAction49 { 50 Q_OBJECT; 51 52 public: 53 54 UI SimpleActionMediumManagerDialog(QObject *pParent)55 : UI SimpleAction(pParent, ":/diskimage_16px.png")48 class UIActionSimpleMediumManagerDialog : public UIActionSimple 49 { 50 Q_OBJECT; 51 52 public: 53 54 UIActionSimpleMediumManagerDialog(QObject *pParent) 55 : UIActionSimple(pParent, ":/diskimage_16px.png") 56 56 { 57 57 retranslateUi(); … … 68 68 }; 69 69 70 class UI SimpleActionImportApplianceWizard : public UISimpleAction71 { 72 Q_OBJECT; 73 74 public: 75 76 UI SimpleActionImportApplianceWizard(QObject *pParent)77 : UI SimpleAction(pParent, ":/import_16px.png")70 class UIActionSimpleImportApplianceWizard : public UIActionSimple 71 { 72 Q_OBJECT; 73 74 public: 75 76 UIActionSimpleImportApplianceWizard(QObject *pParent) 77 : UIActionSimple(pParent, ":/import_16px.png") 78 78 { 79 79 retranslateUi(); … … 90 90 }; 91 91 92 class UI SimpleActionExportApplianceWizard : public UISimpleAction93 { 94 Q_OBJECT; 95 96 public: 97 98 UI SimpleActionExportApplianceWizard(QObject *pParent)99 : UI SimpleAction(pParent, ":/export_16px.png")92 class UIActionSimpleExportApplianceWizard : public UIActionSimple 93 { 94 Q_OBJECT; 95 96 public: 97 98 UIActionSimpleExportApplianceWizard(QObject *pParent) 99 : UIActionSimple(pParent, ":/export_16px.png") 100 100 { 101 101 retranslateUi(); … … 112 112 }; 113 113 114 class UI SimpleActionPreferencesDialog : public UISimpleAction115 { 116 Q_OBJECT; 117 118 public: 119 120 UI SimpleActionPreferencesDialog(QObject *pParent)121 : UI SimpleAction(pParent, ":/global_settings_16px.png")114 class UIActionSimplePreferencesDialog : public UIActionSimple 115 { 116 Q_OBJECT; 117 118 public: 119 120 UIActionSimplePreferencesDialog(QObject *pParent) 121 : UIActionSimple(pParent, ":/global_settings_16px.png") 122 122 { 123 123 setMenuRole(QAction::PreferencesRole); … … 135 135 }; 136 136 137 class UI SimpleActionExit : public UISimpleAction138 { 139 Q_OBJECT; 140 141 public: 142 143 UI SimpleActionExit(QObject *pParent)144 : UI SimpleAction(pParent, ":/exit_16px.png")137 class UIActionSimpleExit : public UIActionSimple 138 { 139 Q_OBJECT; 140 141 public: 142 143 UIActionSimpleExit(QObject *pParent) 144 : UIActionSimple(pParent, ":/exit_16px.png") 145 145 { 146 146 setMenuRole(QAction::QuitRole); … … 158 158 }; 159 159 160 class UIMenuActionMachine : public UIMenuAction 161 { 162 Q_OBJECT; 163 164 public: 165 166 UIMenuActionMachine(QObject *pParent) 167 : UIMenuAction(pParent) 168 { 169 retranslateUi(); 170 } 171 172 protected: 173 174 void retranslateUi() 175 { 176 menu()->setTitle(QApplication::translate("UIActionPool", "&Machine")); 177 } 178 }; 179 180 class UISimpleActionNewWizard : public UISimpleAction 181 { 182 Q_OBJECT; 183 184 public: 185 186 UISimpleActionNewWizard(QObject *pParent) 187 : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png") 188 { 189 retranslateUi(); 190 } 191 192 protected: 193 194 void retranslateUi() 195 { 196 setText(QApplication::translate("UIActionPool", "&New...")); 160 161 class UIActionMenuGroup : public UIActionMenu 162 { 163 Q_OBJECT; 164 165 public: 166 167 UIActionMenuGroup(QObject *pParent) 168 : UIActionMenu(pParent) 169 { 170 retranslateUi(); 171 } 172 173 protected: 174 175 void retranslateUi() 176 { 177 menu()->setTitle(QApplication::translate("UIActionPool", "&Group")); 178 } 179 }; 180 181 class UIActionSimpleGroupNewWizard : public UIActionSimple 182 { 183 Q_OBJECT; 184 185 public: 186 187 UIActionSimpleGroupNewWizard(QObject *pParent) 188 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png") 189 { 190 retranslateUi(); 191 } 192 193 protected: 194 195 void retranslateUi() 196 { 197 setText(QApplication::translate("UIActionPool", "&New machine...")); 197 198 setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine")); 198 199 setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut)); … … 202 203 }; 203 204 204 class UI SimpleActionAddDialog : public UISimpleAction205 { 206 Q_OBJECT; 207 208 public: 209 210 UI SimpleActionAddDialog(QObject *pParent)211 : UI SimpleAction(pParent, ":/vm_add_16px.png")212 { 213 retranslateUi(); 214 } 215 216 protected: 217 218 void retranslateUi() 219 { 220 setText(QApplication::translate("UIActionPool", "&Add ..."));205 class UIActionSimpleGroupAddDialog : public UIActionSimple 206 { 207 Q_OBJECT; 208 209 public: 210 211 UIActionSimpleGroupAddDialog(QObject *pParent) 212 : UIActionSimple(pParent, ":/vm_add_16px.png") 213 { 214 retranslateUi(); 215 } 216 217 protected: 218 219 void retranslateUi() 220 { 221 setText(QApplication::translate("UIActionPool", "&Add machine...")); 221 222 setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine")); 222 223 setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut)); … … 224 225 }; 225 226 226 class UISimpleActionSettingsDialog : public UISimpleAction 227 { 228 Q_OBJECT; 229 230 public: 231 232 UISimpleActionSettingsDialog(QObject *pParent) 233 : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16), 234 ":/vm_settings_32px.png", ":/settings_16px.png", 235 ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png") 236 { 237 retranslateUi(); 238 } 239 240 protected: 241 242 void retranslateUi() 243 { 244 setText(QApplication::translate("UIActionPool", "&Settings...")); 245 setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings")); 246 setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut)); 247 setToolTip(text().remove('&').remove('.') + 248 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 249 } 250 }; 251 252 class UISimpleActionCloneWizard : public UISimpleAction 253 { 254 Q_OBJECT; 255 256 public: 257 258 UISimpleActionCloneWizard(QObject *pParent) 259 : UISimpleAction(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png") 260 { 261 retranslateUi(); 262 } 263 264 protected: 265 266 void retranslateUi() 267 { 268 setText(QApplication::translate("UIActionPool", "Cl&one...")); 269 setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine")); 270 setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut)); 271 } 272 }; 273 274 class UISimpleActionRemoveDialog : public UISimpleAction 275 { 276 Q_OBJECT; 277 278 public: 279 280 UISimpleActionRemoveDialog(QObject *pParent) 281 : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16), 227 class UIActionSimpleGroupRenameDialog : public UIActionSimple 228 { 229 Q_OBJECT; 230 231 public: 232 233 UIActionSimpleGroupRenameDialog(QObject *pParent) 234 : UIActionSimple(pParent, ":/name_16px.png") 235 { 236 retranslateUi(); 237 } 238 239 protected: 240 241 void retranslateUi() 242 { 243 setText(QApplication::translate("UIActionPool", "Rena&me group...")); 244 setStatusTip(QApplication::translate("UIActionPool", "Rename the selected virtual machine group")); 245 setShortcut(gSS->keySequence(UISelectorShortcuts::RenameVMGroupShortcut)); 246 } 247 }; 248 249 class UIActionSimpleGroupRemoveDialog : public UIActionSimple 250 { 251 Q_OBJECT; 252 253 public: 254 255 UIActionSimpleGroupRemoveDialog(QObject *pParent) 256 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 282 257 ":/vm_delete_32px.png", ":/delete_16px.png", 283 258 ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png") … … 290 265 void retranslateUi() 291 266 { 292 setText(QApplication::translate("UIActionPool", "&Remove "));293 setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine "));267 setText(QApplication::translate("UIActionPool", "&Remove group...")); 268 setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine group")); 294 269 setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut)); 295 270 } 296 271 }; 297 272 298 class UI StateActionStartOrShow : public UIStateAction299 { 300 Q_OBJECT; 301 302 public: 303 304 UI StateActionStartOrShow(QObject *pParent)305 : UI StateAction(pParent, QSize(32, 32), QSize(16, 16),273 class UIActionStateGroupStartOrShow : public UIActionState 274 { 275 Q_OBJECT; 276 277 public: 278 279 UIActionStateGroupStartOrShow(QObject *pParent) 280 : UIActionState(pParent, QSize(32, 32), QSize(16, 16), 306 281 ":/vm_start_32px.png", ":/start_16px.png", 307 282 ":/vm_start_disabled_32px.png", ":/start_dis_16px.png") … … 340 315 }; 341 316 342 class UISimpleActionDiscard : public UISimpleAction 343 { 344 Q_OBJECT; 345 346 public: 347 348 UISimpleActionDiscard(QObject *pParent) 349 : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16), 350 ":/vm_discard_32px.png", ":/discard_16px.png", 351 ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png") 352 { 353 retranslateUi(); 354 } 355 356 protected: 357 358 void retranslateUi() 359 { 360 setIconText(QApplication::translate("UIActionPool", "Discard")); 361 setText(QApplication::translate("UIActionPool", "D&iscard Saved State")); 362 setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machine")); 363 setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut)); 364 setToolTip(text().remove('&').remove('.') + 365 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 366 } 367 }; 368 369 class UIToggleActionPauseAndResume : public UIToggleAction 370 { 371 Q_OBJECT; 372 373 public: 374 375 UIToggleActionPauseAndResume(QObject *pParent) 376 : UIToggleAction(pParent, QSize(32, 32), QSize(16, 16), 317 class UIActionToggleGroupPauseAndResume : public UIActionToggle 318 { 319 Q_OBJECT; 320 321 public: 322 323 UIActionToggleGroupPauseAndResume(QObject *pParent) 324 : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16), 377 325 ":/vm_pause_32px.png", ":/pause_16px.png", 378 326 ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png") … … 391 339 }; 392 340 393 class UI SimpleActionReset : public UISimpleAction394 { 395 Q_OBJECT; 396 397 public: 398 399 UI SimpleActionReset(QObject *pParent)400 : UI SimpleAction(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")341 class UIActionSimpleGroupReset : public UIActionSimple 342 { 343 Q_OBJECT; 344 345 public: 346 347 UIActionSimpleGroupReset(QObject *pParent) 348 : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png") 401 349 { 402 350 retranslateUi(); … … 413 361 }; 414 362 415 class UI SimpleActionRefresh : public UISimpleAction416 { 417 Q_OBJECT; 418 419 public: 420 421 UI SimpleActionRefresh(QObject *pParent)422 : UI SimpleAction(pParent, QSize(32, 32), QSize(16, 16),363 class UIActionSimpleGroupRefresh : public UIActionSimple 364 { 365 Q_OBJECT; 366 367 public: 368 369 UIActionSimpleGroupRefresh(QObject *pParent) 370 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 423 371 ":/refresh_32px.png", ":/refresh_16px.png", 424 372 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png") … … 431 379 void retranslateUi() 432 380 { 433 setText(QApplication::translate("UIActionPool", "Re&fresh "));381 setText(QApplication::translate("UIActionPool", "Re&fresh...")); 434 382 setStatusTip(QApplication::translate("UIActionPool", "Refresh the accessibility state of the selected virtual machine")); 435 383 setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut)); … … 437 385 }; 438 386 439 class UI SimpleActionShowInFileManager : public UISimpleAction440 { 441 Q_OBJECT; 442 443 public: 444 445 UI SimpleActionShowInFileManager(QObject *pParent)446 : UI SimpleAction(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")387 class UIActionSimpleGroupShowInFileManager : public UIActionSimple 388 { 389 Q_OBJECT; 390 391 public: 392 393 UIActionSimpleGroupShowInFileManager(QObject *pParent) 394 : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png") 447 395 { 448 396 retranslateUi(); … … 467 415 }; 468 416 469 class UI SimpleActionCreateShortcut : public UISimpleAction470 { 471 Q_OBJECT; 472 473 public: 474 475 UI SimpleActionCreateShortcut(QObject *pParent)476 : UI SimpleAction(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")417 class UIActionSimpleGroupCreateShortcut : public UIActionSimple 418 { 419 Q_OBJECT; 420 421 public: 422 423 UIActionSimpleGroupCreateShortcut(QObject *pParent) 424 : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png") 477 425 { 478 426 retranslateUi(); … … 494 442 }; 495 443 496 class UI SimpleActionSort : public UISimpleAction497 { 498 Q_OBJECT; 499 500 public: 501 502 UI SimpleActionSort(QObject *pParent)503 : UI SimpleAction(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)444 class UIActionSimpleGroupSort : public UIActionSimple 445 { 446 Q_OBJECT; 447 448 public: 449 450 UIActionSimpleGroupSort(QObject *pParent) 451 : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/) 504 452 { 505 453 retranslateUi(); … … 516 464 }; 517 465 518 class UIMenuActionMachineClose : public UIMenuAction 519 { 520 Q_OBJECT; 521 522 public: 523 524 UIMenuActionMachineClose(QObject *pParent) 525 : UIMenuAction(pParent, ":/exit_16px.png") 466 467 class UIActionMenuMachine : public UIActionMenu 468 { 469 Q_OBJECT; 470 471 public: 472 473 UIActionMenuMachine(QObject *pParent) 474 : UIActionMenu(pParent) 475 { 476 retranslateUi(); 477 } 478 479 protected: 480 481 void retranslateUi() 482 { 483 menu()->setTitle(QApplication::translate("UIActionPool", "&Machine")); 484 } 485 }; 486 487 class UIActionSimpleMachineNewWizard : public UIActionSimple 488 { 489 Q_OBJECT; 490 491 public: 492 493 UIActionSimpleMachineNewWizard(QObject *pParent) 494 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png") 495 { 496 retranslateUi(); 497 } 498 499 protected: 500 501 void retranslateUi() 502 { 503 setText(QApplication::translate("UIActionPool", "&New...")); 504 setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine")); 505 setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut)); 506 setToolTip(text().remove('&').remove('.') + 507 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 508 } 509 }; 510 511 class UIActionSimpleMachineAddDialog : public UIActionSimple 512 { 513 Q_OBJECT; 514 515 public: 516 517 UIActionSimpleMachineAddDialog(QObject *pParent) 518 : UIActionSimple(pParent, ":/vm_add_16px.png") 519 { 520 retranslateUi(); 521 } 522 523 protected: 524 525 void retranslateUi() 526 { 527 setText(QApplication::translate("UIActionPool", "&Add...")); 528 setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine")); 529 setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut)); 530 } 531 }; 532 533 class UIActionSimpleMachineSettingsDialog : public UIActionSimple 534 { 535 Q_OBJECT; 536 537 public: 538 539 UIActionSimpleMachineSettingsDialog(QObject *pParent) 540 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 541 ":/vm_settings_32px.png", ":/settings_16px.png", 542 ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png") 543 { 544 retranslateUi(); 545 } 546 547 protected: 548 549 void retranslateUi() 550 { 551 setText(QApplication::translate("UIActionPool", "&Settings...")); 552 setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings")); 553 setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut)); 554 setToolTip(text().remove('&').remove('.') + 555 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 556 } 557 }; 558 559 class UIActionSimpleMachineCloneWizard : public UIActionSimple 560 { 561 Q_OBJECT; 562 563 public: 564 565 UIActionSimpleMachineCloneWizard(QObject *pParent) 566 : UIActionSimple(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png") 567 { 568 retranslateUi(); 569 } 570 571 protected: 572 573 void retranslateUi() 574 { 575 setText(QApplication::translate("UIActionPool", "Cl&one...")); 576 setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine")); 577 setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut)); 578 } 579 }; 580 581 class UIActionSimpleMachineRemoveDialog : public UIActionSimple 582 { 583 Q_OBJECT; 584 585 public: 586 587 UIActionSimpleMachineRemoveDialog(QObject *pParent) 588 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 589 ":/vm_delete_32px.png", ":/delete_16px.png", 590 ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png") 591 { 592 retranslateUi(); 593 } 594 595 protected: 596 597 void retranslateUi() 598 { 599 setText(QApplication::translate("UIActionPool", "&Remove...")); 600 setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine")); 601 setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut)); 602 } 603 }; 604 605 class UIActionStateMachineStartOrShow : public UIActionState 606 { 607 Q_OBJECT; 608 609 public: 610 611 UIActionStateMachineStartOrShow(QObject *pParent) 612 : UIActionState(pParent, QSize(32, 32), QSize(16, 16), 613 ":/vm_start_32px.png", ":/start_16px.png", 614 ":/vm_start_disabled_32px.png", ":/start_dis_16px.png") 615 { 616 retranslateUi(); 617 } 618 619 protected: 620 621 void retranslateUi() 622 { 623 switch (m_iState) 624 { 625 case 1: 626 { 627 setText(QApplication::translate("UIActionPool", "S&tart")); 628 setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machine")); 629 setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut)); 630 setToolTip(text().remove('&').remove('.') + 631 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 632 break; 633 } 634 case 2: 635 { 636 setText(QApplication::translate("UIActionPool", "S&how")); 637 setStatusTip(QApplication::translate("UIActionPool", "Switch to the window of the selected virtual machine")); 638 setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut)); 639 setToolTip(text().remove('&').remove('.') + 640 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 641 break; 642 } 643 default: 644 break; 645 } 646 } 647 }; 648 649 class UIActionSimpleMachineDiscard : public UIActionSimple 650 { 651 Q_OBJECT; 652 653 public: 654 655 UIActionSimpleMachineDiscard(QObject *pParent) 656 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 657 ":/vm_discard_32px.png", ":/discard_16px.png", 658 ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png") 659 { 660 retranslateUi(); 661 } 662 663 protected: 664 665 void retranslateUi() 666 { 667 setIconText(QApplication::translate("UIActionPool", "Discard")); 668 setText(QApplication::translate("UIActionPool", "D&iscard saved state...")); 669 setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machine")); 670 setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut)); 671 setToolTip(text().remove('&').remove('.') + 672 (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString()))); 673 } 674 }; 675 676 class UIActionToggleMachinePauseAndResume : public UIActionToggle 677 { 678 Q_OBJECT; 679 680 public: 681 682 UIActionToggleMachinePauseAndResume(QObject *pParent) 683 : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16), 684 ":/vm_pause_32px.png", ":/pause_16px.png", 685 ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png") 686 { 687 retranslateUi(); 688 } 689 690 protected: 691 692 void retranslateUi() 693 { 694 setText(QApplication::translate("UIActionPool", "&Pause")); 695 setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine")); 696 setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut)); 697 } 698 }; 699 700 class UIActionSimpleMachineReset : public UIActionSimple 701 { 702 Q_OBJECT; 703 704 public: 705 706 UIActionSimpleMachineReset(QObject *pParent) 707 : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png") 708 { 709 retranslateUi(); 710 } 711 712 protected: 713 714 void retranslateUi() 715 { 716 setText(QApplication::translate("UIActionPool", "&Reset")); 717 setStatusTip(QApplication::translate("UIActionPool", "Reset the virtual machine")); 718 setShortcut(gSS->keySequence(UISelectorShortcuts::ResetVMShortcut)); 719 } 720 }; 721 722 class UIActionSimpleMachineRefresh : public UIActionSimple 723 { 724 Q_OBJECT; 725 726 public: 727 728 UIActionSimpleMachineRefresh(QObject *pParent) 729 : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), 730 ":/refresh_32px.png", ":/refresh_16px.png", 731 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png") 732 { 733 retranslateUi(); 734 } 735 736 protected: 737 738 void retranslateUi() 739 { 740 setText(QApplication::translate("UIActionPool", "Re&fresh...")); 741 setStatusTip(QApplication::translate("UIActionPool", "Refresh the accessibility state of the selected virtual machine")); 742 setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut)); 743 } 744 }; 745 746 class UIActionSimpleMachineShowInFileManager : public UIActionSimple 747 { 748 Q_OBJECT; 749 750 public: 751 752 UIActionSimpleMachineShowInFileManager(QObject *pParent) 753 : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png") 754 { 755 retranslateUi(); 756 } 757 758 protected: 759 760 void retranslateUi() 761 { 762 #if defined(Q_WS_MAC) 763 setText(QApplication::translate("UIActionPool", "Show in Finder")); 764 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Finder.")); 765 #elif defined(Q_WS_WIN) 766 setText(QApplication::translate("UIActionPool", "Show in Explorer")); 767 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Explorer.")); 768 #else 769 setText(QApplication::translate("UIActionPool", "Show in File Manager")); 770 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in the File Manager")); 771 #endif 772 setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMInFileManagerShortcut)); 773 } 774 }; 775 776 class UIActionSimpleMachineCreateShortcut : public UIActionSimple 777 { 778 Q_OBJECT; 779 780 public: 781 782 UIActionSimpleMachineCreateShortcut(QObject *pParent) 783 : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png") 784 { 785 retranslateUi(); 786 } 787 788 protected: 789 790 void retranslateUi() 791 { 792 #if defined(Q_WS_MAC) 793 setText(QApplication::translate("UIActionPool", "Create Alias on Desktop")); 794 setStatusTip(QApplication::translate("UIActionPool", "Creates an Alias file to the VirtualBox Machine Definition file on your Desktop.")); 795 #else 796 setText(QApplication::translate("UIActionPool", "Create Shortcut on Desktop")); 797 setStatusTip(QApplication::translate("UIActionPool", "Creates an Shortcut file to the VirtualBox Machine Definition file on your Desktop.")); 798 #endif 799 setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut)); 800 } 801 }; 802 803 class UIActionSimpleMachineSort : public UIActionSimple 804 { 805 Q_OBJECT; 806 807 public: 808 809 UIActionSimpleMachineSort(QObject *pParent) 810 : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/) 811 { 812 retranslateUi(); 813 } 814 815 protected: 816 817 void retranslateUi() 818 { 819 setText(QApplication::translate("UIActionPool", "Sort List")); 820 setStatusTip(QApplication::translate("UIActionPool", "Sort the VM list alphabetically (Shift for descending order)")); 821 setShortcut(gSS->keySequence(UISelectorShortcuts::ResortVMList)); 822 } 823 }; 824 825 826 class UIActionMenuMachineClose : public UIActionMenu 827 { 828 Q_OBJECT; 829 830 public: 831 832 UIActionMenuMachineClose(QObject *pParent) 833 : UIActionMenu(pParent, ":/exit_16px.png") 526 834 { 527 835 retranslateUi(); … … 537 845 }; 538 846 539 class UI SimpleActionACPIShutdown : public UISimpleAction540 { 541 Q_OBJECT; 542 543 public: 544 545 UI SimpleActionACPIShutdown(QObject *pParent)546 : UI SimpleAction(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")847 class UIActionSimpleACPIShutdown : public UIActionSimple 848 { 849 Q_OBJECT; 850 851 public: 852 853 UIActionSimpleACPIShutdown(QObject *pParent) 854 : UIActionSimple(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png") 547 855 { 548 856 retranslateUi(); … … 559 867 }; 560 868 561 class UI SimpleActionPowerOff : public UISimpleAction562 { 563 Q_OBJECT; 564 565 public: 566 567 UI SimpleActionPowerOff(QObject *pParent)568 : UI SimpleAction(pParent, ":/poweroff_16px.png", ":/poweroff_disabled_16px.png")869 class UIActionSimplePowerOff : public UIActionSimple 870 { 871 Q_OBJECT; 872 873 public: 874 875 UIActionSimplePowerOff(QObject *pParent) 876 : UIActionSimple(pParent, ":/poweroff_16px.png", ":/poweroff_disabled_16px.png") 569 877 { 570 878 retranslateUi(); … … 580 888 } 581 889 }; 890 582 891 583 892 /* static */ … … 613 922 614 923 /* 'File' actions: */ 615 m_pool[UIActionIndexSelector_Simple_File_MediumManagerDialog] = new UISimpleActionMediumManagerDialog(this); 616 m_pool[UIActionIndexSelector_Simple_File_ImportApplianceWizard] = new UISimpleActionImportApplianceWizard(this); 617 m_pool[UIActionIndexSelector_Simple_File_ExportApplianceWizard] = new UISimpleActionExportApplianceWizard(this); 618 m_pool[UIActionIndexSelector_Simple_File_PreferencesDialog] = new UISimpleActionPreferencesDialog(this); 619 m_pool[UIActionIndexSelector_Simple_File_Exit] = new UISimpleActionExit(this); 924 m_pool[UIActionIndexSelector_Simple_File_MediumManagerDialog] = new UIActionSimpleMediumManagerDialog(this); 925 m_pool[UIActionIndexSelector_Simple_File_ImportApplianceWizard] = new UIActionSimpleImportApplianceWizard(this); 926 m_pool[UIActionIndexSelector_Simple_File_ExportApplianceWizard] = new UIActionSimpleExportApplianceWizard(this); 927 m_pool[UIActionIndexSelector_Simple_File_PreferencesDialog] = new UIActionSimplePreferencesDialog(this); 928 m_pool[UIActionIndexSelector_Simple_File_Exit] = new UIActionSimpleExit(this); 929 930 /* 'Group' actions: */ 931 m_pool[UIActionIndexSelector_Simple_Group_NewWizard] = new UIActionSimpleGroupNewWizard(this); 932 m_pool[UIActionIndexSelector_Simple_Group_AddDialog] = new UIActionSimpleGroupAddDialog(this); 933 m_pool[UIActionIndexSelector_Simple_Group_RenameDialog] = new UIActionSimpleGroupRenameDialog(this); 934 m_pool[UIActionIndexSelector_Simple_Group_RemoveDialog] = new UIActionSimpleGroupRemoveDialog(this); 935 m_pool[UIActionIndexSelector_State_Group_StartOrShow] = new UIActionStateGroupStartOrShow(this); 936 m_pool[UIActionIndexSelector_Toggle_Group_PauseAndResume] = new UIActionToggleGroupPauseAndResume(this); 937 m_pool[UIActionIndexSelector_Simple_Group_Reset] = new UIActionSimpleGroupReset(this); 938 m_pool[UIActionIndexSelector_Simple_Group_Refresh] = new UIActionSimpleGroupRefresh(this); 939 m_pool[UIActionIndexSelector_Simple_Group_ShowInFileManager] = new UIActionSimpleGroupShowInFileManager(this); 940 m_pool[UIActionIndexSelector_Simple_Group_CreateShortcut] = new UIActionSimpleGroupCreateShortcut(this); 941 m_pool[UIActionIndexSelector_Simple_Group_Sort] = new UIActionSimpleGroupSort(this); 620 942 621 943 /* 'Machine' actions: */ 622 m_pool[UIActionIndexSelector_Simple_Machine_NewWizard] = new UI SimpleActionNewWizard(this);623 m_pool[UIActionIndexSelector_Simple_Machine_AddDialog] = new UI SimpleActionAddDialog(this);624 m_pool[UIActionIndexSelector_Simple_Machine_SettingsDialog] = new UI SimpleActionSettingsDialog(this);625 m_pool[UIActionIndexSelector_Simple_Machine_CloneWizard] = new UI SimpleActionCloneWizard(this);626 m_pool[UIActionIndexSelector_Simple_Machine_RemoveDialog] = new UI SimpleActionRemoveDialog(this);627 m_pool[UIActionIndexSelector_State_Machine_StartOrShow] = new UI StateActionStartOrShow(this);628 m_pool[UIActionIndexSelector_Simple_Machine_Discard] = new UI SimpleActionDiscard(this);629 m_pool[UIActionIndexSelector_Toggle_Machine_PauseAndResume] = new UI ToggleActionPauseAndResume(this);630 m_pool[UIActionIndexSelector_Simple_Machine_Reset] = new UI SimpleActionReset(this);631 m_pool[UIActionIndexSelector_Simple_Machine_Refresh] = new UI SimpleActionRefresh(this);632 m_pool[UIActionIndexSelector_Simple_Machine_ShowInFileManager] = new UI SimpleActionShowInFileManager(this);633 m_pool[UIActionIndexSelector_Simple_Machine_CreateShortcut] = new UI SimpleActionCreateShortcut(this);634 m_pool[UIActionIndexSelector_Simple_Machine_Sort] = new UI SimpleActionSort(this);944 m_pool[UIActionIndexSelector_Simple_Machine_NewWizard] = new UIActionSimpleMachineNewWizard(this); 945 m_pool[UIActionIndexSelector_Simple_Machine_AddDialog] = new UIActionSimpleMachineAddDialog(this); 946 m_pool[UIActionIndexSelector_Simple_Machine_SettingsDialog] = new UIActionSimpleMachineSettingsDialog(this); 947 m_pool[UIActionIndexSelector_Simple_Machine_CloneWizard] = new UIActionSimpleMachineCloneWizard(this); 948 m_pool[UIActionIndexSelector_Simple_Machine_RemoveDialog] = new UIActionSimpleMachineRemoveDialog(this); 949 m_pool[UIActionIndexSelector_State_Machine_StartOrShow] = new UIActionStateMachineStartOrShow(this); 950 m_pool[UIActionIndexSelector_Simple_Machine_Discard] = new UIActionSimpleMachineDiscard(this); 951 m_pool[UIActionIndexSelector_Toggle_Machine_PauseAndResume] = new UIActionToggleMachinePauseAndResume(this); 952 m_pool[UIActionIndexSelector_Simple_Machine_Reset] = new UIActionSimpleMachineReset(this); 953 m_pool[UIActionIndexSelector_Simple_Machine_Refresh] = new UIActionSimpleMachineRefresh(this); 954 m_pool[UIActionIndexSelector_Simple_Machine_ShowInFileManager] = new UIActionSimpleMachineShowInFileManager(this); 955 m_pool[UIActionIndexSelector_Simple_Machine_CreateShortcut] = new UIActionSimpleMachineCreateShortcut(this); 956 m_pool[UIActionIndexSelector_Simple_Machine_Sort] = new UIActionSimpleMachineSort(this); 635 957 636 958 /* 'Machine/Close' actions: */ 637 m_pool[UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown] = new UI SimpleActionACPIShutdown(this);638 m_pool[UIActionIndexSelector_Simple_Machine_Close_PowerOff] = new UI SimpleActionPowerOff(this);959 m_pool[UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown] = new UIActionSimpleACPIShutdown(this); 960 m_pool[UIActionIndexSelector_Simple_Machine_Close_PowerOff] = new UIActionSimplePowerOff(this); 639 961 } 640 962 … … 645 967 646 968 /* 'File' menu: */ 647 m_pool[UIActionIndexSelector_Menu_File] = new UIMenuActionFile(this); 969 m_pool[UIActionIndexSelector_Menu_File] = new UIActionMenuFile(this); 970 971 /* 'Group' menu: */ 972 m_pool[UIActionIndexSelector_Menu_Group] = new UIActionMenuGroup(this); 648 973 649 974 /* 'Machine' menu: */ 650 m_pool[UIActionIndexSelector_Menu_Machine] = new UI MenuActionMachine(this);975 m_pool[UIActionIndexSelector_Menu_Machine] = new UIActionMenuMachine(this); 651 976 652 977 /* 'Machine/Close' menu: */ 653 m_pool[UIActionIndexSelector_Menu_Machine_Close] = new UI MenuActionMachineClose(this);978 m_pool[UIActionIndexSelector_Menu_Machine_Close] = new UIActionMenuMachineClose(this); 654 979 } 655 980 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h
r41047 r42526 33 33 UIActionIndexSelector_Simple_File_PreferencesDialog, 34 34 UIActionIndexSelector_Simple_File_Exit, 35 36 /* 'Group' menu actions: */ 37 UIActionIndexSelector_Menu_Group, 38 UIActionIndexSelector_Simple_Group_NewWizard, 39 UIActionIndexSelector_Simple_Group_AddDialog, 40 UIActionIndexSelector_Simple_Group_RenameDialog, 41 UIActionIndexSelector_Simple_Group_RemoveDialog, 42 UIActionIndexSelector_State_Group_StartOrShow, 43 UIActionIndexSelector_Toggle_Group_PauseAndResume, 44 UIActionIndexSelector_Simple_Group_Reset, 45 UIActionIndexSelector_Simple_Group_Refresh, 46 UIActionIndexSelector_Simple_Group_ShowInFileManager, 47 UIActionIndexSelector_Simple_Group_CreateShortcut, 48 UIActionIndexSelector_Simple_Group_Sort, 35 49 36 50 /* 'Machine' menu actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp
r41689 r42526 35 35 m_Shortcuts[SettingsVMShortcut] = UIKeySequence("SettingsVM", "Ctrl+S"); 36 36 m_Shortcuts[CloneVMShortcut] = UIKeySequence("CloneVM", "Ctrl+O"); 37 m_Shortcuts[RemoveVMGroupShortcut] = UIKeySequence("RemoveVMGroup", "Ctrl+R"); 37 38 m_Shortcuts[RemoveVMShortcut] = UIKeySequence("RemoveVM", "Ctrl+R"); 39 m_Shortcuts[RenameVMGroupShortcut] = UIKeySequence("RenameVMGroup", "Ctrl+M"); 38 40 m_Shortcuts[StartVMShortcut] = UIKeySequence("StartVM"); 39 41 m_Shortcuts[DiscardVMShortcut] = UIKeySequence("DiscardVM", "Ctrl+J"); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h
r39932 r42526 37 37 SettingsVMShortcut, 38 38 CloneVMShortcut, 39 RemoveVMGroupShortcut, 39 40 RemoveVMShortcut, 41 RenameVMGroupShortcut, 40 42 StartVMShortcut, 41 43 DiscardVMShortcut, -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r41846 r42526 6 6 7 7 /* 8 * Copyright (C) 2006-201 1Oracle Corporation8 * Copyright (C) 2006-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 # include "precomp.h" 21 21 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 22 /* Global includes */ 22 23 /* Qt includes: */ 23 24 #include <QDesktopWidget> 25 #include <QDesktopServices> 24 26 #include <QMenuBar> 25 27 #include <QResizeEvent> 26 #include <Q DesktopServices>28 #include <QStackedWidget> 27 29 28 30 /* Local includes: */ 29 31 #include "QISplitter.h" 32 #include "QIFileDialog.h" 30 33 #include "UIBar.h" 31 34 #include "UINetworkManager.h" … … 40 43 #include "UIWizardImportApp.h" 41 44 #include "UIVMDesktop.h" 42 #include "UIVMListView.h"43 45 #include "UIVirtualBoxEventHandler.h" 44 #include "VBoxGlobal.h"45 46 #include "UIMediumManager.h" 46 47 #include "UIMessageCenter.h" … … 49 50 #include "UIToolBar.h" 50 51 #include "UIVMLogViewer.h" 51 #include "QIFileDialog.h"52 52 #include "UISelectorShortcuts.h" 53 53 #include "UIDesktopServices.h" 54 54 #include "UIGlobalSettingsExtension.h" 55 55 #include "UIActionPoolSelector.h" 56 57 #ifdef VBOX_GUI_WITH_SYSTRAY 58 # include "VBoxTrayIcon.h" 59 # include "UIExtraDataEventHandler.h" 60 #endif /* VBOX_GUI_WITH_SYSTRAY */ 56 #include "UIGChooser.h" 57 #include "UIGDetails.h" 58 #include "UIVMItem.h" 59 #include "VBoxGlobal.h" 61 60 62 61 #ifdef Q_WS_MAC … … 66 65 #endif /* Q_WS_MAC */ 67 66 67 /* Other VBox stuff: */ 68 #include <iprt/buildconfig.h> 69 #include <VBox/version.h> 68 70 #ifdef Q_WS_X11 69 71 # include <iprt/env.h> 70 72 #endif /* Q_WS_X11 */ 71 73 72 #include <iprt/buildconfig.h>73 #include <VBox/version.h>74 74 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 75 75 … … 82 82 #endif /* !Q_WS_MAC */ 83 83 , mVMToolBar(0) 84 , m_p VMListView(0)85 , m_p VMModel(0)86 , m_p MachineContextMenu(0)84 , m_pContainer(0) 85 , m_pChooser(0) 86 , m_pDetails(0) 87 87 , m_pVMDesktop(0) 88 88 , m_fDoneInaccessibleWarningOnce(false) … … 92 92 *ppSelf = this; 93 93 94 /* Prepare everything: */94 /* Prepare: */ 95 95 prepareIcon(); 96 96 prepareMenuBar(); 97 prepareContextMenu();98 97 prepareStatusBar(); 99 98 prepareWidgets(); 100 99 prepareConnections(); 101 100 102 /* Load allsettings: */101 /* Load settings: */ 103 102 loadSettings(); 104 103 … … 129 128 UISelectorWindow::~UISelectorWindow() 130 129 { 131 /* Destroy ourevent handlers: */130 /* Destroy event handlers: */ 132 131 UIVirtualBoxEventHandler::destroy(); 133 132 134 /* Save allsettings: */133 /* Save settings: */ 135 134 saveSettings(); 136 137 #ifdef VBOX_GUI_WITH_SYSTRAY 138 /* Delete systray menu object: */ 139 delete m_pTrayIcon; 140 m_pTrayIcon = NULL; 141 #endif /* VBOX_GUI_WITH_SYSTRAY */ 135 } 136 137 void UISelectorWindow::sltDetailsViewIndexChanged(int iWidgetIndex) 138 { 139 if (iWidgetIndex) 140 m_pContainer->setCurrentWidget(m_pVMDesktop); 141 else 142 m_pContainer->setCurrentWidget(m_pDetails); 143 } 144 145 void UISelectorWindow::sltMediumEnumFinished(const VBoxMediaList &list) 146 { 147 /* We warn about inaccessible media only once 148 * (after media emumeration started from main() at startup), 149 * to avoid annoying the user: */ 150 if (m_fDoneInaccessibleWarningOnce) 151 return; 152 m_fDoneInaccessibleWarningOnce = true; 153 154 /* Ignore the signal if a modal widget is currently active 155 * (we won't be able to properly show the modeless VDI manager window in this case): */ 156 // TODO: Not sure that is required at all... 157 if (QApplication::activeModalWidget()) 158 return; 159 160 /* Ignore the signal if a UIMediumManager window is active: */ 161 // TODO: Thats a very dirty way, rework required! 162 if (qApp->activeWindow() && 163 !strcmp(qApp->activeWindow()->metaObject()->className(), "UIMediumManager")) 164 return; 165 166 /* Look for at least one inaccessible media: */ 167 VBoxMediaList::const_iterator it; 168 for (it = list.begin(); it != list.end(); ++it) 169 if ((*it).state() == KMediumState_Inaccessible) 170 break; 171 /* Ask the user about: */ 172 if (it != list.end() && msgCenter().remindAboutInaccessibleMedia()) 173 { 174 /* Show the VMM dialog without refresh: */ 175 UIMediumManager::showModeless(this, false /* refresh? */); 176 } 142 177 } 143 178 … … 225 260 { 226 261 /* Get selected items: */ 227 QList<UIVMItem*> items = m_pVMListView->currentItems();262 QList<UIVMItem*> items = currentItems(); 228 263 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 229 264 … … 255 290 void UISelectorWindow::sltPerformExit() 256 291 { 257 /* We have to check if there are any open windows beside this mainwindow258 * (e.g. VDM) and if so close them. Note that the default behavior is259 * different to Qt3 where a *mainWidget* exists & if this going to close260 * all other windows are closed automatically. We do the same below. */261 QWidgetList widgets = QApplication::topLevelWidgets();262 for(int i = 0; i < widgets.size(); ++i)263 {264 QWidget *pWidget = widgets[i];265 if (pWidget && pWidget->isVisible() && pWidget != this)266 pWidget->close();267 }268 /* We close this pWidget last: */269 292 close(); 270 293 } 271 294 272 void UISelectorWindow::sltShowNewMachineWizard() 273 { 274 /* Show New VM wizard: */ 295 void UISelectorWindow::sltShowCreateMachineWizard() 296 { 275 297 UIWizardNewVM wizard(this); 276 298 wizard.exec(); … … 299 321 strTmpFile = fileNames.at(0); 300 322 } 301 302 /* Open corresponding machine: */ 303 if (!strTmpFile.isEmpty()) 304 { 305 CMachine newMachine = vbox.OpenMachine(strTmpFile); 306 /* First we should test what machine was opened: */ 307 if (vbox.isOk() && !newMachine.isNull()) 308 { 309 /* Second we should check what such machine was NOT already registered. 310 * Actually current Main implementation will even prevent such machine opening 311 * but we will perform such a check anyway: */ 312 CMachine oldMachine = vbox.FindMachine(newMachine.GetId()); 313 if (oldMachine.isNull()) 314 { 315 /* Register that machine: */ 316 vbox.RegisterMachine(newMachine); 317 } 318 else 319 msgCenter().cannotReregisterMachine(this, strTmpFile, oldMachine.GetName()); 320 } 321 else 322 msgCenter().cannotOpenMachine(this, strTmpFile, vbox); 323 } 323 /* Nothing was chosen? */ 324 if (strTmpFile.isEmpty()) 325 return; 326 327 /* Make sure this machine can be opened: */ 328 CMachine newMachine = vbox.OpenMachine(strTmpFile); 329 if (!vbox.isOk() || newMachine.isNull()) 330 { 331 msgCenter().cannotOpenMachine(this, strTmpFile, vbox); 332 return; 333 } 334 335 /* Make sure this machine was NOT registered already: */ 336 CMachine oldMachine = vbox.FindMachine(newMachine.GetId()); 337 if (!oldMachine.isNull()) 338 { 339 msgCenter().cannotReregisterMachine(this, strTmpFile, oldMachine.GetName()); 340 return; 341 } 342 343 /* Register that machine: */ 344 vbox.RegisterMachine(newMachine); 324 345 } 325 346 326 347 void UISelectorWindow::sltShowMachineSettingsDialog(const QString &strCategoryRef /* = QString() */, 327 348 const QString &strControlRef /* = QString() */, 328 const QString &str MachineId /* = QString() */)349 const QString &strId /* = QString() */) 329 350 { 330 351 /* Check that we do NOT handling that already: */ 331 if (m_p SettingsDialogAction->data().toBool())352 if (m_pActionMachineSettingsDialog->data().toBool()) 332 353 return; 333 354 /* Remember that we handling that already: */ 334 m_p SettingsDialogAction->setData(true);355 m_pActionMachineSettingsDialog->setData(true); 335 356 336 357 /* Process href from VM details / description: */ … … 358 379 m_fDoneInaccessibleWarningOnce = true; 359 380 360 /* Get corresponding VM item: */361 UIVMItem *pItem = strMachineId.isNull() ? m_pVMListView->currentItem() : m_pVMModel->itemById(strMachineId);362 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));363 364 381 /* Create and execute corresponding VM settings dialog: */ 365 UISettingsDialogMachine dialog(this, pItem->id(), strCategory, strControl); 382 UISettingsDialogMachine dialog(this, 383 strId.isEmpty() ? currentItem()->id() : strId, 384 strCategory, strControl); 366 385 dialog.execute(); 367 386 368 387 /* Remember that we do NOT handling that already: */ 369 m_p SettingsDialogAction->setData(false);388 m_pActionMachineSettingsDialog->setData(false); 370 389 } 371 390 … … 373 392 { 374 393 /* Get current item: */ 375 UIVMItem *pItem = m_pVMListView->currentItem();394 UIVMItem *pItem = currentItem(); 376 395 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n")); 377 396 … … 381 400 } 382 401 383 void UISelectorWindow::sltShowRemoveMachineDialog() 384 { 402 void UISelectorWindow::sltPerformStartOrShowAction() 403 { 404 /* Check if the action is enabled: */ 405 if (!m_pActionMachineStartOrShow->isEnabled()) 406 return; 407 385 408 /* Get selected items: */ 386 QList<UIVMItem*> items = m_pVMListView->currentItems(); 387 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 388 389 /* Populate machine list: */ 390 QList<CMachine> machines; 391 for (int i = 0; i < items.size(); ++i) 392 machines << items[i]->machine(); 393 /* Show machine remove dialog: */ 394 int rc = msgCenter().confirmMachineDeletion(machines); 395 if (rc != QIMessageBox::Cancel) 396 { 397 /* For every selected item: */ 398 for (int i = 0; i < machines.size(); ++i) 399 { 400 /* Check if current item could be removed: */ 401 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items[i], items)) 402 continue; 403 404 /* Get iterated VM: */ 405 CMachine machine = machines[i]; 406 if (rc == QIMessageBox::Yes) 407 { 408 /* Unregister and cleanup machine's data & hard-disks: */ 409 CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 410 if (machine.isOk()) 411 { 412 /* Delete machine hard-disks: */ 413 CProgress progress = machine.Delete(mediums); 414 if (machine.isOk()) 415 { 416 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_delete_90px.png", 0, true); 417 if (progress.GetResultCode() != 0) 418 msgCenter().cannotDeleteMachine(machine, progress); 419 } 420 } 421 if (!machine.isOk()) 422 msgCenter().cannotDeleteMachine(machine); 423 } 424 else 425 { 426 /* Just unregister machine: */ 427 machine.Unregister(KCleanupMode_DetachAllReturnNone); 428 if (!machine.isOk()) 429 msgCenter().cannotDeleteMachine(machine); 430 } 431 } 432 } 433 } 434 435 void UISelectorWindow::sltPerformStartOrShowAction() 436 { 437 /* We always get here when m_pVMListView emits the activated() signal, 438 * so we must explicitly check if the action is enabled or not. */ 439 if (!m_pStartOrShowAction->isEnabled()) 440 return; 441 442 /* Get selected items: */ 443 QList<UIVMItem*> items = m_pVMListView->currentItems(); 409 QList<UIVMItem*> items = currentItems(); 444 410 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 445 411 … … 448 414 { 449 415 /* Check if current item could be started/showed: */ 450 if (!isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items [i], items))416 if (!isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items)) 451 417 continue; 452 418 … … 461 427 { 462 428 /* Get current item: */ 463 UIVMItem *pItem = m_pVMListView->currentItem();429 UIVMItem *pItem = currentItem(); 464 430 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n")); 465 431 … … 489 455 { 490 456 /* Get selected items: */ 491 QList<UIVMItem*> items = m_pVMListView->currentItems();457 QList<UIVMItem*> items = currentItems(); 492 458 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 493 459 … … 501 467 502 468 /* Check if current item could be paused/resumed: */ 503 if (!isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, pItem,items))469 if (!isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items)) 504 470 continue; 505 471 … … 550 516 551 517 /* Get selected items: */ 552 QList<UIVMItem*> items = m_pVMListView->currentItems();518 QList<UIVMItem*> items = currentItems(); 553 519 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 554 520 … … 560 526 561 527 /* Check if current item could be reseted: */ 562 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, pItem,items))528 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items)) 563 529 continue; 564 530 … … 588 554 589 555 /* Get selected items: */ 590 QList<UIVMItem*> items = m_pVMListView->currentItems();556 QList<UIVMItem*> items = currentItems(); 591 557 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 592 558 … … 598 564 599 565 /* Check if current item could be shutdowned: */ 600 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, pItem,items))566 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items)) 601 567 continue; 602 568 … … 626 592 627 593 /* Get selected items: */ 628 QList<UIVMItem*> items = m_pVMListView->currentItems();594 QList<UIVMItem*> items = currentItems(); 629 595 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 630 596 … … 636 602 637 603 /* Check if current item could be powered off: */ 638 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, pItem,items))604 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, items)) 639 605 continue; 640 606 … … 660 626 { 661 627 /* Get selected items: */ 662 QList<UIVMItem*> items = m_pVMListView->currentItems(); 628 QList<UIVMItem*> items = currentItems(); 629 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 630 631 // TODO: Notify selector-model to refresh selected items! 632 633 /* Refresh details: */ 634 sltCurrentVMItemChanged(); 635 } 636 637 void UISelectorWindow::sltShowLogDialog() 638 { 639 /* Get selected items: */ 640 QList<UIVMItem*> items = currentItems(); 663 641 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 664 642 … … 669 647 UIVMItem *pItem = items[i]; 670 648 671 /* Check if current item could be refreshed: */672 if (!isActionEnabled(UIActionIndex Selector_Simple_Machine_Refresh, pItem, items))649 /* Check if log could be show for the current item: */ 650 if (!isActionEnabled(UIActionIndex_Simple_LogDialog, items)) 673 651 continue; 674 652 675 /* Refresh currently selected VM item: */676 sltRefreshVMItem(pItem->id(), true /* details */, true /* snapshot */, true /* description */);677 } 678 } 679 680 void UISelectorWindow::sltShow LogDialog()653 /* Show VM Log Viewer: */ 654 UIVMLogViewer::showLogViewerFor(this, pItem->machine()); 655 } 656 } 657 658 void UISelectorWindow::sltShowMachineInFileManager() 681 659 { 682 660 /* Get selected items: */ 683 QList<UIVMItem*> items = m_pVMListView->currentItems();661 QList<UIVMItem*> items = currentItems(); 684 662 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 685 663 … … 690 668 UIVMItem *pItem = items[i]; 691 669 692 /* Check if log could be show for the current item: */693 if (!isActionEnabled(UIActionIndex _Simple_LogDialog, pItem, items))670 /* Check if that item could be shown in file-browser: */ 671 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items)) 694 672 continue; 695 673 696 /* Show VM Log Viewer: */697 UI VMLogViewer::showLogViewerFor(this, pItem->machine());698 } 699 } 700 701 void UISelectorWindow::slt ShowMachineInFileManager()674 /* Show VM in filebrowser: */ 675 UIDesktopServices::openInFileManager(pItem->machine().GetSettingsFilePath()); 676 } 677 } 678 679 void UISelectorWindow::sltPerformCreateShortcutAction() 702 680 { 703 681 /* Get selected items: */ 704 QList<UIVMItem*> items = m_pVMListView->currentItems();682 QList<UIVMItem*> items = currentItems(); 705 683 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 706 684 … … 711 689 UIVMItem *pItem = items[i]; 712 690 713 /* Check if that item could be shown in file-browser: */714 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, pItem, items))715 continue;716 717 /* Show VM in filebrowser: */718 UIDesktopServices::openInFileManager(pItem->machine().GetSettingsFilePath());719 }720 }721 722 void UISelectorWindow::sltPerformCreateShortcutAction()723 {724 /* Get selected items: */725 QList<UIVMItem*> items = m_pVMListView->currentItems();726 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));727 728 /* For each selected item: */729 for (int i = 0; i < items.size(); ++i)730 {731 /* Get iterated item: */732 UIVMItem *pItem = items[i];733 734 691 /* Check if shortcuts could be created for this item: */ 735 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, pItem,items))692 if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items)) 736 693 continue; 737 694 … … 744 701 } 745 702 746 void UISelectorWindow::sltPerformSortAction() 703 void UISelectorWindow::sltMachineMenuAboutToShow() 704 { 705 /* Get selected items: */ 706 QList<UIVMItem*> items = currentItems(); 707 /* Enable/disable 'Machine/Close' menu according logic: */ 708 m_pMachineCloseMenuAction->setEnabled(isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items)); 709 } 710 711 void UISelectorWindow::sltMachineCloseMenuAboutToShow() 747 712 { 748 713 /* Get current item: */ 749 UIVMItem *pItem = m_pVMListView->currentItem(); 714 UIVMItem *pItem = currentItem(); 715 /* Get selected items: */ 716 QList<UIVMItem*> items = currentItems(); 750 717 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n")); 751 718 752 /* Sort VM list: */ 753 const QString strOldId = pItem->id(); 754 m_pVMModel->sortByIdList(QStringList(), qApp->keyboardModifiers() == Qt::ShiftModifier ? Qt::DescendingOrder : Qt::AscendingOrder); 755 /* Select the VM which was selected before */ 756 m_pVMListView->selectItemById(strOldId); 757 } 758 759 void UISelectorWindow::sltMachineMenuAboutToShow() 719 m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items)); 720 } 721 722 void UISelectorWindow::sltCurrentVMItemChanged(bool fRefreshDetails, bool fRefreshSnapshots, bool fRefreshDescription) 760 723 { 761 724 /* Get current item: */ 762 UIVMItem *pItem = m_pVMListView->currentItem(); 763 /* Get selected items: */ 764 QList<UIVMItem*> items = m_pVMListView->currentItems(); 765 /* Enable/disable 'Machine/Close' menu according logic: */ 766 m_pMachineCloseMenuAction->setEnabled(isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, pItem, items)); 767 } 768 769 void UISelectorWindow::sltMachineCloseMenuAboutToShow() 770 { 771 /* Get current item: */ 772 UIVMItem *pItem = m_pVMListView->currentItem(); 773 /* Get selected items: */ 774 QList<UIVMItem*> items = m_pVMListView->currentItems(); 775 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n")); 776 777 m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, pItem, items)); 778 } 779 780 void UISelectorWindow::sltMachineContextMenuHovered(QAction *pAction) 781 { 782 /* Update statusbar with howered action status text: */ 783 statusBar()->showMessage(pAction->statusTip()); 784 } 785 786 void UISelectorWindow::sltRefreshVMList() 787 { 788 /* Refresh VM list: */ 789 CVirtualBox vbox = vboxGlobal().virtualBox(); 790 CMachineVector machines = vbox.GetMachines(); 791 for (CMachineVector::ConstIterator m = machines.begin(); m != machines.end(); ++m) 792 m_pVMModel->addItem(*m); 793 /* Apply the saved sort order. */ 794 m_pVMModel->sortByIdList(vbox.GetExtraDataStringList(GUI_SelectorVMPositions)); 795 /* Update details page. */ 796 sltCurrentVMItemChanged(); 797 #ifdef VBOX_GUI_WITH_SYSTRAY 798 if (vboxGlobal().isTrayMenu()) 799 m_pTrayIcon->refresh(); 800 #endif /* VBOX_GUI_WITH_SYSTRAY */ 801 } 802 803 void UISelectorWindow::sltRefreshVMItem(const QString &strMachineId, bool fDetails, bool fSnapshots, bool fDescription) 804 { 805 /* Refresh VM item: */ 806 UIVMItem *pItem = m_pVMModel->itemById(strMachineId); 807 if (pItem) 808 { 809 m_pVMModel->refreshItem(pItem); 810 if (pItem && pItem->id() == strMachineId) 811 sltCurrentVMItemChanged(fDetails, fSnapshots, fDescription); 812 } 813 } 814 815 void UISelectorWindow::sltShowContextMenu(const QPoint &point) 816 { 817 /* Show VM list context menu: */ 818 const QModelIndex &index = m_pVMListView->indexAt(point); 819 if (index.isValid() && m_pVMListView->model()->data(index, UIVMItemModel::UIVMItemPtrRole).value<UIVMItem*>()) 820 { 821 m_pMachineContextMenu->exec(m_pVMListView->mapToGlobal(point)); 822 /* Make sure every status bar hint from the context menu is cleared when the menu is closed: */ 823 statusBar()->clearMessage(); 824 } 825 } 826 827 void UISelectorWindow::sltCurrentVMItemChanged(bool fRefreshDetails, bool fRefreshSnapshots, bool fRefreshDescription) 828 { 829 /* Get current item: */ 830 UIVMItem *pItem = m_pVMListView->currentItem(); 831 QList<UIVMItem*> items = m_pVMListView->currentItems(); 832 833 /* Enable/disable actions: */ 834 m_pSettingsDialogAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, pItem, items)); 835 m_pCloneWizardAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, pItem, items)); 836 m_pRemoveDialogAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, pItem, items)); 837 m_pStartOrShowAction->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, pItem, items)); 838 m_pDiscardAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, pItem, items)); 839 m_pPauseAndResumeAction->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, pItem, items)); 840 m_pResetAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, pItem, items)); 841 m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, pItem, items)); 842 m_pPowerOffAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, pItem, items)); 843 m_pRefreshAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, pItem, items)); 844 m_pLogDialogAction->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, pItem, items)); 845 m_pShowInFileManagerAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, pItem, items)); 846 m_pCreateShortcutAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, pItem, items)); 847 m_pSortAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, pItem, items)); 725 UIVMItem *pItem = currentItem(); 726 QList<UIVMItem*> items = currentItems(); 727 728 /* Determine which menu to show: */ 729 m_pGroupMenuAction->setVisible(m_pChooser->singleGroupSelected()); 730 m_pMachineMenuAction->setVisible(!m_pChooser->singleGroupSelected()); 731 732 /* Enable/disable group actions: */ 733 m_pActionGroupRenameDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RenameDialog, items)); 734 m_pActionGroupRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RemoveDialog, items)); 735 m_pActionGroupStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Group_StartOrShow, items)); 736 m_pActionGroupPauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Group_PauseAndResume, items)); 737 m_pActionGroupReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Reset, items)); 738 m_pActionGroupRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Refresh, items)); 739 m_pActionGroupLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items)); 740 m_pActionGroupShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_ShowInFileManager, items)); 741 m_pActionGroupCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_CreateShortcut, items)); 742 // m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items)); 743 744 /* Enable/disable machine actions: */ 745 m_pActionMachineSettingsDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, items)); 746 m_pActionMachineCloneWizard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, items)); 747 m_pActionMachineRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items)); 748 m_pActionMachineStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items)); 749 m_pActionMachineDiscard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, items)); 750 m_pActionMachinePauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items)); 751 m_pActionMachineReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items)); 752 m_pActionMachineRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, items)); 753 m_pActionMachineLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items)); 754 m_pActionMachineShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items)); 755 m_pActionMachineCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items)); 756 // m_pActionMachineSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, items)); 757 758 /* Enable/disable machine-close actions: */ 759 m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items)); 760 m_pPowerOffAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, items)); 848 761 849 762 /* If currently selected VM item is accessible: */ 850 763 if (pItem && pItem->accessible()) 851 764 { 765 /* Make sure valid widget raised: */ 766 if (m_pVMDesktop->widgetIndex()) 767 m_pContainer->setCurrentWidget(m_pVMDesktop); 768 else 769 m_pContainer->setCurrentWidget(m_pDetails); 770 852 771 CMachine m = pItem->machine(); 853 772 QList<CMachine> machines; … … 857 776 858 777 if (fRefreshDetails || fRefreshDescription) 859 m_p VMDesktop->updateDetails(pItem, machines);778 m_pDetails->setItems(currentItems()); 860 779 if (fRefreshSnapshots) 861 780 m_pVMDesktop->updateSnapshots(pItem, m); … … 867 786 state == KMachineState_Aborted) 868 787 { 869 m_pStartOrShowAction->setState(1); 788 m_pActionGroupStartOrShow->setState(1); 789 m_pActionMachineStartOrShow->setState(1); 870 790 #ifdef QT_MAC_USE_COCOA 871 791 /* There is a bug in Qt Cocoa which result in showing a "more arrow" when … … 878 798 else 879 799 { 880 m_pStartOrShowAction->setState(2); 800 m_pActionGroupStartOrShow->setState(2); 801 m_pActionMachineStartOrShow->setState(2); 881 802 #ifdef QT_MAC_USE_COCOA 882 803 /* There is a bug in Qt Cocoa which result in showing a "more arrow" when … … 892 813 state == KMachineState_TeleportingPausedVM) 893 814 { 894 m_pPauseAndResumeAction->blockSignals(true); 895 m_pPauseAndResumeAction->setChecked(true); 896 m_pPauseAndResumeAction->blockSignals(false); 815 m_pActionGroupPauseAndResume->blockSignals(true); 816 m_pActionGroupPauseAndResume->setChecked(true); 817 m_pActionGroupPauseAndResume->blockSignals(false); 818 m_pActionMachinePauseAndResume->blockSignals(true); 819 m_pActionMachinePauseAndResume->setChecked(true); 820 m_pActionMachinePauseAndResume->blockSignals(false); 897 821 } 898 822 else 899 823 { 900 m_pPauseAndResumeAction->blockSignals(true); 901 m_pPauseAndResumeAction->setChecked(false); 902 m_pPauseAndResumeAction->blockSignals(false); 903 } 904 m_pPauseAndResumeAction->updateAppearance(); 824 m_pActionGroupPauseAndResume->blockSignals(true); 825 m_pActionGroupPauseAndResume->setChecked(false); 826 m_pActionGroupPauseAndResume->blockSignals(false); 827 m_pActionMachinePauseAndResume->blockSignals(true); 828 m_pActionMachinePauseAndResume->setChecked(false); 829 m_pActionMachinePauseAndResume->blockSignals(false); 830 } 831 m_pActionGroupPauseAndResume->updateAppearance(); 832 m_pActionMachinePauseAndResume->updateAppearance(); 905 833 } 906 834 … … 908 836 else 909 837 { 838 /* Show m_pVMDesktop: */ 839 m_pContainer->setCurrentWidget(m_pVMDesktop); 840 910 841 /* Note that the machine becomes inaccessible (or if the last VM gets 911 842 * deleted), we have to update all fields, ignoring input arguments. */ … … 939 870 940 871 /* Change the Start button text accordingly: */ 941 m_pStartOrShowAction->setState(1); 872 m_pActionGroupStartOrShow->setState(1); 873 m_pActionMachineStartOrShow->setState(1); 942 874 } 943 875 } … … 946 878 { 947 879 /* Make sure any pending D&D events are consumed. */ 880 // TODO: What? So dangerous method for so cheap purpose? 948 881 qApp->processEvents(); 882 949 883 if (list.isEmpty()) 950 884 { … … 991 925 } 992 926 993 void UISelectorWindow::sltMachineRegistered(QString strMachineId, bool fRegistered)994 {995 /* Add/remove VM: */996 if (fRegistered)997 {998 CMachine m = vboxGlobal().virtualBox().FindMachine(strMachineId);999 if (!m.isNull())1000 {1001 m_pVMModel->addItem(m);1002 int iRow = m_pVMModel->rowById(strMachineId);1003 m_pVMListView->ensureOneRowSelected(iRow);1004 }1005 /* m.isNull() is ok (theoretically, the machine could have been1006 * already deregistered by some other client at this point) */1007 }1008 else1009 {1010 UIVMItem *pItem = m_pVMModel->itemById(strMachineId);1011 if (pItem)1012 {1013 int iRow = m_pVMModel->rowById(strMachineId);1014 m_pVMModel->removeItem(pItem);1015 m_pVMListView->ensureOneRowSelected(iRow);1016 }1017 /* item = 0 is ok (if we originated this event then the item1018 * has been already removed) */1019 }1020 /* Make sure all updated: */1021 sltCurrentVMItemChanged();1022 }1023 1024 void UISelectorWindow::sltMachineStateChanged(QString strMachineId, KMachineState /* state */)1025 {1026 #ifdef VBOX_GUI_WITH_SYSTRAY1027 if (vboxGlobal().isTrayMenu())1028 {1029 /* Check if there are some machines alive - else quit, since1030 * we're not needed as a systray menu anymore. */1031 if (vboxGlobal().mainWindowCount() == 0)1032 {1033 sltPerformExit();1034 return;1035 }1036 }1037 #endif /* VBOX_GUI_WITH_SYSTRAY */1038 1039 sltRefreshVMItem(strMachineId, true /* aDetails */, true /* aSnapshots */, false /* aDescription */);1040 1041 /* Simulate a state change signal: */1042 // m_pVMDesktop->updateDescriptionState();1043 }1044 1045 void UISelectorWindow::sltMachineDataChanged(QString strMachineId)1046 {1047 sltRefreshVMItem(strMachineId, true /* details */, false /* snapshots */, true /* description */);1048 }1049 1050 void UISelectorWindow::sltSessionStateChanged(QString strMachineId, KSessionState /* state */)1051 {1052 sltRefreshVMItem(strMachineId, true /* details */, false /* snapshots */, false /* description */);1053 1054 // /* Simulate a state change signal: */1055 // m_pVMDesktop->updateDescriptionState();1056 }1057 1058 void UISelectorWindow::sltSnapshotChanged(QString strMachineId, QString /* strSnapshotId */)1059 {1060 sltRefreshVMItem(strMachineId, false /* details */, true /* snapshot */, false /* description */);1061 }1062 1063 #ifdef VBOX_GUI_WITH_SYSTRAY1064 void UISelectorWindow::sltMainWindowCountChanged(int iCount)1065 {1066 if (vboxGlobal().isTrayMenu() && count <= 1)1067 sltPerformExit();1068 }1069 1070 void UISelectorWindow::sltTrayIconCanShow(bool fEnabled)1071 {1072 emit sltTrayIconChanged(VBoxChangeTrayIconEvent(vboxGlobal().settings().trayIconEnabled()));1073 }1074 1075 void UISelectorWindow::sltTrayIconShow(bool fEnabled)1076 {1077 if (vboxGlobal().isTrayMenu() && m_pTrayIcon)1078 m_pTrayIcon->sltTrayIconShow(fEnabled);1079 }1080 1081 void UISelectorWindow::sltTrayIconChanged(bool fEnabled)1082 {1083 /* Not used yet. */1084 }1085 1086 void UISelectorWindow::sltTrayIconActivated(QSystemTrayIcon::ActivationReason reason)1087 {1088 switch (reason)1089 {1090 case QSystemTrayIcon::Context:1091 m_pTrayIcon->refresh();1092 break;1093 1094 case QSystemTrayIcon::Trigger:1095 break;1096 1097 case QSystemTrayIcon::DoubleClick:1098 vboxGlobal().trayIconShowSelector();1099 break;1100 1101 case QSystemTrayIcon::MiddleClick:1102 break;1103 1104 default:1105 break;1106 }1107 }1108 1109 void UISelectorWindow::sltShowWindow()1110 {1111 showNormal();1112 raise();1113 activateWindow();1114 }1115 #endif // VBOX_GUI_WITH_SYSTRAY1116 1117 void UISelectorWindow::sltMediumEnumerationStarted()1118 {1119 /* Refresh the current details to pick up hard disk sizes: */1120 sltCurrentVMItemChanged(true /* fRefreshDetails */);1121 }1122 1123 void UISelectorWindow::sltMediumEnumFinished(const VBoxMediaList &list)1124 {1125 /* Refresh the current details to pick up hard disk sizes */1126 sltCurrentVMItemChanged(true /* fRefreshDetails */);1127 1128 /* We warn about inaccessible media only once (after media emumeration1129 * started from main() at startup), to avoid annoying the user */1130 if (m_fDoneInaccessibleWarningOnce1131 #ifdef VBOX_GUI_WITH_SYSTRAY1132 || vboxGlobal().isTrayMenu()1133 #endif /* VBOX_GUI_WITH_SYSTRAY */1134 )1135 return;1136 1137 m_fDoneInaccessibleWarningOnce = true;1138 1139 do1140 {1141 /* Ignore the signal if a modal widget is currently active (we won't be1142 * able to properly show the modeless VDI manager window in this case): */1143 if (QApplication::activeModalWidget())1144 break;1145 1146 /* Ignore the signal if a UIMediumManager window is active: */1147 if (qApp->activeWindow() &&1148 !strcmp(qApp->activeWindow()->metaObject()->className(), "UIMediumManager"))1149 break;1150 1151 /* Look for at least one inaccessible media: */1152 VBoxMediaList::const_iterator it;1153 for (it = list.begin(); it != list.end(); ++ it)1154 if ((*it).state() == KMediumState_Inaccessible)1155 break;1156 1157 if (it != list.end() && msgCenter().remindAboutInaccessibleMedia())1158 {1159 /* Show the VDM dialog but don't refresh once more after a just-finished refresh: */1160 UIMediumManager::showModeless(this, false /* aRefresh */);1161 }1162 }1163 while (0);1164 }1165 1166 927 void UISelectorWindow::retranslateUi() 1167 928 { … … 1200 961 bool UISelectorWindow::event(QEvent *pEvent) 1201 962 { 963 /* Which event do we have? */ 1202 964 switch (pEvent->type()) 1203 965 { … … 1247 1009 break; 1248 1010 } 1249 1011 /* Call to base-class: */ 1250 1012 return QMainWindow::event(pEvent); 1251 1013 } … … 1253 1015 void UISelectorWindow::closeEvent(QCloseEvent *pEvent) 1254 1016 { 1255 #ifdef VBOX_GUI_WITH_SYSTRAY 1256 /* Needed for breaking out of the while() loop in main(). */ 1257 if (vboxGlobal().isTrayMenu()) 1258 vboxGlobal().setTrayMenu(false); 1259 #endif /* VBOX_GUI_WITH_SYSTRAY */ 1260 1017 // TODO: Such things are obsolete, rework required! 1261 1018 emit closing(); 1262 1019 QMainWindow::closeEvent(pEvent); … … 1266 1023 bool UISelectorWindow::eventFilter(QObject *pObject, QEvent *pEvent) 1267 1024 { 1025 /* Ignore for non-active window: */ 1268 1026 if (!isActiveWindow()) 1269 1027 return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent); 1270 1028 1029 /* Ignore for other objects: */ 1271 1030 if (qobject_cast<QWidget*>(pObject) && 1272 1031 qobject_cast<QWidget*>(pObject)->window() != this) 1273 1032 return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent); 1274 1033 1034 /* Which event do we have? */ 1275 1035 switch (pEvent->type()) 1276 1036 { … … 1296 1056 break; 1297 1057 } 1058 /* Call to base-class: */ 1298 1059 return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent); 1299 1060 } … … 1312 1073 void UISelectorWindow::prepareMenuBar() 1313 1074 { 1314 /* Prepare 'File'menu: */1075 /* Prepare File-menu: */ 1315 1076 m_pFileMenu = gActionPool->action(UIActionIndexSelector_Menu_File)->menu(); 1316 1077 prepareMenuFile(m_pFileMenu); 1317 1078 menuBar()->addMenu(m_pFileMenu); 1318 1079 1319 /* Prepare 'Machine' menu: */ 1080 /* Prepare 'Close' menu: */ 1081 m_pMachineCloseMenuAction = gActionPool->action(UIActionIndexSelector_Menu_Machine_Close); 1082 m_pMachineCloseMenu = m_pMachineCloseMenuAction->menu(); 1083 prepareMenuMachineClose(m_pMachineCloseMenu); 1084 1085 /* Prepare Group-menu: */ 1086 m_pGroupMenu = gActionPool->action(UIActionIndexSelector_Menu_Group)->menu(); 1087 prepareMenuGroup(m_pGroupMenu); 1088 m_pGroupMenuAction = menuBar()->addMenu(m_pGroupMenu); 1089 1090 /* Prepare Machine-menu: */ 1320 1091 m_pMachineMenu = gActionPool->action(UIActionIndexSelector_Menu_Machine)->menu(); 1321 1092 prepareMenuMachine(m_pMachineMenu); 1322 m enuBar()->addMenu(m_pMachineMenu);1093 m_pMachineMenuAction = menuBar()->addMenu(m_pMachineMenu); 1323 1094 1324 1095 #ifdef Q_WS_MAC … … 1326 1097 #endif /* Q_WS_MAC */ 1327 1098 1328 /* Prepare 'Help'menu: */1099 /* Prepare Help-menu: */ 1329 1100 m_pHelpMenu = gActionPool->action(UIActionIndex_Menu_Help)->menu(); 1330 1101 prepareMenuHelp(m_pHelpMenu); … … 1341 1112 return; 1342 1113 1343 /* Populate 'File'menu: */1114 /* Populate File-menu: */ 1344 1115 m_pMediumManagerDialogAction = gActionPool->action(UIActionIndexSelector_Simple_File_MediumManagerDialog); 1345 1116 pMenu->addAction(m_pMediumManagerDialogAction); … … 1360 1131 } 1361 1132 1362 void UISelectorWindow::prepareMenu Machine(QMenu *pMenu)1133 void UISelectorWindow::prepareMenuGroup(QMenu *pMenu) 1363 1134 { 1364 1135 /* Do not touch if filled already: */ … … 1366 1137 return; 1367 1138 1368 /* Populate 'Machine' menu: */ 1369 m_pNewWizardAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_NewWizard); 1370 pMenu->addAction(m_pNewWizardAction); 1371 m_pAddDialogAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddDialog); 1372 pMenu->addAction(m_pAddDialogAction); 1373 m_pSettingsDialogAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog); 1374 pMenu->addAction(m_pSettingsDialogAction); 1375 m_pCloneWizardAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_CloneWizard); 1376 pMenu->addAction(m_pCloneWizardAction); 1377 m_pRemoveDialogAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog); 1378 pMenu->addAction(m_pRemoveDialogAction); 1139 /* Populate Machine-menu: */ 1140 m_pActionGroupNewWizard = gActionPool->action(UIActionIndexSelector_Simple_Group_NewWizard); 1141 pMenu->addAction(m_pActionGroupNewWizard); 1142 m_pActionGroupAddDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_AddDialog); 1143 pMenu->addAction(m_pActionGroupAddDialog); 1144 m_pActionGroupRenameDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_RenameDialog); 1145 pMenu->addAction(m_pActionGroupRenameDialog); 1146 m_pActionGroupRemoveDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_RemoveDialog); 1147 pMenu->addAction(m_pActionGroupRemoveDialog); 1379 1148 pMenu->addSeparator(); 1380 m_pStartOrShowAction = gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow); 1381 pMenu->addAction(m_pStartOrShowAction); 1382 m_pDiscardAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Discard); 1383 pMenu->addAction(m_pDiscardAction); 1384 m_pPauseAndResumeAction = gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume); 1385 pMenu->addAction(m_pPauseAndResumeAction); 1386 m_pResetAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Reset); 1387 pMenu->addAction(m_pResetAction); 1388 /* Prepare 'machine/close' menu: */ 1389 m_pMachineCloseMenuAction = gActionPool->action(UIActionIndexSelector_Menu_Machine_Close); 1390 m_pMachineCloseMenu = m_pMachineCloseMenuAction->menu(); 1391 prepareMenuMachineClose(m_pMachineCloseMenu); 1149 m_pActionGroupStartOrShow = gActionPool->action(UIActionIndexSelector_State_Group_StartOrShow); 1150 pMenu->addAction(m_pActionGroupStartOrShow); 1151 m_pActionGroupPauseAndResume = gActionPool->action(UIActionIndexSelector_Toggle_Group_PauseAndResume); 1152 pMenu->addAction(m_pActionGroupPauseAndResume); 1153 m_pActionGroupReset = gActionPool->action(UIActionIndexSelector_Simple_Group_Reset); 1154 pMenu->addAction(m_pActionGroupReset); 1392 1155 pMenu->addMenu(m_pMachineCloseMenu); 1393 1156 pMenu->addSeparator(); 1394 m_p RefreshAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Refresh);1395 pMenu->addAction(m_p RefreshAction);1396 m_p LogDialogAction= gActionPool->action(UIActionIndex_Simple_LogDialog);1397 pMenu->addAction(m_p LogDialogAction);1157 m_pActionGroupRefresh = gActionPool->action(UIActionIndexSelector_Simple_Group_Refresh); 1158 pMenu->addAction(m_pActionGroupRefresh); 1159 m_pActionGroupLogDialog = gActionPool->action(UIActionIndex_Simple_LogDialog); 1160 pMenu->addAction(m_pActionGroupLogDialog); 1398 1161 pMenu->addSeparator(); 1399 m_p ShowInFileManagerAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager);1400 pMenu->addAction(m_p ShowInFileManagerAction);1401 m_p CreateShortcutAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut);1402 pMenu->addAction(m_p CreateShortcutAction);1162 m_pActionGroupShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Group_ShowInFileManager); 1163 pMenu->addAction(m_pActionGroupShowInFileManager); 1164 m_pActionGroupCreateShortcut = gActionPool->action(UIActionIndexSelector_Simple_Group_CreateShortcut); 1165 pMenu->addAction(m_pActionGroupCreateShortcut); 1403 1166 pMenu->addSeparator(); 1404 m_pSortAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Sort);1405 pMenu->addAction(m_pSortAction);1406 } 1407 1408 void UISelectorWindow::prepareMenuMachine Close(QMenu *pMenu)1167 // m_pActionGroupSort = gActionPool->action(UIActionIndexSelector_Simple_Group_Sort); 1168 // pMenu->addAction(m_pActionGroupSort); 1169 } 1170 1171 void UISelectorWindow::prepareMenuMachine(QMenu *pMenu) 1409 1172 { 1410 1173 /* Do not touch if filled already: */ … … 1412 1175 return; 1413 1176 1414 /* Populate 'Machine/Close' menu: */ 1177 /* Populate Machine-menu: */ 1178 m_pActionMachineNewWizard = gActionPool->action(UIActionIndexSelector_Simple_Machine_NewWizard); 1179 pMenu->addAction(m_pActionMachineNewWizard); 1180 m_pActionMachineAddDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddDialog); 1181 pMenu->addAction(m_pActionMachineAddDialog); 1182 m_pActionMachineSettingsDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog); 1183 pMenu->addAction(m_pActionMachineSettingsDialog); 1184 m_pActionMachineCloneWizard = gActionPool->action(UIActionIndexSelector_Simple_Machine_CloneWizard); 1185 pMenu->addAction(m_pActionMachineCloneWizard); 1186 m_pActionMachineRemoveDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog); 1187 pMenu->addAction(m_pActionMachineRemoveDialog); 1188 pMenu->addSeparator(); 1189 m_pActionMachineStartOrShow = gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow); 1190 pMenu->addAction(m_pActionMachineStartOrShow); 1191 m_pActionMachineDiscard = gActionPool->action(UIActionIndexSelector_Simple_Machine_Discard); 1192 pMenu->addAction(m_pActionMachineDiscard); 1193 m_pActionMachinePauseAndResume = gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume); 1194 pMenu->addAction(m_pActionMachinePauseAndResume); 1195 m_pActionMachineReset = gActionPool->action(UIActionIndexSelector_Simple_Machine_Reset); 1196 pMenu->addAction(m_pActionMachineReset); 1197 pMenu->addMenu(m_pMachineCloseMenu); 1198 pMenu->addSeparator(); 1199 m_pActionMachineRefresh = gActionPool->action(UIActionIndexSelector_Simple_Machine_Refresh); 1200 pMenu->addAction(m_pActionMachineRefresh); 1201 m_pActionMachineLogDialog = gActionPool->action(UIActionIndex_Simple_LogDialog); 1202 pMenu->addAction(m_pActionMachineLogDialog); 1203 pMenu->addSeparator(); 1204 m_pActionMachineShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager); 1205 pMenu->addAction(m_pActionMachineShowInFileManager); 1206 m_pActionMachineCreateShortcut = gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut); 1207 pMenu->addAction(m_pActionMachineCreateShortcut); 1208 pMenu->addSeparator(); 1209 // m_pActionMachineSort = gActionPool->action(UIActionIndexSelector_Simple_Machine_Sort); 1210 // pMenu->addAction(m_pActionMachineSort); 1211 } 1212 1213 void UISelectorWindow::prepareMenuMachineClose(QMenu *pMenu) 1214 { 1215 /* Do not touch if filled already: */ 1216 if (!pMenu->isEmpty()) 1217 return; 1218 1219 /* Populate Machine/Close-menu: */ 1415 1220 m_pACPIShutdownAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown); 1416 1221 pMenu->addAction(m_pACPIShutdownAction); … … 1425 1230 return; 1426 1231 1427 /* Populate 'Help'menu: */1428 m_pHelpAction = gActionPool->action(UIActionIndex_Simple_ Help);1232 /* Populate Help-menu: */ 1233 m_pHelpAction = gActionPool->action(UIActionIndex_Simple_Contents); 1429 1234 pMenu->addAction(m_pHelpAction); 1430 m_pWebAction = gActionPool->action(UIActionIndex_Simple_Web );1235 m_pWebAction = gActionPool->action(UIActionIndex_Simple_WebSite); 1431 1236 pMenu->addAction(m_pWebAction); 1432 1237 pMenu->addSeparator(); … … 1440 1245 pMenu->addAction(m_pRegisterAction); 1441 1246 #endif /* VBOX_WITH_REGISTRATION */ 1442 m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_ Update);1247 m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_CheckForUpdates); 1443 1248 pMenu->addAction(m_pUpdateAction); 1444 1249 #ifndef Q_WS_MAC … … 1449 1254 } 1450 1255 1451 void UISelectorWindow::prepareContextMenu()1452 {1453 m_pMachineContextMenu = new QMenu(this);1454 m_pMachineContextMenu->addAction(m_pSettingsDialogAction);1455 m_pMachineContextMenu->addAction(m_pCloneWizardAction);1456 m_pMachineContextMenu->addAction(m_pRemoveDialogAction);1457 m_pMachineContextMenu->addSeparator();1458 m_pMachineContextMenu->addAction(m_pStartOrShowAction);1459 m_pMachineContextMenu->addAction(m_pDiscardAction);1460 m_pMachineContextMenu->addAction(m_pPauseAndResumeAction);1461 m_pMachineContextMenu->addAction(m_pResetAction);1462 m_pMachineContextMenu->addMenu(m_pMachineCloseMenu);1463 m_pMachineContextMenu->addSeparator();1464 m_pMachineContextMenu->addAction(m_pRefreshAction);1465 m_pMachineContextMenu->addAction(m_pLogDialogAction);1466 m_pMachineContextMenu->addSeparator();1467 m_pMachineContextMenu->addAction(m_pShowInFileManagerAction);1468 m_pMachineContextMenu->addAction(m_pCreateShortcutAction);1469 m_pMachineContextMenu->addSeparator();1470 m_pMachineContextMenu->addAction(m_pSortAction);1471 }1472 1473 1256 void UISelectorWindow::prepareStatusBar() 1474 1257 { … … 1486 1269 /* Prepare splitter: */ 1487 1270 m_pSplitter = new QISplitter(this); 1271 #ifdef Q_WS_X11 1488 1272 m_pSplitter->setHandleType(QISplitter::Native); 1273 #endif /* Q_WS_X11 */ 1489 1274 1490 1275 /* Prepare tool-bar: */ … … 1493 1278 mVMToolBar->setIconSize(QSize(32, 32)); 1494 1279 mVMToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 1495 mVMToolBar->addAction(m_pNewWizardAction); 1496 mVMToolBar->addAction(m_pSettingsDialogAction); 1497 mVMToolBar->addAction(m_pStartOrShowAction); 1498 mVMToolBar->addAction(m_pDiscardAction); 1499 1500 /* Prepare VM list: */ 1501 m_pVMModel = new UIVMItemModel(this); 1502 m_pVMListView = new UIVMListView(m_pVMModel); 1503 m_pVMListView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 1504 /* Make non-possible to activate list elements by single click, 1505 * this hack should disable the current possibility to do it if present: */ 1506 if (m_pVMListView->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, m_pVMListView)) 1507 m_pVMListView->setStyleSheet("activate-on-singleclick : 0"); 1280 mVMToolBar->addAction(m_pActionMachineNewWizard); 1281 mVMToolBar->addAction(m_pActionMachineSettingsDialog); 1282 mVMToolBar->addAction(m_pActionMachineStartOrShow); 1283 mVMToolBar->addAction(m_pActionMachineDiscard); 1284 1285 /* Prepare graphics VM list: */ 1286 m_pChooser = new UIGChooser(this); 1287 m_pChooser->setStatusBar(statusBar()); 1288 1289 /* Prepare graphics details: */ 1290 m_pDetails = new UIGDetails(this); 1508 1291 1509 1292 /* Prepare details and snapshots tabs: */ 1510 m_pVMDesktop = new UIVMDesktop(mVMToolBar, m_pRefreshAction, this); 1293 m_pVMDesktop = new UIVMDesktop(mVMToolBar, m_pActionMachineRefresh, this); 1294 1295 /* Crate container: */ 1296 m_pContainer = new QStackedWidget(this); 1297 m_pContainer->addWidget(m_pDetails); 1298 m_pContainer->addWidget(m_pVMDesktop); 1511 1299 1512 1300 /* Layout all the widgets: */ 1513 #define BIG_TOOLBAR1514 1301 #if MAC_LEOPARD_STYLE 1515 1302 addToolBar(mVMToolBar); 1516 1303 /* Central widget @ horizontal layout: */ 1517 1304 setCentralWidget(m_pSplitter); 1518 m_pSplitter->addWidget(m_p VMListView);1305 m_pSplitter->addWidget(m_pChooser); 1519 1306 #else /* MAC_LEOPARD_STYLE */ 1520 QWidget *p LeftWidget = new QWidget(this);1521 QVBoxLayout *pLeftVLayout = new QVBoxLayout(pLeftWidget);1522 pLeftVLayout->setContentsMargins(0, 0, 0, 0);1523 p LeftVLayout->setSpacing(0);1524 # ifdef BIG_TOOLBAR 1307 QWidget *pCentralWidget = new QWidget(this); 1308 setCentralWidget(pCentralWidget); 1309 QVBoxLayout *pCentralLayout = new QVBoxLayout(pCentralWidget); 1310 pCentralLayout->setContentsMargins(0, 0, 0, 0); 1311 pCentralLayout->setSpacing(0); 1525 1312 m_pBar = new UIMainBar(this); 1526 1313 m_pBar->setContentWidget(mVMToolBar); 1527 pLeftVLayout->addWidget(m_pBar); 1528 pLeftVLayout->addWidget(m_pSplitter); 1529 setCentralWidget(pLeftWidget); 1530 m_pSplitter->addWidget(m_pVMListView); 1531 # else /* BIG_TOOLBAR */ 1532 pLeftVLayout->addWidget(mVMToolBar); 1533 pLeftVLayout->addWidget(m_pVMListView); 1534 setCentralWidget(m_pSplitter); 1535 m_pSplitter->addWidget(pLeftWidget); 1536 # endif /* !BIG_TOOLBAR */ 1314 pCentralLayout->addWidget(m_pBar); 1315 pCentralLayout->addWidget(m_pSplitter); 1316 m_pSplitter->addWidget(m_pChooser); 1537 1317 #endif /* !MAC_LEOPARD_STYLE */ 1538 m_pSplitter->addWidget(m_p VMDesktop);1318 m_pSplitter->addWidget(m_pContainer); 1539 1319 1540 1320 /* Set the initial distribution. The right site is bigger. */ … … 1542 1322 m_pSplitter->setStretchFactor(1, 3); 1543 1323 1544 /* Refresh VM list: */1545 sltRefreshVMList();1546 /* Reset to the first item: */1547 m_pVMListView->selectItemByRow(0);1548 1324 /* Bring the VM list to the focus: */ 1549 m_pVMListView->setFocus(); 1550 1551 #ifdef VBOX_GUI_WITH_SYSTRAY 1552 m_pTrayIcon = new VBoxTrayIcon(this, m_pVMModel); 1553 Assert(m_pTrayIcon); 1554 #endif /* VBOX_GUI_WITH_SYSTRAY */ 1325 m_pChooser->setFocus(); 1555 1326 } 1556 1327 1557 1328 void UISelectorWindow::prepareConnections() 1558 1329 { 1559 /* VirtualBox event connections: */1560 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChanged(QString, KMachineState)));1561 connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), this, SLOT(sltMachineDataChanged(QString)));1562 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)), this, SLOT(sltMachineRegistered(QString, bool)));1563 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltSessionStateChanged(QString, KSessionState)));1564 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltSnapshotChanged(QString, QString)));1565 1566 1330 /* Medium enumeration connections: */ 1567 connect(&vboxGlobal(), SIGNAL(mediumEnumStarted()), this, SLOT(sltMediumEnumerationStarted()));1568 1331 connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)), this, SLOT(sltMediumEnumFinished(const VBoxMediaList &))); 1569 1332 … … 1578 1341 connect(m_pExitAction, SIGNAL(triggered()), this, SLOT(sltPerformExit())); 1579 1342 1343 /* 'Group' menu connections: */ 1344 connect(m_pGroupMenu, SIGNAL(aboutToShow()), this, SLOT(sltMachineMenuAboutToShow())); 1345 connect(m_pActionGroupNewWizard, SIGNAL(triggered()), this, SLOT(sltShowCreateMachineWizard())); 1346 connect(m_pActionGroupAddDialog, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog())); 1347 connect(m_pActionGroupStartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction())); 1348 connect(m_pActionGroupPauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool))); 1349 connect(m_pActionGroupReset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction())); 1350 connect(m_pActionGroupRefresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction())); 1351 connect(m_pActionGroupLogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog())); 1352 connect(m_pActionGroupShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager())); 1353 connect(m_pActionGroupCreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction())); 1354 1580 1355 /* 'Machine' menu connections: */ 1581 1356 connect(m_pMachineMenu, SIGNAL(aboutToShow()), this, SLOT(sltMachineMenuAboutToShow())); 1582 connect(m_pNewWizardAction, SIGNAL(triggered()), this, SLOT(sltShowNewMachineWizard())); 1583 connect(m_pAddDialogAction, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog())); 1584 connect(m_pSettingsDialogAction, SIGNAL(triggered()), this, SLOT(sltShowMachineSettingsDialog())); 1585 connect(m_pCloneWizardAction, SIGNAL(triggered()), this, SLOT(sltShowCloneMachineWizard())); 1586 connect(m_pRemoveDialogAction, SIGNAL(triggered()), this, SLOT(sltShowRemoveMachineDialog())); 1587 connect(m_pStartOrShowAction, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction())); 1588 connect(m_pDiscardAction, SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction())); 1589 connect(m_pPauseAndResumeAction, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool))); 1590 connect(m_pResetAction, SIGNAL(triggered()), this, SLOT(sltPerformResetAction())); 1591 connect(m_pRefreshAction, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction())); 1592 connect(m_pLogDialogAction, SIGNAL(triggered()), this, SLOT(sltShowLogDialog())); 1593 connect(m_pShowInFileManagerAction, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager())); 1594 connect(m_pCreateShortcutAction, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction())); 1595 connect(m_pSortAction, SIGNAL(triggered()), this, SLOT(sltPerformSortAction())); 1357 connect(m_pActionMachineNewWizard, SIGNAL(triggered()), this, SLOT(sltShowCreateMachineWizard())); 1358 connect(m_pActionMachineAddDialog, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog())); 1359 connect(m_pActionMachineSettingsDialog, SIGNAL(triggered()), this, SLOT(sltShowMachineSettingsDialog())); 1360 connect(m_pActionMachineCloneWizard, SIGNAL(triggered()), this, SLOT(sltShowCloneMachineWizard())); 1361 connect(m_pActionMachineStartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction())); 1362 connect(m_pActionMachineDiscard, SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction())); 1363 connect(m_pActionMachinePauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool))); 1364 connect(m_pActionMachineReset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction())); 1365 connect(m_pActionMachineRefresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction())); 1366 connect(m_pActionMachineLogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog())); 1367 connect(m_pActionMachineShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager())); 1368 connect(m_pActionMachineCreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction())); 1596 1369 1597 1370 /* 'Machine/Close' menu connections: */ … … 1612 1385 connect(m_pAboutAction, SIGNAL(triggered()), &msgCenter(), SLOT(sltShowHelpAboutDialog())); 1613 1386 1614 /* 'Machine' context menu connections: */1615 connect(m_pMachineContextMenu, SIGNAL(aboutToShow()), this, SLOT(sltMachineMenuAboutToShow()));1616 connect(m_pMachineContextMenu, SIGNAL(hovered(QAction*)), this, SLOT(sltMachineContextMenuHovered(QAction*)));1617 1618 1387 /* Status-bar connections: */ 1619 1388 connect(statusBar(), SIGNAL(customContextMenuRequested(const QPoint&)), 1620 1389 this, SLOT(sltShowSelectorContextMenu(const QPoint&))); 1621 1390 1622 /* VM list-view connections: */ 1623 connect(m_pVMListView, SIGNAL(sigUrlsDropped(QList<QUrl>)), this, SLOT(sltOpenUrls(QList<QUrl>)), Qt::QueuedConnection); 1624 connect(m_pVMListView, SIGNAL(currentChanged()), this, SLOT(sltCurrentVMItemChanged())); 1625 connect(m_pVMListView, SIGNAL(activated()), this, SLOT(sltPerformStartOrShowAction())); 1626 connect(m_pVMListView, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(sltShowContextMenu(const QPoint &))); 1391 /* Graphics VM chooser connections: */ 1392 connect(m_pChooser, SIGNAL(sigSelectionChanged()), this, SLOT(sltCurrentVMItemChanged()), Qt::QueuedConnection); 1627 1393 1628 1394 /* Tool-bar connections: */ … … 1636 1402 1637 1403 /* VM desktop connections: */ 1638 connect(m_pVMDesktop, SIGNAL(linkClicked(const QString &)), this, SLOT(sltShowMachineSettingsDialog(const QString &))); 1404 connect(m_pVMDesktop, SIGNAL(sigCurrentChanged(int)), this, SLOT(sltDetailsViewIndexChanged(int))); 1405 connect(m_pDetails, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)), 1406 this, SLOT(sltShowMachineSettingsDialog(const QString&, const QString&, const QString&))); 1639 1407 1640 1408 #ifdef VBOX_GUI_WITH_SYSTRAY … … 1695 1463 setGeometry(m_normalGeo); 1696 1464 } 1697 }1698 1699 /* Restore selected VM(s): */1700 {1701 QString strPrevVMId = vbox.GetExtraData(GUI_LastVMSelected);1702 1703 m_pVMListView->selectItemById(strPrevVMId);1704 1465 } 1705 1466 … … 1752 1513 } 1753 1514 1754 /* Save selected VM(s): */1755 {1756 UIVMItem *pItem = m_pVMListView->currentItem();1757 QString strCurrentVMId = pItem ? QString(pItem->id()) : QString();1758 vbox.SetExtraData(GUI_LastVMSelected, strCurrentVMId);1759 vbox.SetExtraDataStringList(GUI_SelectorVMPositions, m_pVMModel->idList());1760 }1761 1762 1515 /* Save splitter handle position: */ 1763 1516 { … … 1766 1519 } 1767 1520 1768 bool UISelectorWindow::isActionEnabled(int iActionIndex, UIVMItem *pItem, const QList<UIVMItem*> &items) 1769 { 1770 if (pItem) 1771 { 1772 switch (iActionIndex) 1773 { 1774 case UIActionIndexSelector_Simple_Machine_SettingsDialog: 1521 UIVMItem* UISelectorWindow::currentItem() const 1522 { 1523 return m_pChooser->currentItem(); 1524 } 1525 1526 QList<UIVMItem*> UISelectorWindow::currentItems() const 1527 { 1528 return m_pChooser->currentItems(); 1529 } 1530 1531 bool UISelectorWindow::isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items) 1532 { 1533 /* No actions enabled for empty item list: */ 1534 if (items.isEmpty()) 1535 return false; 1536 1537 /* Get first item: */ 1538 UIVMItem *pItem = items.first(); 1539 1540 /* For known action types: */ 1541 switch (iActionIndex) 1542 { 1543 case UIActionIndexSelector_Simple_Machine_SettingsDialog: 1544 { 1545 /* Check that there is only one item, its accessible 1546 * and machine is not in 'stuck' or 'saved' state. */ 1547 return items.size() == 1 && 1548 pItem->accessible() && 1549 pItem->machineState() != KMachineState_Stuck && 1550 pItem->machineState() != KMachineState_Saved; 1551 } 1552 case UIActionIndexSelector_Simple_Machine_CloneWizard: 1553 { 1554 /* Check that there is only one item, its accessible 1555 * and session state is unlocked. */ 1556 return items.size() == 1 && 1557 pItem->accessible() && 1558 pItem->sessionState() == KSessionState_Unlocked; 1559 } 1560 case UIActionIndexSelector_Simple_Group_RenameDialog: 1561 case UIActionIndexSelector_Simple_Group_RemoveDialog: 1562 { 1563 /* Group can be always removed/renamed: */ 1564 return true; 1565 } 1566 case UIActionIndexSelector_Simple_Machine_RemoveDialog: 1567 { 1568 /* Check that all machines are NOT accessible 1569 * or session states of all machines are unlocked. */ 1570 return isItemsInaccessible(items) || isItemsHasUnlockedSession(items); 1571 } 1572 case UIActionIndexSelector_State_Group_StartOrShow: 1573 case UIActionIndexSelector_State_Machine_StartOrShow: 1574 { 1575 /* Make sure all items are accessible: */ 1576 if (!isItemsAccessible(items)) 1577 return false; 1578 1579 /* If machine is in one of 'powered-off' states:*/ 1580 if (pItem->machineState() == KMachineState_PoweredOff || 1581 pItem->machineState() == KMachineState_Saved || 1582 pItem->machineState() == KMachineState_Teleported || 1583 pItem->machineState() == KMachineState_Aborted) 1775 1584 { 1776 /* Check that there is only one item, its accessible 1777 * and machine is not in 'stuck' or 'saved' state. 1778 * Modifying VM settings in 'saved' state will be available later. */ 1779 return items.size() == 1 && 1780 pItem && pItem->accessible() && 1781 pItem->machineState() != KMachineState_Stuck && 1782 pItem->machineState() != KMachineState_Saved; 1585 /* It depends on session state: */ 1586 return pItem->sessionState() == KSessionState_Unlocked; 1783 1587 } 1784 case UIActionIndexSelector_Simple_Machine_CloneWizard: 1588 1589 /* Otherwise we are in running mode and 1590 * should allow to switch to VM if its possible: */ 1591 return pItem->canSwitchTo(); 1592 } 1593 case UIActionIndexSelector_Simple_Machine_Discard: 1594 { 1595 /* Check that there is only one item, its accessible 1596 * and machine is in 'saved' state and session state is unlocked. */ 1597 return items.size() == 1 && 1598 pItem->accessible() && 1599 pItem->machineState() == KMachineState_Saved && 1600 pItem->sessionState() == KSessionState_Unlocked; 1601 } 1602 case UIActionIndexSelector_Toggle_Group_PauseAndResume: 1603 case UIActionIndexSelector_Toggle_Machine_PauseAndResume: 1604 { 1605 /* Make sure all items are accessible: */ 1606 if (!isItemsAccessible(items)) 1607 return false; 1608 1609 /* True if machine is in one of next 'running' or 'paused' states: */ 1610 return pItem->machineState() == KMachineState_Running || 1611 pItem->machineState() == KMachineState_Teleporting || 1612 pItem->machineState() == KMachineState_LiveSnapshotting || 1613 pItem->machineState() == KMachineState_Paused || 1614 pItem->machineState() == KMachineState_TeleportingPausedVM; 1615 } 1616 case UIActionIndexSelector_Simple_Group_Reset: 1617 case UIActionIndexSelector_Simple_Machine_Reset: 1618 { 1619 /* Make sure all items are accessible: */ 1620 if (!isItemsAccessible(items)) 1621 return false; 1622 1623 /* True if machine is in one of 'running' states: */ 1624 return pItem->machineState() == KMachineState_Running || 1625 pItem->machineState() == KMachineState_Teleporting || 1626 pItem->machineState() == KMachineState_LiveSnapshotting; 1627 } 1628 case UIActionIndexSelector_Menu_Machine_Close: 1629 { 1630 /* Make sure all items are accessible: */ 1631 if (!isItemsAccessible(items)) 1632 return false; 1633 1634 /* True if machine is in one of next 'running' or 'paused' states: */ 1635 return pItem->machineState() == KMachineState_Running || 1636 pItem->machineState() == KMachineState_Paused; 1637 } 1638 case UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown: 1639 { 1640 /* Check that 'Machine/Close' menu is enabled: */ 1641 if (!isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items)) 1642 return false; 1643 1644 /* Check if we are entered ACPI mode already. 1645 * Only then it make sense to send the ACPI shutdown sequence: */ 1646 bool fEnteredACPIMode = false; 1647 CSession session = vboxGlobal().openExistingSession(pItem->id()); 1648 if (!session.isNull()) 1785 1649 { 1786 /* Check that there is only one item, its accessible 1787 * and session state is unlocked. */ 1788 return items.size() == 1 && 1789 pItem && pItem->accessible() && 1790 pItem->sessionState() == KSessionState_Unlocked; 1650 CConsole console = session.GetConsole(); 1651 if (!console.isNull()) 1652 fEnteredACPIMode = console.GetGuestEnteredACPIMode(); 1653 session.UnlockMachine(); 1791 1654 } 1792 case UIActionIndexSelector_Simple_Machine_RemoveDialog: 1793 { 1794 /* Check that item is present and 1795 * machine is not accessible or session state is unlocked. */ 1796 return pItem && 1797 (!pItem->accessible() || pItem->sessionState() == KSessionState_Unlocked); 1798 } 1799 case UIActionIndexSelector_State_Machine_StartOrShow: 1800 { 1801 /* Check that item present and accessible: */ 1802 if (!pItem || !pItem->accessible()) 1803 return false; 1804 1805 /* Check if we are in powered off mode which unifies next possible states. 1806 * Then if session state is unlocked we can allow to start VM. */ 1807 if (pItem->machineState() == KMachineState_PoweredOff || 1808 pItem->machineState() == KMachineState_Saved || 1809 pItem->machineState() == KMachineState_Teleported || 1810 pItem->machineState() == KMachineState_Aborted) 1811 return pItem->sessionState() == KSessionState_Unlocked; 1812 1813 /* Otherwise we are in running mode and 1814 * should allow to switch to VM if its possible: */ 1815 return pItem->canSwitchTo(); 1816 } 1817 case UIActionIndexSelector_Simple_Machine_Discard: 1818 { 1819 /* Check that there is only one item, its accessible 1820 * and machine is in 'saved' state and session state is unlocked. */ 1821 return items.size() == 1 && 1822 pItem && pItem->accessible() && 1823 pItem->machineState() == KMachineState_Saved && 1824 pItem->sessionState() == KSessionState_Unlocked; 1825 } 1826 case UIActionIndexSelector_Toggle_Machine_PauseAndResume: 1827 { 1828 /* Check that item present and accessible 1829 * and machine is in 'running' or 'paused' mode which unifies next possible states. */ 1830 return pItem && pItem->accessible() && 1831 (pItem->machineState() == KMachineState_Running || 1832 pItem->machineState() == KMachineState_Teleporting || 1833 pItem->machineState() == KMachineState_LiveSnapshotting || 1834 pItem->machineState() == KMachineState_Paused || 1835 pItem->machineState() == KMachineState_TeleportingPausedVM); 1836 } 1837 case UIActionIndexSelector_Simple_Machine_Reset: 1838 { 1839 /* Check that item present and accessible 1840 * and machine is in 'running' mode which unifies next possible states. */ 1841 return pItem && pItem->accessible() && 1842 (pItem->machineState() == KMachineState_Running || 1843 pItem->machineState() == KMachineState_Teleporting || 1844 pItem->machineState() == KMachineState_LiveSnapshotting); 1845 } 1846 case UIActionIndexSelector_Menu_Machine_Close: 1847 { 1848 /* Check that item present and accessible 1849 * and machine is in 'running' or 'paused' state. */ 1850 return pItem && pItem->accessible() && 1851 (pItem->machineState() == KMachineState_Running || 1852 pItem->machineState() == KMachineState_Paused); 1853 } 1854 case UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown: 1855 { 1856 /* Check that 'Machine/Close' menu is enabled: */ 1857 if (!isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, pItem, items)) 1858 return false; 1859 1860 /* Check if we are entered ACPI mode already. 1861 * Only then it make sense to send the ACPI shutdown sequence: */ 1862 bool fEnteredACPIMode = false; 1863 CSession session = vboxGlobal().openExistingSession(pItem->id()); 1864 if (!session.isNull()) 1865 { 1866 CConsole console = session.GetConsole(); 1867 if (!console.isNull()) 1868 fEnteredACPIMode = console.GetGuestEnteredACPIMode(); 1869 session.UnlockMachine(); 1870 } 1871 else 1872 msgCenter().cannotOpenSession(session); 1873 1874 return fEnteredACPIMode; 1875 } 1876 case UIActionIndexSelector_Simple_Machine_Close_PowerOff: 1877 { 1878 /* The same as 'Machine/Close' menu is enabled: */ 1879 return isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, pItem, items); 1880 } 1881 case UIActionIndexSelector_Simple_Machine_Refresh: 1882 { 1883 /* Check if item present and NOT accessible: */ 1884 return pItem && !pItem->accessible(); 1885 } 1886 case UIActionIndex_Simple_LogDialog: 1887 case UIActionIndexSelector_Simple_Machine_ShowInFileManager: 1888 case UIActionIndexSelector_Simple_Machine_Sort: 1889 { 1890 /* Check if item present and accessible: */ 1891 return pItem && pItem->accessible(); 1892 } 1893 case UIActionIndexSelector_Simple_Machine_CreateShortcut: 1894 { 1655 else 1656 msgCenter().cannotOpenSession(session); 1657 return fEnteredACPIMode; 1658 } 1659 case UIActionIndexSelector_Simple_Machine_Close_PowerOff: 1660 { 1661 /* The same as 'Machine/Close' menu is enabled: */ 1662 return isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items); 1663 } 1664 case UIActionIndexSelector_Simple_Group_Refresh: 1665 case UIActionIndexSelector_Simple_Machine_Refresh: 1666 { 1667 /* Make sure all items are NOT accessible: */ 1668 return isItemsInaccessible(items); 1669 } 1670 case UIActionIndex_Simple_LogDialog: 1671 case UIActionIndexSelector_Simple_Group_ShowInFileManager: 1672 case UIActionIndexSelector_Simple_Machine_ShowInFileManager: 1673 // case UIActionIndexSelector_Simple_Group_Sort: 1674 // case UIActionIndexSelector_Simple_Machine_Sort: 1675 // { 1676 // /* Make sure all items are accessible: */ 1677 // return isItemsAccessible(items); 1678 // } 1679 case UIActionIndexSelector_Simple_Group_CreateShortcut: 1680 case UIActionIndexSelector_Simple_Machine_CreateShortcut: 1681 { 1682 /* Make sure all items supports shortcuts: */ 1683 return isItemsSupportsShortcuts(items); 1684 } 1685 default: 1686 break; 1687 } 1688 1689 /* Unknown actions are disabled: */ 1690 return false; 1691 } 1692 1693 /* static */ 1694 bool UISelectorWindow::isItemsAccessible(const QList<UIVMItem*> &items) 1695 { 1696 foreach (UIVMItem *pItem, items) 1697 if (!pItem->accessible()) 1698 return false; 1699 return true; 1700 } 1701 1702 /* static */ 1703 bool UISelectorWindow::isItemsInaccessible(const QList<UIVMItem*> &items) 1704 { 1705 foreach (UIVMItem *pItem, items) 1706 if (pItem->accessible()) 1707 return false; 1708 return true; 1709 } 1710 1711 /* static */ 1712 bool UISelectorWindow::isItemsHasUnlockedSession(const QList<UIVMItem*> &items) 1713 { 1714 foreach (UIVMItem *pItem, items) 1715 if (pItem->sessionState() != KSessionState_Unlocked) 1716 return false; 1717 return true; 1718 } 1719 1720 /* static */ 1721 bool UISelectorWindow::isItemsSupportsShortcuts(const QList<UIVMItem*> &items) 1722 { 1723 /* Make sure all items are accessible: */ 1724 if (!isItemsAccessible(items)) 1725 return false; 1726 1895 1727 #ifdef Q_WS_MAC 1896 /* On Mac OS X this are real alias files, which don't work with the old 1897 * legacy xml files. On the other OS's some kind of start up script is used. */ 1898 return pItem && pItem->accessible() && 1899 pItem->settingsFile().endsWith(".vbox", Qt::CaseInsensitive); 1900 #else /* Q_WS_MAC */ 1901 return pItem && pItem->accessible(); 1728 /* On Mac OS X this are real alias files, which don't work with the old 1729 * legacy xml files. On the other OS's some kind of start up script is used. */ 1730 foreach (UIVMItem *pItem, items) 1731 if (!pItem->settingsFile().endsWith(".vbox", Qt::CaseInsensitive)) 1732 return false; 1902 1733 #endif /* Q_WS_MAC */ 1903 } 1904 default: 1905 break; 1906 } 1907 } 1908 return false; 1909 } 1910 1734 1735 /* True by default: */ 1736 return true; 1737 } 1738 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r41846 r42526 6 6 7 7 /* 8 * Copyright (C) 2006-201 1Oracle Corporation8 * Copyright (C) 2006-2012 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 23 23 #include <QMainWindow> 24 24 #include <QUrl> 25 #ifdef VBOX_GUI_WITH_SYSTRAY26 # include <QSystemTrayIcon>27 #endif /* VBOX_GUI_WITH_SYSTRAY */28 25 29 26 /* GUI includes: */ … … 35 32 class QISplitter; 36 33 class QMenu; 37 class UIAction Interface;34 class UIAction; 38 35 class UIMainBar; 39 36 class UIToolBar; … … 42 39 class UIVMItemModel; 43 40 class UIVMListView; 44 #ifdef VBOX_GUI_WITH_SYSTRAY 45 class VBoxTrayIcon;46 #endif /* VBOX_GUI_WITH_SYSTRAY */ 41 class UIGChooser; 42 class UIGDetails; 43 class QStackedWidget; 47 44 48 45 /* VM selector window class: */ … … 51 48 Q_OBJECT; 52 49 50 signals: 51 52 /* Obsolete: Signal to notify listeners about this dialog closed: */ 53 void closing(); 54 53 55 public: 54 56 … … 57 59 QWidget* pParent = 0, 58 60 Qt::WindowFlags flags = Qt::Window); 59 virtual ~UISelectorWindow(); 60 61 signals: 62 63 /* Signal to notify listeners about this dialog closed: */ 64 void closing(); 61 ~UISelectorWindow(); 65 62 66 63 private slots: 67 64 68 /* Menubar/status bar slots: */ 65 /* Handler: Details-view stuff: */ 66 void sltDetailsViewIndexChanged(int iWidgetIndex); 67 68 /* Handler: Medium enumeration stuff: */ 69 void sltMediumEnumFinished(const VBoxMediaList &mediumList); 70 71 /* Handler: Menubar/status stuff: */ 69 72 void sltShowSelectorContextMenu(const QPoint &pos); 70 73 71 /* 'File' menu slots: */74 /* Handlers: File-menu stuff: */ 72 75 void sltShowMediumManager(); 73 76 void sltShowImportApplianceWizard(const QString &strFileName = QString()); … … 76 79 void sltPerformExit(); 77 80 78 /* 'Machine'menu slots: */79 void sltShow NewMachineWizard();81 /* Handlers: Machine-menu slots: */ 82 void sltShowCreateMachineWizard(); 80 83 void sltShowAddMachineDialog(const QString &strFileName = QString()); 81 84 void sltShowMachineSettingsDialog(const QString &strCategory = QString(), 82 85 const QString &strControl = QString(), 83 const QString &str MachineId = QString());86 const QString &strId = QString()); 84 87 void sltShowCloneMachineWizard(); 85 void sltShowRemoveMachineDialog();86 88 void sltPerformStartOrShowAction(); 87 89 void sltPerformDiscardAction(); … … 94 96 void sltShowMachineInFileManager(); 95 97 void sltPerformCreateShortcutAction(); 96 void sltPerformSortAction();97 98 void sltMachineMenuAboutToShow(); 98 99 void sltMachineCloseMenuAboutToShow(); 99 void sltMachineContextMenuHovered(QAction *pAction);100 100 101 101 /* VM list slots: */ 102 void sltRefreshVMList();103 void sltRefreshVMItem(const QString &strMachineId, bool fDetails, bool fSnapshots, bool fDescription);104 void sltShowContextMenu(const QPoint &point);105 102 void sltCurrentVMItemChanged(bool fRefreshDetails = true, bool fRefreshSnapshots = true, bool fRefreshDescription = true); 106 103 void sltOpenUrls(QList<QUrl> list = QList<QUrl>()); 107 108 /* VirtualBox callback events we're interested in: */109 void sltMachineRegistered(QString strID, bool fRegistered);110 void sltMachineStateChanged(QString strId, KMachineState state);111 void sltMachineDataChanged(QString strId);112 void sltSessionStateChanged(QString strId, KSessionState state);113 void sltSnapshotChanged(QString strId, QString strSnapshotId);114 #ifdef VBOX_GUI_WITH_SYSTRAY115 /* Sys tray related event handlers: */116 void sltMainWindowCountChanged(int count);117 void sltTrayIconCanShow(bool fEnabled);118 void sltTrayIconShow(bool fEnabled);119 void sltTrayIconChanged(bool fEnabled);120 /* Sys tray related slots: */121 void sltTrayIconActivated(QSystemTrayIcon::ActivationReason aReason);122 void sltShowWindow();123 #endif /* VBOX_GUI_WITH_SYSTRAY */124 125 /* Medium enumeration related slots: */126 void sltMediumEnumerationStarted();127 void sltMediumEnumFinished(const VBoxMediaList &mediumList);128 104 129 105 private: … … 139 115 #endif /* Q_WS_MAC */ 140 116 141 /* Help ingstuff: */117 /* Helpers: Prepare stuff: */ 142 118 void prepareIcon(); 143 119 void prepareMenuBar(); 144 120 void prepareMenuFile(QMenu *pMenu); 121 void prepareMenuGroup(QMenu *pMenu); 145 122 void prepareMenuMachine(QMenu *pMenu); 146 123 void prepareMenuMachineClose(QMenu *pMenu); 147 124 void prepareMenuHelp(QMenu *pMenu); 148 void prepareContextMenu();149 125 void prepareStatusBar(); 150 126 void prepareWidgets(); … … 153 129 void saveSettings(); 154 130 155 /* Static helping stuff: */ 156 static bool isActionEnabled(int iActionIndex, UIVMItem *pItem, const QList<UIVMItem*> &items); 131 /* Helpers: Current item stuff: */ 132 UIVMItem* currentItem() const; 133 QList<UIVMItem*> currentItems() const; 134 135 /* Helpers: Action stuff: */ 136 static bool isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items); 137 static bool isItemsAccessible(const QList<UIVMItem*> &items); 138 static bool isItemsInaccessible(const QList<UIVMItem*> &items); 139 static bool isItemsHasUnlockedSession(const QList<UIVMItem*> &items); 140 static bool isItemsSupportsShortcuts(const QList<UIVMItem*> &items); 157 141 158 142 /* Central splitter window: */ … … 165 149 UIToolBar *mVMToolBar; 166 150 167 /* VM list view: */168 UIVMListView *m_pVMListView;169 /* VM list model: */ 170 UIVMItemModel *m_pVMModel;171 /* VM list context menu: */172 QMenu *m_pMachineContextMenu;151 /* Details widgets container: */ 152 QStackedWidget *m_pContainer; 153 154 /* Graphics chooser/details: */ 155 UIGChooser *m_pChooser; 156 UIGDetails *m_pDetails; 173 157 174 158 /* VM details widget: */ … … 177 161 /* 'File' menu action pointers: */ 178 162 QMenu *m_pFileMenu; 179 UIAction Interface*m_pMediumManagerDialogAction;180 UIAction Interface*m_pImportApplianceWizardAction;181 UIAction Interface*m_pExportApplianceWizardAction;182 UIAction Interface*m_pPreferencesDialogAction;183 UIAction Interface*m_pExitAction;163 UIAction *m_pMediumManagerDialogAction; 164 UIAction *m_pImportApplianceWizardAction; 165 UIAction *m_pExportApplianceWizardAction; 166 UIAction *m_pPreferencesDialogAction; 167 UIAction *m_pExitAction; 184 168 185 169 /* 'Machine' menu action pointers: */ 170 QAction *m_pGroupMenuAction; 171 QMenu *m_pGroupMenu; 172 UIAction *m_pActionGroupNewWizard; 173 UIAction *m_pActionGroupAddDialog; 174 UIAction *m_pActionGroupRenameDialog; 175 UIAction *m_pActionGroupRemoveDialog; 176 UIAction *m_pActionGroupStartOrShow; 177 UIAction *m_pActionGroupPauseAndResume; 178 UIAction *m_pActionGroupReset; 179 UIAction *m_pActionGroupRefresh; 180 UIAction *m_pActionGroupLogDialog; 181 UIAction *m_pActionGroupShowInFileManager; 182 UIAction *m_pActionGroupCreateShortcut; 183 // UIAction *m_pActionGroupSort; 184 185 /* 'Machine' menu action pointers: */ 186 QAction *m_pMachineMenuAction; 186 187 QMenu *m_pMachineMenu; 187 UIAction Interface *m_pNewWizardAction;188 UIAction Interface *m_pAddDialogAction;189 UIAction Interface *m_pSettingsDialogAction;190 UIAction Interface *m_pCloneWizardAction;191 UIAction Interface *m_pRemoveDialogAction;192 UIAction Interface *m_pStartOrShowAction;193 UIAction Interface *m_pDiscardAction;194 UIAction Interface *m_pPauseAndResumeAction;195 UIAction Interface *m_pResetAction;196 UIAction Interface *m_pRefreshAction;197 UIAction Interface *m_pLogDialogAction;198 UIAction Interface *m_pShowInFileManagerAction;199 UIAction Interface *m_pCreateShortcutAction;200 UIActionInterface *m_pSortAction;188 UIAction *m_pActionMachineNewWizard; 189 UIAction *m_pActionMachineAddDialog; 190 UIAction *m_pActionMachineSettingsDialog; 191 UIAction *m_pActionMachineCloneWizard; 192 UIAction *m_pActionMachineRemoveDialog; 193 UIAction *m_pActionMachineStartOrShow; 194 UIAction *m_pActionMachineDiscard; 195 UIAction *m_pActionMachinePauseAndResume; 196 UIAction *m_pActionMachineReset; 197 UIAction *m_pActionMachineRefresh; 198 UIAction *m_pActionMachineLogDialog; 199 UIAction *m_pActionMachineShowInFileManager; 200 UIAction *m_pActionMachineCreateShortcut; 201 // UIAction *m_pActionMachineSort; 201 202 202 203 /* 'Machine / Close' menu action pointers: */ 203 UIAction Interface*m_pMachineCloseMenuAction;204 UIAction *m_pMachineCloseMenuAction; 204 205 QMenu *m_pMachineCloseMenu; 205 UIAction Interface*m_pACPIShutdownAction;206 UIAction Interface*m_pPowerOffAction;206 UIAction *m_pACPIShutdownAction; 207 UIAction *m_pPowerOffAction; 207 208 208 209 /* 'Help' menu action pointers: */ 209 210 QMenu *m_pHelpMenu; 210 UIActionInterface *m_pHelpAction; 211 UIActionInterface *m_pWebAction; 212 UIActionInterface *m_pResetWarningsAction; 213 UIActionInterface *m_pNetworkAccessManager; 214 #ifdef VBOX_WITH_REGISTRATION 215 UIActionInterface *m_pRegisterAction; 216 #endif /* VBOX_WITH_REGISTRATION */ 217 UIActionInterface *m_pUpdateAction; 218 UIActionInterface *m_pAboutAction; 211 UIAction *m_pHelpAction; 212 UIAction *m_pWebAction; 213 UIAction *m_pResetWarningsAction; 214 UIAction *m_pNetworkAccessManager; 215 UIAction *m_pUpdateAction; 216 UIAction *m_pAboutAction; 219 217 220 218 /* Other variables: */ 221 219 QRect m_normalGeo; 222 220 bool m_fDoneInaccessibleWarningOnce : 1; 223 #ifdef VBOX_GUI_WITH_SYSTRAY224 /* The systray icon: */225 VBoxTrayIcon *m_pTrayIcon;226 #endif /* VBOX_GUI_WITH_SYSTRAY */227 221 }; 228 222 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp
r41819 r42526 1996 1996 1997 1997 /* Add the pages */ 1998 QStackedLayout *pStack= new QStackedLayout(pMainLayout);1998 m_pStackedLayout = new QStackedLayout(pMainLayout); 1999 1999 2000 2000 m_pDetails = new UIDetailsPagePrivate(this, pRefreshAction); 2001 2001 connect(m_pDetails, SIGNAL(linkClicked(const QString&)), 2002 2002 this, SIGNAL(linkClicked(const QString&))); 2003 pStack->addWidget(m_pDetails);2003 m_pStackedLayout->addWidget(m_pDetails); 2004 2004 m_pSnapshotsPage = new VBoxSnapshotsWgt(this); 2005 2005 m_pSnapshotsPage->setContentsMargins(gsLeftMargin, gsTopMargin, gsRightMargin, gsBottomMargin); 2006 pStack->addWidget(m_pSnapshotsPage);2006 m_pStackedLayout->addWidget(m_pSnapshotsPage); 2007 2007 // m_pDescription = new UIDescriptionPagePrivate(this); 2008 2008 // connect(m_pDescription, SIGNAL(linkClicked(const QString&)), 2009 2009 // this, SIGNAL(linkClicked(const QString&))); 2010 2010 // m_pDescription->setContentsMargins(gsLeftMargin, gsTopMargin, gsRightMargin, gsBottomMargin); 2011 // pStack->addWidget(m_pDescription);2011 // m_pStackedLayout->addWidget(m_pDescription); 2012 2012 2013 2013 /* Connect the header buttons with the stack layout. */ 2014 2014 connect(m_pHeaderBtn, SIGNAL(clicked(int)), 2015 pStack, SLOT(setCurrentIndex(int))); 2015 m_pStackedLayout, SLOT(setCurrentIndex(int))); 2016 connect(m_pStackedLayout, SIGNAL(currentChanged(int)), 2017 this, SIGNAL(sigCurrentChanged(int))); 2016 2018 2017 2019 retranslateUi(); … … 2062 2064 m_pHeaderBtn->setEnabled(Snap, false); 2063 2065 } 2066 } 2067 2068 int UIVMDesktop::widgetIndex() const 2069 { 2070 return m_pStackedLayout->currentIndex(); 2064 2071 } 2065 2072 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.h
r39225 r42526 34 34 class VBoxSnapshotsWgt; 35 35 class UIToolBar; 36 class QStackedLayout; 36 37 37 38 class UIVMDesktop: public QIWithRetranslateUI<QWidget> 38 39 { 39 40 Q_OBJECT; 41 42 signals: 43 44 void linkClicked(const QString &strURL); 45 void sigCurrentChanged(int iWidgetIndex); 40 46 41 47 public: … … 51 57 // void updateDescriptionState(); 52 58 53 signals: 54 55 void linkClicked(const QString &strURL); 59 int widgetIndex() const; 56 60 57 61 protected: … … 62 66 63 67 /* Private member vars */ 68 QStackedLayout *m_pStackedLayout; 64 69 UITexturedSegmentedButton *m_pHeaderBtn; 65 70 UIDetailsPagePrivate *m_pDetails; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r42382 r42526 677 677 addItem(":/shared_folder_32px.png", ":/shared_folder_disabled_32px.png", 678 678 ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png", 679 iPageIndex, "#s folders", pSettingsPage);679 iPageIndex, "#sharedFolders", pSettingsPage); 680 680 break; 681 681 } -
trunk/src/VBox/GuestHost/OpenGL/LICENSE
- Property svn:mergeinfo changed
-
trunk/src/VBox/HostServices/SharedOpenGL/LICENSE
- Property svn:mergeinfo changed
-
trunk/src/VBox/Main/glue/tests
- Property svn:mergeinfo changed
-
trunk/src/VBox/Main/glue/tests/Makefile
- Property svn:mergeinfo changed
-
trunk/src/VBox/Main/include/MediumLock.h
- Property svn:mergeinfo changed
-
trunk/src/VBox/Runtime/testcase/tstRTMemEf.cpp
- Property svn:mergeinfo changed
-
trunk/src/libs/libxml2-2.6.31
- Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.

