VirtualBox

Changeset 90695 in vbox


Ignore:
Timestamp:
Aug 16, 2021 1:09:37 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Move rest of popups, COM related this time from UIPopupCenter to UINotificationCenter, s.a. r146301.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp

    r90689 r90695  
    421421    pParent->window()->removeEventFilter(pPopupStack);
    422422}
    423 
    424 void UIPopupCenter::cannotAttachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice)
    425 {
    426     alertWithDetails(pParent, "cannotAttachUSBDevice",
    427                      QApplication::translate("UIMessageCenter",
    428                                              "Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
    429                                              .arg(strDevice, CConsole(comConsole).GetMachine().GetName()),
    430                      UIErrorString::formatErrorInfo(comConsole));
    431 }
    432 
    433 void UIPopupCenter::cannotAttachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo,
    434                                           const QString &strDevice, const QString &strMachineName)
    435 {
    436     alertWithDetails(pParent, "cannotAttachUSBDevice",
    437                      QApplication::translate("UIMessageCenter",
    438                                              "Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
    439                                              .arg(strDevice).arg(strMachineName),
    440                      UIErrorString::formatErrorInfo(comErrorInfo));
    441 }
    442 
    443 void UIPopupCenter::cannotDetachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice)
    444 {
    445     alertWithDetails(pParent, "cannotDetachUSBDevice",
    446                      QApplication::translate("UIMessageCenter",
    447                                              "Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
    448                                              .arg(strDevice, CConsole(comConsole).GetMachine().GetName()),
    449                      UIErrorString::formatErrorInfo(comConsole));
    450 }
    451 
    452 void UIPopupCenter::cannotDetachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo,
    453                                           const QString &strDevice, const QString &strMachineName)
    454 {
    455     alertWithDetails(pParent, "cannotDetachUSBDevice",
    456                      QApplication::translate("UIMessageCenter",
    457                                              "Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
    458                                              .arg(strDevice, strMachineName),
    459                      UIErrorString::formatErrorInfo(comErrorInfo));
    460 }
    461 
    462 void UIPopupCenter::cannotAttachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher,
    463                                        const QString &strWebCamName, const QString &strMachineName)
    464 {
    465     alertWithDetails(pParent, "cannotAttachWebCam",
    466                      QApplication::translate("UIMessageCenter",
    467                                              "Failed to attach the webcam <b>%1</b> to the virtual machine <b>%2</b>.")
    468                                              .arg(strWebCamName, strMachineName),
    469                      UIErrorString::formatErrorInfo(comDispatcher));
    470 }
    471 
    472 void UIPopupCenter::cannotDetachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher,
    473                                        const QString &strWebCamName, const QString &strMachineName)
    474 {
    475     alertWithDetails(pParent, "cannotDetachWebCam",
    476                      QApplication::translate("UIMessageCenter",
    477                                              "Failed to detach the webcam <b>%1</b> from the virtual machine <b>%2</b>.")
    478                                              .arg(strWebCamName, strMachineName),
    479                      UIErrorString::formatErrorInfo(comDispatcher));
    480 }
    481 
    482 void UIPopupCenter::cannotToggleRecording(QWidget *pParent, const CMachine &comMachine, bool fEnable)
    483 {
    484     /* Get machine-name preserving error-info: */
    485     QString strMachineName(CMachine(comMachine).GetName());
    486     alertWithDetails(pParent, "cannotToggleRecording",
    487                      fEnable ?
    488                      QApplication::translate("UIMessageCenter", "Failed to enable recording for the virtual machine <b>%1</b>.").arg(strMachineName) :
    489                      QApplication::translate("UIMessageCenter", "Failed to disable recording for the virtual machine <b>%1</b>.").arg(strMachineName),
    490                      UIErrorString::formatErrorInfo(comMachine));
    491 }
    492 
    493 void UIPopupCenter::cannotToggleVRDEServer(QWidget *pParent, const CVRDEServer &comServer, const QString &strMachineName, bool fEnable)
    494 {
    495     alertWithDetails(pParent, "cannotToggleVRDEServer",
    496                      fEnable ?
    497                      QApplication::translate("UIMessageCenter", "Failed to enable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName) :
    498                      QApplication::translate("UIMessageCenter", "Failed to disable the remote desktop server for the virtual machine <b>%1</b>.").arg(strMachineName),
    499                      UIErrorString::formatErrorInfo(comServer));
    500 }
    501 
    502 void UIPopupCenter::cannotToggleNetworkAdapterCable(QWidget *pParent, const CNetworkAdapter &comAdapter, const QString &strMachineName, bool fConnect)
    503 {
    504     alertWithDetails(pParent, "cannotToggleNetworkAdapterCable",
    505                      fConnect ?
    506                      QApplication::translate("UIMessageCenter", "Failed to connect the network adapter cable of the virtual machine <b>%1</b>.").arg(strMachineName) :
    507                      QApplication::translate("UIMessageCenter", "Failed to disconnect the network adapter cable of the virtual machine <b>%1</b>.").arg(strMachineName),
    508                      UIErrorString::formatErrorInfo(comAdapter));
    509 }
    510 
    511 void UIPopupCenter::cannotToggleAudioOutput(QWidget *pParent, const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable)
    512 {
    513     alertWithDetails(pParent, "cannotToggleAudioOutput",
    514                      fEnable ?
    515                      QApplication::translate("UIMessageCenter", "Failed to enable the audio adapter output for the virtual machine <b>%1</b>.").arg(strMachineName) :
    516                      QApplication::translate("UIMessageCenter", "Failed to disable the audio adapter output for the virtual machine <b>%1</b>.").arg(strMachineName),
    517                      UIErrorString::formatErrorInfo(comAdapter));
    518 }
    519 
    520 void UIPopupCenter::cannotToggleAudioInput(QWidget *pParent, const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable)
    521 {
    522     alertWithDetails(pParent, "cannotToggleAudioInput",
    523                      fEnable ?
    524                      QApplication::translate("UIMessageCenter", "Failed to enable the audio adapter input for the virtual machine <b>%1</b>.").arg(strMachineName) :
    525                      QApplication::translate("UIMessageCenter", "Failed to disable the audio adapter input for the virtual machine <b>%1</b>.").arg(strMachineName),
    526                      UIErrorString::formatErrorInfo(comAdapter));
    527 }
    528 
    529 void UIPopupCenter::cannotMountImage(QWidget *pParent, const QString &strMachineName, const QString &strMediumName)
    530 {
    531     alert(pParent, "cannotMountImage",
    532           QApplication::translate("UIMessageCenter",
    533                                   "<p>Could not insert the <b>%1</b> disk image file into the virtual machine <b>%2</b>, "
    534                                   "as the machine has no optical drives. Please add a drive using the storage page of the "
    535                                   "virtual machine settings window.</p>")
    536                                   .arg(strMediumName, strMachineName));
    537 }
    538 
    539 void UIPopupCenter::cannotOpenMedium(QWidget *pParent, const CVirtualBox &comVBox, UIMediumDeviceType /* enmType */, const QString &strLocation)
    540 {
    541     alertWithDetails(pParent, "cannotOpenMedium",
    542                      QApplication::translate("UIMessageCenter",
    543                                              "Failed to open the disk image file <nobr><b>%1</b></nobr>.")
    544                                              .arg(strLocation),
    545                      UIErrorString::formatErrorInfo(comVBox));
    546 }
    547 
    548 void UIPopupCenter::cannotSaveMachineSettings(QWidget *pParent, const CMachine &comMachine)
    549 {
    550     alertWithDetails(pParent, "cannotSaveMachineSettings",
    551                      QApplication::translate("UIMessageCenter",
    552                                              "Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
    553                                              .arg(CMachine(comMachine).GetName(), CMachine(comMachine).GetSettingsFilePath()),
    554                      UIErrorString::formatErrorInfo(comMachine));
    555 }
    556 
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h

    r90689 r90695  
    147147    void recall(QWidget *pParent, const QString &strID);
    148148
    149     /* API: Runtime UI stuff: */
    150     void cannotAttachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice);
    151     void cannotAttachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo,
    152                                const QString &strDevice, const QString &strMachineName);
    153     void cannotDetachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice);
    154     void cannotDetachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo,
    155                                const QString &strDevice, const QString &strMachineName);
    156     void cannotAttachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher,
    157                             const QString &strWebCamName, const QString &strMachineName);
    158     void cannotDetachWebCam(QWidget *pParent, const CEmulatedUSB &comDispatcher,
    159                             const QString &strWebCamName, const QString &strMachineName);
    160     void cannotToggleRecording(QWidget *pParent, const CMachine &comMachine, bool fEnable);
    161     void cannotToggleVRDEServer(QWidget *pParent,  const CVRDEServer &comServer,
    162                                 const QString &strMachineName, bool fEnable);
    163     void cannotToggleNetworkAdapterCable(QWidget *pParent, const CNetworkAdapter &comAdapter,
    164                                          const QString &strMachineName, bool fConnect);
    165     void cannotToggleAudioOutput(QWidget *pParent, const CAudioAdapter &comAdapter,
    166                                  const QString &strMachineName, bool fEnable);
    167     void cannotToggleAudioInput(QWidget *pParent, const CAudioAdapter &comAdapter,
    168                                 const QString &strMachineName, bool fEnable);
    169     void cannotMountImage(QWidget *pParent, const QString &strMachineName, const QString &strMediumName);
    170     void cannotOpenMedium(QWidget *pParent, const CVirtualBox &comVBox, UIMediumDeviceType enmType, const QString &strLocation);
    171     void cannotSaveMachineSettings(QWidget *pParent, const CMachine &comMachine);
    172 
    173149private slots:
    174150
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90690 r90695  
    2222/* GUI includes: */
    2323#include "UICommon.h"
     24#include "UIErrorString.h"
    2425#include "UIExtraDataManager.h"
    2526#include "UIHostComboEditor.h"
     
    3435
    3536/* COM includes: */
     37#include "CAudioAdapter.h"
    3638#include "CConsole.h"
     39#include "CEmulatedUSB.h"
     40#include "CNetworkAdapter.h"
     41#include "CVRDEServer.h"
    3742
    3843
     
    4348/* static */
    4449QMap<QString, QUuid> UINotificationMessage::m_messages = QMap<QString, QUuid>();
     50
     51/* static */
     52void UINotificationMessage::cannotMountImage(const QString &strMachineName, const QString &strMediumName)
     53{
     54    createMessage(
     55        QApplication::translate("UIMessageCenter", "Can't mount image ..."),
     56        QApplication::translate("UIMessageCenter", "<p>Could not insert the <b>%1</b> disk image file into the virtual machine "
     57                                                   "<b>%2</b>, as the machine has no optical drives. Please add a drive using "
     58                                                   "the storage page of the virtual machine settings window.</p>")
     59                                                   .arg(strMediumName, strMachineName));
     60}
    4561
    4662/* static */
     
    148164}
    149165
     166/* static */
    150167void UINotificationMessage::remindAboutGuestAdditionsAreNotActive()
    151168{
     
    162179}
    163180
     181/* static */
     182void UINotificationMessage::cannotAttachUSBDevice(const CConsole &comConsole, const QString &strDevice)
     183{
     184    createMessage(
     185        QApplication::translate("UIMessageCenter", "Can't attach USB device ..."),
     186        QApplication::translate("UIMessageCenter", "Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
     187                                .arg(strDevice, CConsole(comConsole).GetMachine().GetName()) +
     188        UIErrorString::formatErrorInfo(comConsole));
     189}
     190
     191/* static */
     192void UINotificationMessage::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &comErrorInfo,
     193                                                  const QString &strDevice, const QString &strMachineName)
     194{
     195    createMessage(
     196        QApplication::translate("UIMessageCenter", "Can't attach USB device ..."),
     197        QApplication::translate("UIMessageCenter", "Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
     198                                .arg(strDevice, strMachineName) +
     199        UIErrorString::formatErrorInfo(comErrorInfo));
     200}
     201
     202/* static */
     203void UINotificationMessage::cannotDetachUSBDevice(const CConsole &comConsole, const QString &strDevice)
     204{
     205    createMessage(
     206        QApplication::translate("UIMessageCenter", "Can't detach USB device ..."),
     207        QApplication::translate("UIMessageCenter", "Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
     208                                .arg(strDevice, CConsole(comConsole).GetMachine().GetName()) +
     209        UIErrorString::formatErrorInfo(comConsole));
     210}
     211
     212/* static */
     213void UINotificationMessage::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &comErrorInfo,
     214                                                  const QString &strDevice, const QString &strMachineName)
     215{
     216    createMessage(
     217        QApplication::translate("UIMessageCenter", "Can't detach USB device ..."),
     218        QApplication::translate("UIMessageCenter", "Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
     219                                .arg(strDevice, strMachineName) +
     220        UIErrorString::formatErrorInfo(comErrorInfo));
     221}
     222
     223/* static */
     224void UINotificationMessage::cannotAttachWebCam(const CEmulatedUSB &comDispatcher,
     225                                               const QString &strWebCamName, const QString &strMachineName)
     226{
     227    createMessage(
     228        QApplication::translate("UIMessageCenter", "Can't attach webcam ..."),
     229        QApplication::translate("UIMessageCenter", "Failed to attach the webcam <b>%1</b> to the virtual machine <b>%2</b>.")
     230                                .arg(strWebCamName, strMachineName) +
     231        UIErrorString::formatErrorInfo(comDispatcher));
     232}
     233
     234/* static */
     235void UINotificationMessage::cannotDetachWebCam(const CEmulatedUSB &comDispatcher,
     236                                               const QString &strWebCamName, const QString &strMachineName)
     237{
     238    createMessage(
     239        QApplication::translate("UIMessageCenter", "Can't detach webcam ..."),
     240        QApplication::translate("UIMessageCenter", "Failed to detach the webcam <b>%1</b> from the virtual machine <b>%2</b>.")
     241                                .arg(strWebCamName, strMachineName) +
     242        UIErrorString::formatErrorInfo(comDispatcher));
     243}
     244
     245/* static */
     246void UINotificationMessage::cannotOpenMedium(const CVirtualBox &comVBox, const QString &strLocation)
     247{
     248    createMessage(
     249        QApplication::translate("UIMessageCenter", "Can't open medium ..."),
     250        QApplication::translate("UIMessageCenter", "Failed to open the disk image file <nobr><b>%1</b></nobr>.")
     251                                                   .arg(strLocation) +
     252        UIErrorString::formatErrorInfo(comVBox));
     253}
     254
     255/* static */
     256void UINotificationMessage::cannotSaveMachineSettings(const CMachine &comMachine)
     257{
     258    createMessage(
     259        QApplication::translate("UIMessageCenter", "Can't save machine settings ..."),
     260        QApplication::translate("UIMessageCenter", "Failed to save the settings of the virtual machine <b>%1</b> to "
     261                                                   "<b><nobr>%2</nobr></b>.")
     262                                                   .arg(CMachine(comMachine).GetName(),
     263                                                        CMachine(comMachine).GetSettingsFilePath()) +
     264        UIErrorString::formatErrorInfo(comMachine));
     265}
     266
     267/* static */
     268void UINotificationMessage::cannotToggleAudioInput(const CAudioAdapter &comAdapter,
     269                                                   const QString &strMachineName, bool fEnable)
     270{
     271    createMessage(
     272        QApplication::translate("UIMessageCenter", "Can't toggle audio input ..."),
     273        (  fEnable
     274         ? QApplication::translate("UIMessageCenter", "Failed to enable the audio adapter input for the virtual machine <b>%1</b>.")
     275                                   .arg(strMachineName)
     276         : QApplication::translate("UIMessageCenter", "Failed to disable the audio adapter input for the virtual machine <b>%1</b>.")
     277                                   .arg(strMachineName)) +
     278        UIErrorString::formatErrorInfo(comAdapter));
     279}
     280
     281/* static */
     282void UINotificationMessage::cannotToggleAudioOutput(const CAudioAdapter &comAdapter,
     283                                                    const QString &strMachineName, bool fEnable)
     284{
     285    createMessage(
     286        QApplication::translate("UIMessageCenter", "Can't toggle audio output ..."),
     287        (  fEnable
     288         ? QApplication::translate("UIMessageCenter", "Failed to enable the audio adapter output for the virtual machine <b>%1</b>.")
     289                                   .arg(strMachineName)
     290         : QApplication::translate("UIMessageCenter", "Failed to disable the audio adapter output for the virtual machine <b>%1</b>.")
     291                                   .arg(strMachineName)) +
     292        UIErrorString::formatErrorInfo(comAdapter));
     293}
     294
     295/* static */
     296void UINotificationMessage::cannotToggleNetworkCable(const CNetworkAdapter &comAdapter,
     297                                                     const QString &strMachineName, bool fConnect)
     298{
     299    createMessage(
     300        QApplication::translate("UIMessageCenter", "Can't toggle network cable ..."),
     301        (  fConnect
     302         ? QApplication::translate("UIMessageCenter", "Failed to connect the network adapter cable of the virtual machine <b>%1</b>.")
     303                                   .arg(strMachineName)
     304         : QApplication::translate("UIMessageCenter", "Failed to disconnect the network adapter cable of the virtual machine <b>%1</b>.")
     305                                   .arg(strMachineName)) +
     306        UIErrorString::formatErrorInfo(comAdapter));
     307}
     308
     309/* static */
     310void UINotificationMessage::cannotToggleRecording(const CMachine &comMachine, bool fEnable)
     311{
     312    const QString strMachineName(CMachine(comMachine).GetName());
     313    createMessage(
     314        QApplication::translate("UIMessageCenter", "Can't toggle recording ..."),
     315        (  fEnable
     316         ? QApplication::translate("UIMessageCenter", "Failed to enable recording for the virtual machine <b>%1</b>.")
     317                                   .arg(strMachineName)
     318         : QApplication::translate("UIMessageCenter", "Failed to disable recording for the virtual machine <b>%1</b>.")
     319                                   .arg(strMachineName)) +
     320        UIErrorString::formatErrorInfo(comMachine));
     321}
     322
     323/* static */
     324void UINotificationMessage::cannotToggleVRDEServer(const CVRDEServer &comServer,
     325                                                   const QString &strMachineName, bool fEnable)
     326{
     327    createMessage(
     328        QApplication::translate("UIMessageCenter", "Can't toggle VRDE server ..."),
     329        (  fEnable
     330         ? QApplication::translate("UIMessageCenter", "Failed to enable the remote desktop server for the virtual machine <b>%1</b>.")
     331                                   .arg(strMachineName)
     332         : QApplication::translate("UIMessageCenter", "Failed to disable the remote desktop server for the virtual machine <b>%1</b>.")
     333                                   .arg(strMachineName)) +
     334        UIErrorString::formatErrorInfo(comServer));
     335}
     336
    164337UINotificationMessage::UINotificationMessage(const QString &strName,
    165338                                             const QString &strDetails,
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90689 r90695  
    4444#include "CVirtualSystemDescription.h"
    4545
     46/* Forward declarations: */
     47class CAudioAdapter;
     48class CConsole;
     49class CEmulatedUSB;
     50class CNetworkAdapter;
     51class CVirtualBox;
     52class CVirtualBoxErrorInfo;
     53class CVRDEServer;
     54
    4655/** UINotificationObject extension for message functionality. */
    4756class SHARED_LIBRARY_STUFF UINotificationMessage : public UINotificationSimple
     
    5160public:
    5261
     62    /** Notifies about inability to mount image.
     63      * @param  strMachineName  Brings the machine name.
     64      * @param  strMediumName   Brings the medium name. */
     65    static void cannotMountImage(const QString &strMachineName, const QString &strMediumName);
    5366    /** Notifies about inability to send ACPI shutdown. */
    5467    static void cannotSendACPIToMachine();
     
    7285    static void remindAboutGuestAdditionsAreNotActive();
    7386
     87    /** Notifies about inability to attach USB device.
     88      * @param  comConsole  Brings console USB device belongs to.
     89      * @param  strDevice   Brings the device name. */
     90    static void cannotAttachUSBDevice(const CConsole &comConsole, const QString &strDevice);
     91    /** Notifies about inability to attach USB device.
     92      * @param  comErrorInfo    Brings info about error happened.
     93      * @param  strDevice       Brings the device name.
     94      * @param  strMachineName  Brings the machine name. */
     95    static void cannotAttachUSBDevice(const CVirtualBoxErrorInfo &comErrorInfo,
     96                                      const QString &strDevice, const QString &strMachineName);
     97    /** Notifies about inability to detach USB device.
     98      * @param  comConsole  Brings console USB device belongs to.
     99      * @param  strDevice   Brings the device name. */
     100    static void cannotDetachUSBDevice(const CConsole &comConsole, const QString &strDevice);
     101    /** Notifies about inability to detach USB device.
     102      * @param  comErrorInfo    Brings info about error happened.
     103      * @param  strDevice       Brings the device name.
     104      * @param  strMachineName  Brings the machine name. */
     105    static void cannotDetachUSBDevice(const CVirtualBoxErrorInfo &comErrorInfo,
     106                                      const QString &strDevice, const QString &strMachineName);
     107    /** Notifies about inability to attach webcam.
     108      * @param  comDispatcher   Brings emulated USB dispatcher webcam being attached to.
     109      * @param  strWebCamName   Brings the webcam name.
     110      * @param  strMachineName  Brings the machine name. */
     111    static void cannotAttachWebCam(const CEmulatedUSB &comDispatcher,
     112                                   const QString &strWebCamName, const QString &strMachineName);
     113    /** Notifies about inability to detach webcam.
     114      * @param  comDispatcher   Brings emulated USB dispatcher webcam being detached from.
     115      * @param  strWebCamName   Brings the webcam name.
     116      * @param  strMachineName  Brings the machine name. */
     117    static void cannotDetachWebCam(const CEmulatedUSB &comDispatcher,
     118                                   const QString &strWebCamName, const QString &strMachineName);
     119    /** Notifies about inability to open medium.
     120      * @param  comVBox      Brings common VBox object trying to open medium.
     121      * @param  strLocation  Brings the medium location. */
     122    static void cannotOpenMedium(const CVirtualBox &comVBox, const QString &strLocation);
     123    /** Notifies about inability to save machine settings.
     124      * @param  comMachine  Brings the machine trying to save settings. */
     125    static void cannotSaveMachineSettings(const CMachine &comMachine);
     126    /** Notifies about inability to toggle audio input.
     127      * @param  comAdapter      Brings the adapter input being toggled for.
     128      * @param  strMachineName  Brings the machine name.
     129      * @param  fEnable         Brings whether adapter input is enabled or not. */
     130    static void cannotToggleAudioInput(const CAudioAdapter &comAdapter,
     131                                       const QString &strMachineName, bool fEnable);
     132    /** Notifies about inability to toggle audio output.
     133      * @param  comAdapter      Brings the adapter output being toggled for.
     134      * @param  strMachineName  Brings the machine name.
     135      * @param  fEnable         Brings whether adapter output is enabled or not. */
     136    static void cannotToggleAudioOutput(const CAudioAdapter &comAdapter,
     137                                        const QString &strMachineName, bool fEnable);
     138    /** Notifies about inability to toggle network cable.
     139      * @param  comAdapter      Brings the adapter network cable being toggled for.
     140      * @param  strMachineName  Brings the machine name.
     141      * @param  fConnect        Brings whether network cable is connected or not. */
     142    static void cannotToggleNetworkCable(const CNetworkAdapter &comAdapter,
     143                                         const QString &strMachineName, bool fConnect);
     144    /** Notifies about inability to toggle recording.
     145      * @param  comMachine  Brings the machine recording being toggled for.
     146      * @param  fEnable     Brings whether recording is enabled or not. */
     147    static void cannotToggleRecording(const CMachine &comMachine, bool fEnable);
     148    /** Notifies about inability to toggle VRDE server.
     149      * @param  comServer       Brings the server being toggled.
     150      * @param  strMachineName  Brings the machine name.
     151      * @param  fEnable         Brings whether server is enabled or not. */
     152    static void cannotToggleVRDEServer(const CVRDEServer &comServer,
     153                                       const QString &strMachineName, bool fEnable);
     154
    74155protected:
    75156
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r90689 r90695  
    755755    {
    756756        if (fIsAttached)
    757             popupCenter().cannotAttachUSBDevice(activeMachineWindow(), error, uiCommon().details(device), machineName());
     757            UINotificationMessage::cannotAttachUSBDevice(error, uiCommon().details(device), machineName());
    758758        else
    759             popupCenter().cannotDetachUSBDevice(activeMachineWindow(), error, uiCommon().details(device), machineName());
     759            UINotificationMessage::cannotDetachUSBDevice(error, uiCommon().details(device), machineName());
    760760    }
    761761}
     
    21762176        uisession()->updateStatusRecording();
    21772177        /* Notify about the error: */
    2178         return popupCenter().cannotToggleRecording(activeMachineWindow(), machine(), fEnabled);
     2178        return UINotificationMessage::cannotToggleRecording(machine(), fEnabled);
    21792179    }
    21802180
     
    21862186        uisession()->updateStatusRecording();
    21872187        /* Notify about the error: */
    2188         return msgCenter().cannotSaveMachineSettings(machine());
     2188        return UINotificationMessage::cannotSaveMachineSettings(machine());
    21892189    }
    21902190}
     
    22122212        uisession()->updateStatusVRDE();
    22132213        /* Notify about the error: */
    2214         return popupCenter().cannotToggleVRDEServer(activeMachineWindow(), server, machineName(), fEnabled);
     2214        return UINotificationMessage::cannotToggleVRDEServer(server, machineName(), fEnabled);
    22152215    }
    22162216
     
    22222222        uisession()->updateStatusVRDE();
    22232223        /* Notify about the error: */
    2224         return msgCenter().cannotSaveMachineSettings(machine());
     2224        return UINotificationMessage::cannotSaveMachineSettings(machine());
    22252225    }
    22262226}
     
    22882288        uisession()->updateAudioOutput();
    22892289        /* Notify about the error: */
    2290         return popupCenter().cannotToggleAudioOutput(activeMachineWindow(), comAdapter, machineName(), fEnabled);
     2290        return UINotificationMessage::cannotToggleAudioOutput(comAdapter, machineName(), fEnabled);
    22912291    }
    22922292
     
    22982298        uisession()->updateAudioOutput();
    22992299        /* Notify about the error: */
    2300         return msgCenter().cannotSaveMachineSettings(machine());
     2300        return UINotificationMessage::cannotSaveMachineSettings(machine());
    23012301    }
    23022302}
     
    23242324        uisession()->updateAudioInput();
    23252325        /* Notify about the error: */
    2326         return popupCenter().cannotToggleAudioInput(activeMachineWindow(), comAdapter, machineName(), fEnabled);
     2326        return UINotificationMessage::cannotToggleAudioInput(comAdapter, machineName(), fEnabled);
    23272327    }
    23282328
     
    23342334        uisession()->updateAudioInput();
    23352335        /* Notify about the error: */
    2336         return msgCenter().cannotSaveMachineSettings(machine());
     2336        return UINotificationMessage::cannotSaveMachineSettings(machine());
    23372337    }
    23382338}
     
    23972397            CUSBDevice device(hostDevice);
    23982398            /* Show a message about procedure failure: */
    2399             popupCenter().cannotAttachUSBDevice(activeMachineWindow(), console(), uiCommon().details(device));
     2399            UINotificationMessage::cannotAttachUSBDevice(console(), uiCommon().details(device));
    24002400        }
    24012401    }
     
    24112411        {
    24122412            /* Show a message about procedure failure: */
    2413             popupCenter().cannotDetachUSBDevice(activeMachineWindow(), console(), uiCommon().details(device));
     2413            UINotificationMessage::cannotDetachUSBDevice(console(), uiCommon().details(device));
    24142414        }
    24152415    }
     
    24352435        /* Check if dispatcher is OK: */
    24362436        if (!dispatcher.isOk())
    2437             popupCenter().cannotAttachWebCam(activeMachineWindow(), dispatcher, target.name, machineName());
     2437            UINotificationMessage::cannotAttachWebCam(dispatcher, target.name, machineName());
    24382438    }
    24392439    /* Detach webcam device: */
     
    24442444        /* Check if dispatcher is OK: */
    24452445        if (!dispatcher.isOk())
    2446             popupCenter().cannotDetachWebCam(activeMachineWindow(), dispatcher, target.name, machineName());
     2446            UINotificationMessage::cannotDetachWebCam(dispatcher, target.name, machineName());
    24472447    }
    24482448}
     
    24742474    adapter.SetCableConnected(fConnect);
    24752475    if (!adapter.isOk())
    2476         return popupCenter().cannotToggleNetworkAdapterCable(activeMachineWindow(), adapter, machineName(), fConnect);
     2476        return UINotificationMessage::cannotToggleNetworkCable(adapter, machineName(), fConnect);
    24772477
    24782478    /* Save machine-settings: */
    24792479    machine().SaveSettings();
    24802480    if (!machine().isOk())
    2481         return msgCenter().cannotSaveMachineSettings(machine());
     2481        return UINotificationMessage::cannotSaveMachineSettings(machine());
    24822482}
    24832483
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r90689 r90695  
    4646#include "UIMousePointerShapeData.h"
    4747#include "UINotificationCenter.h"
    48 #include "UIPopupCenter.h"
    4948#include "UIWizardFirstRun.h"
    5049#include "UIConsoleEventHandler.h"
     
    18191818        if (!comVBox.isOk() || comMedium.isNull())
    18201819        {
    1821             popupCenter().cannotOpenMedium(activeMachineWindow(), comVBox, enmMediumType, strMediumName);
     1820            UINotificationMessage::cannotOpenMedium(comVBox, strMediumName);
    18221821            return false;
    18231822        }
     
    18621861    if (sStorageSlots.isEmpty())
    18631862    {
    1864         popupCenter().cannotMountImage(activeMachineWindow(), machineName(), strMediumName);
     1863        UINotificationMessage::cannotMountImage(machineName(), strMediumName);
    18651864        return false;
    18661865    }
     
    18881887    if (!machine().isOk())
    18891888    {
    1890         popupCenter().cannotSaveMachineSettings(activeMachineWindow(), machine());
     1889        UINotificationMessage::cannotSaveMachineSettings(machine());
    18911890        return false;
    18921891    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette