VirtualBox

Changeset 47510 in vbox


Ignore:
Timestamp:
Aug 1, 2013 2:13:16 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Message & Popup centers small cleanup.

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

Legend:

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

    r44529 r47510  
    3131#include "VBoxFBOverlay.h"
    3232#include "UIMessageCenter.h"
     33#include "UIPopupCenter.h"
    3334#include "VBoxGlobal.h"
    3435
     
    39223923
    39233924    if (remind)
    3924         msgCenter().remindAboutWrongColorDepth(size.bitsPerPixel(), 32);
     3925        popupCenter().remindAboutWrongColorDepth(vboxGlobal().activeMachineWindow(), size.bitsPerPixel(), 32);
     3926    else
     3927        popupCenter().forgetAboutWrongColorDepth(vboxGlobal().activeMachineWindow());
    39253928}
    39263929
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r46813 r47510  
    17661766}
    17671767
    1768 void UIMessageCenter::cannotSendACPIToMachine() const
    1769 {
    1770     alert(0,  MessageType_Warning,
    1771           tr("You are trying to shut down the guest with the ACPI power button. "
    1772              "This is currently not possible because the guest does not support software shutdown."));
    1773 }
    1774 
    17751768bool UIMessageCenter::confirmInputCapture(bool &fAutoConfirmed) const
    17761769{
     
    17961789    /* True if "Ok" was pressed: */
    17971790    return (rc & AlertButtonMask) == AlertButton_Ok;
    1798 }
    1799 
    1800 void UIMessageCenter::remindAboutAutoCapture() const
    1801 {
    1802     alert(0, MessageType_Info,
    1803           tr("<p>You have the <b>Auto capture keyboard</b> option turned on. "
    1804              "This will cause the Virtual Machine to automatically <b>capture</b> "
    1805              "the keyboard every time the VM window is activated and make it "
    1806              "unavailable to other applications running on your host machine: "
    1807              "when the keyboard is captured, all keystrokes (including system ones "
    1808              "like Alt-Tab) will be directed to the VM.</p>"
    1809              "<p>You can press the <b>host key</b> at any time to <b>uncapture</b> the "
    1810              "keyboard and mouse (if it is captured) and return them to normal "
    1811              "operation. The currently assigned host key is shown on the status bar "
    1812              "at the bottom of the Virtual Machine window, next to the&nbsp;"
    1813              "<img src=:/hostkey_16px.png/>&nbsp;icon. This icon, together "
    1814              "with the mouse icon placed nearby, indicate the current keyboard "
    1815              "and mouse capture state.</p>") +
    1816           tr("<p>The host key is currently defined as <b>%1</b>.</p>",
    1817              "additional message box paragraph")
    1818              .arg(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo())),
    1819           "remindAboutAutoCapture");
    1820 }
    1821 
    1822 void UIMessageCenter::remindAboutMouseIntegration(bool fSupportsAbsolute) const
    1823 {
    1824     if (warningShown("remindAboutMouseIntegration"))
    1825         return;
    1826     setWarningShown("remindAboutMouseIntegration", true);
    1827 
    1828     /* Show one of warnings, do not close outdated, not possible in current archi: */
    1829     static const char *kNames [2] =
    1830     {
    1831         "remindAboutMouseIntegrationOff",
    1832         "remindAboutMouseIntegrationOn"
    1833     };
    1834     if (fSupportsAbsolute)
    1835     {
    1836         alert(0, MessageType_Info,
    1837               tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. "
    1838                  "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- "
    1839                  "all mouse actions you perform when the mouse pointer is over the Virtual Machine's display "
    1840                  "are directly sent to the guest OS. If the mouse is currently captured, it will be automatically uncaptured.</p>"
    1841                  "<p>The mouse icon on the status bar will look like&nbsp;<img src=:/mouse_seamless_16px.png/>&nbsp;to inform you "
    1842                  "that mouse pointer integration is supported by the guest OS and is currently turned on.</p>"
    1843                  "<p><b>Note</b>: Some applications may behave incorrectly in mouse pointer integration mode. "
    1844                  "You can always disable it for the current session (and enable it again) "
    1845                  "by selecting the corresponding action from the menu bar.</p>"),
    1846               kNames [1] /* auto-confirm id */);
    1847     }
    1848     else
    1849     {
    1850         alert(0, MessageType_Info,
    1851               tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> "
    1852                  "in the current video mode. You need to capture the mouse (by clicking over the VM display "
    1853                  "or pressing the host key) in order to use the mouse inside the guest OS.</p>"),
    1854               kNames [0] /* auto-confirm id */);
    1855     }
    1856 
    1857     setWarningShown("remindAboutMouseIntegration", false);
    1858 }
    1859 
    1860 void UIMessageCenter::remindAboutPausedVMInput() const
    1861 {
    1862     alert(0, MessageType_Info,
    1863           tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and "
    1864              "not able to see any keyboard or mouse input. If you want to "
    1865              "continue to work inside the VM, you need to resume it by selecting the "
    1866              "corresponding action from the menu bar.</p>"),
    1867              "remindAboutPausedVMInput");
    18681791}
    18691792
     
    24792402}
    24802403
    2481 void UIMessageCenter::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const
    2482 {
    2483     emit sigRemindAboutWrongColorDepth(uRealBPP, uWantedBPP);
    2484 }
    2485 
    24862404void UIMessageCenter::sltShowHelpWebDialog()
    24872405{
     
    25822500}
    25832501
    2584 void UIMessageCenter::sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const
    2585 {
    2586     alert(0, MessageType_Info,
    2587           tr("<p>The virtual machine window is optimized to work in "
    2588              "<b>%1&nbsp;bit</b> color mode but the "
    2589              "virtual display is currently set to <b>%2&nbsp;bit</b>.</p>"
    2590              "<p>Please open the display properties dialog of the guest OS and "
    2591              "select a <b>%3&nbsp;bit</b> color mode, if it is available, for "
    2592              "best possible performance of the virtual video subsystem.</p>"
    2593              "<p><b>Note</b>. Some operating systems, like OS/2, may actually "
    2594              "work in 32&nbsp;bit mode but report it as 24&nbsp;bit "
    2595              "(16 million colors). You may try to select a different color "
    2596              "mode to see if this message disappears or you can simply "
    2597              "disable the message now if you are sure the required color "
    2598              "mode (%4&nbsp;bit) is not available in the guest OS.</p>")
    2599              .arg(uWantedBPP).arg(uRealBPP).arg(uWantedBPP).arg(uWantedBPP),
    2600           "remindAboutWrongColorDepth");
    2601 }
    2602 
    26032502UIMessageCenter::UIMessageCenter()
    26042503{
     
    26382537            Qt::BlockingQueuedConnection);
    26392538
    2640     /* Prepare synchronization connection: */
    2641     connect(this, SIGNAL(sigRemindAboutWrongColorDepth(ulong, ulong)),
    2642             this, SLOT(sltRemindAboutWrongColorDepth(ulong, ulong)), Qt::QueuedConnection);
    2643 
    26442539    /* Translations for Main.
    26452540     * Please make sure they corresponds to the strings coming from Main one-by-one symbol! */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r46813 r47510  
    6363                             const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
    6464                             const QString &strAutoConfirmId) const;
    65 
    66     /* Notifiers: Synchronization stuff: */
    67     void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const;
    6865
    6966public:
     
    282279    void cannotStartMachine(const CConsole &console, const QString &strName) const;
    283280    void cannotStartMachine(const CProgress &progress, const QString &strName) const;
    284     void cannotSendACPIToMachine() const;
    285281    bool confirmInputCapture(bool &fAutoConfirmed) const;
    286     void remindAboutAutoCapture() const;
    287     void remindAboutMouseIntegration(bool fSupportsAbsolute) const;
    288     void remindAboutPausedVMInput() const;
    289282    bool confirmGoingFullscreen(const QString &strHotKey) const;
    290283    bool confirmGoingSeamless(const QString &strHotKey) const;
     
    358351    static QString formatErrorInfo(const COMResult &rc);
    359352
    360     /* API: Async stuff: */
    361     void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const;
    362 
    363353public slots:
    364354
     
    379369                           const QString &strAutoConfirmId) const;
    380370
    381     /* Handlers: Synchronization stuff: */
    382     void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP) const;
    383 
    384371private:
    385372
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp

    r47493 r47510  
    173173                                  bool fProposeAutoConfirmation)
    174174{
     175    /* Make sure parent is set! */
     176    AssertMsg(pParent, ("Parent is NULL!"));
     177    if (!pParent)
     178        return;
     179
    175180    /* Make sure at least one button is valid: */
    176181    if (iButton1 == 0 && iButton2 == 0)
     
    196201    }
    197202
    198     /* Make sure parent is set! */
    199     AssertMsg(pParent, ("Parent is NULL!"));
    200     if (!pParent)
    201         return;
    202 
    203203    /* Looking for the corresponding popup-stack: */
    204204    const QString strPopupStackID(popupStackID(pParent));
     
    442442void UIPopupCenter::cannotSendACPIToMachine(QWidget *pParent)
    443443{
    444     alert(pParent,  "cannotSendACPIToMachine",
     444    alert(pParent, "cannotSendACPIToMachine",
    445445          QApplication::translate("UIMessageCenter", "You are trying to shut down the guest with the ACPI power button. "
    446446                                                     "This is currently not possible because the guest does not support software shutdown."));
     
    504504}
    505505
    506 void UIPopupCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent)
    507 {
    508     alert(pParent, "remindAboutGuestAdditionsAreNotActive",
    509           QApplication::translate("UIMessageCenter", "<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
    510                                                      "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
    511                                                      "please install the Guest Additions if they are not installed, or re-install them if they are "
    512                                                      "not working correctly, by selecting <b>Install Guest Additions</b> from the <b>Devices</b> menu. "
    513                                                      "If they are installed but the machine is not yet fully started then shared folders will be available once it is.</p>"),
    514           true);
    515 }
    516 
    517 void UIPopupCenter::updatePopupAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP)
     506void UIPopupCenter::remindAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP)
    518507{
    519508    alert(pParent, "remindAboutWrongColorDepth",
     
    530519}
    531520
    532 void UIPopupCenter::recallPopupAboutWrongColorDepth(QWidget *pParent)
     521void UIPopupCenter::forgetAboutWrongColorDepth(QWidget *pParent)
    533522{
    534523    recall(pParent, "remindAboutWrongColorDepth");
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h

    r47493 r47510  
    104104    void remindAboutMouseIntegration(QWidget *pParent, bool fSupportsAbsolute);
    105105    void remindAboutPausedVMInput(QWidget *pParent);
    106     void remindAboutGuestAdditionsAreNotActive(QWidget *pParent);
    107     void updatePopupAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP);
    108     void recallPopupAboutWrongColorDepth(QWidget *pParent);
     106    void remindAboutWrongColorDepth(QWidget *pParent, ulong uRealBPP, ulong uWantedBPP);
     107    void forgetAboutWrongColorDepth(QWidget *pParent);
    109108
    110109private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.cpp

    r47372 r47510  
    141141    /* Remind if requested: */
    142142    if (bRemind)
    143         popupCenter().updatePopupAboutWrongColorDepth(m_pMachineView->machineWindow(),
     143        popupCenter().remindAboutWrongColorDepth(m_pMachineView->machineWindow(),
    144144                                                      pEvent->bitsPerPixel(), 32);
    145145    else
    146         popupCenter().recallPopupAboutWrongColorDepth(m_pMachineView->machineWindow());
     146        popupCenter().forgetAboutWrongColorDepth(m_pMachineView->machineWindow());
    147147}
    148148
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.cpp

    r47210 r47510  
    211211
    212212    if (remind)
    213         popupCenter().updatePopupAboutWrongColorDepth(m_pMachineView->machineWindow(),
     213        popupCenter().remindAboutWrongColorDepth(m_pMachineView->machineWindow(),
    214214                                                      aEvent->bitsPerPixel(), 32);
    215215    else
    216         popupCenter().recallPopupAboutWrongColorDepth(m_pMachineView->machineWindow());
     216        popupCenter().forgetAboutWrongColorDepth(m_pMachineView->machineWindow());
    217217}
    218218
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