VirtualBox

Ignore:
Timestamp:
Jul 19, 2013 1:01:39 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Machine settings: System page: Cleanup/rework (part 1): Comments.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r43459 r47253  
    8383    }
    8484
    85     /* Add all available devices types, so we could initially calculate the
    86      * right size. */
     85    /* Add all available devices types, so we could initially calculate the right size: */
    8786    for (int i = 0; i < m_possibleBootItems.size(); ++i)
    8887    {
     
    9190    }
    9291
    93     /* Setup validators */
     92    /* Setup validators: */
    9493    mLeMemory->setValidator (new QIntValidator (mSlMemory->minRAM(), mSlMemory->maxRAM(), this));
    9594    mLeCPU->setValidator (new QIntValidator (mMinGuestCPU, mMaxGuestCPU, this));
    9695    mLeCPUExecCap->setValidator(new QIntValidator(mMinGuestCPUExecCap, mMaxGuestCPUExecCap, this));
    9796
    98     /* Setup connections */
     97    /* Setup RAM connections: */
    9998    connect (mSlMemory, SIGNAL (valueChanged (int)),
    10099             this, SLOT (valueChangedRAM (int)));
     
    102101             this, SLOT (textChangedRAM (const QString&)));
    103102
     103    /* Setup boot-table connections: */
    104104    connect (mTbBootItemUp, SIGNAL (clicked()),
    105105             mTwBootOrder, SLOT(sltMoveItemUp()));
     
    109109             this, SLOT (onCurrentBootItemChanged (int)));
    110110
     111    /* Setup CPU connections: */
    111112    connect (mSlCPU, SIGNAL (valueChanged (int)),
    112113             this, SLOT (valueChangedCPU (int)));
    113114    connect (mLeCPU, SIGNAL (textChanged (const QString&)),
    114115             this, SLOT (textChangedCPU (const QString&)));
    115 
    116116    connect(mSlCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltValueChangedCPUExecCap(int)));
    117117    connect(mLeCPUExecCap, SIGNAL(textChanged(const QString&)), this, SLOT(sltTextChangedCPUExecCap(const QString&)));
    118118
    119     /* Setup iconsets */
     119    /* Setup boot-table iconsets: */
    120120    mTbBootItemUp->setIcon(UIIconPool::iconSet(":/list_moveup_16px.png",
    121121                                               ":/list_moveup_disabled_16px.png"));
     
    124124
    125125#ifdef Q_WS_MAC
    126     /* We need a little space for the focus rect. */
     126    /* We need a little space for the focus rect: */
    127127    mLtBootOrder->setContentsMargins (3, 3, 3, 3);
    128128    mLtBootOrder->setSpacing (3);
    129129#endif /* Q_WS_MAC */
    130130
    131     /* Limit min/max. size of QLineEdit */
     131    /* Limit min/max size of QLineEdit: */
    132132    mLeMemory->setFixedWidthByText (QString().fill ('8', 5));
    133     /* Ensure mLeMemory value and validation is updated */
     133    /* Ensure mLeMemory value and validation is updated: */
    134134    valueChangedRAM (mSlMemory->value());
    135135
    136     /* Setup cpu slider */
     136    /* Setup cpu slider: */
    137137    mSlCPU->setPageStep (1);
    138138    mSlCPU->setSingleStep (1);
    139139    mSlCPU->setTickInterval (1);
    140     /* Setup the scale so that ticks are at page step boundaries */
     140    /* Setup the scale so that ticks are at page step boundaries: */
    141141    mSlCPU->setMinimum (mMinGuestCPU);
    142142    mSlCPU->setMaximum (mMaxGuestCPU);
    143143    mSlCPU->setOptimalHint (1, hostCPUs);
    144144    mSlCPU->setWarningHint (hostCPUs, mMaxGuestCPU);
    145     /* Limit min/max. size of QLineEdit */
     145    /* Limit min/max. size of QLineEdit: */
    146146    mLeCPU->setFixedWidthByText(QString().fill('8', 4));
    147     /* Ensure mLeMemory value and validation is updated */
     147    /* Ensure mLeMemory value and validation is updated: */
    148148    valueChangedCPU (mSlCPU->value());
    149149
     
    166166    mCbChipset->insertItem(1, gpConverter->toString(KChipsetType_ICH9), QVariant(KChipsetType_ICH9));
    167167
    168     /* Install global event filter */
     168    /* Install global event filter: */
    169169    qApp->installEventFilter (this);
    170170
    171     /* Applying language settings */
     171    /* Retranslate finally: */
    172172    retranslateUi();
    173173}
     
    283283    mSlCPU->setValue(systemData.m_cCPUCount);
    284284    mSlCPUExecCap->setValue(systemData.m_cCPUExecCap);
    285     int iChipsetPositionPos = mCbChipset->findData(systemData.m_chipsetType);
    286     mCbChipset->setCurrentIndex(iChipsetPositionPos == -1 ? 0 : iChipsetPositionPos);
     285    int iChipsetPosition = mCbChipset->findData(systemData.m_chipsetType);
     286    mCbChipset->setCurrentIndex(iChipsetPosition == -1 ? 0 : iChipsetPosition);
    287287
    288288    /* Polish page finally: */
     
    384384void UIMachineSettingsSystem::setValidator (QIWidgetValidator *aVal)
    385385{
     386    /* Configure validation: */
    386387    mValidator = aVal;
    387388    connect (mCbApic, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
     
    393394bool UIMachineSettingsSystem::revalidate (QString &aWarning, QString & /* aTitle */)
    394395{
     396    /* RAM amount test: */
    395397    ulong fullSize = vboxGlobal().host().GetMemorySize();
    396398    if (mSlMemory->value() > (int)mSlMemory->maxRAMAlw())
     
    415417    }
    416418
    417     /* VCPU amount test */
     419    /* VCPU amount test: */
    418420    int totalCPUs = vboxGlobal().host().GetProcessorOnlineCount();
    419421    if (mSlCPU->value() > 2 * totalCPUs)
     
    437439    }
    438440
    439     /* VCPU IO-APIC test */
     441    /* VCPU IO-APIC test: */
    440442    if (mSlCPU->value() > 1 && !mCbApic->isChecked())
    441443    {
     
    448450    }
    449451
    450     /* VCPU VT-x/AMD-V test */
     452    /* VCPU VT-x/AMD-V test: */
    451453    if (mSlCPU->value() > 1 && !mCbVirt->isChecked())
    452454    {
     
    462464    if (mSlCPUExecCap->value() < (int)mMedGuestCPUExecCap)
    463465    {
    464         aWarning = tr("you have set the processor execution cap to a low value. "
    465                       "This can make the machine feel slow to respond.");
     466        aWarning = tr (
     467            "you have set the processor execution cap to a low value. "
     468            "This can make the machine feel slow to respond.");
    466469        return true;
    467470    }
    468471
    469     /* Chipset type & IO-APIC test */
     472    /* Chipset type & IO-APIC test: */
    470473    if ((KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9 && !mCbApic->isChecked())
    471474    {
     
    506509    setTabOrder (mCbTCUseUTC, mCbUseAbsHID);
    507510
    508     /* Processor tab-order */
     511    /* Processor tab-order: */
    509512    setTabOrder (mCbUseAbsHID, mSlCPU);
    510513    setTabOrder (mSlCPU, mLeCPU);
     
    513516    setTabOrder(mLeCPUExecCap, mCbPae);
    514517
    515     /* Acceleration tab-order */
     518    /* Acceleration tab-order: */
    516519    setTabOrder (mCbPae, mCbVirt);
    517520    setTabOrder (mCbVirt, mCbNestedPaging);
     
    520523void UIMachineSettingsSystem::retranslateUi()
    521524{
    522     /* Translate uic generated strings */
     525    /* Translate uic generated strings: */
    523526    Ui::UIMachineSettingsSystem::retranslateUi (this);
    524527
    525     /* Readjust the tree widget items size */
     528    /* Readjust the tree widget items size: */
    526529    adjustBootOrderTWSize();
    527530
    528     CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
    529 
    530     /* Retranslate the memory slider legend */
     531    /* Retranslate the memory slider legend: */
    531532    mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (mSlMemory->minRAM()));
    532533    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (mSlMemory->maxRAM()));
    533534
    534     /* Retranslate the cpu slider legend */
     535    /* Retranslate the cpu slider legend: */
    535536    mLbCPUMin->setText (tr ("<qt>%1&nbsp;CPU</qt>", "%1 is 1 for now").arg (mMinGuestCPU));
    536537    mLbCPUMax->setText (tr ("<qt>%1&nbsp;CPUs</qt>", "%1 is host cpu count * 2 for now").arg (mMaxGuestCPU));
     
    553554void UIMachineSettingsSystem::onCurrentBootItemChanged (int i)
    554555{
     556    /* Update boot-order tool-buttons: */
    555557    bool upEnabled   = i > 0;
    556558    bool downEnabled = i < mTwBootOrder->count() - 1;
     
    564566void UIMachineSettingsSystem::adjustBootOrderTWSize()
    565567{
     568    /* Adjust boot-table size: */
    566569    mTwBootOrder->adjustSizeToFitContent();
    567 
    568570    /* Update the layout system */
    569571    if (mTabMotherboard->layout())
     
    607609        case QEvent::FocusIn:
    608610        {
    609             /* Boot Table */
     611            /* Boot Table: */
    610612            if (widget == mTwBootOrder)
    611613            {
     
    657659    mCbTCUseUTC->setEnabled(isMachineOffline());
    658660    mCbUseAbsHID->setEnabled(isMachineOffline());
     661
    659662    /* Processor tab: */
    660663    mLbCPU->setEnabled(isMachineOffline());
     
    670673    mLbProcessorExtended->setEnabled(isMachineOffline());
    671674    mCbPae->setEnabled(isMachineOffline() && systemData.m_fPFPAESupported);
     675
    672676    /* Acceleration tab: */
    673677    mTwSystem->setTabEnabled(2, systemData.m_fPFHwVirtExSupported);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h

    r44528 r47253  
    2424#include "UIMachineSettingsSystem.gen.h"
    2525
    26 /* Machine settings / System page / Boot item: */
     26/* Machine settings / System page / Data / Boot item: */
    2727struct UIBootItemData
    2828{
     
    100100/* Machine settings / System page: */
    101101class UIMachineSettingsSystem : public UISettingsPageMachine,
    102                              public Ui::UIMachineSettingsSystem
     102                                public Ui::UIMachineSettingsSystem
    103103{
    104104    Q_OBJECT;
     
    106106public:
    107107
     108    /* Constructor: */
    108109    UIMachineSettingsSystem();
    109110
     111    /* API: Correlation stuff: */
    110112    bool isHWVirtExEnabled() const;
    111113    bool isHIDEnabled() const;
    112114    KChipsetType chipsetType() const;
    113115    void setOHCIEnabled(bool fEnabled);
    114 
    115 signals:
    116 
    117     void tableChanged();
    118116
    119117protected:
     
    133131    void saveFromCacheTo(QVariant &data);
    134132
    135     /* Page changed: */
     133    /* API: Cache stuff: */
    136134    bool changed() const { return m_cache.wasChanged(); }
    137135
     136    /* Helpers: Validation stuff: */
    138137    void setValidator (QIWidgetValidator *aVal);
    139138    bool revalidate (QString &aWarning, QString &aTitle);
    140139
     140    /* Helper: Navigation stuff: */
    141141    void setOrderAfter (QWidget *aWidget);
    142142
     143    /* Helper: Translation stuff: */
    143144    void retranslateUi();
    144145
    145146private slots:
    146147
     148    /* Handlers: RAM stuff: */
    147149    void valueChangedRAM (int aVal);
    148150    void textChangedRAM (const QString &aText);
    149151
     152    /* Handler: Boot stuff: */
    150153    void onCurrentBootItemChanged (int);
    151154
     155    /* Handlers: CPU stuff: */
    152156    void valueChangedCPU (int aVal);
    153157    void textChangedCPU (const QString &aText);
     
    157161private:
    158162
     163    /* Handler: Event-filtration stuff: */
    159164    bool eventFilter (QObject *aObject, QEvent *aEvent);
    160165
     166    /* Helper: Boot stuff: */
    161167    void adjustBootOrderTWSize();
    162168
     169    /* Handler: Polishing stuff: */
    163170    void polishPage();
    164171
     172    /* Variable: Validation stuff: */
    165173    QIWidgetValidator *mValidator;
    166174
     175    /* Variables: CPU stuff: */
    167176    uint mMinGuestCPU;
    168177    uint mMaxGuestCPU;
     
    171180    uint mMaxGuestCPUExecCap;
    172181
     182    /* Variable: Boot stuff: */
    173183    QList<KDeviceType> m_possibleBootItems;
    174184
     185    /* Variable: Correlation stuff: */
    175186    bool m_fOHCIEnabled;
    176187
     
    180191
    181192#endif // __UIMachineSettingsSystem_h__
    182 
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