VirtualBox

Changeset 5094 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 28, 2007 1:13:22 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: Added VBOX_WITH_REGISTRATION to guard the registration code; currently undefined for OSE.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r5022 r5094  
    1515#  be useful, but WITHOUT ANY WARRANTY of any kind.
    1616
     17ifndef VBOX_OSE
     18VBOX_WITH_REGISTRATION := 1
     19endif
     20
    1721# include qmake project file
    1822include VBoxUI.pro
     
    2428# Import images
    2529VirtualBox_QT_IMAGES := $(IMAGES)
     30
     31# exclude inappropriate UI content
     32ifndef VBOX_WITH_REGISTRATION
     33VirtualBox_QT_UISRCS := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS))
     34endif
    2635
    2736# reset things to avoid possible conflicts with kBuild
     
    222231 VirtualBox_DEFS.linux   += VBOX_GUI_USE_QIMAGE
    223232endif
     233ifdef VBOX_WITH_REGISTRATION
     234 VirtualBox_DEFS         += VBOX_WITH_REGISTRATION
     235endif
    224236ifdef VBOX_WITH_ALSA
    225237 VirtualBox_DEFS         += VBOX_WITH_ALSA
     
    229241endif
    230242ifdef VBOX_WITH_DEBUGGER_GUI
    231   VirtualBox_DEFS        += VBOX_WITH_DEBUGGER_GUI_MENU
     243 VirtualBox_DEFS         += VBOX_WITH_DEBUGGER_GUI_MENU
    232244endif
    233245
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r5078 r5094  
    154154    static VBoxGlobal &instance();
    155155
    156     bool isValid() { return valid; }
     156    bool isValid() { return mValid; }
    157157
    158158    QString versionString() { return verString; }
    159159
    160     CVirtualBox virtualBox() const { return vbox; }
     160    CVirtualBox virtualBox() const { return mVBox; }
    161161
    162162    const VBoxGlobalSettings &settings() const { return gset; }
     
    526526    void init();
    527527
    528     bool valid;
    529 
    530     CVirtualBox vbox;
     528    bool mValid;
     529
     530    CVirtualBox mVBox;
    531531
    532532    VBoxGlobalSettings gset;
    533533
    534     VBoxSelectorWnd *selector_wnd;
    535     VBoxConsoleWnd *console_wnd;
    536 
     534    VBoxSelectorWnd *mSelectorWnd;
     535    VBoxConsoleWnd *mConsoleWnd;
     536
     537#ifdef VBOX_WITH_REGISTRATION
    537538    VBoxRegistrationDlg *mRegDlg;
     539#endif
    538540
    539541    QUuid vmUuid;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r5078 r5094  
    2424#include "VBoxProblemReporter.h"
    2525#include "QIHotKeyEdit.h"
     26
     27#ifdef VBOX_WITH_REGISTRATION
    2628#include "VBoxRegistrationDlg.h"
     29#endif
    2730
    2831#include <qapplication.h>
     
    667670
    668671VBoxGlobal::VBoxGlobal()
    669     : valid (false)
    670     , selector_wnd (0), console_wnd (0)
    671     , mRegDlg (0)
    672     , media_enum_thread (0)
     672    : mValid (false)
     673    , mSelectorWnd (NULL), mConsoleWnd (NULL)
     674#ifdef VBOX_WITH_REGISTRATION
     675    , mRegDlg (NULL)
     676#endif
     677    , media_enum_thread (NULL)
    673678    , verString ("1.0")
    674679    , vm_state_color (CEnums::MachineState_COUNT)
     
    748753bool VBoxGlobal::setSettings (const VBoxGlobalSettings &gs)
    749754{
    750     gs.save (vbox);
    751 
    752     if (!vbox.isOk())
    753     {
    754         vboxProblem().cannotSaveGlobalConfig (vbox);
     755    gs.save (mVBox);
     756
     757    if (!mVBox.isOk())
     758    {
     759        vboxProblem().cannotSaveGlobalConfig (mVBox);
    755760        return false;
    756761    }
     
    776781#endif
    777782
    778     Assert (valid);
    779 
    780     if (!selector_wnd)
     783    Assert (mValid);
     784
     785    if (!mSelectorWnd)
    781786    {
    782787        /*
    783          *  We pass the address of selector_wnd to the constructor to let it be
     788         *  We pass the address of mSelectorWnd to the constructor to let it be
    784789         *  initialized right after the constructor is called. It is necessary
    785790         *  to avoid recursion, since this method may be (and will be) called
    786791         *  from the below constructor or from constructors/methods it calls.
    787792         */
    788         VBoxSelectorWnd *w = new VBoxSelectorWnd (&selector_wnd, 0, "selectorWnd");
    789         Assert (w == selector_wnd);
     793        VBoxSelectorWnd *w = new VBoxSelectorWnd (&mSelectorWnd, 0, "selectorWnd");
     794        Assert (w == mSelectorWnd);
    790795        NOREF(w);
    791796    }
    792797
    793     return *selector_wnd;
     798    return *mSelectorWnd;
    794799}
    795800
     
    807812#endif
    808813
    809     Assert (valid);
    810 
    811     if (!console_wnd)
     814    Assert (mValid);
     815
     816    if (!mConsoleWnd)
    812817    {
    813818        /*
    814          *  We pass the address of console_wnd to the constructor to let it be
     819         *  We pass the address of mConsoleWnd to the constructor to let it be
    815820         *  initialized right after the constructor is called. It is necessary
    816821         *  to avoid recursion, since this method may be (and will be) called
    817822         *  from the below constructor or from constructors/methods it calls.
    818823         */
    819         VBoxConsoleWnd *w = new VBoxConsoleWnd (&console_wnd, 0, "consoleWnd");
    820         Assert (w == console_wnd);
     824        VBoxConsoleWnd *w = new VBoxConsoleWnd (&mConsoleWnd, 0, "consoleWnd");
     825        Assert (w == mConsoleWnd);
    821826        NOREF(w);
    822827    }
    823828
    824     return *console_wnd;
     829    return *mConsoleWnd;
    825830}
    826831
     
    12981303        /* boot order */
    12991304        QString bootOrder;
    1300         for (ulong i = 1; i <= vbox.GetSystemProperties().GetMaxBootPosition(); i++)
     1305        for (ulong i = 1; i <= mVBox.GetSystemProperties().GetMaxBootPosition(); i++)
    13011306        {
    13021307            CEnums::DeviceType device = m.GetBootOrder (i);
     
    14311436        {
    14321437            item = QString::null;
    1433             ulong count = vbox.GetSystemProperties().GetNetworkAdapterCount();
     1438            ulong count = mVBox.GetSystemProperties().GetNetworkAdapterCount();
    14341439            int rows = 2; /* including section header and footer */
    14351440            for (ulong slot = 0; slot < count; slot ++)
     
    14741479        {
    14751480            item = QString::null;
    1476             ulong count = vbox.GetSystemProperties().GetSerialPortCount();
     1481            ulong count = mVBox.GetSystemProperties().GetSerialPortCount();
    14771482            int rows = 2; /* including section header and footer */
    14781483            for (ulong slot = 0; slot < count; slot ++)
     
    16571662void VBoxGlobal::showRegistrationDialog()
    16581663{
     1664#ifdef VBOX_WITH_REGISTRATION
    16591665    if (mRegDlg)
    16601666    {
     
    16691675        VBoxRegistrationDlg *dlg =
    16701676            new VBoxRegistrationDlg (0, 0, false, WDestructiveClose);
    1671         dlg->setup (&mRegDlg, "http://www.innotek.de/register762.php");
     1677        dlg->setup (&mRegDlg);
    16721678        Assert (dlg == mRegDlg);
    16731679        mRegDlg->show();
    16741680    }
     1681#endif
    16751682}
    16761683
     
    16921699    }
    16931700
    1694     vbox.OpenSession (session, id);
    1695     if (!vbox.isOk())
    1696     {
    1697         CMachine machine = CVirtualBox (vbox).GetMachine (id);
    1698         vboxProblem().cannotOpenSession (vbox, machine);
     1701    mVBox.OpenSession (session, id);
     1702    if (!mVBox.isOk())
     1703    {
     1704        CMachine machine = CVirtualBox (mVBox).GetMachine (id);
     1705        vboxProblem().cannotOpenSession (mVBox, machine);
    16991706        session.detach();
    17001707    }
     
    17081715bool VBoxGlobal::startMachine (const QUuid &id)
    17091716{
    1710     AssertReturn (valid, false);
     1717    AssertReturn (mValid, false);
    17111718
    17121719    CSession session = vboxGlobal().openSession (id);
     
    17521759void VBoxGlobal::startEnumeratingMedia()
    17531760{
    1754     Assert (valid);
     1761    Assert (mValid);
    17551762
    17561763    /* check if already started but not yet finished */
     
    17651772    media_list.clear();
    17661773    {
    1767         CHardDiskEnumerator enHD = vbox.GetHardDisks().Enumerate();
     1774        CHardDiskEnumerator enHD = mVBox.GetHardDisks().Enumerate();
    17681775        while (enHD.HasMore())
    17691776            addMediaToList (media_list, CUnknown (enHD.GetNext()), VBoxDefs::HD);
    17701777
    1771         CDVDImageEnumerator enCD = vbox.GetDVDImages().Enumerate();
     1778        CDVDImageEnumerator enCD = mVBox.GetDVDImages().Enumerate();
    17721779        while (enCD.HasMore())
    17731780            addMediaToList (media_list, CUnknown (enCD.GetNext()), VBoxDefs::CD);
    17741781
    1775         CFloppyImageEnumerator enFD = vbox.GetFloppyImages().Enumerate();
     1782        CFloppyImageEnumerator enFD = mVBox.GetFloppyImages().Enumerate();
    17761783        while (enFD.HasMore())
    17771784            addMediaToList (media_list, CUnknown (enFD.GetNext()), VBoxDefs::FD);
     
    17901797            COMBase::initializeCOM();
    17911798
    1792             CVirtualBox vbox = vboxGlobal().virtualBox();
     1799            CVirtualBox mVBox = vboxGlobal().virtualBox();
    17931800            QObject *target = &vboxGlobal();
    17941801
     
    18171824                            if (!machineId.isNull())
    18181825                            {
    1819                                 CMachine machine = vbox.GetMachine (machineId);
     1826                                CMachine machine = mVBox.GetMachine (machineId);
    18201827                                if (!machine.isNull() && (machine.GetState() >= CEnums::Running))
    18211828                                    media.status = VBoxMedia::Ok;
     
    35433550#endif
    35443551
    3545     vbox.createInstance (CLSID_VirtualBox);
    3546     if (!vbox.isOk())
    3547     {
    3548         vboxProblem().cannotCreateVirtualBox (vbox);
     3552    mVBox.createInstance (CLSID_VirtualBox);
     3553    if (!mVBox.isOk())
     3554    {
     3555        vboxProblem().cannotCreateVirtualBox (mVBox);
    35493556        return;
    35503557    }
    35513558
    35523559    // initialize guest OS type vector
    3553     CGuestOSTypeCollection coll = vbox.GetGuestOSTypes();
     3560    CGuestOSTypeCollection coll = mVBox.GetGuestOSTypes();
    35543561    int osTypeCount = coll.GetCount();
    35553562    AssertMsg (osTypeCount > 0, ("Number of OS types must not be zero"));
     
    36503657
    36513658    // try to load global settings
    3652     gset.load (vbox);
    3653     if (!vbox.isOk() || !gset)
    3654     {
    3655         vboxProblem().cannotLoadGlobalConfig (vbox, gset.lastError());
     3659    gset.load (mVBox);
     3660    if (!mVBox.isOk() || !gset)
     3661    {
     3662        vboxProblem().cannotLoadGlobalConfig (mVBox, gset.lastError());
    36563663        return;
    36573664    }
     
    36873694                    vmUuid = uuid;
    36883695                } else {
    3689                     CMachine m = vbox.FindMachine (param);
     3696                    CMachine m = mVBox.FindMachine (param);
    36903697                    if (m.isNull()) {
    3691                         vboxProblem().cannotFindMachineByName (vbox, param);
     3698                        vboxProblem().cannotFindMachineByName (mVBox, param);
    36923699                        return;
    36933700                    }
     
    37243731    // setup the callback
    37253732    callback = CVirtualBoxCallback (new VBoxCallback (*this));
    3726     vbox.RegisterCallback (callback);
    3727     AssertWrapperOk (vbox);
    3728     if (!vbox.isOk())
     3733    mVBox.RegisterCallback (callback);
     3734    AssertWrapperOk (mVBox);
     3735    if (!mVBox.isOk())
    37293736        return;
    37303737
     
    37383745    QIconSet::setIconSize (QIconSet::Large, QSize (22, 22));
    37393746
    3740     valid = true;
     3747    mValid = true;
    37413748}
    37423749
     
    37573764    if (!callback.isNull())
    37583765    {
    3759         vbox.UnregisterCallback (callback);
    3760         AssertWrapperOk (vbox);
     3766        mVBox.UnregisterCallback (callback);
     3767        AssertWrapperOk (mVBox);
    37613768        callback.detach();
    37623769    }
     
    37703777    }
    37713778
    3772     if (console_wnd)
    3773         delete console_wnd;
    3774     if (selector_wnd)
    3775         delete selector_wnd;
     3779#ifdef VBOX_WITH_REGISTRATION
    37763780    if (mRegDlg)
    37773781        mRegDlg->close();
     3782#endif
     3783
     3784    if (mConsoleWnd)
     3785        delete mConsoleWnd;
     3786    if (mSelectorWnd)
     3787        delete mSelectorWnd;
    37783788
    37793789    /* ensure CGuestOSType objects are no longer used */
     
    37823792    media_list.clear();
    37833793    /* the last step to ensure we don't use COM any more */
    3784     vbox.detach();
     3794    mVBox.detach();
    37853795
    37863796    /* There may be VBoxEnumerateMediaEvent instances still in the message
     
    37953805#endif
    37963806
    3797     valid = false;
     3807    mValid = false;
    37983808}
    37993809
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r5082 r5094  
    14351435    aResult == "OK" ?
    14361436        message (aParent, Info,
    1437                  tr ("<p>Congratulations! You have successfully registered the "
    1438                      "VirtualBox product.</p>"
     1437                 tr ("<p>Congratulations! You have been successfully registered "
     1438                     "as a user of VirtualBox.</p>"
    14391439                     "<p>Thank you for finding time to fill out the "
    14401440                     "registration form!</p>")) :
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