VirtualBox

Changeset 5078 in vbox


Ignore:
Timestamp:
Sep 27, 2007 1:58:39 PM (17 years ago)
Author:
vboxsync
Message:

2332: Registration feature

Add Selector&Console menu "Help" item "Register..." to invoke the Registration Dialog.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r4514 r5078  
    227227    // Help actions
    228228    QAction *helpWebAction;
     229    QAction *helpRegisterAction;
    229230    QAction *helpAboutAction;
    230231    QAction *helpResetMessagesAction;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r5051 r5078  
    377377#endif
    378378
    379     void showRegistrationDialog();
     379    void callRegistration();
    380380
    381381    CSession openSession (const QUuid &id);
     
    511511
    512512    bool openURL (const QString &aURL);
     513
     514    void showRegistrationDialog();
    513515
    514516protected:
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h

    r4071 r5078  
    120120    QAction *helpContentsAction;
    121121    QAction *helpWebAction;
     122    QAction *helpRegisterAction;
    122123    QAction *helpAboutAction;
    123124    QAction *helpResetMessagesAction;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r4701 r5078  
    263263    helpWebAction = new QAction (this, "helpWebAction");
    264264    helpWebAction->setIconSet (VBoxGlobal::iconSet ("site_16px.png"));
     265    helpRegisterAction = new QAction (this, "helpRegisterAction");
     266    helpRegisterAction->setIconSet (VBoxGlobal::iconSet ("refresh_16px.png"));
    265267    helpAboutAction = new QAction (this, "helpAboutAction");
    266268    helpAboutAction->setIconSet (VBoxGlobal::iconSet ("about_16px.png"));
     
    371373    helpWebAction->addTo( helpMenu );
    372374    helpMenu->insertSeparator();
     375    helpRegisterAction->addTo( helpMenu );
    373376    helpAboutAction->addTo( helpMenu );
    374377    helpMenu->insertSeparator();
     
    519522    connect (helpWebAction, SIGNAL (activated()),
    520523             &vboxProblem(), SLOT (showHelpWebDialog()));
     524    connect (helpRegisterAction, SIGNAL (activated()),
     525             &vboxGlobal(), SLOT (showRegistrationDialog()));
    521526    connect (helpAboutAction, SIGNAL (activated()),
    522527             &vboxProblem(), SLOT (showHelpAboutDialog()));
     
    14751480        tr ("Open the browser and go to the VirtualBox product web site"));
    14761481
     1482    helpRegisterAction->setMenuText (tr ("&Register VirtualBox..."));
     1483    helpRegisterAction->setStatusTip (
     1484        tr ("Open VirtualBox registration form"));
     1485
    14771486    helpAboutAction->setMenuText (tr ("&About VirtualBox..."));
    14781487    helpAboutAction->setStatusTip (tr ("Show a dialog with product information"));
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r5051 r5078  
    16441644#endif
    16451645
    1646 void VBoxGlobal::showRegistrationDialog()
    1647 {
    1648     /* check if the registration already passed */
     1646void VBoxGlobal::callRegistration()
     1647{
     1648    /* Check if the automatic registration already passed */
    16491649    if (virtualBox().GetExtraData (VBoxDefs::GUI_RegistrationTriesLeft) == "0")
    16501650        return;
    16511651
    1652     /* store the winid of main app wgt to ensure only one reg dlg running */
     1652    /* Store the winid of main app wgt to ensure only one reg dlg running */
    16531653    virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID,
    16541654                               QString ("%1").arg ((long)qApp->mainWidget()->winId()));
     1655}
     1656
     1657void VBoxGlobal::showRegistrationDialog()
     1658{
     1659    if (mRegDlg)
     1660    {
     1661        /* Show already opened registration dialog */
     1662        mRegDlg->setWindowState (mRegDlg->windowState() & ~WindowMinimized);
     1663        mRegDlg->raise();
     1664        mRegDlg->setActiveWindow();
     1665    }
     1666    else
     1667    {
     1668        /* Create new registration dialog */
     1669        VBoxRegistrationDlg *dlg =
     1670            new VBoxRegistrationDlg (0, 0, false, WDestructiveClose);
     1671        dlg->setup (&mRegDlg, "http://www.innotek.de/register762.php");
     1672        Assert (dlg == mRegDlg);
     1673        mRegDlg->show();
     1674    }
    16551675}
    16561676
     
    34603480        case VBoxDefs::ShowRegDlgEventType:
    34613481        {
    3462             /* show unique registration dialog */
    3463             if (!mRegDlg)
    3464             {
    3465                 VBoxRegistrationDlg *dlg =
    3466                     new VBoxRegistrationDlg (0, 0, false, WDestructiveClose);
    3467                 dlg->setup (&mRegDlg, "http://www.innotek.de/register762.php");
    3468                 Assert (dlg == mRegDlg);
    3469                 mRegDlg->show();
    3470             }
     3482            showRegistrationDialog();
    34713483            return true;
    34723484        }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r5030 r5078  
    425425    helpWebAction = new QAction (this, "helpWebAction");
    426426    helpWebAction->setIconSet (VBoxGlobal::iconSet ("site_16px.png"));
     427    helpRegisterAction = new QAction (this, "helpRegisterAction");
     428    helpRegisterAction->setIconSet (VBoxGlobal::iconSet ("refresh_16px.png"));
    427429    helpAboutAction = new QAction (this, "helpAboutAction");
    428430    helpAboutAction->setIconSet (VBoxGlobal::iconSet ("about_16px.png"));
     
    522524    helpWebAction->addTo( helpMenu );
    523525    helpMenu->insertSeparator();
     526    helpRegisterAction->addTo( helpMenu );
    524527    helpAboutAction->addTo( helpMenu );
    525528    helpMenu->insertSeparator();
     
    580583    connect (helpWebAction, SIGNAL (activated()),
    581584             &vboxProblem(), SLOT (showHelpWebDialog()));
     585    connect (helpRegisterAction, SIGNAL (activated()),
     586             &vboxGlobal(), SLOT (showRegistrationDialog()));
    582587    connect (helpAboutAction, SIGNAL (activated()),
    583588             &vboxProblem(), SLOT (showHelpAboutDialog()));
     
    11001105        tr ("Open the browser and go to the VirtualBox product web site"));
    11011106
     1107    helpRegisterAction->setMenuText (tr ("&Register VirtualBox..."));
     1108    helpRegisterAction->setAccel( QString::null );
     1109    helpRegisterAction->setStatusTip (
     1110        tr ("Open VirtualBox registration form"));
     1111
    11021112    helpAboutAction->setMenuText (tr ("&About VirtualBox..."));
    11031113    helpAboutAction->setAccel( QString::null );
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r5022 r5078  
    234234                if (vboxGlobal().startMachine (vboxGlobal().managedVMUuid()))
    235235                {
    236                     vboxGlobal().showRegistrationDialog();
     236                    vboxGlobal().callRegistration();
    237237                    rc = a.exec();
    238238                }
     
    245245            {
    246246                a.setMainWidget (&vboxGlobal().selectorWnd());
    247                 vboxGlobal().showRegistrationDialog();
     247                vboxGlobal().callRegistration();
    248248                vboxGlobal().selectorWnd().show();
    249249                vboxGlobal().startEnumeratingMedia();
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