VirtualBox

Ignore:
Timestamp:
Nov 20, 2007 4:59:20 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: Fixed inpit captire canceling on Linux hosts.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r5803 r5804  
    254254                             const QString &aResult);
    255255
    256     bool confirmInputCapture();
     256    bool confirmInputCapture (bool *aAutoConfirmed = NULL);
    257257    void remindAboutAutoCapture();
    258258    void remindAboutMouseIntegration (bool aSupportsAbsolute);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r5803 r5804  
    19611961//                captureMouse (true);
    19621962        }
     1963
     1964        /* reset the single-time disable capture flag */
     1965        if (mDisableAutoCapture)
     1966            mDisableAutoCapture = false;
    19631967    }
    19641968    else
     
    22312235                             * dialog result itself */
    22322236                            mDisableAutoCapture = true;
    2233                             ok = vboxProblem().confirmInputCapture();
    2234                             mDisableAutoCapture = false;
     2237                            bool autoConfirmed = false;
     2238                            ok = vboxProblem().confirmInputCapture (&autoConfirmed);
     2239                            if (autoConfirmed)
     2240                                mDisableAutoCapture = false;
     2241                            /* otherwise, the disable flag will be reset in
     2242                             * the next console view's foucs in event (since
     2243                             * may happen asynchronously on some platforms,
     2244                             * after we return from this code) */
    22352245                        }
     2246
    22362247                        if (ok)
    22372248                        {
     
    25722583                     * dialog result itself */
    25732584                    mDisableAutoCapture = true;
    2574                     bool ok = vboxProblem().confirmInputCapture();
    2575                     mDisableAutoCapture = false;
     2585                    bool autoConfirmed = false;
     2586                    bool ok = vboxProblem().confirmInputCapture (&autoConfirmed);
     2587                    if (autoConfirmed)
     2588                        mDisableAutoCapture = false;
     2589                    /* otherwise, the disable flag will be reset in
     2590                     * the next console view's foucs in event (since
     2591                     * may happen asynchronously on some platforms,
     2592                     * after we return from this code) */
     2593
    25762594                    if (ok)
    25772595                    {
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r5803 r5804  
    14471447/**
    14481448 *  @return @c true if the user has confirmed input capture (this is always
    1449  *  the case if the dialog was autoconfirmed).
     1449 *  the case if the dialog was autoconfirmed). @a aAutoConfirmed, when not
     1450 *  NULL, will receive @c true if the dialog wasn't actually shown.
    14501451 */
    1451 bool VBoxProblemReporter::confirmInputCapture()
    1452 {
    1453     return messageOkCancel (&vboxGlobal().consoleWnd(), Info,
     1452bool VBoxProblemReporter::confirmInputCapture (bool *aAutoConfirmed /* = NULL */)
     1453{
     1454    int rc = message (&vboxGlobal().consoleWnd(), Info,
    14541455        tr ("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display "
    14551456            "or pressed the <b>host key</b>. This will cause the Virtual Machine to "
     
    14711472            .arg (QIHotKeyEdit::keyName (vboxGlobal().settings().hostKey())),
    14721473        "confirmInputCapture",
     1474        QIMessageBox::Ok | QIMessageBox::Default,
     1475        QIMessageBox::Cancel | QIMessageBox::Escape,
     1476        0,
    14731477        tr ("Capture", "do input capture"));
     1478
     1479    if (aAutoConfirmed)
     1480        *aAutoConfirmed = (rc & AutoConfirmed);
     1481
     1482    return (rc & QIMessageBox::ButtonMask) == QIMessageBox::Ok;
    14741483}
    14751484
     
    15751584bool VBoxProblemReporter::remindAboutInaccessibleMedia()
    15761585{
    1577     int rc = message (
    1578         &vboxGlobal().selectorWnd(),
    1579         Warning,
     1586    int rc = message (&vboxGlobal().selectorWnd(), Warning,
    15801587        tr ("<p>One or more of the registered virtual hard disks, CD/DVD or "
    15811588            "floppy media are not currently accessible. As a result, you will "
    15821589            "not be able to operate virtual machines that use these media until "
    15831590            "they become accessible later.</p>"
    1584             "<p>Press <b>OK</b> to open the Virtual Disk Manager window and "
     1591            "<p>Press <b>Check</b> to open the Virtual Disk Manager window and "
    15851592            "see what media are inaccessible, or press <b>Ignore</b> to "
    15861593            "ignore this message.</p>"),
    15871594        "remindAboutInaccessibleMedia",
    15881595        QIMessageBox::Ok | QIMessageBox::Default,
    1589         QIMessageBox::Ignore | QIMessageBox::Escape
    1590     );
    1591 
    1592     return rc == QIMessageBox::Ok && !(rc & AutoConfirmed);
     1596        QIMessageBox::Ignore | QIMessageBox::Escape,
     1597        0,
     1598        tr ("Check", "inaccessible media message box"));
     1599
     1600    return rc == QIMessageBox::Ok; /* implies !AutoConfirmed */
    15931601}
    15941602
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