Changeset 15610 in vbox for trunk/src/VBox
- Timestamp:
- Dec 16, 2008 10:01:58 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r15304 r15610 1051 1051 1052 1052 #ifdef VBOX_GUI_WITH_SYSTRAY 1053 bool mIsTrayMenu; /* Tray icon active/desired? */ 1053 bool mIsTrayMenu : 1; /*< Tray icon active/desired? */ 1054 bool mIncreasedWindowCounter : 1; 1054 1055 #endif 1056 1055 1057 QThread *mMediaEnumThread; 1056 1058 VBoxMediaList mMediaList; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r15586 r15610 1256 1256 #ifdef VBOX_GUI_WITH_SYSTRAY 1257 1257 , mIsTrayMenu (false) 1258 , mIncreasedWindowCounter (false) 1258 1259 #endif 1259 1260 , mMediaEnumThread (NULL) … … 5305 5306 } 5306 5307 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 5307 5333 #ifdef VBOX_GUI_WITH_SYSTRAY 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)); 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 } 5313 5343 #endif 5314 5344 … … 5467 5497 qApp->installEventFilter (this); 5468 5498 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 5487 5499 /* process command line */ 5488 5500 … … 5601 5613 } 5602 5614 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 5603 5635 if (!callback.isNull()) 5604 5636 { … … 5625 5657 if (mSelectorWnd) 5626 5658 delete mSelectorWnd; 5627 5628 #ifdef VBOX_GUI_WITH_SYSTRAY5629 /* 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 #endif5639 5659 5640 5660 /* ensure CGuestOSType objects are no longer used */ -
trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp
r15474 r15610 346 346 break; 347 347 348 /* Note: the settings conversion check must be done before349 * anything else that can unconditionally overwrite settings files350 * int he new format (like the license thingy below) */351 if (!vboxGlobal().checkForAutoConvertedSettings())352 break;353 354 348 #ifndef VBOX_OSE 355 349 #ifdef Q_WS_X11
Note:
See TracChangeset
for help on using the changeset viewer.