Changeset 15669 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Dec 18, 2008 6:54:07 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 41215
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r15622 r15669 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
r15622 r15669 1256 1256 #ifdef VBOX_GUI_WITH_SYSTRAY 1257 1257 , mIsTrayMenu (false) 1258 , mIncreasedWindowCounter (false) 1258 1259 #endif 1259 1260 , mMediaEnumThread (NULL) … … 2077 2078 static const char *sSectionHrefTpl = 2078 2079 "<tr><td width=22 rowspan=%1 align=left><img src='%2'></td>" 2079 "<td colspan= 2><b><a href='%3'><nobr>%4</nobr></a></b></td></tr>"2080 "<td colspan=3><b><a href='%3'><nobr>%4</nobr></a></b></td></tr>" 2080 2081 "%5" 2081 "<tr><td colspan= 2><font size=1> </font></td></tr>";2082 "<tr><td colspan=3><font size=1> </font></td></tr>"; 2082 2083 static const char *sSectionBoldTpl = 2083 2084 "<tr><td width=22 rowspan=%1 align=left><img src='%2'></td>" 2084 "<td colspan= 2><!-- %3 --><b><nobr>%4</nobr></b></td></tr>"2085 "<td colspan=3><!-- %3 --><b><nobr>%4</nobr></b></td></tr>" 2085 2086 "%5" 2086 "<tr><td colspan=2><font size=1> </font></td></tr>"; 2087 static const char *sSectionItemTpl = 2088 "<tr><td width=40%><nobr>%1</nobr></td><td>%2</td></tr>"; 2087 "<tr><td colspan=3><font size=1> </font></td></tr>"; 2088 static const char *sSectionItemTpl1 = 2089 "<tr><td width=40%><nobr><i>%1</i></nobr></td><td/><td/></tr>"; 2090 static const char *sSectionItemTpl2 = 2091 "<tr><td width=40%><nobr>%1:</nobr></td><td/><td>%2</td></tr>"; 2089 2092 2090 2093 static QString sGeneralBasicHrefTpl, sGeneralBasicBoldTpl; … … 2098 2101 2099 2102 QString generalItems 2100 = QString (sSectionItemTpl ).arg (tr ("Name", "details report"), "%1")2101 + QString (sSectionItemTpl ).arg (tr ("OS Type", "details report"), "%2")2102 + QString (sSectionItemTpl ).arg (tr ("Base Memory", "details report"),2103 tr ("<nobr>%3 MB</nobr>", "details report"));2103 = QString (sSectionItemTpl2).arg (tr ("Name", "details report"), "%1") 2104 + QString (sSectionItemTpl2).arg (tr ("OS Type", "details report"), "%2") 2105 + QString (sSectionItemTpl2).arg (tr ("Base Memory", "details report"), 2106 tr ("<nobr>%3 MB</nobr>", "details report")); 2104 2107 sGeneralBasicHrefTpl = QString (sSectionHrefTpl) 2105 2108 .arg (2 + 3) /* rows */ … … 2116 2119 2117 2120 generalItems 2118 += QString (sSectionItemTpl ).arg (tr ("Video Memory", "details report"),2119 tr ("<nobr>%4 MB</nobr>", "details report"))2120 + QString (sSectionItemTpl ).arg (tr ("Boot Order", "details report"), "%5")2121 + QString (sSectionItemTpl ).arg (tr ("ACPI", "details report"), "%6")2122 + QString (sSectionItemTpl ).arg (tr ("IO APIC", "details report"), "%7")2123 + QString (sSectionItemTpl ).arg (tr ("VT-x/AMD-V", "details report"), "%8")2124 + QString (sSectionItemTpl ).arg (tr ("PAE/NX", "details report"), "%9")2125 + QString (sSectionItemTpl ).arg (tr ("3D Acceleration", "details report"), "%10");2121 += QString (sSectionItemTpl2).arg (tr ("Video Memory", "details report"), 2122 tr ("<nobr>%4 MB</nobr>", "details report")) 2123 + QString (sSectionItemTpl2).arg (tr ("Boot Order", "details report"), "%5") 2124 + QString (sSectionItemTpl2).arg (tr ("ACPI", "details report"), "%6") 2125 + QString (sSectionItemTpl2).arg (tr ("IO APIC", "details report"), "%7") 2126 + QString (sSectionItemTpl2).arg (tr ("VT-x/AMD-V", "details report"), "%8") 2127 + QString (sSectionItemTpl2).arg (tr ("PAE/NX", "details report"), "%9") 2128 + QString (sSectionItemTpl2).arg (tr ("3D Acceleration", "details report"), "%10"); 2126 2129 2127 2130 sGeneralFullHrefTpl = QString (sSectionHrefTpl) … … 2162 2165 LONG channel = hda.GetChannel(); 2163 2166 LONG device = hda.GetDevice(); 2164 hardDisks += QString (sSectionItemTpl )2167 hardDisks += QString (sSectionItemTpl2) 2165 2168 .arg (toFullString (bus, channel, device)) 2166 2169 .arg (details (hd, aIsNewVM)); … … 2171 2174 if (hardDisks.isNull()) 2172 2175 { 2173 hardDisks = QString (sSectionItemTpl )2174 .arg (tr ("Not Attached", "details report (HDDs)")) .arg ("");2176 hardDisks = QString (sSectionItemTpl1) 2177 .arg (tr ("Not Attached", "details report (HDDs)")); 2175 2178 ++ rows; 2176 2179 } … … 2267 2270 /* DVD */ 2268 2271 CDVDDrive dvd = aMachine.GetDVDDrive(); 2269 item = QString (sSectionItemTpl);2270 2272 switch (dvd.GetState()) 2271 2273 { 2272 2274 case KDriveState_NotMounted: 2273 item = item.arg (tr ("Not mounted", "details report (DVD)"), ""); 2275 item = QString (sSectionItemTpl1) 2276 .arg (tr ("Not mounted", "details report (DVD)")); 2274 2277 break; 2275 2278 case KDriveState_ImageMounted: 2276 2279 { 2277 2280 CDVDImage2 img = dvd.GetImage(); 2278 item = item.arg (tr ("Image", "details report (DVD)"), 2279 locationForHTML (img.GetName())); 2281 item = QString (sSectionItemTpl2) 2282 .arg (tr ("Image", "details report (DVD)"), 2283 locationForHTML (img.GetName())); 2280 2284 break; 2281 2285 } … … 2288 2292 drvName : 2289 2293 QString ("%1 (%2)").arg (description, drvName); 2290 item = item.arg (tr ("Host Drive", "details report (DVD)"), 2291 fullName); 2294 item = QString (sSectionItemTpl2) 2295 .arg (tr ("Host Drive", "details report (DVD)"), 2296 fullName); 2292 2297 break; 2293 2298 } … … 2304 2309 /* Floppy */ 2305 2310 CFloppyDrive floppy = aMachine.GetFloppyDrive(); 2306 item = QString (sSectionItemTpl);2307 2311 switch (floppy.GetState()) 2308 2312 { 2309 2313 case KDriveState_NotMounted: 2310 item = item.arg (tr ("Not mounted", "details report (floppy)"), ""); 2314 item = QString (sSectionItemTpl1) 2315 .arg (tr ("Not mounted", "details report (floppy)")); 2311 2316 break; 2312 2317 case KDriveState_ImageMounted: 2313 2318 { 2314 2319 CFloppyImage2 img = floppy.GetImage(); 2315 item = item.arg (tr ("Image", "details report (floppy)"), 2316 locationForHTML (img.GetName())); 2320 item = QString (sSectionItemTpl2) 2321 .arg (tr ("Image", "details report (floppy)"), 2322 locationForHTML (img.GetName())); 2317 2323 break; 2318 2324 } … … 2325 2331 drvName : 2326 2332 QString ("%1 (%2)").arg (description, drvName); 2327 item = item.arg (tr ("Host Drive", "details report (floppy)"), 2328 fullName); 2333 item = QString (sSectionItemTpl2) 2334 .arg (tr ("Host Drive", "details report (floppy)"), 2335 fullName); 2329 2336 break; 2330 2337 } … … 2344 2351 int rows = audio.GetEnabled() ? 3 : 2; 2345 2352 if (audio.GetEnabled()) 2346 item = QString (sSectionItemTpl )2353 item = QString (sSectionItemTpl2) 2347 2354 .arg (tr ("Host Driver", "details report (audio)"), 2348 2355 toString (audio.GetAudioDriver())) + 2349 QString (sSectionItemTpl )2356 QString (sSectionItemTpl2) 2350 2357 .arg (tr ("Controller", "details report (audio)"), 2351 2358 toString (audio.GetAudioController())); 2352 2359 else 2353 item = QString (sSectionItemTpl )2354 .arg (tr ("Disabled", "details report (audio)") , "");2360 item = QString (sSectionItemTpl1) 2361 .arg (tr ("Disabled", "details report (audio)")); 2355 2362 2356 2363 detailsReport += sectionTpl … … 2386 2393 attType = attType.arg (vboxGlobal().toString (type)); 2387 2394 2388 item += QString (sSectionItemTpl )2395 item += QString (sSectionItemTpl2) 2389 2396 .arg (tr ("Adapter %1", "details report (network)") 2390 2397 .arg (adapter.GetSlot() + 1)) … … 2395 2402 if (item.isNull()) 2396 2403 { 2397 item = QString (sSectionItemTpl )2398 .arg (tr ("Disabled", "details report (network)") , "");2404 item = QString (sSectionItemTpl1) 2405 .arg (tr ("Disabled", "details report (network)")); 2399 2406 ++ rows; 2400 2407 } … … 2428 2435 data += toString (mode); 2429 2436 2430 item += QString (sSectionItemTpl )2437 item += QString (sSectionItemTpl2) 2431 2438 .arg (tr ("Port %1", "details report (serial ports)") 2432 2439 .arg (port.GetSlot() + 1)) … … 2437 2444 if (item.isNull()) 2438 2445 { 2439 item = QString (sSectionItemTpl )2440 .arg (tr ("Disabled", "details report (serial ports)") , "");2446 item = QString (sSectionItemTpl1) 2447 .arg (tr ("Disabled", "details report (serial ports)")); 2441 2448 ++ rows; 2442 2449 } … … 2464 2471 .arg (QDir::toNativeSeparators (port.GetPath())); 2465 2472 2466 item += QString (sSectionItemTpl )2473 item += QString (sSectionItemTpl2) 2467 2474 .arg (tr ("Port %1", "details report (parallel ports)") 2468 2475 .arg (port.GetSlot() + 1)) … … 2473 2480 if (item.isNull()) 2474 2481 { 2475 item = QString (sSectionItemTpl )2476 .arg (tr ("Disabled", "details report (parallel ports)") , "");2482 item = QString (sSectionItemTpl1) 2483 .arg (tr ("Disabled", "details report (parallel ports)")); 2477 2484 ++ rows; 2478 2485 } … … 2502 2509 active ++; 2503 2510 2504 item = QString (sSectionItemTpl )2511 item = QString (sSectionItemTpl2) 2505 2512 .arg (tr ("Device Filters", "details report (USB)"), 2506 2513 tr ("%1 (%2 active)", "details report (USB)") … … 2508 2515 } 2509 2516 else 2510 item = QString (sSectionItemTpl )2511 .arg (tr ("Disabled", "details report (USB)") , "");2517 item = QString (sSectionItemTpl1) 2518 .arg (tr ("Disabled", "details report (USB)")); 2512 2519 2513 2520 detailsReport += sectionTpl … … 2524 2531 if (count > 0) 2525 2532 { 2526 item = QString (sSectionItemTpl) 2527 .arg (tr ("Shared Folders", "details report (shared folders)"), 2528 tr ("%1", "details report (shadef folders)") 2529 .arg (count)); 2533 item = QString (sSectionItemTpl2) 2534 .arg (tr ("Shared Folders", "details report (shared folders)")) 2535 .arg (count); 2530 2536 } 2531 2537 else 2532 item = QString (sSectionItemTpl )2533 .arg (tr ("None", "details report (shared folders)") , "");2538 item = QString (sSectionItemTpl1) 2539 .arg (tr ("None", "details report (shared folders)")); 2534 2540 2535 2541 detailsReport += sectionTpl … … 2548 2554 2549 2555 if (srv.GetEnabled()) 2550 item = QString (sSectionItemTpl) 2551 .arg (tr ("VRDP Server Port", "details report (VRDP)"), 2552 tr ("%1", "details report (VRDP)") 2553 .arg (srv.GetPort())); 2556 item = QString (sSectionItemTpl2) 2557 .arg (tr ("VRDP Server Port", "details report (VRDP)")) 2558 .arg (srv.GetPort()); 2554 2559 else 2555 item = QString (sSectionItemTpl )2556 .arg (tr ("Disabled", "details report (VRDP)") , "");2560 item = QString (sSectionItemTpl1) 2561 .arg (tr ("Disabled", "details report (VRDP)")); 2557 2562 2558 2563 detailsReport += sectionTpl … … 5305 5310 } 5306 5311 5312 /* create default non-null global settings */ 5313 gset = VBoxGlobalSettings (false); 5314 5315 /* try to load global settings */ 5316 gset.load (mVBox); 5317 if (!mVBox.isOk() || !gset) 5318 { 5319 vboxProblem().cannotLoadGlobalConfig (mVBox, gset.lastError()); 5320 return; 5321 } 5322 5323 /* Load the customized language as early as possible to get possible error 5324 * messages translated */ 5325 QString languageId = gset.languageId(); 5326 if (!languageId.isNull()) 5327 loadLanguage (languageId); 5328 5329 retranslateUi(); 5330 5331 /* Note: the settings conversion check must be done before anything else 5332 * that may unconditionally overwrite settings files in the new format (like 5333 * SetExtraData()). But after loading the proper the language. */ 5334 if (!checkForAutoConvertedSettings()) 5335 return; 5336 5307 5337 #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)); 5338 { 5339 /* Increase open Fe/Qt4 windows reference count. */ 5340 int c = mVBox.GetExtraData (VBoxDefs::GUI_MainWindowCount).toInt() + 1; 5341 AssertMsgReturnVoid ((c >= 0) || (mVBox.isOk()), 5342 ("Something went wrong with the window reference count!")); 5343 mVBox.SetExtraData (VBoxDefs::GUI_MainWindowCount, QString ("%1").arg (c)); 5344 mIncreasedWindowCounter = mVBox.isOk(); 5345 AssertReturnVoid (mIncreasedWindowCounter); 5346 } 5313 5347 #endif 5314 5348 … … 5467 5501 qApp->installEventFilter (this); 5468 5502 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 5503 /* process command line */ 5488 5504 … … 5601 5617 } 5602 5618 5619 #ifdef VBOX_GUI_WITH_SYSTRAY 5620 if (mIncreasedWindowCounter) 5621 { 5622 /* Decrease open Fe/Qt4 windows reference count. */ 5623 int c = mVBox.GetExtraData (VBoxDefs::GUI_MainWindowCount).toInt() - 1; 5624 AssertMsg ((c >= 0) || (mVBox.isOk()), 5625 ("Something went wrong with the window reference count!")); 5626 if (c < 0) 5627 c = 0; /* Clean up the mess. */ 5628 mVBox.SetExtraData (VBoxDefs::GUI_MainWindowCount, 5629 (c > 0) ? QString ("%1").arg (c) : NULL); 5630 AssertWrapperOk (mVBox); 5631 if (c == 0) 5632 { 5633 mVBox.SetExtraData (VBoxDefs::GUI_TrayIconWinID, NULL); 5634 AssertWrapperOk (mVBox); 5635 } 5636 } 5637 #endif 5638 5603 5639 if (!callback.isNull()) 5604 5640 { … … 5625 5661 if (mSelectorWnd) 5626 5662 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 5663 5640 5664 /* ensure CGuestOSType objects are no longer used */ -
trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp
r15622 r15669 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.