Changeset 28762 in vbox
- Timestamp:
- Apr 26, 2010 3:59:23 PM (15 years ago)
- 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 126 126 Ui::UIFirstRunWzdPage2::setupUi(this); 127 127 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! */ 134 129 registerField("source", this, "source"); 135 130 registerField("id", this, "id"); … … 139 134 140 135 /* 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())); 145 138 } 146 139 … … 155 148 m_pPage2Text1Var1->setHidden(hda.isNull()); 156 149 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 */ 161 152 m_pMediaSelector->setMachineId(machine.GetId()); 153 m_pMediaSelector->setType(VBoxDefs::MediumType_DVD); 154 m_pMediaSelector->repopulate(); 162 155 } 163 156 … … 177 170 178 171 /* Initial choice */ 179 m_pTypeCD->click();180 172 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(); 184 177 } 185 178 … … 191 184 void UIFirstRunWzdPage2::sltMediumChanged() 192 185 { 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(); 226 188 emit completeChanged(); 227 189 } … … 231 193 /* Create & open VMM */ 232 194 VBoxMediaManagerDlg dlg(this); 233 dlg.setup(m_pMediaSelector->type(), true /* aDoSelect*/);195 dlg.setup(m_pMediaSelector->type(), true /* propose to choose? */); 234 196 if (dlg.exec() == QDialog::Accepted) 235 197 m_pMediaSelector->setCurrentItem(dlg.selectedId()); … … 248 210 249 211 /* Disable the background painting of the summary widget */ 250 m_pSummaryText->viewport()->setAutoFillBackground 212 m_pSummaryText->viewport()->setAutoFillBackground(false); 251 213 /* Make the summary field read-only */ 252 m_pSummaryText->setReadOnly 214 m_pSummaryText->setReadOnly(true); 253 215 } 254 216 … … 278 240 QString summary; 279 241 280 QString description = field("description").toString();242 QString description = tr("CD/DVD-ROM Device"); 281 243 QString source = field("source").toString(); 282 244 … … 286 248 "<tr><td><nobr>%3: </nobr></td><td><nobr>%4</nobr></td></tr>" 287 249 ) 288 .arg 289 .arg 250 .arg(tr("Type", "summary"), description) 251 .arg(tr("Source", "summary"), source) 290 252 ; 291 253 /* Feat summary to 3 lines */ … … 317 279 { 318 280 /* Composing default controller name */ 319 KStorageBus bus = field("bus").value<KStorageBus>();320 281 QString mediumId = field("id").toString(); 321 LONG port = bus == KStorageBus_IDE ? 1 : 0;282 LONG port = 1; 322 283 LONG device = 0; 323 284 QString name; … … 326 287 foreach (CStorageController controller, controllers) 327 288 { 328 if (controller.GetBus() == bus)289 if (controller.GetBus() == KStorageBus_IDE) 329 290 { 330 291 name = controller.GetName(); … … 332 293 } 333 294 } 334 Assert 295 Assert(!name.isEmpty()); 335 296 336 297 /* Mount medium to the predefined port/device */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.h
r26714 r28762 66 66 { 67 67 Q_OBJECT; 68 Q_PROPERTY(KStorageBus bus READ bus WRITE setBus);69 Q_PROPERTY(QString description READ description WRITE setDescription);70 68 Q_PROPERTY(QString source READ source WRITE setSource); 71 69 Q_PROPERTY(QString id READ id WRITE setId); … … 91 89 92 90 private: 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;101 91 102 92 QString source() const { return m_strSource; } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage2.ui
r26079 r28762 41 41 <widget class="QILabel" name="m_pPage2Text1Var1"> 42 42 <property name="text"> 43 <string><p>Select the type of media you would like to use for installation.</p></string>43 <string><p>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.</p></string> 44 44 </property> 45 45 <property name="wordWrap"> … … 50 50 <item> 51 51 <widget class="QILabel" name="m_pPage2Text1Var2"> 52 <property name="text">53 <string><p>Select the type of media you would like to use for booting an operating system.</p></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>&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>&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><p>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.</p></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">95 52 <property name="text"> 96 53 <string><p>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.</p></string>
Note:
See TracChangeset
for help on using the changeset viewer.