Changeset 2864 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 25, 2007 11:06:20 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 21520
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r2801 r2864 83 83 84 84 # Sources containing local definitions of classes that use the Q_OBJECT macro 85 VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp \ 86 src/VBoxConsoleWnd.cpp 85 VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp 87 86 ifneq ($(BUILD_TARGET),win) 88 87 VirtualBox_QT_MOCSRCS += src/COMDefs.cpp -
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r2823 r2864 37 37 ui/VBoxNewHDWzd.ui \ 38 38 ui/VBoxSnapshotsWgt.ui \ 39 ui/VBoxAboutDlg.ui 39 ui/VBoxAboutDlg.ui \ 40 ui/VBoxVMFirstRunWzd.ui 40 41 41 42 IMAGES = images/tpixel.png \ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxMediaComboBox.h
-
Property svn:keywords
set to
Date Revision Author Id
r868 r2864 46 46 QUuid getBelongsTo(); 47 47 void setCurrentItem (const QUuid &); 48 void setType (int); 48 49 49 50 protected slots: -
Property svn:keywords
set to
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r2835 r2864 31 31 #include "VBoxTakeSnapshotDlg.h" 32 32 #include "VBoxDiskImageManagerDlg.h" 33 #include "VBoxVMFirstRunWzd.h" 33 34 #include "VBoxSharedFoldersSettings.h" 34 35 #include "VBoxUtils.h" … … 190 191 191 192 QString mTip; 192 };193 194 /**195 * Bootable CD/DVD ISO Selection Dialog class.196 * Allows user to select temporarily mounted image or host drive197 * to load the system from.198 */199 class BootDVDDialog : public QDialog200 {201 Q_OBJECT202 203 public:204 205 BootDVDDialog (QWidget *aParent, CMachine &aMachine)206 : QDialog (aParent, "BootDVDDialog", true /* modal */)207 , mMachine (aMachine)208 , mGrpBox (0)209 , mRbHost (0), mRbImage (0)210 , mCbHost (0), mCbImage (0)211 , mTbVDM (0), mPbOk (0)212 {213 /* Setup Dialog's title */214 setCaption (tr ("Select Boot Source"));215 setIcon (QPixmap::fromMimeSource ("select_file_16px.png"));216 217 /* Setup main group-box */218 mGrpBox = new QButtonGroup (this, "mGrpBox");219 mGrpBox->setCheckable (true);220 mGrpBox->setChecked (false);221 mGrpBox->setColumnLayout (0, Qt::Vertical);222 mGrpBox->setTitle (tr ("&Mount CD/DVD Drive"));223 mGrpBox->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);224 connect (mGrpBox, SIGNAL (toggled (bool)), this, SLOT (grpBoxToggled (bool)));225 226 /* Setup group box widgets */227 mRbHost = new QRadioButton (tr ("Host CD/DVD &Drive"), mGrpBox, "mRbHost");228 connect (mRbHost, SIGNAL (clicked()), this, SLOT (rbClicked()));229 mCbHost = new QComboBox (mGrpBox, "mCbHost");230 CHostDVDDriveCollection coll = vboxGlobal().virtualBox().GetHost().GetDVDDrives();231 mHostDVDs.resize (coll.GetCount());232 int id = 0;233 CHostDVDDriveEnumerator en = coll.Enumerate();234 while (en.HasMore())235 {236 CHostDVDDrive hostDVD = en.GetNext();237 mCbHost->insertItem (hostDVD.GetName(), id);238 mHostDVDs [id] = hostDVD;239 ++ id;240 }241 242 mRbImage = new QRadioButton (tr ("&ISO Image File"), mGrpBox, "mRbImage");243 connect (mRbImage, SIGNAL (clicked()), this, SLOT (rbClicked()));244 mCbImage = new VBoxMediaComboBox (mGrpBox, "sel", VBoxDefs::CD);245 if (!vboxGlobal().isMediaEnumerationStarted())246 vboxGlobal().startEnumeratingMedia();247 else248 mCbImage->refresh();249 mTbVDM = new QToolButton (mGrpBox, "mTbVDM");250 mTbVDM->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png",251 "select_file_dis_16px.png"));252 mTbVDM->setFocusPolicy (QWidget::TabFocus);253 connect (mTbVDM, SIGNAL (clicked()), this, SLOT (vdmOpen()));254 255 /* Setup group box layout */256 QGridLayout *grbLayout = new QGridLayout (mGrpBox->layout(), 2, 3, 10, "grbLayout");257 grbLayout->addWidget (mRbHost, 0, 0);258 grbLayout->addWidget (mCbHost, 0, 1);259 grbLayout->addWidget (mRbImage, 1, 0);260 grbLayout->addWidget (mCbImage, 1, 1);261 grbLayout->addWidget (mTbVDM, 1, 2);262 263 /* Setup dialog buttons */264 mPbOk = new QPushButton (tr ("OK"), this, "mPbOk");265 QSpacerItem *spacer = new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);266 QPushButton *pbCancel = new QPushButton (tr ("Cancel"), this, "pbCancel");267 connect (mPbOk, SIGNAL (clicked()), this, SLOT (accept()));268 connect (pbCancel, SIGNAL (clicked()), this, SLOT (reject()));269 270 /* Setup main layout */271 QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10, "mainLayout");272 mainLayout->addWidget (mGrpBox);273 QSpacerItem *btSpacer =274 new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);275 mainLayout->addItem (btSpacer);276 277 /* Setup buttons layout */278 QHBoxLayout *buttonLayout = new QHBoxLayout (mainLayout, 10, "buttonLayout");279 buttonLayout->addWidget (mPbOk);280 buttonLayout->addItem (spacer);281 buttonLayout->addWidget (pbCancel);282 }283 284 private slots:285 286 void grpBoxToggled (bool aOn)287 {288 if (aOn)289 mRbHost->animateClick();290 else291 {292 mRbHost->setChecked (false);293 mRbImage->setChecked (false);294 validate();295 }296 }297 298 void rbClicked()299 {300 mCbHost->setEnabled (sender() == mRbHost);301 mCbImage->setEnabled (sender() == mRbImage);302 mTbVDM->setEnabled (sender() == mRbImage);303 validate();304 }305 306 void vdmOpen()307 {308 VBoxDiskImageManagerDlg vdm (this, "VBoxDiskImageManagerDlg",309 WType_Dialog | WShowModal);310 QUuid machineId = mMachine.GetId();311 vdm.setup (VBoxDefs::CD, true, &machineId);312 if (vdm.exec() == VBoxDiskImageManagerDlg::Accepted)313 mCbImage->setCurrentItem (vdm.getSelectedUuid());314 }315 316 void accept()317 {318 if (mGrpBox->isChecked() && mRbHost->isChecked())319 {320 CHostDVDDrive hostDrive = mHostDVDs [mCbHost->currentItem()];321 if (!hostDrive.isNull())322 {323 CDVDDrive virtualDrive = mMachine.GetDVDDrive();324 virtualDrive.CaptureHostDrive (hostDrive);325 }326 }327 else if (mGrpBox->isChecked() && mRbImage->isChecked())328 {329 CDVDDrive virtualDrive = mMachine.GetDVDDrive();330 virtualDrive.MountImage (mCbImage->getId());331 }332 333 QDialog::accept();334 }335 336 private:337 338 void validate()339 {340 bool valid =341 !mGrpBox->isChecked() ||342 (mGrpBox->isChecked() && mRbHost->isChecked()343 && !mCbHost->currentText().isEmpty()) ||344 (mGrpBox->isChecked() && mRbImage->isChecked()345 && !mCbImage->currentText().isEmpty());346 mPbOk->setEnabled (valid);347 }348 349 CMachine mMachine;350 QButtonGroup *mGrpBox;351 QRadioButton *mRbHost, *mRbImage;352 QComboBox *mCbHost;353 VBoxMediaComboBox *mCbImage;354 QToolButton *mTbVDM;355 QPushButton *mPbOk;356 QValueVector <CHostDVDDrive> mHostDVDs;357 193 }; 358 194 … … 392 228 , was_max (false) 393 229 , console_style (0) 394 , mIsFirstTimeStarted ( true)230 , mIsFirstTimeStarted (false) 395 231 #ifdef VBOX_WITH_DEBUGGER_GUI 396 232 , dbg_gui (NULL) … … 843 679 static const char *GUI_Fullscreen = "GUI/Fullscreen"; 844 680 static const char *GUI_AutoresizeGuest = "GUI/AutoresizeGuest"; 845 staticconst char *GUI_FirstRun = "GUI/FirstRun";681 extern const char *GUI_FirstRun = "GUI/FirstRun"; 846 682 847 683 /** … … 897 733 898 734 str = cmachine.GetExtraData (GUI_FirstRun); 899 if (str == "no") 900 mIsFirstTimeStarted = false; 735 if (str == "yes") 736 mIsFirstTimeStarted = true; 737 else if (!str.isEmpty()) 738 cmachine.SetExtraData (GUI_FirstRun, QString::null); 901 739 902 740 str = cmachine.GetExtraData (GUI_LastWindowPosition); … … 1070 908 if (mIsFirstTimeStarted) 1071 909 { 1072 BootDVDDialog dlg (this, cmachine); 1073 dlg.exec(); 910 VBoxVMFirstRunWzd wzd (this, "VBoxVMFirstRunWzd"); 911 wzd.setup (cmachine); 912 wzd.exec(); 1074 913 } 1075 914 … … 1175 1014 machine.SetExtraData (GUI_AutoresizeGuest, 1176 1015 vmAutoresizeGuestAction->isOn() ? "on" : "off"); 1177 machine.SetExtraData (GUI_FirstRun, "no");1178 1016 } 1179 1017 … … 2899 2737 VBoxGlobal::centerWidget (this, parentWidget()); 2900 2738 } 2901 2902 #include "VBoxConsoleWnd.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaComboBox.cpp
-
Property svn:keywords
set to
Date Revision Author Id
r1381 r2864 293 293 } 294 294 } 295 296 void VBoxMediaComboBox::setType (int aType) 297 { 298 mType = aType; 299 } -
Property svn:keywords
set to
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h
r2593 r2864 33 33 *****************************************************************************/ 34 34 35 extern const char *GUI_FirstRun; 36 35 37 /** 36 38 * Calculates a suitable page step size for the given max value. … … 313 315 return false; 314 316 } 317 cmachine.SetExtraData (GUI_FirstRun, "yes"); 315 318 } 316 319
Note:
See TracChangeset
for help on using the changeset viewer.