- Timestamp:
- Feb 3, 2014 2:41:28 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc
r49333 r50309 75 75 <file alias="hd_16px.png">images/hd_16px.png</file> 76 76 <file alias="hd_disabled_16px.png">images/hd_disabled_16px.png</file> 77 <file alias="hd_settings_16px.png">images/hd_settings_16px.png</file> 78 <file alias="hd_settings_disabled_16px.png">images/hd_settings_disabled_16px.png</file> 77 79 <file alias="hd_32px.png">images/hd_32px.png</file> 78 80 <file alias="hd_disabled_32px.png">images/hd_disabled_32px.png</file> -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r50165 r50309 664 664 { 665 665 setName(QApplication::translate("UIActionPool", "&Devices")); 666 } 667 }; 668 669 class UIActionMenuHardDisks : public UIActionMenu 670 { 671 Q_OBJECT; 672 673 public: 674 675 UIActionMenuHardDisks(UIActionPool *pParent) 676 : UIActionMenu(pParent, ":/hd_16px.png", ":/hd_disabled_16px.png") 677 { 678 qobject_cast<UIMenu*>(menu())->setShowToolTips(true); 679 retranslateUi(); 680 } 681 682 protected: 683 684 void retranslateUi() {} 685 }; 686 687 class UIActionSimpleShowStorageSettingsDialog : public UIActionSimple 688 { 689 Q_OBJECT; 690 691 public: 692 693 UIActionSimpleShowStorageSettingsDialog(UIActionPool *pParent) 694 : UIActionSimple(pParent, ":/hd_settings_16px.png", ":/hd_settings_disabled_16px.png") 695 { 696 retranslateUi(); 697 } 698 699 protected: 700 701 QString shortcutExtraDataID() const 702 { 703 return QString("StorageSettingsDialog"); 704 } 705 706 void retranslateUi() 707 { 708 setName(QApplication::translate("UIActionPool", "&Storage Settings...")); 709 setStatusTip(QApplication::translate("UIActionPool", "Change the settings of storage devices")); 666 710 } 667 711 }; … … 1239 1283 1240 1284 /* 'Devices' actions: */ 1285 m_pool[UIActionIndexRuntime_Simple_StorageSettings] = new UIActionSimpleShowStorageSettingsDialog(this); 1241 1286 m_pool[UIActionIndexRuntime_Simple_NetworkSettings] = new UIActionSimpleShowNetworkSettingsDialog(this); 1242 1287 m_pool[UIActionIndexRuntime_Simple_SharedFoldersSettings] = new UIActionSimpleShowSharedFoldersSettingsDialog(this); … … 1292 1337 delete m_pool[UIActionIndexRuntime_Menu_Devices]; 1293 1338 m_pool[UIActionIndexRuntime_Menu_Devices] = new UIActionMenuDevices(this); 1339 if (m_pool[UIActionIndexRuntime_Menu_HardDisks]) 1340 delete m_pool[UIActionIndexRuntime_Menu_HardDisks]; 1341 m_pool[UIActionIndexRuntime_Menu_HardDisks] = new UIActionMenuHardDisks(this); 1294 1342 if (m_pool[UIActionIndexRuntime_Menu_OpticalDevices]) 1295 1343 delete m_pool[UIActionIndexRuntime_Menu_OpticalDevices]; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r49333 r50309 55 55 /* 'Devices' menu actions: */ 56 56 UIActionIndexRuntime_Menu_Devices, 57 UIActionIndexRuntime_Menu_HardDisks, 58 UIActionIndexRuntime_Simple_StorageSettings, 57 59 UIActionIndexRuntime_Menu_OpticalDevices, 58 60 UIActionIndexRuntime_Menu_FloppyDevices, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r50301 r50309 827 827 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_MouseIntegration)); 828 828 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_Pause)); 829 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_HardDisks)); 830 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_StorageSettings)); 829 831 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_OpticalDevices)); 830 832 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_FloppyDevices)); … … 886 888 887 889 /* "Devices" actions connections: */ 890 connect(gActionPool->action(UIActionIndexRuntime_Simple_StorageSettings), SIGNAL(triggered()), 891 this, SLOT(sltOpenStorageSettingsDialog())); 888 892 connect(gActionPool->action(UIActionIndexRuntime_Menu_OpticalDevices)->menu(), SIGNAL(aboutToShow()), 889 893 this, SLOT(sltPrepareStorageMenu())); … … 1453 1457 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 1454 1458 pMachineWindow->updateAppearanceOf(UIVisualElement_HDStuff | UIVisualElement_CDStuff | UIVisualElement_FDStuff); 1459 } 1460 1461 void UIMachineLogic::sltOpenStorageSettingsDialog() 1462 { 1463 /* Machine settings: Storage page: */ 1464 sltOpenVMSettingsDialog("#storage"); 1455 1465 } 1456 1466 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r50302 r50309 199 199 /* "Device" menu functionality: */ 200 200 void sltOpenVMSettingsDialog(const QString &strCategory = QString(), const QString &strControl = QString()); 201 void sltOpenStorageSettingsDialog(); 201 202 void sltOpenNetworkAdaptersDialog(); 202 203 void sltOpenSharedFoldersDialog(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r50302 r50309 1260 1260 bool fAllowReconfiguration = m_machineState != KMachineState_Stuck && m_fReconfigurable; 1261 1261 gActionPool->action(UIActionIndexRuntime_Simple_SettingsDialog)->setEnabled(fAllowReconfiguration); 1262 gActionPool->action(UIActionIndexRuntime_Simple_StorageSettings)->setEnabled(fAllowReconfiguration); 1262 1263 gActionPool->action(UIActionIndexRuntime_Simple_SharedFoldersSettings)->setEnabled(fAllowReconfiguration); 1263 1264 gActionPool->action(UIActionIndexRuntime_Simple_VideoCaptureSettings)->setEnabled(fAllowReconfiguration); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r50300 r50309 67 67 } 68 68 69 void UIMachineLogicNormal::sltPrepareHardDisksMenu() 70 { 71 QMenu *pMenu = qobject_cast<QMenu*>(sender()); 72 AssertMsg(pMenu, ("This slot should be called only on Hard Disks menu show!\n")); 73 pMenu->clear(); 74 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_StorageSettings)); 75 } 76 69 77 void UIMachineLogicNormal::sltPrepareSharedFoldersMenu() 70 78 { … … 106 114 107 115 /* "Device" actions connections: */ 116 connect(gActionPool->action(UIActionIndexRuntime_Menu_HardDisks)->menu(), SIGNAL(aboutToShow()), 117 this, SLOT(sltPrepareHardDisksMenu())); 108 118 connect(gActionPool->action(UIActionIndexRuntime_Menu_SharedFolders)->menu(), SIGNAL(aboutToShow()), 109 119 this, SLOT(sltPrepareSharedFoldersMenu())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h
r50165 r50309 40 40 41 41 /* Windowed mode functionality: */ 42 void sltPrepareHardDisksMenu(); 42 43 void sltPrepareSharedFoldersMenu(); 43 44 void sltPrepareVideoCaptureMenu(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r49177 r50309 133 133 void UIMachineWindowNormal::sltShowIndicatorsContextMenu(QIStateIndicator *pIndicator, QContextMenuEvent *pEvent) 134 134 { 135 /* Show hard-disks LED context menu: */ 136 if (pIndicator == indicatorsPool()->indicator(IndicatorType_HardDisks)) 137 { 138 if (gActionPool->action(UIActionIndexRuntime_Menu_HardDisks)->isEnabled()) 139 gActionPool->action(UIActionIndexRuntime_Menu_HardDisks)->menu()->exec(pEvent->globalPos()); 140 } 135 141 /* Show optical-disks LED context menu: */ 136 if (pIndicator == indicatorsPool()->indicator(IndicatorType_OpticalDisks))142 else if (pIndicator == indicatorsPool()->indicator(IndicatorType_OpticalDisks)) 137 143 { 138 144 if (gActionPool->action(UIActionIndexRuntime_Menu_OpticalDevices)->isEnabled()) … … 249 255 { 250 256 pIndicatorBoxHLayout->addWidget(pLedHardDisks); 257 connect(pLedHardDisks, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)), 258 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 251 259 fAtLeastOneAddedToLeftSection = true; 252 260 }
Note:
See TracChangeset
for help on using the changeset viewer.