VirtualBox

Changeset 5996 in vbox for trunk/src


Ignore:
Timestamp:
Dec 7, 2007 12:40:30 PM (17 years ago)
Author:
vboxsync
Message:

2551: VM Console window jumps to a saved location upon VM startup: fixed.

File:
1 edited

Legend:

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

    r5923 r5996  
    655655    CMachine cmachine = csession.GetMachine();
    656656
    657     show();
    658 
    659657    /* restore the position of the window and some options */
    660658    {
    661         QString str = cmachine.GetExtraData (VBoxDefs::GUI_Fullscreen);
    662         if (str == "on")
    663             vmFullscreenAction->setOn (true);
    664 
    665         vmSeamlessAction->setEnabled (false);
    666         str = cmachine.GetExtraData (VBoxDefs::GUI_Seamless);
    667         if (str == "on")
    668             vmSeamlessAction->setOn (true);
    669 
    670         str = cmachine.GetExtraData (VBoxDefs::GUI_AutoresizeGuest);
    671         if (str != "off")
    672             vmAutoresizeGuestAction->setOn (true);
    673 
    674         str = cmachine.GetExtraData (VBoxDefs::GUI_FirstRun);
    675         if (str == "yes")
    676             mIsFirstTimeStarted = true;
    677         else if (!str.isEmpty())
    678             cmachine.SetExtraData (VBoxDefs::GUI_FirstRun, QString::null);
    679 
    680         str = cmachine.GetExtraData (VBoxDefs::GUI_SaveMountedAtRuntime);
    681         if (str == "no")
    682             mIsAutoSaveMedia = false;
    683 
    684         str = cmachine.GetExtraData (VBoxDefs::GUI_LastWindowPosition);
     659        QString str = cmachine.GetExtraData (VBoxDefs::GUI_LastWindowPosition);
    685660
    686661        QRect ar = QApplication::desktop()->availableGeometry (this);
     
    700675            normal_pos = QPoint (x, y);
    701676            normal_size = QSize (w, h);
    702             if (!mIsFullscreen && !vmSeamlessAction->isOn())
    703             {
    704                 move (normal_pos);
    705                 resize (normal_size);
    706                 /* normalize to the optimal size */
    707                 console->normalizeGeometry (true /* adjustPosition */);
    708                 /* maximize if needed */
    709                 if (max)
    710                     setWindowState (windowState() | WindowMaximized);
    711             }
    712             else
    713                 was_max = max;
     677
     678            move (normal_pos);
     679            resize (normal_size);
    714680        }
    715681        else
     
    717683            normal_pos = QPoint();
    718684            normal_size = QSize();
    719             if (!mIsFullscreen && !vmSeamlessAction->isOn())
    720             {
    721                 console->normalizeGeometry (true /* adjustPosition */);
    722                 /* maximize if needed */
    723                 if (max)
    724                     setWindowState (windowState() | WindowMaximized);
    725             }
    726             else
    727                 was_max = max;
    728         }
     685        }
     686        /* normalize to the optimal size */
     687        console->normalizeGeometry (true /* adjustPosition */);
     688        /* maximize if needed */
     689        if (max)
     690            setWindowState (windowState() | WindowMaximized);
     691        was_max = max;
     692
     693        show();
     694
     695        str = cmachine.GetExtraData (VBoxDefs::GUI_Fullscreen);
     696        if (str == "on")
     697            vmFullscreenAction->setOn (true);
     698
     699        vmSeamlessAction->setEnabled (false);
     700        str = cmachine.GetExtraData (VBoxDefs::GUI_Seamless);
     701        if (str == "on")
     702            vmSeamlessAction->setOn (true);
     703
     704        str = cmachine.GetExtraData (VBoxDefs::GUI_AutoresizeGuest);
     705        if (str != "off")
     706            vmAutoresizeGuestAction->setOn (true);
     707
     708        str = cmachine.GetExtraData (VBoxDefs::GUI_FirstRun);
     709        if (str == "yes")
     710            mIsFirstTimeStarted = true;
     711        else if (!str.isEmpty())
     712            cmachine.SetExtraData (VBoxDefs::GUI_FirstRun, QString::null);
     713
     714        str = cmachine.GetExtraData (VBoxDefs::GUI_SaveMountedAtRuntime);
     715        if (str == "no")
     716            mIsAutoSaveMedia = false;
    729717    }
    730718
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