- Timestamp:
- Jun 17, 2013 10:47:06 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r46542 r46582 249 249 <file alias="video_capture_16px.png">images/video_capture_16px.png</file> 250 250 <file alias="video_capture_disabled_16px.png">images/video_capture_disabled_16px.png</file> 251 <file alias="video_capture_settings_16px.png">images/video_capture_settings_16px.png</file> 252 <file alias="video_capture_write_16px.png">images/video_capture_write_16px.png</file> 251 253 </qresource> 252 254 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/images/video_capture_16px.png
-
Property svn:keywords
set to
Date Revision Author Id
-
Property svn:keywords
set to
-
trunk/src/VBox/Frontends/VirtualBox/images/video_capture_disabled_16px.png
-
Property svn:keywords
set to
Date Revision Author Id
-
Property svn:keywords
set to
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r46542 r46582 882 882 }; 883 883 884 class UIActionMenuVideoCapture : public UIActionMenu 885 { 886 Q_OBJECT; 887 888 public: 889 890 UIActionMenuVideoCapture(UIActionPool *pParent) 891 : UIActionMenu(pParent) 892 { 893 retranslateUi(); 894 } 895 896 protected: 897 898 void retranslateUi() {} 899 }; 900 884 901 class UIActionToggleVideoCapture : public UIActionToggle 885 902 { … … 906 923 setName(QApplication::translate("UIActionPool", "Enable &Video Capture")); 907 924 setStatusTip(QApplication::translate("UIActionPool", "Enable video capture")); 925 } 926 }; 927 928 class UIActionSimpleShowVideoCaptureOptions : public UIActionSimple 929 { 930 Q_OBJECT; 931 932 public: 933 934 UIActionSimpleShowVideoCaptureOptions(UIActionPool *pParent) 935 : UIActionSimple(pParent, ":/video_capture_settings_16px.png") 936 { 937 retranslateUi(); 938 } 939 940 protected: 941 942 QString shortcutExtraDataID() const 943 { 944 return QString("VideoCaptureOptions"); 945 } 946 947 void retranslateUi() 948 { 949 setName(QApplication::translate("UIActionPool", "&Video Capture Options...")); 950 setStatusTip(QApplication::translate("UIActionPool", "Configure video capture options")); 908 951 } 909 952 }; … … 1173 1216 m_pool[UIActionIndexRuntime_Toggle_VRDEServer] = new UIActionToggleVRDEServer(this); 1174 1217 m_pool[UIActionIndexRuntime_Toggle_VideoCapture] = new UIActionToggleVideoCapture(this); 1218 m_pool[UIActionIndexRuntime_Simple_VideoCaptureOptions] = new UIActionSimpleShowVideoCaptureOptions(this); 1175 1219 m_pool[UIActionIndexRuntime_Simple_InstallGuestTools] = new UIActionSimplePerformInstallGuestTools(this); 1176 1220 … … 1242 1286 delete m_pool[UIActionIndexRuntime_Menu_SharedFolders]; 1243 1287 m_pool[UIActionIndexRuntime_Menu_SharedFolders] = new UIActionMenuSharedFolders(this); 1288 if (m_pool[UIActionIndexRuntime_Menu_VideoCapture]) 1289 delete m_pool[UIActionIndexRuntime_Menu_VideoCapture]; 1290 m_pool[UIActionIndexRuntime_Menu_VideoCapture] = new UIActionMenuVideoCapture(this); 1244 1291 1245 1292 #ifdef VBOX_WITH_DEBUGGER_GUI -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r46542 r46582 65 65 UIActionIndexRuntime_Simple_SharedFoldersDialog, 66 66 UIActionIndexRuntime_Toggle_VRDEServer, 67 UIActionIndexRuntime_Menu_VideoCapture, 67 68 UIActionIndexRuntime_Toggle_VideoCapture, 69 UIActionIndexRuntime_Simple_VideoCaptureOptions, 68 70 UIActionIndexRuntime_Simple_InstallGuestTools, 69 71 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r46102 r46582 495 495 }; 496 496 497 class UIIndicatorVRDEDisks : public QIWithRetranslateUI<QIStateIndicator> 498 { 499 Q_OBJECT; 500 501 public: 502 503 UIIndicatorVRDEDisks(CSession &session) 504 : QIWithRetranslateUI<QIStateIndicator>() 505 , m_session(session) 506 { 507 setStateIcon(0, QPixmap (":/vrdp_disabled_16px.png")); 508 setStateIcon(1, QPixmap (":/vrdp_16px.png")); 509 510 retranslateUi(); 511 } 512 497 class UIIndicatorVideoCapture : public QIWithRetranslateUI<QIStateIndicator> 498 { 499 Q_OBJECT; 500 501 public: 502 503 /* State enumerator: */ 504 enum UIIndicatorStateVideoCapture 505 { 506 UIIndicatorStateVideoCapture_Disabled = 0, 507 UIIndicatorStateVideoCapture_Enabled = 1, 508 UIIndicatorStateVideoCapture_Writing = 2 509 }; 510 511 /* Constructor: */ 512 UIIndicatorVideoCapture(CSession &session) 513 : QIWithRetranslateUI<QIStateIndicator>() 514 , m_session(session) 515 , m_pUpdateTimer(new QTimer(this)) 516 { 517 /* Assign state icons: */ 518 setStateIcon(UIIndicatorStateVideoCapture_Disabled, QPixmap(":/video_capture_disabled_16px.png")); 519 setStateIcon(UIIndicatorStateVideoCapture_Enabled, QPixmap(":/video_capture_16px.png")); 520 setStateIcon(UIIndicatorStateVideoCapture_Writing, QPixmap(":/video_capture_write_16px.png")); 521 522 /* Connect timer to update active state: */ 523 connect(m_pUpdateTimer, SIGNAL(timeout()), SLOT(sltUpdateState())); 524 m_pUpdateTimer->start(500); 525 526 /* Translate finally: */ 527 retranslateUi(); 528 } 529 530 /* API: Update stuff: */ 531 void updateAppearance() 532 { 533 /* Get machine: */ 534 CMachine machine = m_session.GetMachine(); 535 536 /* Update LED state: */ 537 setState(machine.GetVideoCaptureEnabled()); 538 539 /* Update LED tool-tip: */ 540 QString strToolTip = QApplication::translate("UIIndicatorsPool", "<nobr>Indicates the activity of the video capture:</nobr>"); 541 strToolTip += "<br>"; 542 switch (state()) 543 { 544 case UIIndicatorStateVideoCapture_Disabled: 545 { 546 strToolTip += QApplication::translate("UIIndicatorsPool", "<b>Video capture disabled</b>"); 547 break; 548 } 549 case UIIndicatorStateVideoCapture_Enabled: 550 case UIIndicatorStateVideoCapture_Writing: 551 { 552 strToolTip += QApplication::translate("UIIndicatorsPool", "<nobr><b>Video capture file:</b> %1</nobr>") 553 .arg(machine.GetVideoCaptureFile()); 554 break; 555 } 556 default: 557 break; 558 } 559 setToolTip(strToolTip); 560 } 561 562 protected slots: 563 564 /* Handler: Update stuff: */ 565 void sltUpdateState() 566 { 567 /* Toggle state from 'Enabled' to 'Writing': */ 568 if (state() == UIIndicatorStateVideoCapture_Enabled) 569 setState(UIIndicatorStateVideoCapture_Writing); 570 /* Toggle state from 'Writing' to 'Enabled': */ 571 else if (state() == UIIndicatorStateVideoCapture_Writing) 572 setState(UIIndicatorStateVideoCapture_Enabled); 573 } 574 575 protected: 576 577 /* Handler: Translate stuff: */ 513 578 void retranslateUi() 514 579 { … … 516 581 } 517 582 518 void updateAppearance() 519 { 520 CVRDEServer srv = m_session.GetMachine().GetVRDEServer(); 521 if (!srv.isNull()) 522 { 523 /* update menu&status icon state */ 524 bool fEnabled = srv.GetEnabled(); 525 526 setState(fEnabled ? KDeviceActivity_Idle : KDeviceActivity_Null); 527 528 QString tip = QApplication::translate("UIIndicatorsPool", "Indicates whether the Remote Desktop Server " 529 "is enabled (<img src=:/vrdp_16px.png/>) or not " 530 "(<img src=:/vrdp_disabled_16px.png/>)."); 531 if (srv.GetEnabled()) 532 tip += QApplication::translate("UIIndicatorsPool", "<hr>The Remote Desktop Server is listening on port %1").arg(srv.GetVRDEProperty("TCP/Ports")); 533 setToolTip(tip); 534 } 535 } 536 537 protected: 538 /* For compatibility reason we do it here, later this should be moved to 539 * QIStateIndicator. */ 540 CSession &m_session; 583 /* For compatibility reason we do it here, 584 * later this should be moved to QIStateIndicator. */ 585 CSession &m_session; 586 QTimer *m_pUpdateTimer; 541 587 }; 542 588 … … 740 786 m_IndicatorsPool[index] = new UIIndicatorSharedFolders(m_session); 741 787 break; 788 case UIIndicatorIndex_VideoCapture: 789 m_IndicatorsPool[index] = new UIIndicatorVideoCapture(m_session); 790 break; 742 791 case UIIndicatorIndex_Virtualization: 743 792 m_IndicatorsPool[index] = new UIIndicatorVirtualization(m_session); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r28800 r46582 33 33 UIIndicatorIndex_USBDevices, 34 34 UIIndicatorIndex_SharedFolders, 35 UIIndicatorIndex_V RDP,35 UIIndicatorIndex_VideoCapture, 36 36 UIIndicatorIndex_Virtualization, 37 37 UIIndicatorIndex_Mouse, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h
r44529 r46582 43 43 UIVisualElement_NetworkStuff = RT_BIT(6), 44 44 UIVisualElement_USBStuff = RT_BIT(7), 45 UIVisualElement_ VRDPStuff= RT_BIT(8),46 UIVisualElement_ SharedFolderStuff= RT_BIT(9),45 UIVisualElement_SharedFolderStuff = RT_BIT(8), 46 UIVisualElement_VideoCapture = RT_BIT(9), 47 47 UIVisualElement_VirtualizationStuff = RT_BIT(10), 48 48 UIVisualElement_MiniToolBar = RT_BIT(11), -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r46542 r46582 747 747 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_SharedFoldersDialog)); 748 748 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer)); 749 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_VideoCapture)); 749 750 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture)); 751 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_VideoCaptureOptions)); 750 752 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_InstallGuestTools)); 751 753 … … 811 813 connect(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture), SIGNAL(toggled(bool)), 812 814 this, SLOT(sltToggleVideoCapture(bool))); 815 connect(gActionPool->action(UIActionIndexRuntime_Simple_VideoCaptureOptions), SIGNAL(triggered()), 816 this, SLOT(sltOpenVideoCaptureOptions())); 813 817 connect(gActionPool->action(UIActionIndexRuntime_Simple_InstallGuestTools), SIGNAL(triggered()), 814 818 this, SLOT(sltInstallGuestAdditions())); … … 1312 1316 } 1313 1317 1314 void UIMachineLogic::sltOpenVMSettingsDialog(const QString &strCategory /* = QString() */) 1318 void UIMachineLogic::sltOpenVMSettingsDialog(const QString &strCategory /* = QString() */, 1319 const QString &strControl /*= QString()*/) 1315 1320 { 1316 1321 /* Do not process if window(s) missed! */ … … 1322 1327 QPointer<UISettingsDialogMachine> pDialog = new UISettingsDialogMachine(activeMachineWindow(), 1323 1328 session().GetMachine().GetId(), 1324 strCategory, QString());1329 strCategory, strControl); 1325 1330 /* Executing VM settings dialog. 1326 1331 * This blocking function calls for the internal event-loop to process all further events, … … 1901 1906 /* Make sure something had changed: */ 1902 1907 CMachine machine = session().GetMachine(); 1903 if (machine.GetVideoCaptureEnabled() == fEnabled)1908 if (machine.GetVideoCaptureEnabled() == static_cast<BOOL>(fEnabled)) 1904 1909 return; 1905 1910 … … 1919 1924 if (!machine.isOk()) 1920 1925 msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow()); 1926 } 1927 1928 void UIMachineLogic::sltOpenVideoCaptureOptions() 1929 { 1930 /* Open VM settings : Display page : Video Capture tab: */ 1931 sltOpenVMSettingsDialog("#display", "m_pCheckboxVideoCapture"); 1921 1932 } 1922 1933 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r46542 r46582 193 193 194 194 /* "Device" menu functionality: */ 195 void sltOpenVMSettingsDialog(const QString &strCategory = QString() );195 void sltOpenVMSettingsDialog(const QString &strCategory = QString(), const QString &strControl = QString()); 196 196 void sltOpenNetworkAdaptersDialog(); 197 197 void sltOpenSharedFoldersDialog(); … … 207 207 void sltSwitchVrde(bool fOn); 208 208 void sltToggleVideoCapture(bool fEnabled); 209 void sltOpenVideoCaptureOptions(); 209 210 void sltInstallGuestAdditions(); 210 211 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r46542 r46582 244 244 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_NetworkAdaptersDialog)); 245 245 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_SharedFoldersDialog)); 246 pMenu->addSeparator(); 246 247 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer)); 247 248 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture)); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r46542 r46582 996 996 gActionPool->action(UIActionIndexRuntime_Simple_SettingsDialog)->setEnabled(fAllowReconfiguration); 997 997 gActionPool->action(UIActionIndexRuntime_Simple_SharedFoldersDialog)->setEnabled(fAllowReconfiguration); 998 gActionPool->action(UIActionIndexRuntime_Simple_VideoCaptureOptions)->setEnabled(fAllowReconfiguration); 998 999 gActionPool->action(UIActionIndexRuntime_Simple_NetworkAdaptersDialog)->setEnabled(fAllowReconfiguration); 999 1000 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r45939 r46582 62 62 } 63 63 64 void UIMachineLogicNormal::sltPrepareVideoCaptureMenu() 65 { 66 QMenu *pMenu = qobject_cast<QMenu*>(sender()); 67 AssertMsg(pMenu, ("This slot should be called only on Video Capture menu show!\n")); 68 pMenu->clear(); 69 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture)); 70 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_VideoCaptureOptions)); 71 } 72 64 73 void UIMachineLogicNormal::sltPrepareMouseIntegrationMenu() 65 74 { … … 80 89 connect(gActionPool->action(UIActionIndexRuntime_Menu_SharedFolders)->menu(), SIGNAL(aboutToShow()), 81 90 this, SLOT(sltPrepareSharedFoldersMenu())); 91 connect(gActionPool->action(UIActionIndexRuntime_Menu_VideoCapture)->menu(), SIGNAL(aboutToShow()), 92 this, SLOT(sltPrepareVideoCaptureMenu())); 82 93 connect(gActionPool->action(UIActionIndexRuntime_Menu_MouseIntegration)->menu(), SIGNAL(aboutToShow()), 83 94 this, SLOT(sltPrepareMouseIntegrationMenu())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h
r41064 r46582 41 41 void sltPrepareNetworkAdaptersMenu(); 42 42 void sltPrepareSharedFoldersMenu(); 43 void sltPrepareVideoCaptureMenu(); 43 44 void sltPrepareMouseIntegrationMenu(); 44 45 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r44954 r46582 100 100 } 101 101 102 void UIMachineWindowNormal::sltVideoCaptureChange() 103 { 104 /* Update video-capture stuff: */ 105 updateAppearanceOf(UIVisualElement_VideoCapture); 106 } 107 102 108 void UIMachineWindowNormal::sltCPUExecutionCapChange() 103 109 { … … 149 155 gActionPool->action(UIActionIndexRuntime_Menu_SharedFolders)->menu()->exec(pEvent->globalPos()); 150 156 } 157 /* Show video-capture LED context menu: */ 158 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_VideoCapture)) 159 { 160 if (gActionPool->action(UIActionIndexRuntime_Menu_VideoCapture)->isEnabled()) 161 gActionPool->action(UIActionIndexRuntime_Menu_VideoCapture)->menu()->exec(pEvent->globalPos()); 162 } 151 163 /* Show mouse LED context menu: */ 152 164 else if (pIndicator == indicatorsPool()->indicator(UIIndicatorIndex_Mouse)) … … 187 199 connect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()), 188 200 this, SLOT(sltSharedFolderChange())); 201 202 /* Video capture change updater: */ 203 connect(machineLogic()->uisession(), SIGNAL(sigVideoCaptureChange()), 204 this, SLOT(sltVideoCaptureChange())); 189 205 190 206 /* CPU execution cap change updater: */ … … 247 263 pIndicatorBoxHLayout->addWidget(pLedSharedFolders); 248 264 connect(pLedSharedFolders, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)), 265 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 266 267 /* Video Capture: */ 268 QIStateIndicator *pLedVideoCapture = indicatorsPool()->indicator(UIIndicatorIndex_VideoCapture); 269 pIndicatorBoxHLayout->addWidget(pLedVideoCapture); 270 connect(pLedVideoCapture, SIGNAL(contextMenuRequested(QIStateIndicator*, QContextMenuEvent*)), 249 271 this, SLOT(sltShowIndicatorsContextMenu(QIStateIndicator*, QContextMenuEvent*))); 250 272 … … 556 578 if (iElement & UIVisualElement_SharedFolderStuff) 557 579 indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders)->updateAppearance(); 580 if (iElement & UIVisualElement_VideoCapture) 581 indicatorsPool()->indicator(UIIndicatorIndex_VideoCapture)->updateAppearance(); 558 582 if (iElement & UIVisualElement_VirtualizationStuff) 559 583 indicatorsPool()->indicator(UIIndicatorIndex_Virtualization)->updateAppearance(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r41114 r46582 50 50 void sltNetworkAdapterChange(); 51 51 void sltSharedFolderChange(); 52 void sltVideoCaptureChange(); 52 53 void sltCPUExecutionCapChange(); 53 54
Note:
See TracChangeset
for help on using the changeset viewer.