VirtualBox

Changeset 9089 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 23, 2008 3:20:30 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4: Updated the left over designer classes to use the new QIWithRetranslateUI base class.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
13 edited

Legend:

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

    r9072 r9089  
    347347
    348348class VBoxSharedFoldersSettings;
    349 class VBoxSFDialog : public QDialog
     349class VBoxSFDialog : public QIWithRetranslateUI<QDialog>
    350350{
    351     Q_OBJECT
     351    Q_OBJECT;
    352352
    353353public:
    354354
    355355    VBoxSFDialog (QWidget*, CSession&);
     356
     357protected:
     358
     359    void retranslateUi();
    356360
    357361protected slots:
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNewVMWzd.h

    r8621 r9089  
    2424#define __VBoxNewVMWzd_h__
    2525
    26 #include <QIAbstractWizard.h>
    27 #include <VBoxNewVMWzd.gen.h>
    28 #include <COMDefs.h>
    29 #include <QIWidgetValidator.h>
     26#include "QIAbstractWizard.h"
     27#include "VBoxNewVMWzd.gen.h"
     28#include "COMDefs.h"
     29#include "QIWidgetValidator.h"
     30#include "QIWithRetranslateUI.h"
    3031
    31 class VBoxNewVMWzd : public QIAbstractWizard, public Ui::VBoxNewVMWzd
     32class VBoxNewVMWzd : public QIWithRetranslateUI<QIAbstractWizard>,
     33                     public Ui::VBoxNewVMWzd
    3234{
    3335    Q_OBJECT;
     
    3941
    4042    const CMachine& machine() const;
     43
     44protected:
     45
     46    void retranslateUi();
    4147
    4248private slots:
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxRegistrationDlg.h

    r8648 r9089  
    2424#define __VBoxRegistrationDlg_h__
    2525
    26 #include <QIAbstractWizard.h>
    27 #include <VBoxRegistrationDlg.gen.h>
    28 #include <COMDefs.h>
    29 #include <QIWidgetValidator.h>
     26#include "QIAbstractWizard.h"
     27#include "VBoxRegistrationDlg.gen.h"
     28#include "COMDefs.h"
     29#include "QIWidgetValidator.h"
     30#include "QIWithRetranslateUI.h"
    3031
    3132/* Qt includes */
     
    3435class VBoxNetworkFramework;
    3536
    36 class VBoxRegistrationDlg : public QIAbstractWizard, public Ui::VBoxRegistrationDlg
     37class VBoxRegistrationDlg : public QIWithRetranslateUI2<QIAbstractWizard>,
     38                            public Ui::VBoxRegistrationDlg
    3739{
    3840    Q_OBJECT;
     
    4547
    4648    static bool hasToBeShown();
     49
     50protected:
     51
     52    void retranslateUi();
    4753
    4854private slots:
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSharedFoldersSettings.h

    r8741 r9089  
    2424#define __VBoxSharedFoldersSettings_h__
    2525
    26 #include <VBoxSharedFoldersSettings.gen.h>
     26#include "VBoxSharedFoldersSettings.gen.h"
     27#include "QIWithRetranslateUI.h"
    2728
    2829/* Qt includes */
     
    4647typedef QList<SFolderName> SFoldersNameList;
    4748
    48 class VBoxSharedFoldersSettings : public QWidget, public Ui::VBoxSharedFoldersSettings
     49class VBoxSharedFoldersSettings : public QIWithRetranslateUI<QWidget>,
     50                                  public Ui::VBoxSharedFoldersSettings
    4951{
    5052    Q_OBJECT;
     
    6365    void putBackToMachine();
    6466    void putBackToConsole();
     67
     68protected:
     69
     70    void retranslateUi();
    6571
    6672private slots:
     
    103109};
    104110
    105 class VBoxAddSFDialog : public QDialog
     111class VBoxAddSFDialog : public QIWithRetranslateUI<QDialog>
    106112{
    107113    Q_OBJECT;
     
    131137    void setWritable (bool aWritable);
    132138
     139protected:
     140
     141    void retranslateUi();
     142
    133143private slots:
    134144
     
    140150    void showEvent (QShowEvent *aEvent);
    141151
    142     QIDialogButtonBox *mButtonBox;
    143     QLineEdit         *mLePath;
    144     QLineEdit         *mLeName;
    145     QCheckBox         *mCbPermanent;
    146     QCheckBox         *mCbReadonly;
    147     SFoldersNameList   mUsedNames;
     152    VBoxAddSFDialog::DialogType  mType;
     153    QIDialogButtonBox           *mButtonBox;
     154    QLabel                      *mLbPath;
     155    QLineEdit                   *mLePath;
     156    QToolButton                 *mTbPath;
     157    QLabel                      *mLbName;
     158    QLineEdit                   *mLeName;
     159    QCheckBox                   *mCbPermanent;
     160    QCheckBox                   *mCbReadonly;
     161    SFoldersNameList             mUsedNames;
    148162};
    149163
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxTakeSnapshotDlg.h

    r8743 r9089  
    2424#define __VBoxTakeSnapshotDlg_h__
    2525
    26 #include <VBoxTakeSnapshotDlg.gen.h>
     26#include "VBoxTakeSnapshotDlg.gen.h"
     27#include "QIWithRetranslateUI.h"
    2728
    28 class VBoxTakeSnapshotDlg : public QDialog, public Ui::VBoxTakeSnapshotDlg
     29class VBoxTakeSnapshotDlg : public QIWithRetranslateUI<QDialog>,
     30                            public Ui::VBoxTakeSnapshotDlg
    2931{
    3032    Q_OBJECT;
     
    3335
    3436    VBoxTakeSnapshotDlg (QWidget *aParent);
     37
     38protected:
     39
     40    void retranslateUi();
    3541
    3642private slots:
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMFirstRunWzd.h

    r8641 r9089  
    2424#define __VBoxVMFirstRunWzd_h__
    2525
    26 #include <QIAbstractWizard.h>
    27 #include <VBoxVMFirstRunWzd.gen.h>
    28 #include <COMDefs.h>
    29 #include <QIWidgetValidator.h>
     26#include "QIAbstractWizard.h"
     27#include "VBoxVMFirstRunWzd.gen.h"
     28#include "COMDefs.h"
     29#include "QIWidgetValidator.h"
     30#include "QIWithRetranslateUI.h"
    3031
    31 class VBoxVMFirstRunWzd : public QIAbstractWizard, public Ui::VBoxVMFirstRunWzd
     32class VBoxVMFirstRunWzd : public QIWithRetranslateUI<QIAbstractWizard>,
     33                          public Ui::VBoxVMFirstRunWzd
    3234{
    3335    Q_OBJECT;
     
    3638
    3739    VBoxVMFirstRunWzd (const CMachine &aMachine, QWidget *aParent = 0);
     40
     41protected:
     42
     43    void retranslateUi();
    3844
    3945private slots:
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r9072 r9089  
    34833483
    34843484VBoxSFDialog::VBoxSFDialog (QWidget *aParent, CSession &aSession)
    3485     : QDialog (aParent)
     3485    : QIWithRetranslateUI<QDialog> (aParent)
    34863486    , mSettings (0)
    34873487    , mSession (aSession)
     
    34893489    setModal (true);
    34903490    /* Setup Dialog's options */
    3491     setWindowTitle (tr ("Shared Folders"));
    34923491    setWindowIcon (QIcon (":/select_file_16px.png"));
    34933492    setSizeGripEnabled (true);
     
    35113510    connect (buttonBox, SIGNAL (rejected()), this, SLOT (reject()));
    35123511    mainLayout->addWidget (buttonBox);
     3512
     3513    retranslateUi();
     3514}
     3515
     3516void VBoxSFDialog::retranslateUi()
     3517{
     3518    setWindowTitle (tr ("Shared Folders"));
    35133519}
    35143520
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewHDWzd.cpp

    r8621 r9089  
    2121 */
    2222
    23 #include <VBoxNewHDWzd.h>
    24 #include <VBoxGlobal.h>
    25 #include <VBoxProblemReporter.h>
     23#include "VBoxNewHDWzd.h"
     24#include "VBoxGlobal.h"
     25#include "VBoxProblemReporter.h"
    2626
    2727/* Qt includes */
     
    9292
    9393VBoxNewHDWzd::VBoxNewHDWzd (QWidget *aParent)
    94     : QIAbstractWizard (aParent)
     94    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
    9595{
    9696    /* Apply UI decorations */
    97     setupUi (this);
     97    Ui::VBoxNewHDWzd::setupUi (this);
    9898
    9999    /* Initialize wizard hdr */
     
    161161    /* Initialize wizard ftr */
    162162    initializeWizardFtr();
     163
     164    retranslateUi();
    163165}
    164166
     
    177179}
    178180
    179 
    180 void VBoxNewHDWzd::accept()
    181 {
    182     /* Try to create the hard disk when the Finish button is pressed.
    183      * On failure, the wisard will remain open to give it another try. */
    184     if (createHardDisk())
    185         QIAbstractWizard::accept();
    186 }
    187 
    188 void VBoxNewHDWzd::slSizeValueChanged (int aVal)
    189 {
    190     if (focusWidget() == mSlSize)
    191     {
    192         mCurrentSize = sliderToSizeMB (aVal, mSliderScale);
    193         mLeSize->setText (vboxGlobal().formatSize (mCurrentSize * _1M));
    194         updateSizeToolTip (mCurrentSize * _1M);
    195     }
    196 }
    197 
    198 void VBoxNewHDWzd::leSizeTextChanged (const QString &aText)
    199 {
    200     if (focusWidget() == mLeSize)
    201     {
    202         mCurrentSize = vboxGlobal().parseSize (aText);
    203         updateSizeToolTip (mCurrentSize);
    204         mCurrentSize /= _1M;
    205         mSlSize->setValue (sizeMBToSlider (mCurrentSize, mSliderScale));
    206     }
    207 }
    208 
    209 void VBoxNewHDWzd::tbNameSelectClicked()
    210 {
    211     /* set the first parent directory that exists as the current */
    212     QFileInfo fld (composeFullFileName (mLeName->text()));
    213     do
    214     {
    215         QString dp = fld.path ();
    216         fld = QFileInfo (dp);
    217     }
    218     while (!fld.exists() && !QDir (fld.absoluteFilePath()).isRoot());
    219 
    220     if (!fld.exists())
    221     {
    222         CVirtualBox vbox = vboxGlobal().virtualBox();
    223         fld = QFileInfo (vbox.GetSystemProperties().GetDefaultVDIFolder());
    224         if (!fld.exists())
    225             fld = vbox.GetHomeFolder();
    226     }
    227 
    228     QString selected = QFileDialog::getSaveFileName (
    229         this,
    230         tr ("Select a file for the new hard disk image file"),
    231         fld.absoluteFilePath(),
    232         tr ("Hard disk images (*.vdi)"));
    233 
    234     if (!selected.isEmpty())
    235     {
    236         if (QFileInfo (selected).completeSuffix().isEmpty())
    237             selected += ".vdi";
    238         mLeName->setText (QDir::convertSeparators (selected));
    239         mLeName->selectAll();
    240         mLeName->setFocus();
    241     }
    242 }
    243 
    244 void VBoxNewHDWzd::revalidate (QIWidgetValidator *aWval)
    245 {
    246     /* do individual validations for pages */
    247     bool valid = aWval->isOtherValid();
    248 
    249     if (aWval == mWvalNameAndSize)
    250         valid = mCurrentSize >= MinVDISize && mCurrentSize <= mMaxVDISize;
    251 
    252     aWval->setOtherValid (valid);
    253 }
    254 
    255 void VBoxNewHDWzd::enableNext (const QIWidgetValidator *aWval)
    256 {
    257     nextButton (aWval->widget())->setEnabled (aWval->isValid());
    258 }
    259 
    260 void VBoxNewHDWzd::onPageShow()
    261 {
     181void VBoxNewHDWzd::retranslateUi()
     182{
     183   /* Translate uic generated strings */
     184    Ui::VBoxNewHDWzd::retranslateUi (this);
     185
    262186    QWidget *page = mPageStack->currentWidget();
    263187
    264     if (page == mPageWelcome)
    265         nextButton (page)->setFocus();
    266     else if (page == mPageType)
    267         mRbDynamicType->isChecked() ? mRbDynamicType->setFocus() :
    268                                       mRbFixedType->setFocus();
    269     else if (page == mPageNameAndSize)
    270         mLeName->setFocus();
    271     else if (page == mPageSummary)
     188    if (page == mPageSummary)
    272189    {
    273190        QString type = mRbDynamicType->isChecked() ? mRbDynamicType->text()
     
    291208
    292209        mTeSummary->setText (summary);
     210    }
     211}
     212
     213void VBoxNewHDWzd::accept()
     214{
     215    /* Try to create the hard disk when the Finish button is pressed.
     216     * On failure, the wisard will remain open to give it another try. */
     217    if (createHardDisk())
     218        QIAbstractWizard::accept();
     219}
     220
     221void VBoxNewHDWzd::slSizeValueChanged (int aVal)
     222{
     223    if (focusWidget() == mSlSize)
     224    {
     225        mCurrentSize = sliderToSizeMB (aVal, mSliderScale);
     226        mLeSize->setText (vboxGlobal().formatSize (mCurrentSize * _1M));
     227        updateSizeToolTip (mCurrentSize * _1M);
     228    }
     229}
     230
     231void VBoxNewHDWzd::leSizeTextChanged (const QString &aText)
     232{
     233    if (focusWidget() == mLeSize)
     234    {
     235        mCurrentSize = vboxGlobal().parseSize (aText);
     236        updateSizeToolTip (mCurrentSize);
     237        mCurrentSize /= _1M;
     238        mSlSize->setValue (sizeMBToSlider (mCurrentSize, mSliderScale));
     239    }
     240}
     241
     242void VBoxNewHDWzd::tbNameSelectClicked()
     243{
     244    /* set the first parent directory that exists as the current */
     245    QFileInfo fld (composeFullFileName (mLeName->text()));
     246    do
     247    {
     248        QString dp = fld.path ();
     249        fld = QFileInfo (dp);
     250    }
     251    while (!fld.exists() && !QDir (fld.absoluteFilePath()).isRoot());
     252
     253    if (!fld.exists())
     254    {
     255        CVirtualBox vbox = vboxGlobal().virtualBox();
     256        fld = QFileInfo (vbox.GetSystemProperties().GetDefaultVDIFolder());
     257        if (!fld.exists())
     258            fld = vbox.GetHomeFolder();
     259    }
     260
     261    QString selected = QFileDialog::getSaveFileName (
     262        this,
     263        tr ("Select a file for the new hard disk image file"),
     264        fld.absoluteFilePath(),
     265        tr ("Hard disk images (*.vdi)"));
     266
     267    if (!selected.isEmpty())
     268    {
     269        if (QFileInfo (selected).completeSuffix().isEmpty())
     270            selected += ".vdi";
     271        mLeName->setText (QDir::convertSeparators (selected));
     272        mLeName->selectAll();
     273        mLeName->setFocus();
     274    }
     275}
     276
     277void VBoxNewHDWzd::revalidate (QIWidgetValidator *aWval)
     278{
     279    /* do individual validations for pages */
     280    bool valid = aWval->isOtherValid();
     281
     282    if (aWval == mWvalNameAndSize)
     283        valid = mCurrentSize >= MinVDISize && mCurrentSize <= mMaxVDISize;
     284
     285    aWval->setOtherValid (valid);
     286}
     287
     288void VBoxNewHDWzd::enableNext (const QIWidgetValidator *aWval)
     289{
     290    nextButton (aWval->widget())->setEnabled (aWval->isValid());
     291}
     292
     293void VBoxNewHDWzd::onPageShow()
     294{
     295    /* Make sure all is properly translated & composed */
     296    retranslateUi();
     297
     298    QWidget *page = mPageStack->currentWidget();
     299
     300    if (page == mPageWelcome)
     301        nextButton (page)->setFocus();
     302    else if (page == mPageType)
     303        mRbDynamicType->isChecked() ? mRbDynamicType->setFocus() :
     304                                      mRbFixedType->setFocus();
     305    else if (page == mPageNameAndSize)
     306        mLeName->setFocus();
     307    else if (page == mPageSummary)
    293308        mTeSummary->setFocus();
    294     }
    295309
    296310    if (page == mPageSummary)
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewVMWzd.cpp

    r8875 r9089  
    2121 */
    2222
    23 #include <VBoxNewVMWzd.h>
    24 #include <VBoxUtils.h>
    25 #include <VBoxGlobal.h>
    26 #include <VBoxProblemReporter.h>
    27 #include <VBoxNewHDWzd.h>
    28 #include <VBoxDiskImageManagerDlg.h>
     23#include "VBoxNewVMWzd.h"
     24#include "VBoxUtils.h"
     25#include "VBoxGlobal.h"
     26#include "VBoxProblemReporter.h"
     27#include "VBoxNewHDWzd.h"
     28#include "VBoxDiskImageManagerDlg.h"
    2929
    3030/**
     
    5050
    5151VBoxNewVMWzd::VBoxNewVMWzd (QWidget *aParent)
    52     : QIAbstractWizard (aParent)
     52    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
    5353{
    5454    /* Apply UI decorations */
    55     setupUi (this);
     55    Ui::VBoxNewVMWzd::setupUi (this);
    5656
    5757    /* Initialize wizard hdr */
     
    110110    mSlRAM->setRange ((MinRAM / mSlRAM->pageStep()) * mSlRAM->pageStep(),
    111111                      MaxRAM);
    112     mTxRAMMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (MinRAM));
    113     mTxRAMMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (MaxRAM));
    114112    /* Initial RAM value is set in cbOSActivated()
    115113     * limit min/max. size of QLineEdit */
     
    129127    /* Initialize wizard ftr */
    130128    initializeWizardFtr();
     129
     130    retranslateUi();
    131131}
    132132
     
    141141}
    142142
     143void VBoxNewVMWzd::retranslateUi()
     144{
     145   /* Translate uic generated strings */
     146    Ui::VBoxNewVMWzd::retranslateUi (this);
     147
     148    CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());
     149
     150    mTextRAMBest->setText (
     151        tr ("The recommended base memory size is <b>%1</b> MB.")
     152            .arg (type.GetRecommendedRAM()));
     153    mSlRAM->setValue (type.GetRecommendedRAM());
     154    mTextVDIBest->setText (
     155        tr ("The recommended size of the boot hard disk is <b>%1</b> MB.")
     156            .arg (type.GetRecommendedHDD()));
     157
     158    CSystemProperties sysProps = vboxGlobal().virtualBox().GetSystemProperties();
     159    const uint MinRAM = sysProps.GetMinGuestRAM();
     160    const uint MaxRAM = sysProps.GetMaxGuestRAM();
     161
     162    mTxRAMMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (MinRAM));
     163    mTxRAMMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (MaxRAM));
     164
     165    QWidget *page = mPageStack->currentWidget();
     166
     167    if (page == mPageSummary)
     168    {
     169        /* compose summary */
     170        QString summary = QString (tr (
     171            "<tr><td><nobr>Name:</nobr></td><td>%1</td></tr>"
     172            "<tr><td><nobr>OS Type:</nobr></td><td>%2<</td></tr>"
     173            "<tr><td><nobr>Base Memory:</nobr></td><td>%3&nbsp;MB</td></tr>"))
     174            .arg (mLeName->text())
     175            .arg (vboxGlobal().vmGuestOSType (mCbOS->currentIndex()).GetDescription())
     176            .arg (mSlRAM->value());
     177
     178        if (mMediaCombo->currentIndex())
     179            summary += QString (tr (
     180                "<tr><td><nobr>Boot Hard Disk:</nobr></td><td>%4</td></tr>"))
     181                .arg (mMediaCombo->currentText());
     182
     183        mTeSummary->setText ("<table cellspacing=0 cellpadding=2>" + summary + "</table>");
     184    }
     185}
    143186
    144187void VBoxNewVMWzd::accept()
     
    210253    CGuestOSType type = vboxGlobal().vmGuestOSType (aItem);
    211254    mPmOS->setPixmap (vboxGlobal().vmGuestOSTypeIcon (type.GetId()));
    212     mTextRAMBest->setText (
    213         tr ("The recommended base memory size is <b>%1</b> MB.")
    214             .arg (type.GetRecommendedRAM()));
    215     mSlRAM->setValue (type.GetRecommendedRAM());
    216     mTextVDIBest->setText (
    217         tr ("The recommended size of the boot hard disk is <b>%1</b> MB.")
    218             .arg (type.GetRecommendedHDD()));
    219255}
    220256
     
    247283void VBoxNewVMWzd::onPageShow()
    248284{
     285    /* Make sure all is properly translated & composed */
     286    retranslateUi();
     287
    249288    QWidget *page = mPageStack->currentWidget();
    250289
     
    258297        mMediaCombo->setFocus();
    259298    else if (page == mPageSummary)
    260     {
    261         /* compose summary */
    262         QString summary = QString (tr (
    263             "<tr><td><nobr>Name:</nobr></td><td>%1</td></tr>"
    264             "<tr><td><nobr>OS Type:</nobr></td><td>%2<</td></tr>"
    265             "<tr><td><nobr>Base Memory:</nobr></td><td>%3&nbsp;MB</td></tr>"))
    266             .arg (mLeName->text())
    267             .arg (vboxGlobal().vmGuestOSType (mCbOS->currentIndex()).GetDescription())
    268             .arg (mSlRAM->value());
    269 
    270         if (mMediaCombo->currentIndex())
    271             summary += QString (tr (
    272                 "<tr><td><nobr>Boot Hard Disk:</nobr></td><td>%4</td></tr>"))
    273                 .arg (mMediaCombo->currentText());
    274 
    275         mTeSummary->setText ("<table cellspacing=0 cellpadding=2>" + summary + "</table>");
    276299        mTeSummary->setFocus();
    277     }
    278300
    279301    if (page == mPageSummary)
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxRegistrationDlg.cpp

    r8648 r9089  
    2121 */
    2222
    23 #include <VBoxRegistrationDlg.h>
    24 #include <VBoxGlobal.h>
    25 #include <VBoxProblemReporter.h>
    26 #include <VBoxNetworkFramework.h>
     23#include "VBoxRegistrationDlg.h"
     24#include "VBoxGlobal.h"
     25#include "VBoxProblemReporter.h"
     26#include "VBoxNetworkFramework.h"
    2727
    2828/* Qt includes */
     
    197197                                          QWidget *aParent,
    198198                                          Qt::WindowFlags aFlags)
    199     : QIAbstractWizard (aParent, aFlags)
     199    : QIWithRetranslateUI2<QIAbstractWizard> (aParent, aFlags)
    200200    , mSelf (aSelf)
    201201    , mWvalReg (0)
     
    211211
    212212    /* Apply UI decorations */
    213     setupUi (this);
     213    Ui::VBoxRegistrationDlg::setupUi (this);
    214214
    215215    /* Initialize wizard hdr */
     
    261261    /* Initialize wizard hdr */
    262262    initializeWizardFtr();
     263
     264    retranslateUi();
    263265}
    264266
     
    284286    return !regData.isValid() ||
    285287           (!regData.isRegistered() && regData.triesLeft() > 0);
     288}
     289
     290void VBoxRegistrationDlg::retranslateUi()
     291{
     292    /* Translate uic generated strings */
     293    Ui::VBoxRegistrationDlg::retranslateUi (this);
    286294}
    287295
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSharedFoldersSettings.cpp

    r8783 r9089  
    173173VBoxSharedFoldersSettings::VBoxSharedFoldersSettings (QWidget *aParent,
    174174                                                      int aType)
    175     : QWidget (aParent)
     175    : QIWithRetranslateUI<QWidget> (aParent)
    176176    , mDialogType (aType)
    177177    , mIsListViewChanged (false)
    178     , mTrFull (tr ("Full"))
    179     , mTrReadOnly (tr ("Read-only"))
    180178{
    181179    /* Apply UI decorations */
    182     setupUi (this);
     180    Ui::VBoxSharedFoldersSettings::setupUi (this);
    183181
    184182    mTreeView->header()->setMovable (false);
     
    225223    }
    226224    mTreeView->sortItems (0, Qt::Ascending);
     225
     226    retranslateUi();
    227227}
    228228
     
    297297}
    298298
     299void VBoxSharedFoldersSettings::retranslateUi()
     300{
     301    /* Translate uic generated strings */
     302    Ui::VBoxSharedFoldersSettings::retranslateUi (this);
     303
     304    mTrFull = tr ("Full");
     305    mTrReadOnly = tr ("Read-only");
     306}
    299307
    300308void VBoxSharedFoldersSettings::tbAddPressed()
     
    657665                                  bool aEnableSelector,
    658666                                  const SFoldersNameList &aUsedNames)
    659     : QDialog (aParent)
    660     , mLePath (0), mLeName (0), mCbPermanent (0), mCbReadonly (0)
     667    : QIWithRetranslateUI<QDialog> (aParent)
     668    , mType(aType), mLePath (0), mLeName (0), mCbPermanent (0), mCbReadonly (0)
    661669    , mUsedNames (aUsedNames)
    662670{
    663671    setModal (true);
    664672
    665     switch (aType)
     673    QVBoxLayout *mainLayout = new QVBoxLayout (this);
     674
     675    /* Setup Input layout */
     676    QGridLayout *inputLayout = new QGridLayout ();
     677    mainLayout->addLayout (inputLayout);
     678    mLbPath = new QLabel (this);
     679    mLePath = new QLineEdit (this);
     680    mTbPath = new QToolButton (this);
     681    mTbPath->setAutoRaise (true);
     682    mLbName = new QLabel (this);
     683    mLeName = new QLineEdit (this);
     684    mTbPath->setIcon (VBoxGlobal::iconSet (":/select_file_16px.png",
     685                                          ":/select_file_dis_16px.png"));
     686    mTbPath->setFocusPolicy (Qt::TabFocus);
     687    connect (mLePath, SIGNAL (textChanged (const QString &)),
     688             this, SLOT (validate()));
     689    connect (mLeName, SIGNAL (textChanged (const QString &)),
     690             this, SLOT (validate()));
     691    connect (mTbPath, SIGNAL (clicked()), this, SLOT (showFileDialog()));
     692    mCbReadonly = new QCheckBox (this);
     693    mCbReadonly->setChecked (false);
     694
     695    inputLayout->addWidget (mLbPath,  0, 0);
     696    inputLayout->addWidget (mLePath, 0, 1);
     697    inputLayout->addWidget (mTbPath,  0, 2);
     698    inputLayout->addWidget (mLbName,  1, 0);
     699    inputLayout->addWidget (mLeName, 1, 1, 1, 2);
     700    inputLayout->addWidget (mCbReadonly, 2, 0, 1, 3);
     701
     702    if (aEnableSelector)
     703    {
     704        mCbPermanent = new QCheckBox (this);
     705        mCbPermanent->setChecked (true);
     706        inputLayout->addWidget (mCbPermanent, 3, 0, 1, 3);
     707        connect (mCbPermanent, SIGNAL (toggled (bool)),
     708                 this, SLOT (validate()));
     709    }
     710
     711    /* Setup Button layout */
     712    mButtonBox = new QIDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
     713    mButtonBox->setCenterButtons (true);
     714    connect (mButtonBox, SIGNAL (accepted()), this, SLOT (accept()));
     715    connect (mButtonBox, SIGNAL (rejected()), this, SLOT (reject()));
     716    mainLayout->addWidget (mButtonBox);
     717
     718    /* Validate fields */
     719    validate();
     720
     721    retranslateUi();
     722}
     723
     724QString VBoxAddSFDialog::getPath()
     725{
     726    return mLePath->text();
     727}
     728QString VBoxAddSFDialog::getName()
     729{
     730    return mLeName->text();
     731}
     732bool VBoxAddSFDialog::getPermanent()
     733{
     734    return mCbPermanent ? mCbPermanent->isChecked() : true;
     735}
     736bool VBoxAddSFDialog::getWritable()
     737{
     738    return !mCbReadonly->isChecked();
     739}
     740
     741void VBoxAddSFDialog::setPath (const QString &aPath)
     742{
     743    mLePath->setText (aPath);
     744}
     745void VBoxAddSFDialog::setName (const QString &aName)
     746{
     747    mLeName->setText (aName);
     748}
     749void VBoxAddSFDialog::setPermanent (bool aPermanent)
     750{
     751    if (mCbPermanent)
     752    {
     753        mCbPermanent->setChecked (aPermanent);
     754        mCbPermanent->setEnabled (!aPermanent);
     755    }
     756}
     757void VBoxAddSFDialog::setWritable (bool aWritable)
     758{
     759    mCbReadonly->setChecked (!aWritable);
     760}
     761
     762void VBoxAddSFDialog::retranslateUi()
     763{
     764    switch (mType)
    666765    {
    667766        case AddDialogType:
     
    675774    }
    676775
    677     QVBoxLayout *mainLayout = new QVBoxLayout (this);
    678 
    679     /* Setup Input layout */
    680     QGridLayout *inputLayout = new QGridLayout ();
    681     mainLayout->addLayout (inputLayout);
    682     QLabel *lbPath = new QLabel (tr ("Folder Path"), this);
    683     mLePath = new QLineEdit (this);
    684     QToolButton *tbPath = new QToolButton (this);
    685     tbPath->setAutoRaise (true);
    686     QLabel *lbName = new QLabel (tr ("Folder Name"), this);
    687     mLeName = new QLineEdit (this);
    688     tbPath->setIcon (VBoxGlobal::iconSet (":/select_file_16px.png",
    689                                           ":/select_file_dis_16px.png"));
    690     tbPath->setFocusPolicy (Qt::TabFocus);
    691     connect (mLePath, SIGNAL (textChanged (const QString &)),
    692              this, SLOT (validate()));
    693     connect (mLeName, SIGNAL (textChanged (const QString &)),
    694              this, SLOT (validate()));
    695     connect (tbPath, SIGNAL (clicked()), this, SLOT (showFileDialog()));
     776    mLbPath->setText (tr ("Folder Path"));
    696777    mLePath->setWhatsThis (tr ("Displays the path to an existing folder "
    697778                               "on the host PC."));
     779
     780    mLbName->setText (tr ("Folder Name"));
    698781    mLeName->setWhatsThis (tr ("Displays the name of the shared folder "
    699782                               "(as it will be seen by the guest OS)."));
    700     tbPath->setWhatsThis (tr ("Opens the dialog to select a folder."));
    701     mCbReadonly = new QCheckBox (tr ("&Read-only"), this);
    702     mCbReadonly->setChecked (false);
     783
     784    mTbPath->setWhatsThis (tr ("Opens the dialog to select a folder."));
     785
     786    mCbReadonly->setText (tr ("&Read-only"));
    703787    mCbReadonly->setWhatsThis (tr ("When checked, the guest OS will not "
    704788                                   "be able to write to the specified "
    705789                                   "shared folder."));
    706790
    707     inputLayout->addWidget (lbPath,  0, 0);
    708     inputLayout->addWidget (mLePath, 0, 1);
    709     inputLayout->addWidget (tbPath,  0, 2);
    710     inputLayout->addWidget (lbName,  1, 0);
    711     inputLayout->addWidget (mLeName, 1, 1, 1, 2);
    712     inputLayout->addWidget (mCbReadonly, 2, 0, 1, 3);
    713 
    714     if (aEnableSelector)
    715     {
    716         mCbPermanent = new QCheckBox (tr ("&Make Permanent"), this);
    717         mCbPermanent->setChecked (true);
    718         inputLayout->addWidget (mCbPermanent, 3, 0, 1, 3);
    719         connect (mCbPermanent, SIGNAL (toggled (bool)),
    720                  this, SLOT (validate()));
    721     }
    722 
    723     /* Setup Button layout */
    724     mButtonBox = new QIDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    725     mButtonBox->setCenterButtons (true);
    726     connect (mButtonBox, SIGNAL (accepted()), this, SLOT (accept()));
    727     connect (mButtonBox, SIGNAL (rejected()), this, SLOT (reject()));
    728     mainLayout->addWidget (mButtonBox);
    729 
    730     /* Validate fields */
    731     validate();
    732 }
    733 
    734 QString VBoxAddSFDialog::getPath()
    735 {
    736     return mLePath->text();
    737 }
    738 QString VBoxAddSFDialog::getName()
    739 {
    740     return mLeName->text();
    741 }
    742 bool VBoxAddSFDialog::getPermanent()
    743 {
    744     return mCbPermanent ? mCbPermanent->isChecked() : true;
    745 }
    746 bool VBoxAddSFDialog::getWritable()
    747 {
    748     return !mCbReadonly->isChecked();
    749 }
    750 
    751 void VBoxAddSFDialog::setPath (const QString &aPath)
    752 {
    753     mLePath->setText (aPath);
    754 }
    755 void VBoxAddSFDialog::setName (const QString &aName)
    756 {
    757     mLeName->setText (aName);
    758 }
    759 void VBoxAddSFDialog::setPermanent (bool aPermanent)
    760 {
    761791    if (mCbPermanent)
    762     {
    763         mCbPermanent->setChecked (aPermanent);
    764         mCbPermanent->setEnabled (!aPermanent);
    765     }
    766 }
    767 void VBoxAddSFDialog::setWritable (bool aWritable)
    768 {
    769     mCbReadonly->setChecked (!aWritable);
     792        mCbPermanent->setText (tr ("&Make Permanent"));
    770793}
    771794
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxTakeSnapshotDlg.cpp

    r8743 r9089  
    2121 */
    2222
    23 #include <VBoxTakeSnapshotDlg.h>
    24 #include <VBoxProblemReporter.h>
    25 #include <VBoxUtils.h>
     23#include "VBoxTakeSnapshotDlg.h"
     24#include "VBoxProblemReporter.h"
     25#include "VBoxUtils.h"
    2626
    2727/* Qt includes */
     
    2929
    3030VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg (QWidget *aParent)
    31     : QDialog (aParent)
     31    : QIWithRetranslateUI<QDialog> (aParent)
    3232{
    3333    /* Apply UI decorations */
    34     setupUi (this);
     34    Ui::VBoxTakeSnapshotDlg::setupUi (this);
    3535
    3636    QIAltKeyFilter *af = new QIAltKeyFilter (this);
     
    4242    connect (mLeName, SIGNAL (textChanged (const QString &)),
    4343             this, SLOT (nameChanged (const QString &)));
     44
     45    retranslateUi();
     46}
     47
     48void VBoxTakeSnapshotDlg::retranslateUi()
     49{
     50    /* Translate uic generated strings */
     51    Ui::VBoxTakeSnapshotDlg::retranslateUi (this);
    4452}
    4553
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMFirstRunWzd.cpp

    r8641 r9089  
    2121 */
    2222
    23 #include <VBoxVMFirstRunWzd.h>
    24 #include <VBoxGlobal.h>
    25 #include <VBoxDiskImageManagerDlg.h>
     23#include "VBoxVMFirstRunWzd.h"
     24#include "VBoxGlobal.h"
     25#include "VBoxDiskImageManagerDlg.h"
    2626
    2727VBoxVMFirstRunWzd::VBoxVMFirstRunWzd (const CMachine &aMachine, QWidget *aParent)
    28     : QIAbstractWizard (aParent)
     28    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
    2929    , mMachine (aMachine)
    3030{
    3131    /* Apply UI decorations */
    32     setupUi (this);
     32    Ui::VBoxVMFirstRunWzd::setupUi (this);
    3333
    3434    /* Initialize wizard hdr */
     
    7777    /* Initialize wizard ftr */
    7878    initializeWizardFtr();
    79 }
    80 
    81 void VBoxVMFirstRunWzd::accept()
    82 {
    83     /* CD/DVD Media selected */
    84     if (mRbCdType->isChecked())
    85     {
    86         if (mRbHost->isChecked())
    87         {
    88             CHostDVDDrive hostDrive = mHostDVDs [mCbHost->currentIndex()];
    89             if (!hostDrive.isNull())
    90             {
    91                 CDVDDrive virtualDrive = mMachine.GetDVDDrive();
    92                 virtualDrive.CaptureHostDrive (hostDrive);
    93             }
    94         }
    95         else if (mRbImage->isChecked())
    96         {
    97             CDVDDrive virtualDrive = mMachine.GetDVDDrive();
    98             virtualDrive.MountImage (mCbImage->getId());
    99         }
    100     }
    101     /* Floppy Media selected */
    102     else if (mRbFdType->isChecked())
    103     {
    104         if (mRbHost->isChecked())
    105         {
    106             CHostFloppyDrive hostDrive = mHostFloppys [mCbHost->currentIndex()];
    107             if (!hostDrive.isNull())
    108             {
    109                 CFloppyDrive virtualDrive = mMachine.GetFloppyDrive();
    110                 virtualDrive.CaptureHostDrive (hostDrive);
    111             }
    112         }
    113         else if (mRbImage->isChecked())
    114         {
    115             CFloppyDrive virtualDrive = mMachine.GetFloppyDrive();
    116             virtualDrive.MountImage (mCbImage->getId());
    117         }
    118     }
    119 
    120     QIAbstractWizard::accept();
    121 }
    122 
    123 void VBoxVMFirstRunWzd::revalidate (QIWidgetValidator *aWval)
    124 {
    125     /* do individual validations for pages */
    126     QWidget *pg = aWval->widget();
    127     bool valid = aWval->isOtherValid();
    128 
    129     if (pg == mPageMedia)
    130     {
    131         valid = (mRbHost->isChecked() && !mCbHost->currentText().isEmpty()) ||
    132                 (mRbImage->isChecked() && !mCbImage->currentText().isEmpty());
    133     }
    134 
    135     aWval->setOtherValid (valid);
    136 }
    137 
    138 void VBoxVMFirstRunWzd::mediaTypeChanged()
    139 {
    140     /* CD/DVD Media type selected */
    141     mCbHost->clear();
    142     if (sender() == mRbCdType)
    143     {
    144         /* Search for the host dvd-drives */
    145         CHostDVDDriveCollection coll =
    146             vboxGlobal().virtualBox().GetHost().GetDVDDrives();
    147         mHostDVDs.resize (coll.GetCount());
    148         int id = 0;
    149         CHostDVDDriveEnumerator en = coll.Enumerate();
    150         while (en.HasMore())
    151         {
    152             CHostDVDDrive hostDVD = en.GetNext();
    153             QString name = hostDVD.GetName();
    154             QString description = hostDVD.GetDescription();
    155             QString fullName = description.isEmpty() ?
    156                 name : QString ("%1 (%2)").arg (description, name);
    157             mCbHost->insertItem (id, fullName);
    158             mHostDVDs [id] = hostDVD;
    159             ++ id;
    160         }
    161 
    162         /* Switch media images type to CD */
    163         mCbImage->setType (VBoxDefs::CD);
    164     }
    165     /* Floppy media type selected */
    166     else if (sender() == mRbFdType)
    167     {
    168         /* Search for the host floppy-drives */
    169         CHostFloppyDriveCollection coll =
    170             vboxGlobal().virtualBox().GetHost().GetFloppyDrives();
    171         mHostFloppys.resize (coll.GetCount());
    172         int id = 0;
    173         CHostFloppyDriveEnumerator en = coll.Enumerate();
    174         while (en.HasMore())
    175         {
    176             CHostFloppyDrive hostFloppy = en.GetNext();
    177             QString name = hostFloppy.GetName();
    178             QString description = hostFloppy.GetDescription();
    179             QString fullName = description.isEmpty() ?
    180                 name : QString ("%1 (%2)").arg (description, name);
    181             mCbHost->insertItem (id, fullName);
    182             mHostFloppys [id] = hostFloppy;
    183             ++ id;
    184         }
    185 
    186         /* Switch media images type to FD */
    187         mCbImage->setType (VBoxDefs::FD);
    188     }
    189     /* Update media images list */
    190     if (!vboxGlobal().isMediaEnumerationStarted())
    191         vboxGlobal().startEnumeratingMedia();
    192     else
    193         mCbImage->refresh();
    194 
    195     /* Revalidate updated page */
    196     mWvalType->revalidate();
    197 }
    198 
    199 void VBoxVMFirstRunWzd::mediaSourceChanged()
    200 {
    201     mCbHost->setEnabled (sender() == mRbHost);
    202     mCbImage->setEnabled (sender() == mRbImage);
    203     mTbVdm->setEnabled (sender() == mRbImage);
    204 
    205     /* Revalidate updated page */
    206     mWvalType->revalidate();
    207 }
    208 
    209 void VBoxVMFirstRunWzd::openVdm()
    210 {
    211     VBoxDiskImageManagerDlg vdm (this, "VBoxDiskImageManagerDlg",
    212                                  Qt::WType_Dialog | Qt::WShowModal);
    213     QUuid machineId = mMachine.GetId();
    214     VBoxDefs::DiskType type = mRbCdType->isChecked() ? VBoxDefs::CD :
    215         mRbFdType->isChecked() ? VBoxDefs::FD : VBoxDefs::InvalidType;
    216     vdm.setup (type, true, &machineId);
    217     if (vdm.exec() == VBoxDiskImageManagerDlg::Accepted)
    218     {
    219         mCbImage->setCurrentItem (vdm.getSelectedUuid());
    220 
    221         /* Revalidate updated page */
    222         mWvalType->revalidate();
    223     }
    224 }
    225 
    226 void VBoxVMFirstRunWzd::enableNext (const QIWidgetValidator *aWval)
    227 {
    228     nextButton (aWval->widget())->setEnabled (aWval->isValid());
    229 }
    230 
    231 void VBoxVMFirstRunWzd::onPageShow()
    232 {
     79
     80    retranslateUi();
     81}
     82
     83void VBoxVMFirstRunWzd::retranslateUi()
     84{
     85    /* Translate uic generated strings */
     86    Ui::VBoxVMFirstRunWzd::retranslateUi (this);
     87
    23388    QWidget *page = mPageStack->currentWidget();
    23489
    235     if (page == mPageWelcome)
    236         nextButton (page)->setFocus();
    237     else if (page == mPageMedia)
    238         mRbCdType->isChecked() ? mRbCdType->setFocus() :
    239                                  mRbFdType->setFocus();
    240     else if (page == mPageSummary)
     90    if (page == mPageSummary)
    24191    {
    24292        /* compose summary */
     
    258108
    259109        mTeSummary->setText (summary);
     110    }
     111}
     112
     113void VBoxVMFirstRunWzd::accept()
     114{
     115    /* CD/DVD Media selected */
     116    if (mRbCdType->isChecked())
     117    {
     118        if (mRbHost->isChecked())
     119        {
     120            CHostDVDDrive hostDrive = mHostDVDs [mCbHost->currentIndex()];
     121            if (!hostDrive.isNull())
     122            {
     123                CDVDDrive virtualDrive = mMachine.GetDVDDrive();
     124                virtualDrive.CaptureHostDrive (hostDrive);
     125            }
     126        }
     127        else if (mRbImage->isChecked())
     128        {
     129            CDVDDrive virtualDrive = mMachine.GetDVDDrive();
     130            virtualDrive.MountImage (mCbImage->getId());
     131        }
     132    }
     133    /* Floppy Media selected */
     134    else if (mRbFdType->isChecked())
     135    {
     136        if (mRbHost->isChecked())
     137        {
     138            CHostFloppyDrive hostDrive = mHostFloppys [mCbHost->currentIndex()];
     139            if (!hostDrive.isNull())
     140            {
     141                CFloppyDrive virtualDrive = mMachine.GetFloppyDrive();
     142                virtualDrive.CaptureHostDrive (hostDrive);
     143            }
     144        }
     145        else if (mRbImage->isChecked())
     146        {
     147            CFloppyDrive virtualDrive = mMachine.GetFloppyDrive();
     148            virtualDrive.MountImage (mCbImage->getId());
     149        }
     150    }
     151
     152    QIAbstractWizard::accept();
     153}
     154
     155void VBoxVMFirstRunWzd::revalidate (QIWidgetValidator *aWval)
     156{
     157    /* do individual validations for pages */
     158    QWidget *pg = aWval->widget();
     159    bool valid = aWval->isOtherValid();
     160
     161    if (pg == mPageMedia)
     162    {
     163        valid = (mRbHost->isChecked() && !mCbHost->currentText().isEmpty()) ||
     164                (mRbImage->isChecked() && !mCbImage->currentText().isEmpty());
     165    }
     166
     167    aWval->setOtherValid (valid);
     168}
     169
     170void VBoxVMFirstRunWzd::mediaTypeChanged()
     171{
     172    /* CD/DVD Media type selected */
     173    mCbHost->clear();
     174    if (sender() == mRbCdType)
     175    {
     176        /* Search for the host dvd-drives */
     177        CHostDVDDriveCollection coll =
     178            vboxGlobal().virtualBox().GetHost().GetDVDDrives();
     179        mHostDVDs.resize (coll.GetCount());
     180        int id = 0;
     181        CHostDVDDriveEnumerator en = coll.Enumerate();
     182        while (en.HasMore())
     183        {
     184            CHostDVDDrive hostDVD = en.GetNext();
     185            QString name = hostDVD.GetName();
     186            QString description = hostDVD.GetDescription();
     187            QString fullName = description.isEmpty() ?
     188                name : QString ("%1 (%2)").arg (description, name);
     189            mCbHost->insertItem (id, fullName);
     190            mHostDVDs [id] = hostDVD;
     191            ++ id;
     192        }
     193
     194        /* Switch media images type to CD */
     195        mCbImage->setType (VBoxDefs::CD);
     196    }
     197    /* Floppy media type selected */
     198    else if (sender() == mRbFdType)
     199    {
     200        /* Search for the host floppy-drives */
     201        CHostFloppyDriveCollection coll =
     202            vboxGlobal().virtualBox().GetHost().GetFloppyDrives();
     203        mHostFloppys.resize (coll.GetCount());
     204        int id = 0;
     205        CHostFloppyDriveEnumerator en = coll.Enumerate();
     206        while (en.HasMore())
     207        {
     208            CHostFloppyDrive hostFloppy = en.GetNext();
     209            QString name = hostFloppy.GetName();
     210            QString description = hostFloppy.GetDescription();
     211            QString fullName = description.isEmpty() ?
     212                name : QString ("%1 (%2)").arg (description, name);
     213            mCbHost->insertItem (id, fullName);
     214            mHostFloppys [id] = hostFloppy;
     215            ++ id;
     216        }
     217
     218        /* Switch media images type to FD */
     219        mCbImage->setType (VBoxDefs::FD);
     220    }
     221    /* Update media images list */
     222    if (!vboxGlobal().isMediaEnumerationStarted())
     223        vboxGlobal().startEnumeratingMedia();
     224    else
     225        mCbImage->refresh();
     226
     227    /* Revalidate updated page */
     228    mWvalType->revalidate();
     229}
     230
     231void VBoxVMFirstRunWzd::mediaSourceChanged()
     232{
     233    mCbHost->setEnabled (sender() == mRbHost);
     234    mCbImage->setEnabled (sender() == mRbImage);
     235    mTbVdm->setEnabled (sender() == mRbImage);
     236
     237    /* Revalidate updated page */
     238    mWvalType->revalidate();
     239}
     240
     241void VBoxVMFirstRunWzd::openVdm()
     242{
     243    VBoxDiskImageManagerDlg vdm (this, "VBoxDiskImageManagerDlg",
     244                                 Qt::WType_Dialog | Qt::WShowModal);
     245    QUuid machineId = mMachine.GetId();
     246    VBoxDefs::DiskType type = mRbCdType->isChecked() ? VBoxDefs::CD :
     247        mRbFdType->isChecked() ? VBoxDefs::FD : VBoxDefs::InvalidType;
     248    vdm.setup (type, true, &machineId);
     249    if (vdm.exec() == VBoxDiskImageManagerDlg::Accepted)
     250    {
     251        mCbImage->setCurrentItem (vdm.getSelectedUuid());
     252
     253        /* Revalidate updated page */
     254        mWvalType->revalidate();
     255    }
     256}
     257
     258void VBoxVMFirstRunWzd::enableNext (const QIWidgetValidator *aWval)
     259{
     260    nextButton (aWval->widget())->setEnabled (aWval->isValid());
     261}
     262
     263void VBoxVMFirstRunWzd::onPageShow()
     264{
     265    /* Make sure all is properly translated & composed */
     266    retranslateUi();
     267
     268    QWidget *page = mPageStack->currentWidget();
     269
     270    if (page == mPageWelcome)
     271        nextButton (page)->setFocus();
     272    else if (page == mPageMedia)
     273        mRbCdType->isChecked() ? mRbCdType->setFocus() :
     274                                 mRbFdType->setFocus();
     275    else if (page == mPageSummary)
    260276        mTeSummary->setFocus();
    261     }
    262277
    263278    if (page == mPageSummary)
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