VirtualBox

Changeset 7188 in vbox


Ignore:
Timestamp:
Feb 27, 2008 7:08:51 PM (17 years ago)
Author:
vboxsync
Message:

Save size and max state of Information Dialog at dialog closing.

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

Legend:

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

    r6645 r7188  
    167167    static const char* GUI_RegistrationData;
    168168    static const char* GUI_LastVMSelected;
     169    static const char* GUI_InfoDlgState;
    169170};
    170171
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp

    r5999 r7188  
    3535const char* VBoxDefs::GUI_RegistrationData = "GUI/RegistrationData";
    3636const char* VBoxDefs::GUI_LastVMSelected = "GUI/LastVMSelected";
     37const char* VBoxDefs::GUI_InfoDlgState = "GUI/InfoDlgState";
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMInformationDlg.ui

    r6719 r7188  
    137137    <variable access="private">QTimer mStatTimer;</variable>
    138138    <variable access="private">VBoxConsoleView *mConsole;</variable>
     139    <variable access="private">int mWidth;</variable>
     140    <variable access="private">int mHeight;</variable>
     141    <variable access="private">bool mMax;</variable>
    139142</variables>
    140143<slots>
     
    156159    <function access="protected">resizeEvent( QResizeEvent* )</function>
    157160    <function returnType="QString" access="pritave">parseStatistics( const QString &amp; )</function>
    158     <function access="pritave">refreshStatistics()</function>
     161    <function access="private">refreshStatistics()</function>
    159162    <function returnType="QString" access="pritave">formatHardDisk( const QString &amp;, CEnums::DiskControllerType, LONG, int, int )</function>
    160163    <function returnType="QString" access="pritave">formatAdapter( const QString &amp;, ULONG, int, int )</function>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMInformationDlg.ui.h

    r6986 r7188  
    104104    languageChangeImp();
    105105
    106     /* make initial resize */
    107     resize (500, 450);
    108 
    109106    /* show statistics page and make it focused */
    110107    connect (mInfoStack, SIGNAL (currentChanged (QWidget*)),
     
    116113void VBoxVMInformationDlg::destroy()
    117114{
     115    /* save dialog attributes for this vm */
     116    QString dlgsize ("%1,%2,%3");
     117    mSession.GetMachine().SetExtraData (VBoxDefs::GUI_InfoDlgState,
     118        dlgsize.arg (mWidth).arg (mHeight).arg (isMaximized() ? "max" : "normal"));
     119
    118120    if (!mSession.isNull() && !mSession.GetMachine().isNull())
    119121        mSelfArray.erase (mSession.GetMachine().GetName());
     
    148150    connect (&mStatTimer, SIGNAL (timeout()), this, SLOT (processStatistics()));
    149151    connect (mConsole, SIGNAL (resizeHintDone()), this, SLOT (processStatistics()));
     152
     153    /* preload dialog attributes for this vm */
     154    QString dlgsize = mSession.GetMachine().GetExtraData (VBoxDefs::GUI_InfoDlgState);
     155    if (dlgsize.isNull())
     156    {
     157        mWidth = 400;
     158        mHeight = 450;
     159        mMax = false;
     160    }
     161    else
     162    {
     163        QStringList list = QStringList::split (',', dlgsize);
     164        mWidth = list [0].toInt(), mHeight = list [1].toInt();
     165        mMax = list [2] == "max";
     166    }
    150167}
    151168
     
    315332    mIsPolished = true;
    316333
     334    /* load window size and state */
     335    resize (mWidth, mHeight);
     336    if (mMax)
     337        QTimer::singleShot (0, this, SLOT (showMaximized()));
     338
    317339    VBoxGlobal::centerWidget (this, parentWidget());
    318340}
     
    325347                     QPoint (mSizeGrip->rect().width() - 1,
    326348                     mSizeGrip->rect().height() - 1));
     349
     350    /* store dialog size for this vm */
     351    if (mIsPolished && !isMaximized())
     352    {
     353        mWidth = width();
     354        mHeight = height();
     355    }
    327356}
    328357
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