VirtualBox

Changeset 441 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 30, 2007 6:07:31 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Disabled VRDP UI when IMachine::VRDPServer is not available (i.e. in OSE).

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h

    r382 r441  
    974974    else if (pg == pageVRDP)
    975975    {
    976         valid = !(grbVRDP->isChecked() &&
    977                 (leVRDPPort->text().isEmpty() || leVRDPTimeout->text().isEmpty()));
    978         if (!valid && leVRDPPort->text().isEmpty())
    979             setWarning (tr ("VRDP Port is not set."));
    980         if (!valid && leVRDPTimeout->text().isEmpty())
    981             setWarning (tr ("VRDP Timeout is not set."));
     976        if (pageVRDP->isEnabled())
     977        {
     978            valid = !(grbVRDP->isChecked() &&
     979                    (leVRDPPort->text().isEmpty() || leVRDPTimeout->text().isEmpty()));
     980            if (!valid && leVRDPPort->text().isEmpty())
     981                setWarning (tr ("VRDP Port is not set."));
     982            if (!valid && leVRDPTimeout->text().isEmpty())
     983                setWarning (tr ("VRDP Timeout is not set."));
     984        }
     985        else
     986            valid = true;
    982987    }
    983988
     
    12321237                usbItem->setVisible (false);
    12331238
     1239            /* disable validators if any */
     1240            pageUSB->setEnabled (false);
     1241
    12341242            /* if machine has something to say, show the message */
    12351243            vboxProblem().cannotLoadMachineSettings (machine, false /* strict */);
     
    12441252
    12451253            lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild());
    1246             /*
    1247              *  silly, silly Qt -- doesn't emit currentChanged after adding the
    1248              *  first item to an empty list
    1249              */
     1254            /* silly Qt -- doesn't emit currentChanged after adding the
     1255             * first item to an empty list */
    12501256            lvUSBFilters_currentChanged (lvUSBFilters->firstChild());
    12511257        }
     
    12551261    {
    12561262        CVRDPServer vrdp = machine.GetVRDPServer();
    1257         grbVRDP->setChecked (vrdp.GetEnabled());
    1258         leVRDPPort->setText (QString::number (vrdp.GetPort()));
    1259         cbVRDPAuthType->setCurrentText (vboxGlobal().toString (vrdp.GetAuthType()));
    1260         leVRDPTimeout->setText (QString::number (vrdp.GetAuthTimeout()));
     1263
     1264        if (vrdp.isNull())
     1265        {
     1266            /* disable the VRDP category if VRDP is
     1267             * not available (i.e. in VirtualBox OSE) */
     1268
     1269            QListViewItem *vrdpItem = listView->findItem ("#vrdp", listView_Link);
     1270            Assert (vrdpItem);
     1271            if (vrdpItem)
     1272                vrdpItem->setVisible (false);
     1273
     1274            /* disable validators if any */
     1275            pageVRDP->setEnabled (false);
     1276
     1277            /* if machine has something to say, show the message */
     1278            vboxProblem().cannotLoadMachineSettings (machine, false /* strict */);
     1279        }
     1280        else
     1281        {
     1282            grbVRDP->setChecked (vrdp.GetEnabled());
     1283            leVRDPPort->setText (QString::number (vrdp.GetPort()));
     1284            cbVRDPAuthType->setCurrentText (vboxGlobal().toString (vrdp.GetAuthType()));
     1285            leVRDPTimeout->setText (QString::number (vrdp.GetAuthTimeout()));
     1286        }
    12611287    }
    12621288
     
    12711297    wvalDVD->revalidate();
    12721298    wvalFloppy->revalidate();
     1299    wvalVRDP->revalidate();
    12731300}
    12741301
     
    14791506    {
    14801507        CVRDPServer vrdp = cmachine.GetVRDPServer();
    1481         vrdp.SetEnabled (grbVRDP->isChecked());
    1482         vrdp.SetPort (leVRDPPort->text().toULong());
    1483         vrdp.SetAuthType (vboxGlobal().toVRDPAuthType (cbVRDPAuthType->currentText()));
    1484         vrdp.SetAuthTimeout (leVRDPTimeout->text().toULong());
     1508
     1509        if (!vrdp.isNull())
     1510        {
     1511            /* VRDP may be unavailable (i.e. in VirtualBox OSE) */
     1512            vrdp.SetEnabled (grbVRDP->isChecked());
     1513            vrdp.SetPort (leVRDPPort->text().toULong());
     1514            vrdp.SetAuthType (vboxGlobal().toVRDPAuthType (cbVRDPAuthType->currentText()));
     1515            vrdp.SetAuthTimeout (leVRDPTimeout->text().toULong());
     1516        }
    14851517    }
    14861518
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r436 r441  
    258258    AssertComRCReturn (rc, rc);
    259259
     260#ifdef VBOX_VRDP
    260261    rc = mMachine->COMGETTER(VRDPServer) (unconst (mVRDPServer).asOutParam());
    261262    AssertComRCReturn (rc, rc);
     263#endif   
    262264
    263265    rc = mMachine->COMGETTER(DVDDrive) (unconst (mDVDDrive).asOutParam());
     
    410412    unconst (mFloppyDrive).setNull();
    411413    unconst (mDVDDrive).setNull();
     414#ifdef VBOX_VRDP
    412415    unconst (mVRDPServer).setNull();
     416#endif
    413417
    414418    unconst (mControl).setNull();
  • trunk/src/VBox/Main/MachineImpl.cpp

    r436 r441  
    10461046STDMETHODIMP Machine::COMGETTER(VRDPServer)(IVRDPServer **vrdpServer)
    10471047{
     1048#ifdef VBOX_VRDP
    10481049    if (!vrdpServer)
    10491050        return E_POINTER;
     
    10541055    AutoReaderLock alock (this);
    10551056
    1056 #ifdef VBOX_VRDP
    10571057    Assert (!!mVRDPServer);
    10581058    mVRDPServer.queryInterfaceTo (vrdpServer);
     1059
     1060    return S_OK;
    10591061#else
    1060     *vrdpServer = NULL;
     1062    return E_NOTIMPL;
    10611063#endif
    1062 
    1063     return S_OK;
    10641064}
    10651065
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