VirtualBox

Changeset 90689 in vbox


Ignore:
Timestamp:
Aug 15, 2021 3:03:02 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Move simple reminders from UIPopupCenter to UINotificationCenter.

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

Legend:

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

    r82968 r90689  
    422422}
    423423
    424 void UIPopupCenter::cannotSendACPIToMachine(QWidget *pParent)
    425 {
    426     alert(pParent, "cannotSendACPIToMachine",
    427           QApplication::translate("UIMessageCenter", "You are trying to shut down the guest with the ACPI power button. "
    428                                                      "This is currently not possible because the guest does not support software shutdown."));
    429 }
    430 
    431 void UIPopupCenter::remindAboutAutoCapture(QWidget *pParent)
    432 {
    433     alert(pParent, "remindAboutAutoCapture",
    434           QApplication::translate("UIMessageCenter", "<p>You have the <b>Auto capture keyboard</b> option turned on. "
    435                                                      "This will cause the Virtual Machine to automatically <b>capture</b> "
    436                                                      "the keyboard every time the VM window is activated and make it "
    437                                                      "unavailable to other applications running on your host machine: "
    438                                                      "when the keyboard is captured, all keystrokes (including system ones "
    439                                                      "like Alt-Tab) will be directed to the VM.</p>"
    440                                                      "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
    441                                                      "keyboard and mouse (if it is captured) and return them to normal "
    442                                                      "operation. The currently assigned host key is shown on the status bar "
    443                                                      "at the bottom of the Virtual Machine window, next to the&nbsp;"
    444                                                      "<img src=:/hostkey_16px.png/>&nbsp;icon. This icon, together "
    445                                                      "with the mouse icon placed nearby, indicate the current keyboard "
    446                                                      "and mouse capture state.</p>") +
    447           QApplication::translate("UIMessageCenter", "<p>The host key is currently defined as <b>%1</b>.</p>",
    448                                                      "additional message box paragraph")
    449                                                      .arg(UIHostCombo::toReadableString(gEDataManager->hostKeyCombination())),
    450           true);
    451 }
    452 
    453 void UIPopupCenter::remindAboutMouseIntegration(QWidget *pParent, bool fSupportsAbsolute)
    454 {
    455     if (fSupportsAbsolute)
    456     {
    457         alert(pParent, "remindAboutMouseIntegration",
    458               QApplication::translate("UIMessageCenter", "<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. "
    459                                                          "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- "
    460                                                          "all mouse actions you perform when the mouse pointer is over the Virtual Machine's display "
    461                                                          "are directly sent to the guest OS. If the mouse is currently captured, it will be automatically uncaptured.</p>"
    462                                                          "<p>The mouse icon on the status bar will look like&nbsp;<img src=:/mouse_seamless_16px.png/>&nbsp;to inform you "
    463                                                          "that mouse pointer integration is supported by the guest OS and is currently turned on.</p>"
    464                                                          "<p><b>Note</b>: Some applications may behave incorrectly in mouse pointer integration mode. "
    465                                                          "You can always disable it for the current session (and enable it again) "
    466                                                          "by selecting the corresponding action from the menu bar.</p>"),
    467               true);
    468     }
    469     else
    470     {
    471         alert(pParent, "remindAboutMouseIntegration",
    472               QApplication::translate("UIMessageCenter", "<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> "
    473                                                          "in the current video mode. You need to capture the mouse (by clicking over the VM display "
    474                                                          "or pressing the host key) in order to use the mouse inside the guest OS.</p>"),
    475               true);
    476     }
    477 }
    478 
    479 void UIPopupCenter::remindAboutPausedVMInput(QWidget *pParent)
    480 {
    481     alert(pParent, "remindAboutPausedVMInput",
    482           QApplication::translate("UIMessageCenter", "<p>The Virtual Machine is currently in the <b>Paused</b> state and not able to see any keyboard or mouse input. "
    483                                                      "If you want to continue to work inside the VM, you need to resume it by selecting the corresponding action "
    484                                                      "from the menu bar.</p>"),
    485           true);
    486 }
    487 
    488 void UIPopupCenter::forgetAboutPausedVMInput(QWidget *pParent)
    489 {
    490     recall(pParent, "remindAboutPausedVMInput");
    491 }
    492 
    493 void UIPopupCenter::remindAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP)
    494 {
    495     alert(pParent, "remindAboutWrongColorDepth",
    496           QApplication::translate("UIMessageCenter", "<p>The virtual screen is currently set to a <b>%1&nbsp;bit</b> color mode. For better "
    497                                                      "performance please change this to <b>%2&nbsp;bit</b>. This can usually be done from the"
    498                                                      " <b>Display</b> section of the guest operating system's Control Panel or System Settings.</p>")
    499                                                      .arg(uRealBPP).arg(uWantedBPP),
    500           true);
    501 }
    502 
    503 void UIPopupCenter::forgetAboutWrongColorDepth(QWidget *pParent)
    504 {
    505     recall(pParent, "remindAboutWrongColorDepth");
    506 }
    507 
    508424void UIPopupCenter::cannotAttachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice)
    509425{
     
    593509}
    594510
    595 void UIPopupCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent)
    596 {
    597     alert(pParent, "remindAboutGuestAdditionsAreNotActive",
    598           QApplication::translate("UIMessageCenter", "<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
    599                                   "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
    600                                   "please install the Guest Additions if they are not installed, or re-install them if they are "
    601                                   "not working correctly, by selecting <b>Insert Guest Additions CD image</b> from the <b>Devices</b> menu. "
    602                                   "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"),
    603           true);
    604 }
    605 
    606511void UIPopupCenter::cannotToggleAudioOutput(QWidget *pParent, const CAudioAdapter &comAdapter, const QString &strMachineName, bool fEnable)
    607512{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h

    r82968 r90689  
    148148
    149149    /* API: Runtime UI stuff: */
    150     void cannotSendACPIToMachine(QWidget *pParent);
    151     void remindAboutAutoCapture(QWidget *pParent);
    152     void remindAboutMouseIntegration(QWidget *pParent, bool fSupportsAbsolute);
    153     void remindAboutPausedVMInput(QWidget *pParent);
    154     void forgetAboutPausedVMInput(QWidget *pParent);
    155     void remindAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP);
    156     void forgetAboutWrongColorDepth(QWidget *pParent);
    157150    void cannotAttachUSBDevice(QWidget *pParent, const CConsole &comConsole, const QString &strDevice);
    158151    void cannotAttachUSBDevice(QWidget *pParent, const CVirtualBoxErrorInfo &comErrorInfo,
     
    170163    void cannotToggleNetworkAdapterCable(QWidget *pParent, const CNetworkAdapter &comAdapter,
    171164                                         const QString &strMachineName, bool fConnect);
    172     void remindAboutGuestAdditionsAreNotActive(QWidget *pParent);
    173165    void cannotToggleAudioOutput(QWidget *pParent, const CAudioAdapter &comAdapter,
    174166                                 const QString &strMachineName, bool fEnable);
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90687 r90689  
    2222/* GUI includes: */
    2323#include "UICommon.h"
     24#include "UIExtraDataManager.h"
     25#include "UIHostComboEditor.h"
    2426#include "UINotificationCenter.h"
    2527#include "UINotificationObjects.h"
     
    4143/* static */
    4244QMap<QString, QUuid> UINotificationMessage::m_messages = QMap<QString, QUuid>();
     45
     46/* static */
     47void UINotificationMessage::cannotSendACPIToMachine()
     48{
     49    createMessage(
     50        QApplication::translate("UIMessageCenter", "Can't send ACPI ..."),
     51        QApplication::translate("UIMessageCenter", "You are trying to shut down the guest with the ACPI power button. "
     52                                                   "This is currently not possible because the guest does not support "
     53                                                   "software shutdown."));
     54}
     55
     56/* static */
     57void UINotificationMessage::remindAboutAutoCapture()
     58{
     59    createMessage(
     60        QApplication::translate("UIMessageCenter", "Auto capture keyboard ..."),
     61        QApplication::translate("UIMessageCenter", "<p>You have the <b>Auto capture keyboard</b> option turned on. "
     62                                                   "This will cause the Virtual Machine to automatically <b>capture</b> "
     63                                                   "the keyboard every time the VM window is activated and make it "
     64                                                   "unavailable to other applications running on your host machine: "
     65                                                   "when the keyboard is captured, all keystrokes (including system ones "
     66                                                   "like Alt-Tab) will be directed to the VM.</p>"
     67                                                   "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
     68                                                   "keyboard and mouse (if it is captured) and return them to normal "
     69                                                   "operation. The currently assigned host key is shown on the status bar "
     70                                                   "at the bottom of the Virtual Machine window. This icon, together "
     71                                                   "with the mouse icon placed nearby, indicate the current keyboard "
     72                                                   "and mouse capture state.</p>") +
     73        QApplication::translate("UIMessageCenter", "<p>The host key is currently defined as <b>%1</b>.</p>",
     74                                                   "additional message box paragraph")
     75                                                   .arg(UIHostCombo::toReadableString(gEDataManager->hostKeyCombination())),
     76        "remindAboutAutoCapture");
     77}
     78
     79/* static */
     80void UINotificationMessage::remindAboutMouseIntegration(bool fSupportsAbsolute)
     81{
     82    if (fSupportsAbsolute)
     83    {
     84        createMessage(
     85            QApplication::translate("UIMessageCenter", "Mouse integration ..."),
     86            QApplication::translate("UIMessageCenter", "<p>The Virtual Machine reports that the guest OS supports <b>mouse "
     87                                                       "pointer integration</b>. This means that you do not need to "
     88                                                       "<i>capture</i> the mouse pointer to be able to use it in your guest "
     89                                                       "OS -- all mouse actions you perform when the mouse pointer is over the "
     90                                                       "Virtual Machine's display are directly sent to the guest OS. If the "
     91                                                       "mouse is currently captured, it will be automatically uncaptured.</p>"
     92                                                       "<p>The mouse icon on the status bar will look "
     93                                                       "like&nbsp;<img src=:/mouse_seamless_16px.png/>&nbsp;to inform you that "
     94                                                       "mouse pointer integration is supported by the guest OS and is currently "
     95                                                       "turned on.</p><p><b>Note</b>: Some applications may behave incorrectly "
     96                                                       "in mouse pointer integration mode. You can always disable it for the "
     97                                                       "current session (and enable it again) by selecting the corresponding "
     98                                                       "action from the menu bar.</p>"),
     99            "remindAboutMouseIntegration");
     100    }
     101    else
     102    {
     103        createMessage(
     104            QApplication::translate("UIMessageCenter", "Mouse integration ..."),
     105            QApplication::translate("UIMessageCenter", "<p>The Virtual Machine reports that the guest OS does not support "
     106                                                       "<b>mouse pointer integration</b> in the current video mode. You need to "
     107                                                       "capture the mouse (by clicking over the VM display or pressing the host "
     108                                                       "key) in order to use the mouse inside the guest OS.</p>"),
     109            "remindAboutMouseIntegration");
     110    }
     111}
     112
     113/* static */
     114void UINotificationMessage::remindAboutPausedVMInput()
     115{
     116    createMessage(
     117        QApplication::translate("UIMessageCenter", "Paused VM input ..."),
     118        QApplication::translate("UIMessageCenter", "<p>The Virtual Machine is currently in the <b>Paused</b> state and not able "
     119                                                   "to see any keyboard or mouse input. If you want to continue to work inside "
     120                                                   "the VM, you need to resume it by selecting the corresponding action from the "
     121                                                   "menu bar.</p>"),
     122        "remindAboutPausedVMInput");
     123}
     124
     125/* static */
     126void UINotificationMessage::forgetAboutPausedVMInput()
     127{
     128    destroyMessage("remindAboutPausedVMInput");
     129}
     130
     131/* static */
     132void UINotificationMessage::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP)
     133{
     134    createMessage(
     135        QApplication::translate("UIMessageCenter", "Wrong color depth ..."),
     136        QApplication::translate("UIMessageCenter", "<p>The virtual screen is currently set to a <b>%1&nbsp;bit</b> color mode. "
     137                                                   "For better performance please change this to <b>%2&nbsp;bit</b>. This can "
     138                                                   "usually be done from the <b>Display</b> section of the guest operating "
     139                                                   "system's Control Panel or System Settings.</p>")
     140                                                   .arg(uRealBPP).arg(uWantedBPP),
     141        "remindAboutWrongColorDepth");
     142}
     143
     144/* static */
     145void UINotificationMessage::forgetAboutWrongColorDepth()
     146{
     147    destroyMessage("remindAboutWrongColorDepth");
     148}
     149
     150void UINotificationMessage::remindAboutGuestAdditionsAreNotActive()
     151{
     152    createMessage(
     153        QApplication::translate("UIMessageCenter", "GA not active ..."),
     154        QApplication::translate("UIMessageCenter", "<p>The VirtualBox Guest Additions do not appear to be available on this "
     155                                                   "virtual machine, and shared folders cannot be used without them. To use "
     156                                                   "shared folders inside the virtual machine, please install the Guest "
     157                                                   "Additions if they are not installed, or re-install them if they are not "
     158                                                   "working correctly, by selecting <b>Insert Guest Additions CD image</b> from "
     159                                                   "the <b>Devices</b> menu. If they are installed but the machine is not yet "
     160                                                   "fully started then shared folders will be available once it is.</p>"),
     161        "remindAboutGuestAdditionsAreNotActive");
     162}
    43163
    44164UINotificationMessage::UINotificationMessage(const QString &strName,
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90687 r90689  
    5151public:
    5252
     53    /** Notifies about inability to send ACPI shutdown. */
     54    static void cannotSendACPIToMachine();
     55
     56    /** Reminds about keyboard auto capturing. */
     57    static void remindAboutAutoCapture();
     58    /** Reminds about mouse integration.
     59      * @param  fSupportsAbsolute  Brings whether mouse supports absolute pointing. */
     60    static void remindAboutMouseIntegration(bool fSupportsAbsolute);
     61    /** Reminds about paused VM input. */
     62    static void remindAboutPausedVMInput();
     63    /** Revokes message about paused VM input. */
     64    static void forgetAboutPausedVMInput();
     65    /** Reminds about wrong color depth.
     66      * @param  uRealBPP    Brings real bit per pixel value.
     67      * @param  uWantedBPP  Brings wanted bit per pixel value. */
     68    static void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     69    /** Revokes message about wrong color depth. */
     70    static void forgetAboutWrongColorDepth();
     71    /** Reminds about GA not affected. */
     72    static void remindAboutGuestAdditionsAreNotActive();
     73
    5374protected:
    5475
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r84888 r90689  
    3030#include "UIMachineWindow.h"
    3131#include "UIMachineView.h"
    32 #include "UIPopupCenter.h"
     32#include "UINotificationCenter.h"
    3333#include "UIExtraDataManager.h"
    3434#include "UICommon.h"
     
    18841884            && ulGuestBitsPerPixel != 0
    18851885            && m_pMachineView->uisession()->isGuestSupportsGraphics())
    1886             popupCenter().remindAboutWrongColorDepth(m_pMachineView->machineWindow(),
    1887                                                      ulGuestBitsPerPixel, ulBitsPerPixel);
     1886            UINotificationMessage::remindAboutWrongColorDepth(ulGuestBitsPerPixel, ulBitsPerPixel);
    18881887        else
    1889             popupCenter().forgetAboutWrongColorDepth(m_pMachineView->machineWindow());
     1888            UINotificationMessage::forgetAboutWrongColorDepth();
    18901889    }
    18911890
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r90475 r90689  
    4242#include "UIExtraDataManager.h"
    4343#include "UIMessageCenter.h"
    44 #include "UIPopupCenter.h"
    4544#include "UIActionPool.h"
    4645#include "UISession.h"
     
    5453#include "UIKeyboardHandlerScale.h"
    5554#include "UIMouseHandler.h"
     55#include "UINotificationCenter.h"
    5656#ifdef VBOX_WS_MAC
    5757# include "UICocoaApplication.h"
     
    946946        state != KMachineState_Paused &&
    947947        state != KMachineState_TeleportingPausedVM)
    948         popupCenter().forgetAboutPausedVMInput(machineLogic()->activeMachineWindow());
     948        UINotificationMessage::forgetAboutPausedVMInput();
    949949}
    950950
     
    12461246                    /* Show a possible warning on key release which seems to be more expected by the end user: */
    12471247                    if (uisession()->isPaused())
    1248                         popupCenter().remindAboutPausedVMInput(machineLogic()->activeMachineWindow());
     1248                        UINotificationMessage::remindAboutPausedVMInput();
    12491249                }
    12501250
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r90664 r90689  
    433433    /* Warn the user about ACPI is not available if so: */
    434434    if (!console().GetGuestEnteredACPIMode())
    435         return popupCenter().cannotSendACPIToMachine(activeMachineWindow());
     435        return UINotificationMessage::cannotSendACPIToMachine();
    436436
    437437    /* Shutdown: */
     
    23542354    /* Do not process if additions are not loaded! */
    23552355    if (!uisession()->isGuestAdditionsActive())
    2356         popupCenter().remindAboutGuestAdditionsAreNotActive(activeMachineWindow());
     2356        UINotificationMessage::remindAboutGuestAdditionsAreNotActive();
    23572357
    23582358    /* Open VM settings : Shared folders page: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r82968 r90689  
    2929#include "UIExtraDataManager.h"
    3030#include "UIMessageCenter.h"
    31 #include "UIPopupCenter.h"
     31#include "UINotificationCenter.h"
    3232#include "UISession.h"
    3333#include "UIMachineLogic.h"
     
    386386        machineState != KMachineState_Paused &&
    387387        machineState != KMachineState_TeleportingPausedVM)
    388         popupCenter().forgetAboutPausedVMInput(machineLogic()->activeMachineWindow());
     388        UINotificationMessage::forgetAboutPausedVMInput();
    389389
    390390    /* Notify all the listeners: */
     
    434434#endif
    435435
    436     /* Notify user about mouse supports or not absolute pointing if that method was called by signal: */
     436    /* Notify user whether mouse supports absolute pointing
     437     * if that method was called by corresponding signal: */
    437438    if (sender())
    438439    {
    439         /* don't annoy the user while restoring a VM */
    440         KMachineState state = uisession()->machineState();
    441         if (state != KMachineState_Restoring)
    442             popupCenter().remindAboutMouseIntegration(uisession()->machineLogic()->activeMachineWindow(),
    443                                                       uisession()->isMouseSupportsAbsolute());
     440        /* Do not annoy user while restoring VM: */
     441        if (uisession()->machineState() != KMachineState_Restoring)
     442            UINotificationMessage::remindAboutMouseIntegration(uisession()->isMouseSupportsAbsolute());
    444443    }
    445444
     
    11291128            {
    11301129                if (uisession()->isPaused())
    1131                 {
    1132                     popupCenter().remindAboutPausedVMInput(machineLogic()->activeMachineWindow());
    1133                 }
     1130                    UINotificationMessage::remindAboutPausedVMInput();
    11341131                else if (uisession()->isRunning())
    11351132                {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r90663 r90689  
    167167    /* Notify user about mouse&keyboard auto-capturing: */
    168168    if (gEDataManager->autoCaptureEnabled())
    169         popupCenter().remindAboutAutoCapture(activeMachineWindow());
     169        UINotificationMessage::remindAboutAutoCapture();
    170170
    171171    /* Check if we are in teleportation waiting mode.
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