- Timestamp:
- Sep 25, 2007 1:56:26 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r4887 r5022 103 103 include/VBoxConsoleView.h \ 104 104 include/VBoxProblemReporter.h \ 105 include/VBoxDownloaderWgt.h 105 include/VBoxDownloaderWgt.h \ 106 include/VBoxNetworkFramework.h 106 107 107 108 # Sources containing local definitions of classes that use the Q_OBJECT macro … … 167 168 src/VBoxVMListBox.cpp \ 168 169 src/VBoxFrameBuffer.cpp \ 169 src/HappyHttp.cpp 170 src/HappyHttp.cpp \ 171 src/VBoxNetworkFramework.cpp 170 172 171 173 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11 … … 189 191 src/HappyHttp.cpp_CXXFLAGS += -fexceptions 190 192 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions 193 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions 191 194 endif 192 195 src/HappyHttp.cpp_CXXFLAGS.linux += -O2 -
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r4944 r5022 35 35 ui/VBoxAboutDlg.ui \ 36 36 ui/VBoxVMFirstRunWzd.ui \ 37 ui/VBoxVMLogViewer.ui 37 ui/VBoxVMLogViewer.ui \ 38 ui/VBoxRegistrationDlg.ui 38 39 39 40 IMAGES = images/tpixel.png \ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h
r4572 r5022 132 132 MachineDataChangeEventType, 133 133 MachineRegisteredEventType, 134 ShowRegDlgEventType, 134 135 SessionStateChangeEventType, 135 136 SnapshotEventType, … … 163 164 static const char* GUI_LicenseKey; 164 165 #endif 166 static const char* GUI_RegistrationTryLeft; 167 static const char* GUI_RegistrationDlgWinID; 165 168 }; 166 169 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r4572 r5022 100 100 }; 101 101 102 class VBoxShowRegDlgEvent : public QEvent 103 { 104 public: 105 VBoxShowRegDlgEvent() 106 : QEvent ((QEvent::Type) VBoxDefs::ShowRegDlgEventType) 107 {} 108 }; 109 102 110 class VBoxSessionStateChangeEvent : public QEvent 103 111 { … … 136 144 class VBoxSelectorWnd; 137 145 class VBoxConsoleWnd; 146 class VBoxRegistrationDlg; 138 147 139 148 class VBoxGlobal : public QObject … … 367 376 bool showVirtualBoxLicense(); 368 377 #endif 378 379 void showRegistrationDialog(); 369 380 370 381 CSession openSession (const QUuid &id); … … 519 530 VBoxSelectorWnd *selector_wnd; 520 531 VBoxConsoleWnd *console_wnd; 532 533 VBoxRegistrationDlg *mRegDlg; 521 534 522 535 QUuid vmUuid; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r4572 r5022 209 209 void warnAboutNewAdditions (QWidget *, const QString &, const QString &); 210 210 211 void cannotConnectRegister (QWidget *aParent, 212 const QString &aURL, 213 const QString &aReason); 214 void showRegisterResult (QWidget *aParent, 215 const QString &aResult); 216 211 217 bool remindAboutInputCapture(); 212 218 bool remindAboutAutoCapture(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp
r4572 r5022 32 32 const char* VBoxDefs::GUI_LicenseKey = "GUI/LicenseAgreed"; 33 33 #endif 34 34 const char* VBoxDefs::GUI_RegistrationTryLeft = "GUI/RegistrationTryLeft"; 35 const char* VBoxDefs::GUI_RegistrationDlgWinID = "GUI/RegistrationDlgWinID"; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r4862 r5022 24 24 #include "VBoxProblemReporter.h" 25 25 #include "QIHotKeyEdit.h" 26 #include "VBoxRegistrationDlg.h" 26 27 27 28 #include <qapplication.h> … … 204 205 if (sKey.startsWith ("GUI/")) 205 206 { 207 if (!sVal.isEmpty() && 208 sKey == VBoxDefs::GUI_RegistrationDlgWinID) 209 { 210 if (sVal == QString ("%1") 211 .arg (qApp->mainWidget()->winId())) 212 { 213 *allowChange = TRUE; 214 QApplication::postEvent (&global, new VBoxShowRegDlgEvent()); 215 } 216 else 217 *allowChange = FALSE; 218 return S_OK; 219 } 220 206 221 /* try to set the global setting to check its syntax */ 207 222 VBoxGlobalSettings gs (false /* non-null */); … … 654 669 : valid (false) 655 670 , selector_wnd (0), console_wnd (0) 671 , mRegDlg (0) 656 672 , media_enum_thread (0) 657 673 , verString ("1.0") … … 1627 1643 } 1628 1644 #endif 1645 1646 void VBoxGlobal::showRegistrationDialog() 1647 { 1648 /* check if the registration already passed */ 1649 if (virtualBox().GetExtraData (VBoxDefs::GUI_RegistrationTryLeft) == "0") 1650 return; 1651 1652 /* store the winid of main app wgt to ensure only one reg dlg running */ 1653 virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID, 1654 QString ("%1").arg (qApp->mainWidget()->winId())); 1655 } 1629 1656 1630 1657 /** … … 3428 3455 return true; 3429 3456 } 3457 case VBoxDefs::ShowRegDlgEventType: 3458 { 3459 /* show unique registration dialog */ 3460 if (!mRegDlg) 3461 { 3462 VBoxRegistrationDlg *dlg = new VBoxRegistrationDlg(); 3463 dlg->setup (&mRegDlg, "http://www.innotek.de/register762.php"); 3464 Assert (dlg == mRegDlg); 3465 mRegDlg->show(); 3466 } 3467 return true; 3468 } 3430 3469 case VBoxDefs::SessionStateChangeEventType: 3431 3470 { … … 3719 3758 if (selector_wnd) 3720 3759 delete selector_wnd; 3760 if (mRegDlg) 3761 delete mRegDlg; 3721 3762 3722 3763 /* ensure CGuestOSType objects are no longer used */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r4740 r5022 1404 1404 } 1405 1405 1406 void VBoxProblemReporter::cannotConnectRegister (QWidget *aParent, 1407 const QString &aURL, 1408 const QString &aReason) 1409 { 1410 message (aParent, Error, 1411 tr ("<p>Failed to connect to the VirtualBox network " 1412 "registration form " 1413 "<nobr><a href=\"%1\">%2</a>.</nobr></p><p>%3</p>") 1414 .arg (aURL).arg (aURL).arg (aReason)); 1415 } 1416 1417 void VBoxProblemReporter::showRegisterResult (QWidget *aParent, 1418 const QString &aResult) 1419 { 1420 aResult == "OK" ? 1421 message (aParent, Info, 1422 tr ("<p><nobr>You have successfully registered with innotek. " 1423 "Thank you for registration.</nobr></p>")) : 1424 message (aParent, Error, 1425 tr ("<p>Registration failed (%1)</p>").arg (aResult)); 1426 } 1427 1406 1428 /** @return false if the dialog wasn't actually shown (i.e. it was autoconfirmed) */ 1407 1429 bool VBoxProblemReporter::remindAboutInputCapture() -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r4880 r5022 231 231 if (vboxGlobal().isVMConsoleProcess()) 232 232 { 233 a.setMainWidget (&vboxGlobal().consoleWnd());233 a.setMainWidget (&vboxGlobal().consoleWnd()); 234 234 if (vboxGlobal().startMachine (vboxGlobal().managedVMUuid())) 235 { 236 vboxGlobal().showRegistrationDialog(); 235 237 rc = a.exec(); 238 } 236 239 } 237 240 else if (noSelector) … … 242 245 { 243 246 a.setMainWidget (&vboxGlobal().selectorWnd()); 247 vboxGlobal().showRegistrationDialog(); 244 248 vboxGlobal().selectorWnd().show(); 245 249 vboxGlobal().startEnumeratingMedia();
Note:
See TracChangeset
for help on using the changeset viewer.