VirtualBox

Changeset 15622 in vbox


Ignore:
Timestamp:
Dec 17, 2008 8:36:39 AM (16 years ago)
Author:
vboxsync
Message:

backed out 41122, not authorized

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r15610 r15622  
    10511051
    10521052#ifdef VBOX_GUI_WITH_SYSTRAY
    1053     bool mIsTrayMenu : 1; /*< Tray icon active/desired? */
    1054     bool mIncreasedWindowCounter : 1;
     1053    bool mIsTrayMenu;           /* Tray icon active/desired? */
    10551054#endif
    1056 
    10571055    QThread *mMediaEnumThread;
    10581056    VBoxMediaList mMediaList;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r15621 r15622  
    12561256#ifdef VBOX_GUI_WITH_SYSTRAY
    12571257    , mIsTrayMenu (false)
    1258     , mIncreasedWindowCounter (false)
    12591258#endif
    12601259    , mMediaEnumThread (NULL)
     
    53065305    }
    53075306
    5308     /* create default non-null global settings */
    5309     gset = VBoxGlobalSettings (false);
    5310 
    5311     /* try to load global settings */
    5312     gset.load (mVBox);
    5313     if (!mVBox.isOk() || !gset)
    5314     {
    5315         vboxProblem().cannotLoadGlobalConfig (mVBox, gset.lastError());
    5316         return;
    5317     }
    5318 
    5319     /* Load the customized language as early as possible to get possible error
    5320      * messages translated */
    5321     QString languageId = gset.languageId();
    5322     if (!languageId.isNull())
    5323         loadLanguage (languageId);
    5324 
    5325     retranslateUi();
    5326 
    5327     /* Note: the settings conversion check must be done before anything else
    5328      * that may unconditionally overwrite settings files in the new format (like
    5329      * SetExtraData()). But after loading the proper the language. */
    5330     if (!checkForAutoConvertedSettings())
    5331         return;
    5332 
    53335307#ifdef VBOX_GUI_WITH_SYSTRAY
    5334     {
    5335         /* Increase open Fe/Qt4 windows reference count. */
    5336         int c = mVBox.GetExtraData (VBoxDefs::GUI_MainWindowCount).toInt() + 1;
    5337         AssertMsgReturnVoid ((c >= 0) || (mVBox.isOk()),
    5338             ("Something went wrong with the window reference count!"));
    5339         mVBox.SetExtraData (VBoxDefs::GUI_MainWindowCount, QString ("%1").arg (c));
    5340         mIncreasedWindowCounter = mVBox.isOk();
    5341         AssertReturnVoid (mIncreasedWindowCounter);
    5342     }
     5308    /* Increase open Fe/Qt4 windows reference count. */
     5309    int c = mVBox.GetExtraData (VBoxDefs::GUI_MainWindowCount).toInt() + 1;
     5310    AssertMsg ((c>=0) || (mVBox.isOk()),
     5311        ("Something went wrong with the window reference count!"));
     5312    mVBox.SetExtraData (VBoxDefs::GUI_MainWindowCount, QString ("%1").arg (c));
    53435313#endif
    53445314
     
    54975467    qApp->installEventFilter (this);
    54985468
     5469    /* create default non-null global settings */
     5470    gset = VBoxGlobalSettings (false);
     5471
     5472    /* try to load global settings */
     5473    gset.load (mVBox);
     5474    if (!mVBox.isOk() || !gset)
     5475    {
     5476        vboxProblem().cannotLoadGlobalConfig (mVBox, gset.lastError());
     5477        return;
     5478    }
     5479
     5480    /* Load customized language if any */
     5481    QString languageId = gset.languageId();
     5482    if (!languageId.isNull())
     5483        loadLanguage (languageId);
     5484
     5485    retranslateUi();
     5486
    54995487    /* process command line */
    55005488
     
    56135601    }
    56145602
    5615 #ifdef VBOX_GUI_WITH_SYSTRAY
    5616     if (mIncreasedWindowCounter)
    5617     {
    5618         /* Decrease open Fe/Qt4 windows reference count. */
    5619         int c = mVBox.GetExtraData (VBoxDefs::GUI_MainWindowCount).toInt() - 1;
    5620         AssertMsg ((c >= 0) || (mVBox.isOk()),
    5621             ("Something went wrong with the window reference count!"));
    5622         if (c < 0)
    5623             c = 0;   /* Clean up the mess. */
    5624         mVBox.SetExtraData (VBoxDefs::GUI_MainWindowCount,
    5625                             (c > 0) ? QString ("%1").arg (c) : NULL);
    5626         AssertWrapperOk (mVBox);
    5627         if (c == 0)
    5628         {
    5629             mVBox.SetExtraData (VBoxDefs::GUI_TrayIconWinID, NULL);
    5630             AssertWrapperOk (mVBox);
    5631         }
    5632     }
    5633 #endif
    5634 
    56355603    if (!callback.isNull())
    56365604    {
     
    56575625    if (mSelectorWnd)
    56585626        delete mSelectorWnd;
     5627
     5628#ifdef VBOX_GUI_WITH_SYSTRAY
     5629    /* Decrease open Fe/Qt4 windows reference count. */
     5630    int c = mVBox.GetExtraData (VBoxDefs::GUI_MainWindowCount).toInt() - 1;
     5631    AssertMsg ((c>=0) || (mVBox.isOk()),
     5632        ("Something went wrong with the window reference count!"));
     5633    if (c < 0)
     5634        c = 0;   /* Clean up the mess. */
     5635    mVBox.SetExtraData (VBoxDefs::GUI_MainWindowCount, (c > 0) ? QString ("%1").arg (c) : NULL);
     5636    if (c == 0)
     5637        mVBox.SetExtraData (VBoxDefs::GUI_TrayIconWinID, NULL);
     5638#endif
    56595639
    56605640    /* ensure CGuestOSType objects are no longer used */
  • trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp

    r15610 r15622  
    346346                break;
    347347
     348            /* Note: the settings conversion check must be done before
     349             * anything else that can unconditionally overwrite settings files
     350             * int he new format (like the license thingy below) */
     351            if (!vboxGlobal().checkForAutoConvertedSettings())
     352                break;
     353
    348354#ifndef VBOX_OSE
    349355#ifdef Q_WS_X11
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