Changeset 10439 in vbox
- Timestamp:
- Jul 9, 2008 4:56:58 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33103
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r10429 r10439 539 539 include/VBoxVMFirstRunWzd.h \ 540 540 include/VBoxRegistrationDlg.h \ 541 include/VBoxUpdateDlg.h \ 541 542 include/VBoxSnapshotDetailsDlg.h \ 542 543 include/VBoxVMInformationDlg.h \ … … 608 609 src/VBoxVMFirstRunWzd.cpp \ 609 610 src/VBoxRegistrationDlg.cpp \ 611 src/VBoxUpdateDlg.cpp \ 610 612 src/VBoxSnapshotDetailsDlg.cpp \ 611 613 src/VBoxVMInformationDlg.cpp \ -
trunk/src/VBox/Frontends/VirtualBox4/VBoxUI.pro
r10168 r10439 32 32 ui/VBoxNewVMWzd.ui \ 33 33 ui/VBoxRegistrationDlg.ui \ 34 ui/VBoxUpdateDlg.ui \ 34 35 ui/VBoxSnapshotDetailsDlg.ui \ 35 36 ui/VBoxSnapshotsWgt.ui \ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h
r10112 r10439 240 240 QAction *helpWebAction; 241 241 QAction *helpRegisterAction; 242 QAction *helpUpdateAction; 242 243 QAction *helpAboutAction; 243 244 QAction *helpResetMessagesAction; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h
r9214 r10439 136 136 SnapshotEventType, 137 137 CanShowRegDlgEventType, 138 CanShowUpdDlgEventType, 138 139 NetworkAdapterChangeEventType, 139 140 USBCtlStateChangeEventType, … … 169 170 static const char* GUI_RegistrationDlgWinID; 170 171 static const char* GUI_RegistrationData; 172 static const char* GUI_UpdateDlgWinID; 173 static const char* GUI_UpdateDate; 171 174 static const char* GUI_LastVMSelected; 172 175 static const char* GUI_InfoDlgState; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r10437 r10439 140 140 }; 141 141 142 class VBoxCanShowUpdDlgEvent : public QEvent 143 { 144 public: 145 VBoxCanShowUpdDlgEvent (bool aCanShow) 146 : QEvent ((QEvent::Type) VBoxDefs::CanShowUpdDlgEventType) 147 , mCanShow (aCanShow) 148 {} 149 150 const bool mCanShow; 151 }; 152 142 153 class VBoxChangeGUILanguageEvent : public QEvent 143 154 { … … 157 168 class VBoxConsoleWnd; 158 169 class VBoxRegistrationDlg; 170 class VBoxUpdateDlg; 159 171 160 172 class VBoxGlobal : public QObject … … 618 630 619 631 void canShowRegDlg (bool aCanShow); 632 void canShowUpdDlg (bool aCanShow); 620 633 621 634 public slots: … … 624 637 625 638 void showRegistrationDialog (bool aForce = true); 639 void showUpdateDialog (bool aForce = true); 626 640 627 641 protected: … … 650 664 VBoxRegistrationDlg *mRegDlg; 651 665 #endif 666 VBoxUpdateDlg *mUpdDlg; 652 667 653 668 QUuid vmUuid; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h
r9627 r10439 267 267 const QString &aResult); 268 268 269 void showUpdateResult (QWidget *aParent, 270 const QString &aVersion, 271 const QString &aLink); 272 269 273 bool confirmInputCapture (bool *aAutoConfirmed = NULL); 270 274 void remindAboutAutoCapture(); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r10149 r10439 128 128 QAction *helpWebAction; 129 129 QAction *helpRegisterAction; 130 QAction *helpUpdateAction; 130 131 QAction *helpAboutAction; 131 132 QAction *helpResetMessagesAction; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r10437 r10439 282 282 helpRegisterAction = new QAction (this); 283 283 helpRegisterAction->setIcon (VBoxGlobal::iconSet (":/register_16px.png", 284 ":/register_disabled_16px.png")); 284 ":/register_disabled_16px.png")); 285 helpUpdateAction = new QAction (this); 286 helpUpdateAction->setIcon (VBoxGlobal::iconSet (":/refresh_16px.png", 287 ":/refresh_disabled_16px.png")); 285 288 helpAboutAction = new QAction (this); 286 289 helpAboutAction->setIcon (VBoxGlobal::iconSet (":/about_16px.png")); … … 390 393 GetExtraData (VBoxDefs::GUI_RegistrationDlgWinID).isEmpty()); 391 394 #endif 395 mHelpMenu->addAction (helpUpdateAction); 396 helpUpdateAction->setEnabled (vboxGlobal().virtualBox(). 397 GetExtraData (VBoxDefs::GUI_UpdateDlgWinID).isEmpty()); 392 398 mHelpMenu->addAction (helpAboutAction); 393 399 mHelpMenu->addSeparator(); … … 556 562 connect (helpRegisterAction, SIGNAL (triggered()), 557 563 &vboxGlobal(), SLOT (showRegistrationDialog())); 564 connect (helpUpdateAction, SIGNAL (activated()), 565 &vboxGlobal(), SLOT (showUpdateDialog())); 558 566 connect (&vboxGlobal(), SIGNAL (canShowRegDlg (bool)), 559 567 helpRegisterAction, SLOT (setEnabled (bool))); 568 connect (&vboxGlobal(), SIGNAL (canShowUpdDlg (bool)), 569 helpUpdateAction, SLOT (setEnabled (bool))); 560 570 connect (helpAboutAction, SIGNAL (triggered()), 561 571 &vboxProblem(), SLOT (showHelpAboutDialog())); … … 972 982 vboxGlobal().showRegistrationDialog (false /* aForce */); 973 983 #endif 984 vboxGlobal().showUpdateDialog (false /* aForce */); 974 985 } 975 986 … … 1578 1589 tr ("Open VirtualBox registration form")); 1579 1590 1591 helpUpdateAction->setText (tr ("&Update VirtualBox...")); 1592 helpUpdateAction->setStatusTip ( 1593 tr ("Open VirtualBox New Version Notifier")); 1594 1580 1595 helpAboutAction->setText (tr ("&About VirtualBox...")); 1581 1596 helpAboutAction->setStatusTip (tr ("Show a dialog with product information")); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDefs.cpp
r8219 r10439 38 38 const char* VBoxDefs::GUI_RegistrationDlgWinID = "GUI/RegistrationDlgWinID"; 39 39 const char* VBoxDefs::GUI_RegistrationData = "GUI/RegistrationData"; 40 const char* VBoxDefs::GUI_UpdateDlgWinID = "GUI/UpdateDlgWinID"; 41 const char* VBoxDefs::GUI_UpdateDate = "GUI/UpdateDate"; 40 42 const char* VBoxDefs::GUI_LastVMSelected = "GUI/LastVMSelected"; 41 43 const char* VBoxDefs::GUI_InfoDlgState = "GUI/InfoDlgState"; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r10437 r10439 34 34 #include "VBoxRegistrationDlg.h" 35 35 #endif 36 #include "VBoxUpdateDlg.h" 36 37 37 38 /* Qt includes */ … … 153 154 154 155 VBoxCallback (VBoxGlobal &aGlobal) 155 : mGlobal (aGlobal), mIsRegDlgOwner (false) 156 : mGlobal (aGlobal) 157 , mIsRegDlgOwner (false), mIsUpdDlgOwner (false) 156 158 { 157 159 #if defined (Q_OS_WIN32) … … 247 249 } 248 250 251 if (sKey == VBoxDefs::GUI_UpdateDlgWinID) 252 { 253 if (mIsUpdDlgOwner) 254 { 255 if (sVal.isEmpty() || 256 sVal == QString ("%1") 257 .arg ((qulonglong) vboxGlobal().mainWindow()->winId())) 258 *allowChange = TRUE; 259 else 260 *allowChange = FALSE; 261 } 262 else 263 *allowChange = TRUE; 264 return S_OK; 265 } 266 249 267 /* try to set the global setting to check its syntax */ 250 268 VBoxGlobalSettings gs (false /* non-null */); … … 288 306 } 289 307 else if (sVal == QString ("%1") 290 308 .arg ((qulonglong) vboxGlobal().mainWindow()->winId())) 291 309 { 292 310 mIsRegDlgOwner = true; … … 296 314 QApplication::postEvent (&mGlobal, new VBoxCanShowRegDlgEvent (false)); 297 315 } 316 if (sKey == VBoxDefs::GUI_UpdateDlgWinID) 317 { 318 if (sVal.isEmpty()) 319 { 320 mIsUpdDlgOwner = false; 321 QApplication::postEvent (&mGlobal, new VBoxCanShowUpdDlgEvent (true)); 322 } 323 else if (sVal == QString ("%1") 324 .arg ((qulonglong) vboxGlobal().mainWindow()->winId())) 325 { 326 mIsUpdDlgOwner = true; 327 QApplication::postEvent (&mGlobal, new VBoxCanShowUpdDlgEvent (true)); 328 } 329 else 330 QApplication::postEvent (&mGlobal, new VBoxCanShowUpdDlgEvent (false)); 331 } 298 332 if (sKey == "GUI/LanguageID") 299 333 QApplication::postEvent (&mGlobal, new VBoxChangeGUILanguageEvent (sVal)); … … 374 408 375 409 bool mIsRegDlgOwner; 410 bool mIsUpdDlgOwner; 376 411 377 412 #if defined (Q_OS_WIN32) … … 3900 3935 } 3901 3936 3937 void VBoxGlobal::showUpdateDialog (bool aForce) 3938 { 3939 bool isNecessary = VBoxUpdateDlg::isNecessary(); 3940 bool isAutomatic = VBoxUpdateDlg::isAutomatic(); 3941 3942 if (!aForce && !isNecessary) 3943 return; 3944 3945 if (mUpdDlg) 3946 { 3947 if (!mUpdDlg->isHidden()) 3948 { 3949 mUpdDlg->setWindowState (mUpdDlg->windowState() & ~Qt::WindowMinimized); 3950 mUpdDlg->raise(); 3951 mUpdDlg->activateWindow(); 3952 } 3953 } 3954 else 3955 { 3956 /* Store the ID of the main window to ensure that only one 3957 * update dialog is shown at a time. Due to manipulations with 3958 * OnExtraDataCanChange() and OnExtraDataChange() signals, this extra 3959 * data item acts like an inter-process mutex, so the first process 3960 * that attempts to set it will win, the rest will get a failure from 3961 * the SetExtraData() call. */ 3962 mVBox.SetExtraData (VBoxDefs::GUI_UpdateDlgWinID, 3963 QString ("%1").arg ((qulonglong) mMainWindow->winId())); 3964 3965 if (mVBox.isOk()) 3966 { 3967 /* We've got the "mutex", create a new update dialog */ 3968 VBoxUpdateDlg *dlg = new VBoxUpdateDlg (&mUpdDlg, 0); 3969 dlg->setAttribute (Qt::WA_DeleteOnClose); 3970 Assert (dlg == mUpdDlg); 3971 3972 if (!aForce && isAutomatic) 3973 mUpdDlg->search(); 3974 else 3975 mUpdDlg->show(); 3976 } 3977 } 3978 } 3979 3902 3980 // Protected members 3903 3981 //////////////////////////////////////////////////////////////////////////////// … … 3981 4059 { 3982 4060 emit canShowRegDlg (((VBoxCanShowRegDlgEvent *) e)->mCanShow); 4061 return true; 4062 } 4063 case VBoxDefs::CanShowUpdDlgEventType: 4064 { 4065 emit canShowUpdDlg (((VBoxCanShowUpdDlgEvent *) e)->mCanShow); 3983 4066 return true; 3984 4067 } -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp
r10149 r10439 1544 1544 } 1545 1545 1546 void VBoxProblemReporter::showUpdateResult (QWidget *aParent, 1547 const QString &aVersion, 1548 const QString &aLink) 1549 { 1550 message (aParent, Info, 1551 tr ("<p>VirtualBox New Version Notifier " 1552 "has found VirtualBox %1 version.</p>" 1553 "<p>If you would like to download and install it " 1554 "please proceed to the following link:</p>" 1555 "<p><a href=%2>%3</a></p>") 1556 .arg (aVersion, aLink, aLink)); 1557 } 1558 1546 1559 /** 1547 1560 * @return @c true if the user has confirmed input capture (this is always -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r10416 r10439 449 449 helpRegisterAction = new QAction (this); 450 450 helpRegisterAction->setIcon (VBoxGlobal::iconSet (":/register_16px.png", 451 ":/register_disabled_16px.png")); 451 ":/register_disabled_16px.png")); 452 helpUpdateAction = new QAction (this); 453 helpUpdateAction->setIcon (VBoxGlobal::iconSet (":/refresh_16px.png", 454 ":/refresh_disabled_16px.png")); 452 455 helpAboutAction = new QAction (this); 453 456 helpAboutAction->setIcon (VBoxGlobal::iconSet (":/about_16px.png")); … … 583 586 GetExtraData (VBoxDefs::GUI_RegistrationDlgWinID).isEmpty()); 584 587 #endif 588 mHelpMenu->addAction (helpUpdateAction); 589 helpUpdateAction->setEnabled (vboxGlobal().virtualBox(). 590 GetExtraData (VBoxDefs::GUI_UpdateDlgWinID).isEmpty()); 585 591 mHelpMenu->addAction (helpAboutAction); 586 592 mHelpMenu->addSeparator(); … … 659 665 connect (helpRegisterAction, SIGNAL (triggered()), 660 666 &vboxGlobal(), SLOT (showRegistrationDialog())); 667 connect (helpUpdateAction, SIGNAL (activated()), 668 &vboxGlobal(), SLOT (showUpdateDialog())); 661 669 connect (&vboxGlobal(), SIGNAL (canShowRegDlg (bool)), 662 670 helpRegisterAction, SLOT (setEnabled (bool))); 671 connect (&vboxGlobal(), SIGNAL (canShowUpdDlg (bool)), 672 helpUpdateAction, SLOT (setEnabled (bool))); 663 673 connect (helpAboutAction, SIGNAL (triggered()), 664 674 &vboxProblem(), SLOT (showHelpAboutDialog())); … … 754 764 * different to Qt3 where a *mainWidget* exists & if this going to close 755 765 * all other windows are closed automatically. We do the same below. */ 756 foreach (QWidget *widget, QApplication::topLevelWidgets()) 757 { 758 if (widget->isVisible() && 766 foreach (QWidget *widget, QApplication::topLevelWidgets()) 767 { 768 if (widget->isVisible() && 759 769 widget != this) 760 770 widget->close(); … … 1209 1219 tr ("Open VirtualBox registration form")); 1210 1220 1221 helpUpdateAction->setText (tr ("&Update VirtualBox...")); 1222 helpUpdateAction->setStatusTip ( 1223 tr ("Open VirtualBox New Version Notifier")); 1224 1211 1225 helpAboutAction->setText (tr ("&About VirtualBox...")); 1212 1226 helpAboutAction->setStatusTip (tr ("Show a dialog with product information")); -
trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp
r10112 r10439 274 274 vboxGlobal().showRegistrationDialog (false /* aForce */); 275 275 #endif 276 vboxGlobal().showUpdateDialog (false /* aForce */); 276 277 vboxGlobal().startEnumeratingMedia(); 277 278 rc = a.exec();
Note:
See TracChangeset
for help on using the changeset viewer.