儲存庫 vbox 的更動 68600
- 時間撮記:
- 2017-9-1 下午12:40:41 (7 年 以前)
- 位置:
- trunk/src/VBox/Frontends/VirtualBox/src
- 檔案:
-
- 修改 5 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r68508 r68600 60 60 # include "CNATNetwork.h" 61 61 # include "CDHCPServer.h" 62 # include "CAudioAdapter.h"63 62 # include "CNATEngine.h" 64 63 # include "CSerialPort.h" … … 66 65 # include "CSnapshot.h" 67 66 # include "CStorageController.h" 68 # include "CUSBController.h"69 # include "CUSBDeviceFilters.h"70 # include "CUSBDeviceFilter.h"71 67 # include "CConsole.h" 72 68 # include "CMachine.h" … … 79 75 # include "CExtPackFile.h" 80 76 # include "CHostNetworkInterface.h" 81 # include "CVRDEServer.h"82 # include "CNetworkAdapter.h"83 # include "CEmulatedUSB.h"84 77 # ifdef VBOX_WITH_DRAG_AND_DROP 85 78 # include "CGuest.h" … … 2040 2033 "least <b>%1</b> of video memory.</p>") 2041 2034 .arg(VBoxGlobal::formatSize(uMinVRAM))); 2042 }2043 2044 void UIMessageCenter::cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) const2045 {2046 error(0, MessageType_Error,2047 tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")2048 .arg(strDevice, CConsole(console).GetMachine().GetName()),2049 UIErrorString::formatErrorInfo(console));2050 }2051 2052 void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const2053 {2054 error(0, MessageType_Error,2055 tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")2056 .arg(strDevice, strMachineName),2057 UIErrorString::formatErrorInfo(errorInfo));2058 }2059 2060 void UIMessageCenter::cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const2061 {2062 error(0, MessageType_Error,2063 tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")2064 .arg(strDevice, CConsole(console).GetMachine().GetName()),2065 UIErrorString::formatErrorInfo(console));2066 }2067 2068 void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const2069 {2070 error(0, MessageType_Error,2071 tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")2072 .arg(strDevice, strMachineName),2073 UIErrorString::formatErrorInfo(errorInfo));2074 }2075 2076 void UIMessageCenter::cannotAttachWebCam(const CEmulatedUSB &dispatcher, const QString &strWebCamName, const QString &strMachineName) const2077 {2078 error(0, MessageType_Error,2079 tr("Failed to attach the webcam <b>%1</b> to the virtual machine <b>%2</b>.")2080 .arg(strWebCamName, strMachineName),2081 UIErrorString::formatErrorInfo(dispatcher));2082 }2083 2084 void UIMessageCenter::cannotDetachWebCam(const CEmulatedUSB &dispatcher, const QString &strWebCamName, const QString &strMachineName) const2085 {2086 error(0, MessageType_Error,2087 tr("Failed to detach the webcam <b>%1</b> from the virtual machine <b>%2</b>.")2088 .arg(strWebCamName, strMachineName),2089 UIErrorString::formatErrorInfo(dispatcher));2090 }2091 2092 void UIMessageCenter::cannotToggleVideoCapture(const CMachine &machine, bool fEnable)2093 {2094 /* Get machine-name preserving error-info: */2095 QString strMachineName(CMachine(machine).GetName());2096 error(0, MessageType_Error,2097 fEnable ?2098 tr("Failed to enable video capturing for the virtual machine <b>%1</b>.").arg(strMachineName) :2099 tr("Failed to disable video capturing for the virtual machine <b>%1</b>.").arg(strMachineName),2100 UIErrorString::formatErrorInfo(machine));2101 }2102 2103 void UIMessageCenter::cannotToggleVRDEServer(const CVRDEServer &server, const QString &strMachineName, bool fEnable)2104 {2105 error(0, MessageType_Error,2106 fEnable ?2107 tr("Failed to enable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName) :2108 tr("Failed to disable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName),2109 UIErrorString::formatErrorInfo(server));2110 }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 2130 void UIMessageCenter::cannotToggleNetworkAdapterCable(const CNetworkAdapter &adapter, const QString &strMachineName, bool fConnect)2131 {2132 error(0, MessageType_Error,2133 fConnect ?2134 tr("Failed to connect the network adapter cable of the virtual machine <b>%1</b>.").arg(strMachineName) :2135 tr("Failed to disconnect the network adapter cable of the virtual machine <b>%1</b>.").arg(strMachineName),2136 UIErrorString::formatErrorInfo(adapter));2137 }2138 2139 void UIMessageCenter::remindAboutGuestAdditionsAreNotActive() const2140 {2141 alert(0, MessageType_Warning,2142 tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "2143 "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "2144 "please install the Guest Additions if they are not installed, or re-install them if they are "2145 "not working correctly, by selecting <b>Insert Guest Additions CD image</b> from the <b>Devices</b> menu. "2146 "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"),2147 "remindAboutGuestAdditionsAreNotActive");2148 2035 } 2149 2036 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r68508 r68600 312 312 bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const; 313 313 void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const; 314 void cannotAttachUSBDevice(const CConsole &console, const QString &strDevice) const;315 void cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const;316 void cannotDetachUSBDevice(const CConsole &console, const QString &strDevice) const;317 void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const;318 void cannotAttachWebCam(const CEmulatedUSB &dispatcher, const QString &strWebCamName, const QString &strMachineName) const;319 void cannotDetachWebCam(const CEmulatedUSB &dispatcher, const QString &strWebCamName, const QString &strMachineName) const;320 void cannotToggleVideoCapture(const CMachine &machine, bool fEnable);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);324 void cannotToggleNetworkAdapterCable(const CNetworkAdapter &adapter, const QString &strMachineName, bool fConnect);325 void remindAboutGuestAdditionsAreNotActive() const;326 314 void cannotMountGuestAdditions(const QString &strMachineName) const; 327 315 void cannotAddDiskEncryptionPassword(const CConsole &console); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
r68190 r68600 28 28 # include "UIHostComboEditor.h" 29 29 # include "UIExtraDataManager.h" 30 # include "UIErrorString.h" 31 32 /* COM includes: */ 33 # include "CAudioAdapter.h" 34 # include "CConsole.h" 35 # include "CEmulatedUSB.h" 36 # include "CMachine.h" 37 # include "CNetworkAdapter.h" 38 # include "CVRDEServer.h" 30 39 31 40 /* Other VBox includes: */ … … 199 208 { 200 209 message(pParent, strPopupPaneID, strMessage, QString(), 210 QApplication::translate("UIMessageCenter", "Close") /* 1st button text */, 211 QString() /* 2nd button text */, 212 fProposeAutoConfirmation); 213 } 214 215 void UIPopupCenter::alertWithDetails(QWidget *pParent, const QString &strPopupPaneID, 216 const QString &strMessage, 217 const QString &strDetails, 218 bool fProposeAutoConfirmation /* = false*/) 219 { 220 message(pParent, strPopupPaneID, strMessage, strDetails, 201 221 QApplication::translate("UIMessageCenter", "Close") /* 1st button text */, 202 222 QString() /* 2nd button text */, … … 493 513 } 494 514 515 void UIPopupCenter::cannotAttachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice) 516 { 517 alertWithDetails(pParent, "cannotAttachUSBDevice", 518 QApplication::translate("UIMessageCenter", 519 "Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.") 520 .arg(strDevice, CConsole(comConsole).GetMachine().GetName()), 521 UIErrorString::formatErrorInfo(comConsole)); 522 } 523 524 void UIPopupCenter::cannotAttachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo, 525 const QString &strDevice, const QString &strMachineName) 526 { 527 alertWithDetails(pParent, "cannotAttachUSBDevice", 528 QApplication::translate("UIMessageCenter", 529 "Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.") 530 .arg(strDevice).arg(strMachineName), 531 UIErrorString::formatErrorInfo(comErrorInfo)); 532 } 533 534 void UIPopupCenter::cannotDetachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice) 535 { 536 alertWithDetails(pParent, "cannotDetachUSBDevice", 537 QApplication::translate("UIMessageCenter", 538 "Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.") 539 .arg(strDevice, CConsole(comConsole).GetMachine().GetName()), 540 UIErrorString::formatErrorInfo(comConsole)); 541 } 542 543 void UIPopupCenter::cannotDetachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo, 544 const QString &strDevice, const QString &strMachineName) 545 { 546 alertWithDetails(pParent, "cannotDetachUSBDevice", 547 QApplication::translate("UIMessageCenter", 548 "Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.") 549 .arg(strDevice, strMachineName), 550 UIErrorString::formatErrorInfo(comErrorInfo)); 551 } 552 553 void UIPopupCenter::cannotAttachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher, 554 const QString &strWebCamName, const QString &strMachineName) 555 { 556 alertWithDetails(pParent, "cannotAttachWebCam", 557 QApplication::translate("UIMessageCenter", 558 "Failed to attach the webcam <b>%1</b> to the virtual machine <b>%2</b>.") 559 .arg(strWebCamName, strMachineName), 560 UIErrorString::formatErrorInfo(comDispatcher)); 561 } 562 563 void UIPopupCenter::cannotDetachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher, 564 const QString &strWebCamName, const QString &strMachineName) 565 { 566 alertWithDetails(pParent, "cannotDetachWebCam", 567 QApplication::translate("UIMessageCenter", 568 "Failed to detach the webcam <b>%1</b> from the virtual machine <b>%2</b>.") 569 .arg(strWebCamName, strMachineName), 570 UIErrorString::formatErrorInfo(comDispatcher)); 571 } 572 573 void UIPopupCenter::cannotToggleVideoCapture(QWidget *pParent, const CMachine &comMachine, bool fEnable) 574 { 575 /* Get machine-name preserving error-info: */ 576 QString strMachineName(CMachine(comMachine).GetName()); 577 alertWithDetails(pParent, "cannotToggleVideoCapture", 578 fEnable ? 579 QApplication::translate("UIMessageCenter", "Failed to enable video capturing for the virtual machine <b>%1</b>.").arg(strMachineName) : 580 QApplication::translate("UIMessageCenter", "Failed to disable video capturing for the virtual machine <b>%1</b>.").arg(strMachineName), 581 UIErrorString::formatErrorInfo(comMachine)); 582 } 583 584 void UIPopupCenter::cannotToggleVRDEServer(QWidget *pParent, const CVRDEServer &comServer, const QString &strMachineName, bool fEnable) 585 { 586 alertWithDetails(pParent, "cannotToggleVRDEServer", 587 fEnable ? 588 QApplication::translate("UIMessageCenter", "Failed to enable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName) : 589 QApplication::translate("UIMessageCenter", "Failed to disable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName), 590 UIErrorString::formatErrorInfo(comServer)); 591 } 592 593 void UIPopupCenter::cannotToggleNetworkAdapterCable(QWidget *pParent, const CNetworkAdapter &comAdapter, const QString &strMachineName, bool fConnect) 594 { 595 alertWithDetails(pParent, "cannotToggleNetworkAdapterCable", 596 fConnect ? 597 QApplication::translate("UIMessageCenter", "Failed to connect the network adapter cable of the virtual machine <b>%1</b>.").arg(strMachineName) : 598 QApplication::translate("UIMessageCenter", "Failed to disconnect the network adapter cable of the virtual machine <b>%1</b>.").arg(strMachineName), 599 UIErrorString::formatErrorInfo(comAdapter)); 600 } 601 602 void UIPopupCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent) 603 { 604 alert(pParent, "remindAboutGuestAdditionsAreNotActive", 605 QApplication::translate("UIMessageCenter", "<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, " 606 "and shared folders cannot be used without them. To use shared folders inside the virtual machine, " 607 "please install the Guest Additions if they are not installed, or re-install them if they are " 608 "not working correctly, by selecting <b>Insert Guest Additions CD image</b> from the <b>Devices</b> menu. " 609 "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"), 610 true); 611 } 612 613 void UIPopupCenter::cannotToggleAudioOutput(QWidget *pParent, const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable) 614 { 615 alertWithDetails(pParent, "cannotToggleAudioOutput", 616 fEnable ? 617 QApplication::translate("UIMessageCenter", "Failed to enable the audio adapter output for the virtual machine <b>%1</b>.").arg(strMachineName) : 618 QApplication::translate("UIMessageCenter", "Failed to disable the audio adapter output for the virtual machine <b>%1</b>.").arg(strMachineName), 619 UIErrorString::formatErrorInfo(comAdapter)); 620 } 621 622 void UIPopupCenter::cannotToggleAudioInput(QWidget *pParent, const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable) 623 { 624 alertWithDetails(pParent, "cannotToggleAudioInput", 625 fEnable ? 626 QApplication::translate("UIMessageCenter", "Failed to enable the audio adapter input for the virtual machine <b>%1</b>.").arg(strMachineName) : 627 QApplication::translate("UIMessageCenter", "Failed to disable the audio adapter input for the virtual machine <b>%1</b>.").arg(strMachineName), 628 UIErrorString::formatErrorInfo(comAdapter)); 629 } 630 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h
r62493 r68600 27 27 class QWidget; 28 28 class UIPopupStack; 29 class CAudioAdapter; 30 class CConsole; 31 class CEmulatedUSB; 32 class CMachine; 33 class CNetworkAdapter; 34 class CVirtualBoxErrorInfo; 35 class CVRDEServer; 29 36 30 37 /* Popup-stack types: */ … … 85 92 86 93 /* API: Wrapper to 'message' function. 94 * Provides one button: */ 95 void alertWithDetails(QWidget *pParent, const QString &strPopupPaneID, 96 const QString &strMessage, 97 const QString &strDetails, 98 bool fProposeAutoConfirmation = false); 99 100 /* API: Wrapper to 'message' function. 87 101 * Omits details, provides up to two buttons: */ 88 102 void question(QWidget *pParent, const QString &strPopupPaneID, … … 104 118 void remindAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP); 105 119 void forgetAboutWrongColorDepth(QWidget *pParent); 120 void cannotAttachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice); 121 void cannotAttachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo, 122 const QString &strDevice, const QString &strMachineName); 123 void cannotDetachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice); 124 void cannotDetachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo, 125 const QString &strDevice, const QString &strMachineName); 126 void cannotAttachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher, 127 const QString &strWebCamName, const QString &strMachineName); 128 void cannotDetachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher, 129 const QString &strWebCamName, const QString &strMachineName); 130 void cannotToggleVideoCapture(QWidget *pParent, const CMachine &comMachine, bool fEnable); 131 void cannotToggleVRDEServer(QWidget *pParent, const CVRDEServer &comServer, 132 const QString &strMachineName, bool fEnable); 133 void cannotToggleNetworkAdapterCable(QWidget *pParent, const CNetworkAdapter &comAdapter, 134 const QString &strMachineName, bool fConnect); 135 void remindAboutGuestAdditionsAreNotActive(QWidget *pParent); 136 void cannotToggleAudioOutput(QWidget *pParent, const CAudioAdapter &comAdapter, 137 const QString &strMachineName, bool fEnable); 138 void cannotToggleAudioInput(QWidget *pParent, const CAudioAdapter &comAdapter, 139 const QString &strMachineName, bool fEnable); 106 140 107 141 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r68508 r68600 741 741 { 742 742 if (fIsAttached) 743 msgCenter().cannotAttachUSBDevice(error, vboxGlobal().details(device), machineName());743 popupCenter().cannotAttachUSBDevice(activeMachineWindow(), error, vboxGlobal().details(device), machineName()); 744 744 else 745 msgCenter().cannotDetachUSBDevice(error, vboxGlobal().details(device), machineName());745 popupCenter().cannotDetachUSBDevice(activeMachineWindow(), error, vboxGlobal().details(device), machineName()); 746 746 } 747 747 } … … 1869 1869 uisession()->updateStatusVideoCapture(); 1870 1870 /* Notify about the error: */ 1871 return msgCenter().cannotToggleVideoCapture(machine(), fEnabled);1871 return popupCenter().cannotToggleVideoCapture(activeMachineWindow(), machine(), fEnabled); 1872 1872 } 1873 1873 … … 1905 1905 uisession()->updateStatusVRDE(); 1906 1906 /* Notify about the error: */ 1907 return msgCenter().cannotToggleVRDEServer(server, machineName(), fEnabled);1907 return popupCenter().cannotToggleVRDEServer(activeMachineWindow(), server, machineName(), fEnabled); 1908 1908 } 1909 1909 … … 1976 1976 uisession()->updateAudioOutput(); 1977 1977 /* Notify about the error: */ 1978 return msgCenter().cannotToggleAudioOutput(comAdapter, machineName(), fEnabled);1978 return popupCenter().cannotToggleAudioOutput(activeMachineWindow(), comAdapter, machineName(), fEnabled); 1979 1979 } 1980 1980 … … 2012 2012 uisession()->updateAudioInput(); 2013 2013 /* Notify about the error: */ 2014 return msgCenter().cannotToggleAudioInput(comAdapter, machineName(), fEnabled);2014 return popupCenter().cannotToggleAudioInput(activeMachineWindow(), comAdapter, machineName(), fEnabled); 2015 2015 } 2016 2016 … … 2042 2042 /* Do not process if additions are not loaded! */ 2043 2043 if (!uisession()->isGuestAdditionsActive()) 2044 msgCenter().remindAboutGuestAdditionsAreNotActive();2044 popupCenter().remindAboutGuestAdditionsAreNotActive(activeMachineWindow()); 2045 2045 2046 2046 /* Open VM settings : Shared folders page: */ … … 2085 2085 CUSBDevice device(hostDevice); 2086 2086 /* Show a message about procedure failure: */ 2087 msgCenter().cannotAttachUSBDevice(console(), vboxGlobal().details(device));2087 popupCenter().cannotAttachUSBDevice(activeMachineWindow(), console(), vboxGlobal().details(device)); 2088 2088 } 2089 2089 } … … 2099 2099 { 2100 2100 /* Show a message about procedure failure: */ 2101 msgCenter().cannotDetachUSBDevice(console(), vboxGlobal().details(device));2101 popupCenter().cannotDetachUSBDevice(activeMachineWindow(), console(), vboxGlobal().details(device)); 2102 2102 } 2103 2103 } … … 2123 2123 /* Check if dispatcher is OK: */ 2124 2124 if (!dispatcher.isOk()) 2125 msgCenter().cannotAttachWebCam(dispatcher, target.name, machineName());2125 popupCenter().cannotAttachWebCam(activeMachineWindow(), dispatcher, target.name, machineName()); 2126 2126 } 2127 2127 /* Detach webcam device: */ … … 2132 2132 /* Check if dispatcher is OK: */ 2133 2133 if (!dispatcher.isOk()) 2134 msgCenter().cannotDetachWebCam(dispatcher, target.name, machineName());2134 popupCenter().cannotDetachWebCam(activeMachineWindow(), dispatcher, target.name, machineName()); 2135 2135 } 2136 2136 } … … 2162 2162 adapter.SetCableConnected(fConnect); 2163 2163 if (!adapter.isOk()) 2164 return msgCenter().cannotToggleNetworkAdapterCable(adapter, machineName(), fConnect);2164 return popupCenter().cannotToggleNetworkAdapterCable(activeMachineWindow(), adapter, machineName(), fConnect); 2165 2165 2166 2166 /* Save machine-settings: */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器