Changeset 68508 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 22, 2017 2:42:51 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 21 edited
- 16 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r68214 r68508 15 15 <file alias="attachment_remove_16px.png">images/attachment_remove_16px.png</file> 16 16 <file alias="attachment_remove_disabled_16px.png">images/attachment_remove_disabled_16px.png</file> 17 <file alias="audio_16px.png">images/audio_16px.png</file> 18 <file alias="audio_all_off_16px.png">images/audio_all_off_16px.png</file> 19 <file alias="audio_input_16px.png">images/audio_input_16px.png</file> 20 <file alias="audio_input_off_16px.png">images/audio_input_off_16px.png</file> 21 <file alias="audio_input_on_16px.png">images/audio_input_on_16px.png</file> 22 <file alias="audio_output_16px.png">images/audio_output_16px.png</file> 23 <file alias="audio_output_off_16px.png">images/audio_output_off_16px.png</file> 24 <file alias="audio_output_on_16px.png">images/audio_output_on_16px.png</file> 17 25 <file alias="auto_resize_on_16px.png">images/auto_resize_on_16px.png</file> 18 26 <file alias="auto_resize_on_disabled_16px.png">images/auto_resize_on_disabled_16px.png</file> -
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1_hidpi.qrc
r68214 r68508 15 15 <file alias="attachment_remove_16px_hidpi.png">images/hidpi/attachment_remove_16px_hidpi.png</file> 16 16 <file alias="attachment_remove_disabled_16px_hidpi.png">images/hidpi/attachment_remove_disabled_16px_hidpi.png</file> 17 <file alias="audio_16px_hidpi.png">images/hidpi/audio_16px_hidpi.png</file> 18 <file alias="audio_all_off_16px_hidpi.png">images/hidpi/audio_all_off_16px_hidpi.png</file> 19 <file alias="audio_input_16px_hidpi.png">images/hidpi/audio_input_16px_hidpi.png</file> 20 <file alias="audio_input_off_16px_hidpi.png">images/hidpi/audio_input_off_16px_hidpi.png</file> 21 <file alias="audio_input_on_16px_hidpi.png">images/hidpi/audio_input_on_16px_hidpi.png</file> 22 <file alias="audio_output_16px_hidpi.png">images/hidpi/audio_output_16px_hidpi.png</file> 23 <file alias="audio_output_off_16px_hidpi.png">images/hidpi/audio_output_off_16px_hidpi.png</file> 24 <file alias="audio_output_on_16px_hidpi.png">images/hidpi/audio_output_on_16px_hidpi.png</file> 17 25 <file alias="auto_resize_on_16px_hidpi.png">images/hidpi/auto_resize_on_16px_hidpi.png</file> 18 26 <file alias="auto_resize_on_disabled_16px_hidpi.png">images/hidpi/auto_resize_on_disabled_16px_hidpi.png</file> -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r68394 r68508 732 732 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices: strResult = "OpticalDevices"; break; 733 733 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices: strResult = "FloppyDevices"; break; 734 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio: strResult = "Audio"; break; 735 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput: strResult = "AudioOutput"; break; 736 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput: strResult = "AudioInput"; break; 734 737 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network: strResult = "Network"; break; 735 738 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings: strResult = "NetworkSettings"; break; … … 763 766 keys << "OpticalDevices"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices; 764 767 keys << "FloppyDevices"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices; 768 keys << "Audio"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio; 769 keys << "AudioOutput"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput; 770 keys << "AudioInput"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput; 765 771 keys << "Network"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network; 766 772 keys << "NetworkSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings; … … 1410 1416 case IndicatorType_OpticalDisks: strResult = "OpticalDisks"; break; 1411 1417 case IndicatorType_FloppyDisks: strResult = "FloppyDisks"; break; 1418 case IndicatorType_Audio: strResult = "Audio"; break; 1412 1419 case IndicatorType_Network: strResult = "Network"; break; 1413 1420 case IndicatorType_USB: strResult = "USB"; break; … … 1436 1443 keys << "OpticalDisks"; values << IndicatorType_OpticalDisks; 1437 1444 keys << "FloppyDisks"; values << IndicatorType_FloppyDisks; 1445 keys << "Audio"; values << IndicatorType_Audio; 1438 1446 keys << "Network"; values << IndicatorType_Network; 1439 1447 keys << "USB"; values << IndicatorType_USB; … … 1460 1468 case IndicatorType_OpticalDisks: strResult = QApplication::translate("VBoxGlobal", "Optical Disks", "IndicatorType"); break; 1461 1469 case IndicatorType_FloppyDisks: strResult = QApplication::translate("VBoxGlobal", "Floppy Disks", "IndicatorType"); break; 1470 case IndicatorType_Audio: strResult = QApplication::translate("VBoxGlobal", "Audio", "IndicatorType"); break; 1462 1471 case IndicatorType_Network: strResult = QApplication::translate("VBoxGlobal", "Network", "IndicatorType"); break; 1463 1472 case IndicatorType_USB: strResult = QApplication::translate("VBoxGlobal", "USB", "IndicatorType"); break; … … 1485 1494 case IndicatorType_OpticalDisks: return UIIconPool::iconSet(":/cd_16px.png"); 1486 1495 case IndicatorType_FloppyDisks: return UIIconPool::iconSet(":/fd_16px.png"); 1496 case IndicatorType_Audio: return UIIconPool::iconSet(":/audio_16px.png"); 1487 1497 case IndicatorType_Network: return UIIconPool::iconSet(":/nw_16px.png"); 1488 1498 case IndicatorType_USB: return UIIconPool::iconSet(":/usb_16px.png"); -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r68394 r68508 485 485 RuntimeMenuDevicesActionType_OpticalDevices = RT_BIT(2), 486 486 RuntimeMenuDevicesActionType_FloppyDevices = RT_BIT(3), 487 RuntimeMenuDevicesActionType_Network = RT_BIT(4), 488 RuntimeMenuDevicesActionType_NetworkSettings = RT_BIT(5), 489 RuntimeMenuDevicesActionType_USBDevices = RT_BIT(6), 490 RuntimeMenuDevicesActionType_USBDevicesSettings = RT_BIT(7), 491 RuntimeMenuDevicesActionType_WebCams = RT_BIT(8), 492 RuntimeMenuDevicesActionType_SharedClipboard = RT_BIT(9), 493 RuntimeMenuDevicesActionType_DragAndDrop = RT_BIT(10), 494 RuntimeMenuDevicesActionType_SharedFolders = RT_BIT(11), 495 RuntimeMenuDevicesActionType_SharedFoldersSettings = RT_BIT(12), 496 RuntimeMenuDevicesActionType_InstallGuestTools = RT_BIT(13), 497 RuntimeMenuDevicesActionType_Nothing = RT_BIT(14), 487 RuntimeMenuDevicesActionType_Audio = RT_BIT(4), 488 RuntimeMenuDevicesActionType_AudioOutput = RT_BIT(5), 489 RuntimeMenuDevicesActionType_AudioInput = RT_BIT(6), 490 RuntimeMenuDevicesActionType_Network = RT_BIT(7), 491 RuntimeMenuDevicesActionType_NetworkSettings = RT_BIT(8), 492 RuntimeMenuDevicesActionType_USBDevices = RT_BIT(9), 493 RuntimeMenuDevicesActionType_USBDevicesSettings = RT_BIT(10), 494 RuntimeMenuDevicesActionType_WebCams = RT_BIT(11), 495 RuntimeMenuDevicesActionType_SharedClipboard = RT_BIT(12), 496 RuntimeMenuDevicesActionType_DragAndDrop = RT_BIT(13), 497 RuntimeMenuDevicesActionType_SharedFolders = RT_BIT(14), 498 RuntimeMenuDevicesActionType_SharedFoldersSettings = RT_BIT(15), 499 RuntimeMenuDevicesActionType_InstallGuestTools = RT_BIT(16), 500 RuntimeMenuDevicesActionType_Nothing = RT_BIT(17), 498 501 RuntimeMenuDevicesActionType_All = 0xFFFF 499 502 }; … … 673 676 IndicatorType_OpticalDisks, 674 677 IndicatorType_FloppyDisks, 678 IndicatorType_Audio, 675 679 IndicatorType_Network, 676 680 IndicatorType_USB, -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r60544 r68508 399 399 break; 400 400 } 401 // case KVBoxEventType_OnSerialPortChanged: 402 // case KVBoxEventType_OnParallelPortChanged: 403 // case KVBoxEventType_OnStorageControllerChanged: 404 // case KVBoxEventType_OnCPUChange: 401 case KVBoxEventType_OnAudioAdapterChanged: 402 { 403 emit sigAudioAdapterChange(); 404 break; 405 } 405 406 406 407 default: break; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r60250 r68508 119 119 /** Notifies about VM window with specified @a winId should be shown. */ 120 120 void sigShowWindow(qint64 &winId); /* use Qt::DirectConnection */ 121 /** Notifies about audio adapter state change. */ 122 void sigAudioAdapterChange(); 121 123 122 124 public: -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r68435 r68508 2110 2110 } 2111 2111 2112 void UIMessageCenter::cannotToggleAudioOutput(const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable) 2113 { 2114 error(0, MessageType_Error, 2115 fEnable ? 2116 tr("Failed to enable the audio adapter output for the virtual machine <b>%1</b>.").arg(strMachineName) : 2117 tr("Failed to disable the audio adapter output for the virtual machine <b>%1</b>.").arg(strMachineName), 2118 UIErrorString::formatErrorInfo(comAdapter)); 2119 } 2120 2121 void UIMessageCenter::cannotToggleAudioInput(const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable) 2122 { 2123 error(0, MessageType_Error, 2124 fEnable ? 2125 tr("Failed to enable the audio adapter input for the virtual machine <b>%1</b>.").arg(strMachineName) : 2126 tr("Failed to disable the audio adapter input for the virtual machine <b>%1</b>.").arg(strMachineName), 2127 UIErrorString::formatErrorInfo(comAdapter)); 2128 } 2129 2112 2130 void UIMessageCenter::cannotToggleNetworkAdapterCable(const CNetworkAdapter &adapter, const QString &strMachineName, bool fConnect) 2113 2131 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r68435 r68508 320 320 void cannotToggleVideoCapture(const CMachine &machine, bool fEnable); 321 321 void cannotToggleVRDEServer(const CVRDEServer &server, const QString &strMachineName, bool fEnable); 322 void cannotToggleAudioOutput(const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable); 323 void cannotToggleAudioInput(const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable); 322 324 void cannotToggleNetworkAdapterCable(const CNetworkAdapter &adapter, const QString &strMachineName, bool fConnect); 323 325 void remindAboutGuestAdditionsAreNotActive() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r64659 r68508 1439 1439 { 1440 1440 setName(QApplication::translate("UIActionPool", "&Floppy Drives")); 1441 } 1442 }; 1443 1444 class UIActionMenuAudio : public UIActionMenu 1445 { 1446 Q_OBJECT; 1447 1448 public: 1449 1450 UIActionMenuAudio(UIActionPool *pParent) 1451 : UIActionMenu(pParent, ":/audio_16px.png", ":/audio_all_off_16px.png") {} 1452 1453 protected: 1454 1455 /** Returns action extra-data ID. */ 1456 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio; } 1457 /** Returns action extra-data key. */ 1458 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio); } 1459 /** Returns whether action is allowed. */ 1460 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio); } 1461 1462 void retranslateUi() 1463 { 1464 setName(QApplication::translate("UIActionPool", "&Audio")); 1465 } 1466 }; 1467 1468 class UIActionToggleAudioOutput : public UIActionToggle 1469 { 1470 Q_OBJECT; 1471 1472 public: 1473 1474 UIActionToggleAudioOutput(UIActionPool *pParent) 1475 : UIActionToggle(pParent, 1476 ":/audio_output_on_16px.png", ":/audio_output_16px.png", 1477 ":/audio_output_on_16px.png", ":/audio_output_16px.png") {} 1478 1479 protected: 1480 1481 /** Returns action extra-data ID. */ 1482 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput; } 1483 /** Returns action extra-data key. */ 1484 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput); } 1485 /** Returns whether action is allowed. */ 1486 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput); } 1487 1488 QString shortcutExtraDataID() const 1489 { 1490 return QString("ToggleAudioOutput"); 1491 } 1492 1493 void retranslateUi() 1494 { 1495 setName(QApplication::translate("UIActionPool", "Audio Output")); 1496 setStatusTip(QApplication::translate("UIActionPool", "Enable audio output")); 1497 } 1498 }; 1499 1500 class UIActionToggleAudioInput : public UIActionToggle 1501 { 1502 Q_OBJECT; 1503 1504 public: 1505 1506 UIActionToggleAudioInput(UIActionPool *pParent) 1507 : UIActionToggle(pParent, 1508 ":/audio_input_on_16px.png", ":/audio_input_16px.png", 1509 ":/audio_input_on_16px.png", ":/audio_input_16px.png") {} 1510 1511 protected: 1512 1513 /** Returns action extra-data ID. */ 1514 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput; } 1515 /** Returns action extra-data key. */ 1516 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput); } 1517 /** Returns whether action is allowed. */ 1518 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput); } 1519 1520 QString shortcutExtraDataID() const 1521 { 1522 return QString("ToggleAudioInput"); 1523 } 1524 1525 void retranslateUi() 1526 { 1527 setName(QApplication::translate("UIActionPool", "Audio Input")); 1528 setStatusTip(QApplication::translate("UIActionPool", "Enable audio input")); 1441 1529 } 1442 1530 }; … … 2216 2304 m_pool[UIActionIndexRT_M_Devices_M_OpticalDevices] = new UIActionMenuOpticalDevices(this); 2217 2305 m_pool[UIActionIndexRT_M_Devices_M_FloppyDevices] = new UIActionMenuFloppyDevices(this); 2306 m_pool[UIActionIndexRT_M_Devices_M_Audio] = new UIActionMenuAudio(this); 2307 m_pool[UIActionIndexRT_M_Devices_M_Audio_T_Output] = new UIActionToggleAudioOutput(this); 2308 m_pool[UIActionIndexRT_M_Devices_M_Audio_T_Input] = new UIActionToggleAudioInput(this); 2218 2309 m_pool[UIActionIndexRT_M_Devices_M_Network] = new UIActionMenuNetworkAdapters(this); 2219 2310 m_pool[UIActionIndexRT_M_Devices_M_Network_S_Settings] = new UIActionSimpleShowNetworkSettingsDialog(this); … … 2258 2349 m_menuUpdateHandlers[UIActionIndexRT_M_Devices].ptfr = &UIActionPoolRuntime::updateMenuDevices; 2259 2350 m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_HardDrives].ptfr = &UIActionPoolRuntime::updateMenuDevicesHardDrives; 2351 m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_Audio].ptfr = &UIActionPoolRuntime::updateMenuDevicesAudio; 2260 2352 m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_Network].ptfr = &UIActionPoolRuntime::updateMenuDevicesNetwork; 2261 2353 m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_USBDevices].ptfr = &UIActionPoolRuntime::updateMenuDevicesUSBDevices; … … 2972 3064 /* 'Floppy Devices' submenu: */ 2973 3065 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_FloppyDevices)) || fSeparator; 3066 /* 'Audio' submenu: */ 3067 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Audio)) || fSeparator; 3068 updateMenuDevicesAudio(); 2974 3069 /* 'Network' submenu: */ 2975 3070 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Network)) || fSeparator; … … 2980 3075 /* 'Web Cams' submenu: */ 2981 3076 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_WebCams)) || fSeparator; 3077 3078 /* Separator: */ 3079 if (fSeparator) 3080 { 3081 pMenu->addSeparator(); 3082 fSeparator = false; 3083 } 3084 2982 3085 /* 'Shared Folders' submenu: */ 2983 3086 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedFolders)) || fSeparator; 2984 3087 updateMenuDevicesSharedFolders(); 2985 2986 /* Separator: */2987 if (fSeparator)2988 {2989 pMenu->addSeparator();2990 fSeparator = false;2991 }2992 2993 3088 /* 'Shared Clipboard' submenu: */ 2994 3089 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedClipboard)) || fSeparator; … … 3023 3118 /* Mark menu as valid: */ 3024 3119 m_invalidations.remove(UIActionIndexRT_M_Devices_M_HardDrives); 3120 } 3121 3122 void UIActionPoolRuntime::updateMenuDevicesAudio() 3123 { 3124 /* Get corresponding menu: */ 3125 UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_Audio)->menu(); 3126 AssertPtrReturnVoid(pMenu); 3127 /* Clear contents: */ 3128 pMenu->clear(); 3129 3130 /* 'Output' action: */ 3131 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Audio_T_Output)); 3132 /* 'Input' action: */ 3133 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Audio_T_Input)); 3134 3135 /* Mark menu as valid: */ 3136 m_invalidations.remove(UIActionIndexRT_M_Devices_M_Audio); 3025 3137 } 3026 3138 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r64659 r68508 99 99 UIActionIndexRT_M_Devices_M_OpticalDevices, 100 100 UIActionIndexRT_M_Devices_M_FloppyDevices, 101 UIActionIndexRT_M_Devices_M_Audio, 102 UIActionIndexRT_M_Devices_M_Audio_T_Output, 103 UIActionIndexRT_M_Devices_M_Audio_T_Input, 101 104 UIActionIndexRT_M_Devices_M_Network, 102 105 UIActionIndexRT_M_Devices_M_Network_S_Settings, … … 261 264 /** Update 'Devices' : 'Hard Drives' menu routine. */ 262 265 void updateMenuDevicesHardDrives(); 266 /** Update 'Devices' : 'Audio' menu routine. */ 267 void updateMenuDevicesAudio(); 263 268 /** Update 'Devices' : 'Network' menu routine. */ 264 269 void updateMenuDevicesNetwork(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
r63626 r68508 82 82 void sigShowWindow(); 83 83 #endif /* RT_OS_DARWIN */ 84 /** Notifies about audio adapter state change. */ 85 void sigAudioAdapterChange(); 84 86 85 87 public: … … 194 196 << KVBoxEventType_OnRuntimeError 195 197 << KVBoxEventType_OnCanShowWindow 196 << KVBoxEventType_OnShowWindow; 198 << KVBoxEventType_OnShowWindow 199 << KVBoxEventType_OnAudioAdapterChanged; 197 200 198 201 /* Register event listener for console event source: */ … … 265 268 connect(m_pQtListener->getWrapped(), SIGNAL(sigShowWindow(qint64 &)), 266 269 this, SLOT(sltShowWindow(qint64 &)), 270 Qt::DirectConnection); 271 connect(m_pQtListener->getWrapped(), SIGNAL(sigAudioAdapterChange()), 272 this, SIGNAL(sigAudioAdapterChange()), 267 273 Qt::DirectConnection); 268 274 } … … 421 427 Qt::QueuedConnection); 422 428 #endif /* RT_OS_DARWIN */ 429 connect(m_pProxy, SIGNAL(sigAudioAdapterChange()), 430 this, SIGNAL(sigAudioAdapterChange()), 431 Qt::QueuedConnection); 423 432 } 424 433 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h
r60227 r68508 78 78 void sigShowWindow(); 79 79 #endif /* RT_OS_DARWIN */ 80 /** Notifies about audio adapter state change. */ 81 void sigAudioAdapterChange(); 80 82 81 83 public: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r66946 r68508 41 41 42 42 /* COM includes: */ 43 # include "CAudioAdapter.h" 43 44 # include "CConsole.h" 44 45 # include "CMachine.h" … … 384 385 /* Update indicator state: */ 385 386 setState(fAttachmentsMounted ? KDeviceActivity_Idle : KDeviceActivity_Null); 387 } 388 }; 389 390 391 /** UISessionStateStatusBarIndicator extension for Runtime UI: Audio indicator. */ 392 class UIIndicatorAudio : public UISessionStateStatusBarIndicator 393 { 394 Q_OBJECT; 395 396 public: 397 398 /** Audio states. */ 399 enum AudioState 400 { 401 AudioState_AllOff = 0, 402 AudioState_OutputOn = RT_BIT(0), 403 AudioState_InputOn = RT_BIT(1), 404 AudioState_AllOn = AudioState_InputOn | AudioState_OutputOn 405 }; 406 407 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 408 UIIndicatorAudio(UISession *pSession) 409 : UISessionStateStatusBarIndicator(IndicatorType_Audio, pSession) 410 { 411 /* Assign state-icons: */ 412 setStateIcon(AudioState_AllOff, UIIconPool::iconSet(":/audio_all_off_16px.png")); 413 setStateIcon(AudioState_OutputOn, UIIconPool::iconSet(":/audio_input_off_16px.png")); 414 setStateIcon(AudioState_InputOn, UIIconPool::iconSet(":/audio_output_off_16px.png")); 415 setStateIcon(AudioState_AllOn, UIIconPool::iconSet(":/audio_16px.png")); 416 /* Translate finally: */ 417 retranslateUi(); 418 } 419 420 private: 421 422 /** Update routine. */ 423 void updateAppearance() 424 { 425 /* Get machine: */ 426 const CMachine comMachine = m_pSession->machine(); 427 428 /* Prepare tool-tip: */ 429 QString strToolTip = QApplication::translate("UIIndicatorsPool", 430 "<nobr>Indicates the activity of the " 431 "audio:</nobr>%1", "Audio tooltip"); 432 QString strFullData; 433 434 /* Get audio adapter: */ 435 const CAudioAdapter comAdapter = comMachine.GetAudioAdapter(); 436 const bool fAudioEnabled = comAdapter.GetEnabled(); 437 if (fAudioEnabled) 438 { 439 const bool fEnabledOutput = comAdapter.GetEnabledOut(); 440 const bool fEnabledInput = comAdapter.GetEnabledIn(); 441 strFullData = QString(s_strTableRow2).arg(QApplication::translate("UIGDetails", "Audio Output", "details (audio)"), 442 fEnabledOutput ? 443 QApplication::translate("UIGDetails", "Enabled", "details (audio/output)") : 444 QApplication::translate("UIGDetails", "Disabled", "details (audio/output)")) 445 + QString(s_strTableRow2).arg(QApplication::translate("UIGDetails", "Audio Input", "details (audio)"), 446 fEnabledInput ? 447 QApplication::translate("UIGDetails", "Enabled", "details (audio/input)") : 448 QApplication::translate("UIGDetails", "Disabled", "details (audio/input)")); 449 AudioState enmState = AudioState_AllOff; 450 if (fEnabledOutput) 451 enmState = (AudioState)(enmState | AudioState_OutputOn); 452 if (fEnabledInput) 453 enmState = (AudioState)(enmState | AudioState_InputOn); 454 setState(enmState); 455 } 456 else 457 { 458 strFullData = QString(s_strTableRow2).arg(QApplication::translate("UIGDetails", "Disabled", "details (audio)")); 459 setState(AudioState_AllOff); 460 } 461 462 /* Update tool-tip: */ 463 setToolTip(strToolTip.arg(s_strTable.arg(strFullData))); 386 464 } 387 465 }; … … 1322 1400 case IndicatorType_OpticalDisks: m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_pSession); break; 1323 1401 case IndicatorType_FloppyDisks: m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_pSession); break; 1402 case IndicatorType_Audio: m_pool[indicatorType] = new UIIndicatorAudio(m_pSession); break; 1324 1403 case IndicatorType_Network: m_pool[indicatorType] = new UIIndicatorNetwork(m_pSession); break; 1325 1404 case IndicatorType_USB: m_pool[indicatorType] = new UIIndicatorUSB(m_pSession); break; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h
r62493 r68508 31 31 UIVisualElement_CDStuff = RT_BIT(4), 32 32 UIVisualElement_FDStuff = RT_BIT(5), 33 UIVisualElement_NetworkStuff = RT_BIT(6), 34 UIVisualElement_USBStuff = RT_BIT(7), 35 UIVisualElement_SharedFolderStuff = RT_BIT(8), 36 UIVisualElement_Display = RT_BIT(9), 37 UIVisualElement_VideoCapture = RT_BIT(10), 38 UIVisualElement_FeaturesStuff = RT_BIT(11), 33 UIVisualElement_AudioStuff = RT_BIT(6), 34 UIVisualElement_NetworkStuff = RT_BIT(7), 35 UIVisualElement_USBStuff = RT_BIT(8), 36 UIVisualElement_SharedFolderStuff = RT_BIT(9), 37 UIVisualElement_Display = RT_BIT(10), 38 UIVisualElement_VideoCapture = RT_BIT(11), 39 UIVisualElement_FeaturesStuff = RT_BIT(12), 39 40 #ifndef VBOX_WS_MAC 40 UIVisualElement_MiniToolBar = RT_BIT(1 2),41 UIVisualElement_MiniToolBar = RT_BIT(13), 41 42 #endif /* !VBOX_WS_MAC */ 42 43 UIVisualElement_AllStuff = 0xFFFF -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r68315 r68508 71 71 72 72 /* COM includes: */ 73 # include "CAudioAdapter.h" 73 74 # include "CVirtualBoxErrorInfo.h" 74 75 # include "CMachineDebugger.h" … … 1054 1055 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices)); 1055 1056 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices)); 1057 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio)); 1058 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)); 1059 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)); 1056 1060 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Network)); 1057 1061 m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Devices_M_Network_S_Settings)); … … 1143 1147 connect(actionPool()->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings), SIGNAL(triggered()), 1144 1148 this, SLOT(sltOpenStorageSettingsDialog())); 1149 connect(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output), &UIAction::toggled, 1150 this, &UIMachineLogic::sltToggleAudioOutput); 1151 connect(actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input), &UIAction::toggled, 1152 this, &UIMachineLogic::sltToggleAudioInput); 1145 1153 connect(actionPool()->action(UIActionIndexRT_M_Devices_M_Network_S_Settings), SIGNAL(triggered()), 1146 1154 this, SLOT(sltOpenNetworkSettingsDialog())); … … 1946 1954 } 1947 1955 1956 void UIMachineLogic::sltToggleAudioOutput(bool fEnabled) 1957 { 1958 /* Do not process if window(s) missed! */ 1959 if (!isMachineWindowsCreated()) 1960 return; 1961 1962 /* Access audio adapter: */ 1963 CAudioAdapter comAdapter = machine().GetAudioAdapter(); 1964 AssertMsgReturnVoid(machine().isOk() && comAdapter.isNotNull(), 1965 ("Audio adapter should NOT be null!\n")); 1966 1967 /* Make sure something had changed: */ 1968 if (comAdapter.GetEnabledOut() == static_cast<BOOL>(fEnabled)) 1969 return; 1970 1971 /* Update audio output state: */ 1972 comAdapter.SetEnabledOut(fEnabled); 1973 if (!comAdapter.isOk()) 1974 { 1975 /* Make sure action is updated: */ 1976 uisession()->updateAudioOutput(); 1977 /* Notify about the error: */ 1978 return msgCenter().cannotToggleAudioOutput(comAdapter, machineName(), fEnabled); 1979 } 1980 1981 /* Save machine-settings: */ 1982 machine().SaveSettings(); 1983 if (!machine().isOk()) 1984 { 1985 /* Make sure action is updated: */ 1986 uisession()->updateAudioOutput(); 1987 /* Notify about the error: */ 1988 return msgCenter().cannotSaveMachineSettings(machine()); 1989 } 1990 } 1991 1992 void UIMachineLogic::sltToggleAudioInput(bool fEnabled) 1993 { 1994 /* Do not process if window(s) missed! */ 1995 if (!isMachineWindowsCreated()) 1996 return; 1997 1998 /* Access audio adapter: */ 1999 CAudioAdapter comAdapter = machine().GetAudioAdapter(); 2000 AssertMsgReturnVoid(machine().isOk() && comAdapter.isNotNull(), 2001 ("Audio adapter should NOT be null!\n")); 2002 2003 /* Make sure something had changed: */ 2004 if (comAdapter.GetEnabledIn() == static_cast<BOOL>(fEnabled)) 2005 return; 2006 2007 /* Update audio input state: */ 2008 comAdapter.SetEnabledIn(fEnabled); 2009 if (!comAdapter.isOk()) 2010 { 2011 /* Make sure action is updated: */ 2012 uisession()->updateAudioInput(); 2013 /* Notify about the error: */ 2014 return msgCenter().cannotToggleAudioInput(comAdapter, machineName(), fEnabled); 2015 } 2016 2017 /* Save machine-settings: */ 2018 machine().SaveSettings(); 2019 if (!machine().isOk()) 2020 { 2021 /* Make sure action is updated: */ 2022 uisession()->updateAudioInput(); 2023 /* Notify about the error: */ 2024 return msgCenter().cannotSaveMachineSettings(machine()); 2025 } 2026 } 2027 1948 2028 void UIMachineLogic::sltOpenNetworkSettingsDialog() 1949 2029 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r64659 r68508 289 289 void sltOpenVMSettingsDialog(const QString &strCategory = QString(), const QString &strControl = QString()); 290 290 void sltOpenStorageSettingsDialog(); 291 void sltToggleAudioOutput(bool fEnabled); 292 void sltToggleAudioInput(bool fEnabled); 291 293 void sltOpenNetworkSettingsDialog(); 292 294 void sltOpenUSBDevicesSettingsDialog(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp
r64813 r68508 1236 1236 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices)); 1237 1237 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices)); 1238 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_Audio)); 1238 1239 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_Network)); 1239 1240 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices)); 1240 1241 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_WebCams)); 1242 pMenu->addSeparator(); 1241 1243 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_SharedFolders)); 1242 pMenu->addSeparator();1243 1244 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_SharedClipboard)); 1244 1245 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Devices_M_DragAndDrop)); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r68392 r68508 59 59 60 60 /* COM includes: */ 61 # include "CAudioAdapter.h" 61 62 # include "CSystemProperties.h" 62 63 # include "CStorageController.h" … … 756 757 /* Notify listeners about storage device change: */ 757 758 emit sigStorageDeviceChange(attachment, fRemoved, fSilent); 759 } 760 761 void UISession::sltAudioAdapterChange() 762 { 763 /* Make sure Audio adapter is present: */ 764 const CAudioAdapter comAdapter = machine().GetAudioAdapter(); 765 AssertMsgReturnVoid(machine().isOk() && comAdapter.isNotNull(), 766 ("Audio adapter should NOT be null!\n")); 767 768 /* Check/Uncheck Audio adapter output/input actions depending on features status: */ 769 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)->blockSignals(true); 770 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)->setChecked(comAdapter.GetEnabledOut()); 771 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)->blockSignals(false); 772 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input)->blockSignals(true); 773 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input)->setChecked(comAdapter.GetEnabledIn()); 774 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input)->blockSignals(false); 775 776 /* Notify listeners about Audio adapter change: */ 777 emit sigAudioAdapterChange(); 778 758 779 } 759 780 … … 1138 1159 connect(gConsoleEvents, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 1139 1160 this, SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); 1161 1162 connect(gConsoleEvents, SIGNAL(sigAudioAdapterChange()), 1163 this, SLOT(sltAudioAdapterChange())); 1140 1164 } 1141 1165 … … 1278 1302 /* Input options: */ 1279 1303 actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration)->setChecked(isMouseIntegrated()); 1304 1305 /* Devices options: */ 1306 { 1307 const CAudioAdapter comAudio = m_machine.GetAudioAdapter(); 1308 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)->blockSignals(true); 1309 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)->setChecked(comAudio.GetEnabledOut()); 1310 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Output)->blockSignals(false); 1311 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input)->blockSignals(true); 1312 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input)->setChecked(comAudio.GetEnabledIn()); 1313 actionPool()->action(UIActionIndexRT_M_Devices_M_Audio_T_Input)->blockSignals(false); 1314 } 1280 1315 1281 1316 /* What is the default close action and the restricted are? */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r67610 r68508 257 257 /** Updates Video Capture action state. */ 258 258 void updateStatusVideoCapture() { sltVideoCaptureChange(); } 259 /** Updates Audio output action state. */ 260 void updateAudioOutput() { sltAudioAdapterChange(); } 261 /** Updates Audio input action state. */ 262 void updateAudioInput() { sltAudioAdapterChange(); } 259 263 260 264 /** @name CPU hardware virtualization features for VM. … … 302 306 void sigCPUExecutionCapChange(); 303 307 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 308 void sigAudioAdapterChange(); 304 309 305 310 /** Notifies about host-screen count change. */ … … 347 352 /** Handles storage device change for @a attachment, which was @a fRemoved and it was @a fSilent for guest. */ 348 353 void sltHandleStorageDeviceChange(const CMediumAttachment &attachment, bool fRemoved, bool fSilent); 354 /** Handles audio adapter change. */ 355 void sltAudioAdapterChange(); 349 356 350 357 /* Handlers: Display reconfiguration stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r68315 r68508 98 98 } 99 99 100 void UIMachineWindowNormal::sltAudioAdapterChange() 101 { 102 /* Update audio stuff: */ 103 updateAppearanceOf(UIVisualElement_AudioStuff); 104 } 105 100 106 void UIMachineWindowNormal::sltNetworkAdapterChange() 101 107 { … … 208 214 case IndicatorType_OpticalDisks: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_OpticalDevices); break; 209 215 case IndicatorType_FloppyDisks: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_FloppyDevices); break; 216 case IndicatorType_Audio: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_Audio); break; 210 217 case IndicatorType_Network: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_Network); break; 211 218 case IndicatorType_USB: pAction = actionPool()->action(UIActionIndexRT_M_Devices_M_USBDevices); break; … … 242 249 connect(machineLogic()->uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)), 243 250 this, SLOT(sltUSBDeviceStateChange())); 251 connect(machineLogic()->uisession(), &UISession::sigAudioAdapterChange, 252 this, &UIMachineWindowNormal::sltAudioAdapterChange); 244 253 connect(machineLogic()->uisession(), SIGNAL(sigNetworkAdapterChange(const CNetworkAdapter &)), 245 254 this, SLOT(sltNetworkAdapterChange())); … … 451 460 disconnect(machineLogic()->uisession(), SIGNAL(sigNetworkAdapterChange(const CNetworkAdapter &)), 452 461 this, SLOT(sltNetworkAdapterChange())); 462 disconnect(machineLogic()->uisession(), &UISession::sigAudioAdapterChange, 463 this, &UIMachineWindowNormal::sltAudioAdapterChange); 453 464 disconnect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()), 454 465 this, SLOT(sltSharedFolderChange())); … … 609 620 if (iElement & UIVisualElement_FDStuff) 610 621 m_pIndicatorsPool->updateAppearance(IndicatorType_FloppyDisks); 622 if (iElement & UIVisualElement_AudioStuff) 623 m_pIndicatorsPool->updateAppearance(IndicatorType_Audio); 611 624 if (iElement & UIVisualElement_NetworkStuff) 612 625 m_pIndicatorsPool->updateAppearance(IndicatorType_Network); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r63229 r68508 53 53 /** Handles USB device state change event. */ 54 54 void sltUSBDeviceStateChange(); 55 /** Handles audio adapter change event. */ 56 void sltAudioAdapterChange(); 55 57 /** Handles network adapter change event. */ 56 58 void sltNetworkAdapterChange();
Note:
See TracChangeset
for help on using the changeset viewer.