VirtualBox

Changeset 28762 in vbox


Ignore:
Timestamp:
Apr 26, 2010 3:59:23 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt: First Run Wizard: will now only propose to start from cd/dvd-rom device excluding floppy devices which are now not present by default in newly created VM (see xTracker defect #4847).

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp

    r26714 r28762  
    126126    Ui::UIFirstRunWzdPage2::setupUi(this);
    127127
    128     /* Register KStorageBus class */
    129     qRegisterMetaType<KStorageBus>();
    130 
    131     /* Register 'type', 'description', 'source', 'id' fields! */
    132     registerField("bus", this, "bus");
    133     registerField("description", this, "description");
     128    /* Register 'source' and 'id' fields! */
    134129    registerField("source", this, "source");
    135130    registerField("id", this, "id");
     
    139134
    140135    /* Setup connections */
    141     connect (m_pTypeCD, SIGNAL(clicked()), this, SLOT(sltMediumChanged()));
    142     connect (m_pTypeFD, SIGNAL(clicked()), this, SLOT(sltMediumChanged()));
    143     connect (m_pMediaSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(sltMediumChanged()));
    144     connect (m_pSelectMediaButton, SIGNAL(clicked()), this, SLOT(sltOpenVirtualMediaManager()));
     136    connect(m_pMediaSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(sltMediumChanged()));
     137    connect(m_pSelectMediaButton, SIGNAL(clicked()), this, SLOT(sltOpenVirtualMediaManager()));
    145138}
    146139
     
    155148    m_pPage2Text1Var1->setHidden(hda.isNull());
    156149    m_pPage2Text1Var2->setHidden(!hda.isNull());
    157     m_pPage2Text2Var1->setHidden(hda.isNull());
    158     m_pPage2Text2Var2->setHidden(!hda.isNull());
    159 
    160     /* Assign selector machine */
     150
     151    /* Assign media selector attributes */
    161152    m_pMediaSelector->setMachineId(machine.GetId());
     153    m_pMediaSelector->setType(VBoxDefs::MediumType_DVD);
     154    m_pMediaSelector->repopulate();
    162155}
    163156
     
    177170
    178171    /* Initial choice */
    179     m_pTypeCD->click();
    180172    m_pMediaSelector->setCurrentIndex(0);
    181 
    182     /* CD button should initially have focus */
    183     m_pTypeCD->isChecked();
     173    sltMediumChanged();
     174
     175    /* Media selector should initially have focus */
     176    m_pMediaSelector->setFocus();
    184177}
    185178
     
    191184void UIFirstRunWzdPage2::sltMediumChanged()
    192185{
    193     /* Update data */
    194     if (m_pTypeCD->isChecked())
    195     {
    196         if (m_pMediaSelector->type() != VBoxDefs::MediumType_DVD)
    197         {
    198             m_pMediaSelector->setType(VBoxDefs::MediumType_DVD);
    199             m_pMediaSelector->repopulate();
    200         }
    201         m_Bus = KStorageBus_IDE;
    202         m_strDescription = VBoxGlobal::removeAccelMark(m_pTypeCD->text());
    203         m_strSource = m_pMediaSelector->currentText();
    204         m_strId = m_pMediaSelector->id();
    205     }
    206     else if (m_pTypeFD->isChecked())
    207     {
    208         if (m_pMediaSelector->type() != VBoxDefs::MediumType_Floppy)
    209         {
    210             m_pMediaSelector->setType(VBoxDefs::MediumType_Floppy);
    211             m_pMediaSelector->repopulate();
    212         }
    213         m_Bus = KStorageBus_Floppy;
    214         m_strDescription = VBoxGlobal::removeAccelMark(m_pTypeFD->text());
    215         m_strSource = m_pMediaSelector->currentText();
    216         m_strId = m_pMediaSelector->id();
    217     }
    218     else
    219     {
    220         m_Bus = KStorageBus_Null;
    221         m_strDescription.clear();
    222         m_strSource.clear();
    223         m_strId.clear();
    224     }
    225 
     186    m_strSource = m_pMediaSelector->currentText();
     187    m_strId = m_pMediaSelector->id();
    226188    emit completeChanged();
    227189}
     
    231193    /* Create & open VMM */
    232194    VBoxMediaManagerDlg dlg(this);
    233     dlg.setup(m_pMediaSelector->type(), true /* aDoSelect */);
     195    dlg.setup(m_pMediaSelector->type(), true /* propose to choose? */);
    234196    if (dlg.exec() == QDialog::Accepted)
    235197        m_pMediaSelector->setCurrentItem(dlg.selectedId());
     
    248210
    249211    /* Disable the background painting of the summary widget */
    250     m_pSummaryText->viewport()->setAutoFillBackground (false);
     212    m_pSummaryText->viewport()->setAutoFillBackground(false);
    251213    /* Make the summary field read-only */
    252     m_pSummaryText->setReadOnly (true);
     214    m_pSummaryText->setReadOnly(true);
    253215}
    254216
     
    278240    QString summary;
    279241
    280     QString description = field("description").toString();
     242    QString description = tr("CD/DVD-ROM Device");
    281243    QString source = field("source").toString();
    282244
     
    286248        "<tr><td><nobr>%3: </nobr></td><td><nobr>%4</nobr></td></tr>"
    287249    )
    288     .arg (tr("Type", "summary"), description)
    289     .arg (tr("Source", "summary"), source)
     250    .arg(tr("Type", "summary"), description)
     251    .arg(tr("Source", "summary"), source)
    290252    ;
    291253    /* Feat summary to 3 lines */
     
    317279{
    318280    /* Composing default controller name */
    319     KStorageBus bus = field("bus").value<KStorageBus>();
    320281    QString mediumId = field("id").toString();
    321     LONG port = bus == KStorageBus_IDE ? 1 : 0;
     282    LONG port = 1;
    322283    LONG device = 0;
    323284    QString name;
     
    326287    foreach (CStorageController controller, controllers)
    327288    {
    328         if (controller.GetBus() == bus)
     289        if (controller.GetBus() == KStorageBus_IDE)
    329290        {
    330291            name = controller.GetName();
     
    332293        }
    333294    }
    334     Assert (!name.isEmpty());
     295    Assert(!name.isEmpty());
    335296
    336297    /* Mount medium to the predefined port/device */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.h

    r26714 r28762  
    6666{
    6767    Q_OBJECT;
    68     Q_PROPERTY(KStorageBus bus READ bus WRITE setBus);
    69     Q_PROPERTY(QString description READ description WRITE setDescription);
    7068    Q_PROPERTY(QString source READ source WRITE setSource);
    7169    Q_PROPERTY(QString id READ id WRITE setId);
     
    9189
    9290private:
    93 
    94     KStorageBus bus() const { return m_Bus; }
    95     void setBus(KStorageBus bus) { m_Bus = bus; }
    96     KStorageBus m_Bus;
    97 
    98     QString description() const { return m_strDescription; }
    99     void setDescription(const QString &strDescription) { m_strDescription = strDescription; }
    100     QString m_strDescription;
    10191
    10292    QString source() const { return m_strSource; }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage2.ui

    r26079 r28762  
    4141    <widget class="QILabel" name="m_pPage2Text1Var1">
    4242     <property name="text">
    43       <string>&lt;p&gt;Select the type of media you would like to use for installation.&lt;/p&gt;</string>
     43      <string>&lt;p&gt;Select the media which contains the setup program of the operating system you want to install. This media must be bootable, otherwise the setup program will not be able to start.&lt;/p&gt;</string>
    4444     </property>
    4545     <property name="wordWrap">
     
    5050   <item>
    5151    <widget class="QILabel" name="m_pPage2Text1Var2">
    52      <property name="text">
    53       <string>&lt;p&gt;Select the type of media you would like to use for booting an operating system.&lt;/p&gt;</string>
    54      </property>
    55      <property name="wordWrap">
    56       <bool>true</bool>
    57      </property>
    58     </widget>
    59    </item>
    60    <item>
    61     <widget class="QGroupBox" name="m_pCntType">
    62      <property name="title">
    63       <string>Media Type</string>
    64      </property>
    65      <layout class="QVBoxLayout" name="m_pLayout2">
    66       <item>
    67        <widget class="QRadioButton" name="m_pTypeCD">
    68         <property name="text">
    69          <string>&amp;CD/DVD-ROM Device</string>
    70         </property>
    71        </widget>
    72       </item>
    73       <item>
    74        <widget class="QRadioButton" name="m_pTypeFD">
    75         <property name="text">
    76          <string>&amp;Floppy Device</string>
    77         </property>
    78        </widget>
    79       </item>
    80      </layout>
    81     </widget>
    82    </item>
    83    <item>
    84     <widget class="QILabel" name="m_pPage2Text2Var1">
    85      <property name="text">
    86       <string>&lt;p&gt;Select the media which contains the setup program of the operating system you want to install. This media must be bootable, otherwise the setup program will not be able to start.&lt;/p&gt;</string>
    87      </property>
    88      <property name="wordWrap">
    89       <bool>true</bool>
    90      </property>
    91     </widget>
    92    </item>
    93    <item>
    94     <widget class="QILabel" name="m_pPage2Text2Var2">
    9552     <property name="text">
    9653      <string>&lt;p&gt;Select the media that contains the operating system you want to work with. This media must be bootable, otherwise the operating system will not be able to start.&lt;/p&gt;</string>
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