Changeset 5094 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 28, 2007 1:13:22 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r5022 r5094 15 15 # be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 17 ifndef VBOX_OSE 18 VBOX_WITH_REGISTRATION := 1 19 endif 20 17 21 # include qmake project file 18 22 include VBoxUI.pro … … 24 28 # Import images 25 29 VirtualBox_QT_IMAGES := $(IMAGES) 30 31 # exclude inappropriate UI content 32 ifndef VBOX_WITH_REGISTRATION 33 VirtualBox_QT_UISRCS := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS)) 34 endif 26 35 27 36 # reset things to avoid possible conflicts with kBuild … … 222 231 VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE 223 232 endif 233 ifdef VBOX_WITH_REGISTRATION 234 VirtualBox_DEFS += VBOX_WITH_REGISTRATION 235 endif 224 236 ifdef VBOX_WITH_ALSA 225 237 VirtualBox_DEFS += VBOX_WITH_ALSA … … 229 241 endif 230 242 ifdef VBOX_WITH_DEBUGGER_GUI 231 VirtualBox_DEFS+= VBOX_WITH_DEBUGGER_GUI_MENU243 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU 232 244 endif 233 245 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r5078 r5094 154 154 static VBoxGlobal &instance(); 155 155 156 bool isValid() { return valid; }156 bool isValid() { return mValid; } 157 157 158 158 QString versionString() { return verString; } 159 159 160 CVirtualBox virtualBox() const { return vbox; }160 CVirtualBox virtualBox() const { return mVBox; } 161 161 162 162 const VBoxGlobalSettings &settings() const { return gset; } … … 526 526 void init(); 527 527 528 bool valid;529 530 CVirtualBox vbox;528 bool mValid; 529 530 CVirtualBox mVBox; 531 531 532 532 VBoxGlobalSettings gset; 533 533 534 VBoxSelectorWnd *selector_wnd; 535 VBoxConsoleWnd *console_wnd; 536 534 VBoxSelectorWnd *mSelectorWnd; 535 VBoxConsoleWnd *mConsoleWnd; 536 537 #ifdef VBOX_WITH_REGISTRATION 537 538 VBoxRegistrationDlg *mRegDlg; 539 #endif 538 540 539 541 QUuid vmUuid; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r5078 r5094 24 24 #include "VBoxProblemReporter.h" 25 25 #include "QIHotKeyEdit.h" 26 27 #ifdef VBOX_WITH_REGISTRATION 26 28 #include "VBoxRegistrationDlg.h" 29 #endif 27 30 28 31 #include <qapplication.h> … … 667 670 668 671 VBoxGlobal::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) 673 678 , verString ("1.0") 674 679 , vm_state_color (CEnums::MachineState_COUNT) … … 748 753 bool VBoxGlobal::setSettings (const VBoxGlobalSettings &gs) 749 754 { 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); 755 760 return false; 756 761 } … … 776 781 #endif 777 782 778 Assert ( valid);779 780 if (! selector_wnd)783 Assert (mValid); 784 785 if (!mSelectorWnd) 781 786 { 782 787 /* 783 * We pass the address of selector_wnd to the constructor to let it be788 * We pass the address of mSelectorWnd to the constructor to let it be 784 789 * initialized right after the constructor is called. It is necessary 785 790 * to avoid recursion, since this method may be (and will be) called 786 791 * from the below constructor or from constructors/methods it calls. 787 792 */ 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); 790 795 NOREF(w); 791 796 } 792 797 793 return * selector_wnd;798 return *mSelectorWnd; 794 799 } 795 800 … … 807 812 #endif 808 813 809 Assert ( valid);810 811 if (! console_wnd)814 Assert (mValid); 815 816 if (!mConsoleWnd) 812 817 { 813 818 /* 814 * We pass the address of console_wnd to the constructor to let it be819 * We pass the address of mConsoleWnd to the constructor to let it be 815 820 * initialized right after the constructor is called. It is necessary 816 821 * to avoid recursion, since this method may be (and will be) called 817 822 * from the below constructor or from constructors/methods it calls. 818 823 */ 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); 821 826 NOREF(w); 822 827 } 823 828 824 return * console_wnd;829 return *mConsoleWnd; 825 830 } 826 831 … … 1298 1303 /* boot order */ 1299 1304 QString bootOrder; 1300 for (ulong i = 1; i <= vbox.GetSystemProperties().GetMaxBootPosition(); i++)1305 for (ulong i = 1; i <= mVBox.GetSystemProperties().GetMaxBootPosition(); i++) 1301 1306 { 1302 1307 CEnums::DeviceType device = m.GetBootOrder (i); … … 1431 1436 { 1432 1437 item = QString::null; 1433 ulong count = vbox.GetSystemProperties().GetNetworkAdapterCount();1438 ulong count = mVBox.GetSystemProperties().GetNetworkAdapterCount(); 1434 1439 int rows = 2; /* including section header and footer */ 1435 1440 for (ulong slot = 0; slot < count; slot ++) … … 1474 1479 { 1475 1480 item = QString::null; 1476 ulong count = vbox.GetSystemProperties().GetSerialPortCount();1481 ulong count = mVBox.GetSystemProperties().GetSerialPortCount(); 1477 1482 int rows = 2; /* including section header and footer */ 1478 1483 for (ulong slot = 0; slot < count; slot ++) … … 1657 1662 void VBoxGlobal::showRegistrationDialog() 1658 1663 { 1664 #ifdef VBOX_WITH_REGISTRATION 1659 1665 if (mRegDlg) 1660 1666 { … … 1669 1675 VBoxRegistrationDlg *dlg = 1670 1676 new VBoxRegistrationDlg (0, 0, false, WDestructiveClose); 1671 dlg->setup (&mRegDlg , "http://www.innotek.de/register762.php");1677 dlg->setup (&mRegDlg); 1672 1678 Assert (dlg == mRegDlg); 1673 1679 mRegDlg->show(); 1674 1680 } 1681 #endif 1675 1682 } 1676 1683 … … 1692 1699 } 1693 1700 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); 1699 1706 session.detach(); 1700 1707 } … … 1708 1715 bool VBoxGlobal::startMachine (const QUuid &id) 1709 1716 { 1710 AssertReturn ( valid, false);1717 AssertReturn (mValid, false); 1711 1718 1712 1719 CSession session = vboxGlobal().openSession (id); … … 1752 1759 void VBoxGlobal::startEnumeratingMedia() 1753 1760 { 1754 Assert ( valid);1761 Assert (mValid); 1755 1762 1756 1763 /* check if already started but not yet finished */ … … 1765 1772 media_list.clear(); 1766 1773 { 1767 CHardDiskEnumerator enHD = vbox.GetHardDisks().Enumerate();1774 CHardDiskEnumerator enHD = mVBox.GetHardDisks().Enumerate(); 1768 1775 while (enHD.HasMore()) 1769 1776 addMediaToList (media_list, CUnknown (enHD.GetNext()), VBoxDefs::HD); 1770 1777 1771 CDVDImageEnumerator enCD = vbox.GetDVDImages().Enumerate();1778 CDVDImageEnumerator enCD = mVBox.GetDVDImages().Enumerate(); 1772 1779 while (enCD.HasMore()) 1773 1780 addMediaToList (media_list, CUnknown (enCD.GetNext()), VBoxDefs::CD); 1774 1781 1775 CFloppyImageEnumerator enFD = vbox.GetFloppyImages().Enumerate();1782 CFloppyImageEnumerator enFD = mVBox.GetFloppyImages().Enumerate(); 1776 1783 while (enFD.HasMore()) 1777 1784 addMediaToList (media_list, CUnknown (enFD.GetNext()), VBoxDefs::FD); … … 1790 1797 COMBase::initializeCOM(); 1791 1798 1792 CVirtualBox vbox = vboxGlobal().virtualBox();1799 CVirtualBox mVBox = vboxGlobal().virtualBox(); 1793 1800 QObject *target = &vboxGlobal(); 1794 1801 … … 1817 1824 if (!machineId.isNull()) 1818 1825 { 1819 CMachine machine = vbox.GetMachine (machineId);1826 CMachine machine = mVBox.GetMachine (machineId); 1820 1827 if (!machine.isNull() && (machine.GetState() >= CEnums::Running)) 1821 1828 media.status = VBoxMedia::Ok; … … 3543 3550 #endif 3544 3551 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); 3549 3556 return; 3550 3557 } 3551 3558 3552 3559 // initialize guest OS type vector 3553 CGuestOSTypeCollection coll = vbox.GetGuestOSTypes();3560 CGuestOSTypeCollection coll = mVBox.GetGuestOSTypes(); 3554 3561 int osTypeCount = coll.GetCount(); 3555 3562 AssertMsg (osTypeCount > 0, ("Number of OS types must not be zero")); … … 3650 3657 3651 3658 // 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()); 3656 3663 return; 3657 3664 } … … 3687 3694 vmUuid = uuid; 3688 3695 } else { 3689 CMachine m = vbox.FindMachine (param);3696 CMachine m = mVBox.FindMachine (param); 3690 3697 if (m.isNull()) { 3691 vboxProblem().cannotFindMachineByName ( vbox, param);3698 vboxProblem().cannotFindMachineByName (mVBox, param); 3692 3699 return; 3693 3700 } … … 3724 3731 // setup the callback 3725 3732 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()) 3729 3736 return; 3730 3737 … … 3738 3745 QIconSet::setIconSize (QIconSet::Large, QSize (22, 22)); 3739 3746 3740 valid = true;3747 mValid = true; 3741 3748 } 3742 3749 … … 3757 3764 if (!callback.isNull()) 3758 3765 { 3759 vbox.UnregisterCallback (callback);3760 AssertWrapperOk ( vbox);3766 mVBox.UnregisterCallback (callback); 3767 AssertWrapperOk (mVBox); 3761 3768 callback.detach(); 3762 3769 } … … 3770 3777 } 3771 3778 3772 if (console_wnd) 3773 delete console_wnd; 3774 if (selector_wnd) 3775 delete selector_wnd; 3779 #ifdef VBOX_WITH_REGISTRATION 3776 3780 if (mRegDlg) 3777 3781 mRegDlg->close(); 3782 #endif 3783 3784 if (mConsoleWnd) 3785 delete mConsoleWnd; 3786 if (mSelectorWnd) 3787 delete mSelectorWnd; 3778 3788 3779 3789 /* ensure CGuestOSType objects are no longer used */ … … 3782 3792 media_list.clear(); 3783 3793 /* the last step to ensure we don't use COM any more */ 3784 vbox.detach();3794 mVBox.detach(); 3785 3795 3786 3796 /* There may be VBoxEnumerateMediaEvent instances still in the message … … 3795 3805 #endif 3796 3806 3797 valid = false;3807 mValid = false; 3798 3808 } 3799 3809 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r5082 r5094 1435 1435 aResult == "OK" ? 1436 1436 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>" 1439 1439 "<p>Thank you for finding time to fill out the " 1440 1440 "registration form!</p>")) :
Note:
See TracChangeset
for help on using the changeset viewer.