VirtualBox

Ignore:
Timestamp:
Dec 18, 2008 6:54:07 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41215
Message:

FE/Qt4: Restored r41122 and r41128.

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

Legend:

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

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

    r15622 r15669  
    12561256#ifdef VBOX_GUI_WITH_SYSTRAY
    12571257    , mIsTrayMenu (false)
     1258    , mIncreasedWindowCounter (false)
    12581259#endif
    12591260    , mMediaEnumThread (NULL)
     
    20772078    static const char *sSectionHrefTpl =
    20782079        "<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>"
    20802081            "%5"
    2081         "<tr><td colspan=2><font size=1>&nbsp;</font></td></tr>";
     2082        "<tr><td colspan=3><font size=1>&nbsp;</font></td></tr>";
    20822083    static const char *sSectionBoldTpl =
    20832084        "<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>"
    20852086            "%5"
    2086         "<tr><td colspan=2><font size=1>&nbsp;</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>&nbsp;</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>";
    20892092
    20902093    static QString sGeneralBasicHrefTpl, sGeneralBasicBoldTpl;
     
    20982101
    20992102        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"));
    21042107        sGeneralBasicHrefTpl = QString (sSectionHrefTpl)
    21052108                .arg (2 + 3) /* rows */
     
    21162119
    21172120        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");
    21262129
    21272130        sGeneralFullHrefTpl = QString (sSectionHrefTpl)
     
    21622165                LONG channel = hda.GetChannel();
    21632166                LONG device = hda.GetDevice();
    2164                 hardDisks += QString (sSectionItemTpl)
     2167                hardDisks += QString (sSectionItemTpl2)
    21652168                    .arg (toFullString (bus, channel, device))
    21662169                    .arg (details (hd, aIsNewVM));
     
    21712174        if (hardDisks.isNull())
    21722175        {
    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)"));
    21752178            ++ rows;
    21762179        }
     
    22672270        /* DVD */
    22682271        CDVDDrive dvd = aMachine.GetDVDDrive();
    2269         item = QString (sSectionItemTpl);
    22702272        switch (dvd.GetState())
    22712273        {
    22722274            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)"));
    22742277                break;
    22752278            case KDriveState_ImageMounted:
    22762279            {
    22772280                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()));
    22802284                break;
    22812285            }
     
    22882292                    drvName :
    22892293                    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);
    22922297                break;
    22932298            }
     
    23042309        /* Floppy */
    23052310        CFloppyDrive floppy = aMachine.GetFloppyDrive();
    2306         item = QString (sSectionItemTpl);
    23072311        switch (floppy.GetState())
    23082312        {
    23092313            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)"));
    23112316                break;
    23122317            case KDriveState_ImageMounted:
    23132318            {
    23142319                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()));
    23172323                break;
    23182324            }
     
    23252331                    drvName :
    23262332                    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);
    23292336                break;
    23302337            }
     
    23442351            int rows = audio.GetEnabled() ? 3 : 2;
    23452352            if (audio.GetEnabled())
    2346                 item = QString (sSectionItemTpl)
     2353                item = QString (sSectionItemTpl2)
    23472354                       .arg (tr ("Host Driver", "details report (audio)"),
    23482355                             toString (audio.GetAudioDriver())) +
    2349                        QString (sSectionItemTpl)
     2356                       QString (sSectionItemTpl2)
    23502357                       .arg (tr ("Controller", "details report (audio)"),
    23512358                             toString (audio.GetAudioController()));
    23522359            else
    2353                 item = QString (sSectionItemTpl)
    2354                     .arg (tr ("Disabled", "details report (audio)"), "");
     2360                item = QString (sSectionItemTpl1)
     2361                    .arg (tr ("Disabled", "details report (audio)"));
    23552362
    23562363            detailsReport += sectionTpl
     
    23862393                        attType = attType.arg (vboxGlobal().toString (type));
    23872394
    2388                     item += QString (sSectionItemTpl)
     2395                    item += QString (sSectionItemTpl2)
    23892396                        .arg (tr ("Adapter %1", "details report (network)")
    23902397                              .arg (adapter.GetSlot() + 1))
     
    23952402            if (item.isNull())
    23962403            {
    2397                 item = QString (sSectionItemTpl)
    2398                     .arg (tr ("Disabled", "details report (network)"), "");
     2404                item = QString (sSectionItemTpl1)
     2405                    .arg (tr ("Disabled", "details report (network)"));
    23992406                ++ rows;
    24002407            }
     
    24282435                        data += toString (mode);
    24292436
    2430                     item += QString (sSectionItemTpl)
     2437                    item += QString (sSectionItemTpl2)
    24312438                        .arg (tr ("Port %1", "details report (serial ports)")
    24322439                              .arg (port.GetSlot() + 1))
     
    24372444            if (item.isNull())
    24382445            {
    2439                 item = QString (sSectionItemTpl)
    2440                     .arg (tr ("Disabled", "details report (serial ports)"), "");
     2446                item = QString (sSectionItemTpl1)
     2447                    .arg (tr ("Disabled", "details report (serial ports)"));
    24412448                ++ rows;
    24422449            }
     
    24642471                        .arg (QDir::toNativeSeparators (port.GetPath()));
    24652472
    2466                     item += QString (sSectionItemTpl)
     2473                    item += QString (sSectionItemTpl2)
    24672474                        .arg (tr ("Port %1", "details report (parallel ports)")
    24682475                              .arg (port.GetSlot() + 1))
     
    24732480            if (item.isNull())
    24742481            {
    2475                 item = QString (sSectionItemTpl)
    2476                     .arg (tr ("Disabled", "details report (parallel ports)"), "");
     2482                item = QString (sSectionItemTpl1)
     2483                    .arg (tr ("Disabled", "details report (parallel ports)"));
    24772484                ++ rows;
    24782485            }
     
    25022509                            active ++;
    25032510
    2504                     item = QString (sSectionItemTpl)
     2511                    item = QString (sSectionItemTpl2)
    25052512                        .arg (tr ("Device Filters", "details report (USB)"),
    25062513                              tr ("%1 (%2 active)", "details report (USB)")
     
    25082515                }
    25092516                else
    2510                     item = QString (sSectionItemTpl)
    2511                         .arg (tr ("Disabled", "details report (USB)"), "");
     2517                    item = QString (sSectionItemTpl1)
     2518                        .arg (tr ("Disabled", "details report (USB)"));
    25122519
    25132520                detailsReport += sectionTpl
     
    25242531            if (count > 0)
    25252532            {
    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);
    25302536            }
    25312537            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)"));
    25342540
    25352541            detailsReport += sectionTpl
     
    25482554
    25492555                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());
    25542559                else
    2555                     item = QString (sSectionItemTpl)
    2556                         .arg (tr ("Disabled", "details report (VRDP)"), "");
     2560                    item = QString (sSectionItemTpl1)
     2561                        .arg (tr ("Disabled", "details report (VRDP)"));
    25572562
    25582563                detailsReport += sectionTpl
     
    53055310    }
    53065311
     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
    53075337#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    }
    53135347#endif
    53145348
     
    54675501    qApp->installEventFilter (this);
    54685502
    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 
    54875503    /* process command line */
    54885504
     
    56015617    }
    56025618
     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
    56035639    if (!callback.isNull())
    56045640    {
     
    56255661    if (mSelectorWnd)
    56265662        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
    56395663
    56405664    /* ensure CGuestOSType objects are no longer used */
  • trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp

    r15622 r15669  
    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 
    354348#ifndef VBOX_OSE
    355349#ifdef Q_WS_X11
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette