Changeset 15622 in vbox
- Timestamp:
- Dec 17, 2008 8:36:39 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r15610 r15622 1051 1051 1052 1052 #ifdef VBOX_GUI_WITH_SYSTRAY 1053 bool mIsTrayMenu : 1; /*< Tray icon active/desired? */ 1054 bool mIncreasedWindowCounter : 1; 1053 bool mIsTrayMenu; /* Tray icon active/desired? */ 1055 1054 #endif 1056 1057 1055 QThread *mMediaEnumThread; 1058 1056 VBoxMediaList mMediaList; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r15621 r15622 1256 1256 #ifdef VBOX_GUI_WITH_SYSTRAY 1257 1257 , mIsTrayMenu (false) 1258 , mIncreasedWindowCounter (false)1259 1258 #endif 1260 1259 , mMediaEnumThread (NULL) … … 5306 5305 } 5307 5306 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 error5320 * 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 else5328 * that may unconditionally overwrite settings files in the new format (like5329 * SetExtraData()). But after loading the proper the language. */5330 if (!checkForAutoConvertedSettings())5331 return;5332 5333 5307 #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)); 5343 5313 #endif 5344 5314 … … 5497 5467 qApp->installEventFilter (this); 5498 5468 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 5499 5487 /* process command line */ 5500 5488 … … 5613 5601 } 5614 5602 5615 #ifdef VBOX_GUI_WITH_SYSTRAY5616 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 #endif5634 5635 5603 if (!callback.isNull()) 5636 5604 { … … 5657 5625 if (mSelectorWnd) 5658 5626 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 5659 5639 5660 5640 /* ensure CGuestOSType objects are no longer used */ -
trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp
r15610 r15622 346 346 break; 347 347 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 348 354 #ifndef VBOX_OSE 349 355 #ifdef Q_WS_X11
Note:
See TracChangeset
for help on using the changeset viewer.