VirtualBox

Changeset 2764 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2007 12:57:33 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Fixed spelling; added proper console window restriction for SDL mode when no guest additions are active or when the auto-resize feature is turned off.

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

Legend:

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

    r2753 r2764  
    181181private:
    182182
     183    void maybeRestrictMinimumSize();
     184
    183185    VBoxConsoleWnd *mainwnd;
    184186
     
    209211    bool mAutoresizeGuest : 1;
    210212
    211     bool mIsAdditionsActive;
     213    bool mIsAdditionsActive : 1;
    212214
    213215    bool mfNumLock : 1;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r2736 r2764  
    273273    QPoint normal_pos;
    274274    QSize normal_size;
     275    QSize prev_min_size;
    275276
    276277    // variables for dealing with true fullscreen
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r2736 r2764  
    144144    bool confirmDiscardSavedState (const CMachine &machine);
    145145
     146    bool confirmReleaseImage (QWidget *parent, const QString &usage);
     147
    146148    void sayCannotOverwriteHardDiskImage (QWidget *parent, const QString &src);
    147149    int confirmHardDiskImageDeletion (QWidget *parent, const QString &src);
     
    198200                                   const QString &, const QString &);
    199201
    200     bool confirmReleaseImage (QWidget*, QString);
    201 
    202     void warnAboutOldAdditions (QWidget*, const QString &);
    203     void warnAboutNewAdditions (QWidget*, const QString &);
     202    void warnAboutTooOldAdditions (QWidget *, const QString &, const QString &);
     203    void warnAboutOldAdditions (QWidget *, const QString &, const QString &);
     204    void warnAboutNewAdditions (QWidget *, const QString &, const QString &);
    204205
    205206    bool remindAboutInputCapture();
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r2736 r2764  
    774774        mAutoresizeGuest = on;
    775775
    776         if (mode == VBoxDefs::SDLMode)
    777         {
    778             /* restrict minimum size because we cannot correctly draw
    779              * in a scrolled window using SDL */
    780             if (!mAutoresizeGuest)
    781                 setMinimumSize (sizeHint());
    782             else
    783                 setMinimumSize (0, 0);
    784         }
     776        maybeRestrictMinimumSize();
    785777
    786778        if (mIsAdditionsActive && mAutoresizeGuest)
     
    795787void VBoxConsoleView::onFullscreenChange (bool /* on */)
    796788{
    797     /// @todo (r=dmik) not currently sure is this method necessary to
    798     //  fix fullscreen toggle problems (invalid areas) on Linux/SDL
    799 //    if (fb)
    800 //    {
    801 //        VBoxResizeEvent e (fb->pixelFormat(), fb->address(), fb->colorDepth(),
    802 //                           fb->width(), fb->height());
    803 //        fb->resizeEvent (&e);
    804 //    }
     789    /* Nothing to do here so far */
    805790}
    806791
     
    843828                setMaximumSize (sizeHint());
    844829
    845                 if (mode == VBoxDefs::SDLMode)
    846                 {
    847                     /* restrict minimum size because we cannot correctly draw
    848                      * in a scrolled window using SDL */
    849                     if (!mAutoresizeGuest)
    850                         setMinimumSize (sizeHint());
    851                     else
    852                         setMinimumSize (0, 0);
    853                 }
     830                maybeRestrictMinimumSize();
    854831
    855832                /* resize the guest canvas */
     
    937914                GuestAdditionsEvent *ge = (GuestAdditionsEvent *) e;
    938915                LogFlowFunc (("AdditionsStateChangeEventType\n"));
     916
    939917                mIsAdditionsActive = ge->additionActive();
     918
     919                maybeRestrictMinimumSize();
     920
    940921                emit additionsStateChanged (ge->additionVersion(), ge->additionActive());
    941922                return true;
     
    17001681
    17011682/**
    1702  *  Called on every exit from fullscreen and maximized mode.
     1683 *  Called on exit from fullscreen or from maximized mode.
    17031684 */
    17041685void VBoxConsoleView::exitFullScreen()
     
    17071688    {
    17081689        doResizeHint();
     1690        /* Fire a normalize event with some delay to let the guest process the
     1691         * resize hint and send resize properly, instead of normalizing to the
     1692         * current guest size right now. */
    17091693        QTimer::singleShot (200, this, SLOT (normalizeGeo()));
    17101694    }
     
    17131697        normalizeGeo();
    17141698    }
     1699
    17151700    ignore_mainwnd_resize = false;
    17161701}
     
    28882873}
    28892874
     2875/**
     2876 *  Sets the the minimum size restriction depending on the auto-resize feature
     2877 *  state and the current rendering mode.
     2878 *
     2879 *  Currently, the restriction is set only in SDL mode and only when the
     2880 *  auto-resize feature is inactive. We need to do that because we cannot
     2881 *  correctly draw in a scrolled window in SDL mode.
     2882 *
     2883 *  In all other modes, or when auto-resize is in force, this function does
     2884 *  nothing.
     2885 */
     2886void VBoxConsoleView::maybeRestrictMinimumSize()
     2887{
     2888    if (mode == VBoxDefs::SDLMode)
     2889    {
     2890        if (!mIsAdditionsActive || !mAutoresizeGuest)
     2891            setMinimumSize (sizeHint());
     2892        else
     2893            setMinimumSize (0, 0);
     2894    }
     2895}
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r2736 r2764  
    17101710    bool wasHidden = isHidden();
    17111711
    1712     static QSize prevMinimumSize;
    17131712    if (on)
    17141713    {
    1715         /* Save previous scroll-view minimum size before entering fullscreen
    1716          * state to make return to this minimum size before the exiting
    1717          * fullscreen. Required for correct scroll-view update in SDL mode. */
    1718         prevMinimumSize = console->minimumSize();
     1714        /* Save the previous scroll-view minimum size before entering
     1715         * fullscreen state to restore this minimum size before the exiting
     1716         * fullscreen. Required for correct scroll-view and guest display
     1717         * update in SDL mode. */
     1718        prev_min_size = console->minimumSize();
    17191719        console->setMinimumSize (0, 0);
    17201720
     
    17661766    else
    17671767    {
    1768         /* Returns to previous scroll-view minimum size before the exiting
    1769          * fullscreen. Required for correct scroll-view update in SDL mode. */
    1770         console->setMinimumSize (prevMinimumSize);
     1768        /* Restore the previous scroll-view minimum size before the exiting
     1769         * fullscreen. Required for correct scroll-view and guest display
     1770         * update in SDL mode. */
     1771        console->setMinimumSize (prev_min_size);
    17711772
    17721773        /* hide early to avoid extra flicker */
     
    25152516    vmAutoresizeGuestAction->setEnabled (aActive);
    25162517
    2517     /* Checking for the Guest Additions version to warn user about possible
    2518      * compatibility issues in case of installed version is outdated. */
     2518    /* Check the Guest Additions version and warn the user about possible
     2519     * compatibility issues in case if the installed version is outdated. */
    25192520    uint version = aVersion.toUInt();
    2520     QString fullVersion = QString ("%1.%2")
     2521    QString verisonStr = QString ("%1.%2")
    25212522        .arg (RT_HIWORD (version)).arg (RT_LOWORD (version));
    2522 
    2523     if (RT_HIWORD (version) < RT_HIWORD (VMMDEV_VERSION))
    2524         vboxProblem().warnAboutOldAdditions (this, fullVersion);
    2525     else if (RT_HIWORD (version) == RT_HIWORD (VMMDEV_VERSION) &&
    2526              RT_LOWORD (version) <  RT_LOWORD (VMMDEV_VERSION))
    2527         vboxProblem().warnAboutNewAdditions (this, fullVersion);
     2523    QString expectedStr = QString ("%1.%2")
     2524        .arg (VMMDEV_VERSION_MAJOR).arg (VMMDEV_VERSION_MINOR);
     2525
     2526    if (RT_HIWORD (version) < VMMDEV_VERSION_MAJOR)
     2527    {
     2528        vboxProblem().warnAboutTooOldAdditions (this, verisonStr, expectedStr);
     2529    }
     2530    else if (RT_HIWORD (version) == VMMDEV_VERSION_MAJOR &&
     2531             RT_LOWORD (version) <  VMMDEV_VERSION_MINOR)
     2532    {
     2533        vboxProblem().warnAboutOldAdditions (this, verisonStr, expectedStr);
     2534    }
     2535    else if (version > VMMDEV_VERSION)
     2536    {
     2537        vboxProblem().warnAboutNewAdditions (this, verisonStr, expectedStr);
     2538    }
    25282539}
    25292540
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r2736 r2764  
    884884}
    885885
    886 bool VBoxProblemReporter::confirmReleaseImage (QWidget* parent, QString usage)
     886bool VBoxProblemReporter::confirmReleaseImage (QWidget *parent,
     887                                               const QString &usage)
    887888{
    888889    return messageYesNo (
     
    10971098}
    10981099
    1099 void VBoxProblemReporter::warnAboutOldAdditions (QWidget *aParent,
    1100                                                  const QString &aVersion)
    1101 {
    1102     message (aParent, VBoxProblemReporter::Warning,
    1103         tr ("<p>Your Guest Additions are outdated (current version: %1).</p>"
    1104             "<p>You must update to the latest version by choosing Devices "
    1105             "- Install Guest Additions.</p>").arg (aVersion));
    1106 }
    1107 
    1108 void VBoxProblemReporter::warnAboutNewAdditions (QWidget *aParent,
    1109                                                  const QString &aVersion)
    1110 {
    1111     message (aParent, VBoxProblemReporter::Warning,
    1112         tr ("<p>Your Guest Additions are outdated (current version: %1).</p>"
    1113             "<p>There is a newer Guest Additions version. You should update "
    1114             "to the latest version by choosing Devices "
    1115             "- Install Guest Additions.</p>").arg (aVersion));
    1116 }
    1117 
    11181100#if defined Q_WS_WIN
    11191101
     
    12541236                 .arg (aConsole.GetMachine().GetName()),
    12551237             formatErrorInfo (res));
     1238}
     1239
     1240void VBoxProblemReporter::warnAboutTooOldAdditions (QWidget *aParent,
     1241                                                    const QString &aInstalledVer,
     1242                                                    const QString &aExpectedVer)
     1243{
     1244    message (aParent, VBoxProblemReporter::Error,
     1245        tr ("<p>VirtualBox Guest Additions installed in the Guest OS are too "
     1246            "old: the installed version is %1, the expected version is %2. "
     1247            "Some features that require Guest Additions (mouse integration, "
     1248            "guest dislpay auto-resize) will most likely stop "
     1249            "working properly.</p>"
     1250            "<p>Please update Guest Additions to a newer version by choosing "
     1251            "<b>Devices</b> - <b>Install Guest Additions</b> from the "
     1252            "main menu.</p>")
     1253             .arg (aInstalledVer).arg (aExpectedVer),
     1254        "warnAboutTooOldAdditions");
     1255}
     1256
     1257void VBoxProblemReporter::warnAboutOldAdditions (QWidget *aParent,
     1258                                                 const QString &aInstalledVer,
     1259                                                 const QString &aExpectedVer)
     1260{
     1261    message (aParent, VBoxProblemReporter::Warning,
     1262        tr ("<p>VirtualBox Guest Additions installed in the Guest OS are "
     1263            "outdated: the installed version is %1, the expected version is %2. "
     1264            "Some features that require Guest Additions (mouse integration, "
     1265            "guest dislpay auto-resize) may not work as expected.</p>"
     1266            "<p>It is recommended to update Guest Additions to a newer version by "
     1267            "choosing <b>Devices</b> - <b>Install Guest Additions</b> from the "
     1268            "main menu.</p>")
     1269             .arg (aInstalledVer).arg (aExpectedVer),
     1270        "warnAboutOldAdditions");
     1271}
     1272
     1273void VBoxProblemReporter::warnAboutNewAdditions (QWidget *aParent,
     1274                                                 const QString &aInstalledVer,
     1275                                                 const QString &aExpectedVer)
     1276{
     1277    message (aParent, VBoxProblemReporter::Error,
     1278        tr ("<p>VirtualBox Guest Additions installed in the Guest OS are "
     1279            "too new: the installed version is %1, the expected version is %2.</p>"
     1280            "<p>Using a newer version of Additions with an older version of "
     1281            "VirtualBox is not supported. Please update Guest Additions to a suitable "
     1282            "version by choosing <b>Devices</b> - <b>Install Guest Additions</b> "
     1283            "from the main menu.</p>")
     1284             .arg (aInstalledVer).arg (aExpectedVer),
     1285        "warnAboutNewAdditions");
    12561286}
    12571287
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