Changeset 37468 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 15, 2011 1:39:42 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72283
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 10 added
- 14 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r37331 r37468 178 178 ./src/settings/global \ 179 179 ./src/settings/machine \ 180 ./src/wizards/clonevm \ 180 181 ./src/wizards/newvm \ 181 182 ./src/wizards/newhd \ … … 319 320 src/settings/machine/UIMachineSettingsSF.h \ 320 321 src/settings/machine/UIMachineSettingsSFDetails.h \ 322 src/wizards/clonevm/UICloneVMWizard.h \ 321 323 src/wizards/newvm/UINewVMWzd.h \ 322 324 src/wizards/newhd/UINewHDWizard.h \ … … 485 487 src/settings/machine/UIMachineSettingsSF.cpp \ 486 488 src/settings/machine/UIMachineSettingsSFDetails.cpp \ 489 src/wizards/clonevm/UICloneVMWizard.cpp \ 487 490 src/wizards/newvm/UINewVMWzd.cpp \ 488 491 src/wizards/newhd/UINewHDWizard.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r37331 r37468 48 48 src/settings/machine/UIMachineSettingsSF.ui \ 49 49 src/settings/machine/UIMachineSettingsSFDetails.ui \ 50 src/wizards/clonevm/UICloneVMWizardPage1.ui \ 51 src/wizards/clonevm/UICloneVMWizardPage2.ui \ 50 52 src/wizards/newvm/UINewVMWzdPage1.ui \ 51 53 src/wizards/newvm/UINewVMWzdPage2.ui \ -
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r34498 r37468 14 14 <file alias="vm_settings_32px.png">images/vm_settings_32px.png</file> 15 15 <file alias="vm_settings_disabled_32px.png">images/vm_settings_disabled_32px.png</file> 16 <file alias="vm_clone_16px.png">images/vm_clone_16px.png</file> 17 <file alias="vm_clone_disabled_16px.png">images/vm_clone_disabled_16px.png</file> 16 18 <file alias="vm_show_logs_32px.png">images/vm_show_logs_32px.png</file> 17 19 <file alias="vm_show_logs_disabled_32px.png">images/vm_show_logs_disabled_32px.png</file> -
trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc
r35894 r37468 161 161 <file alias="progress_snapshot_restore_90px.png">images/progress_snapshot_restore_90px.png</file> 162 162 <file alias="progress_snapshot_discard_90px.png">images/progress_snapshot_discard_90px.png</file> 163 <file alias="progress_clone_90px.png">images/progress_clone_90px.png</file> 163 164 <file alias="status_check_16px.png">images/status_check_16px.png</file> 164 165 <file alias="status_check_32px.png">images/status_check_32px.png</file> -
trunk/src/VBox/Frontends/VirtualBox/VirtualBoxMac.qrc
r26190 r37468 7 7 <file alias="vmw_ovf_import_bg.png">images/vmw_ovf_import_bg.png</file> 8 8 <file alias="vmw_ovf_export_bg.png">images/vmw_ovf_export_bg.png</file> 9 <file alias="vmw_clone_bg.png">images/vmw_clone_bg.png</file> 9 10 <file alias="monitor.png">images/monitor.png</file> 10 11 <file alias="monitor_glossy.png">images/monitor_glossy.png</file> -
trunk/src/VBox/Frontends/VirtualBox/VirtualBoxOther.qrc
r26537 r37468 7 7 <file alias="vmw_ovf_export.png">images/vmw_ovf_export.png</file> 8 8 <file alias="vmw_ovf_import.png">images/vmw_ovf_import.png</file> 9 <file alias="vmw_clone.png">images/vmw_clone.png</file> 9 10 </qresource> 10 11 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r37143 r37468 665 665 } 666 666 667 void VBoxProblemReporter::cannotRegisterMachine(const CVirtualBox &vbox, 668 const CMachine &machine, 669 QWidget *pParent) 670 { 671 message(pParent ? pParent : mainWindowShown(), 672 Error, 673 tr("Failed to register the virtual machine <b>%1</b>.") 674 .arg(machine.GetName()), 675 formatErrorInfo(vbox)); 676 } 677 667 678 void VBoxProblemReporter::cannotReregisterMachine(QWidget *pParent, const QString &strMachinePath, const QString &strMachineName) 668 679 { … … 814 825 .arg (console.GetMachine().GetName()), 815 826 formatErrorInfo (progress.GetErrorInfo()) 827 ); 828 } 829 830 void VBoxProblemReporter::cannotCreateClone(const CMachine &machine, 831 QWidget *pParent /* = 0 */) 832 { 833 message( 834 pParent ? pParent : mainWindowShown(), 835 Error, 836 tr ("Failed to clone the virtual machine <b>%1</b>.") 837 .arg(machine.GetName()), 838 formatErrorInfo(machine) 839 ); 840 } 841 842 void VBoxProblemReporter::cannotCreateClone(const CMachine &machine, 843 const CProgress &progress, 844 QWidget *pParent /* = 0 */) 845 { 846 AssertWrapperOk(progress); 847 848 message( 849 pParent ? pParent : mainWindowShown(), 850 Error, 851 tr ("Failed to clone the virtual machine <b>%1</b>.") 852 .arg(machine.GetName()), 853 formatErrorInfo(progress.GetErrorInfo()) 816 854 ); 817 855 } … … 2654 2692 } 2655 2693 2694 void VBoxProblemReporter::showGenericError(COMBaseWithEI *object, QWidget *pParent /* = 0 */) 2695 { 2696 if ( !object 2697 || object->lastRC() == S_OK) 2698 return; 2699 2700 message(pParent ? pParent : mainWindowShown(), 2701 Error, 2702 tr("Sorry, some generic error happens."), 2703 formatErrorInfo(*object)); 2704 } 2705 2706 // Public slots 2707 ///////////////////////////////////////////////////////////////////////////// 2708 2656 2709 void VBoxProblemReporter::remindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent) 2657 2710 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r37143 r37468 193 193 194 194 void cannotOpenMachine(QWidget *pParent, const QString &strMachinePath, const CVirtualBox &vbox); 195 void cannotRegisterMachine(const CVirtualBox &vbox, const CMachine &machine, QWidget *pParent); 195 196 void cannotReregisterMachine(QWidget *pParent, const QString &strMachinePath, const QString &strMachineName); 196 197 197 void cannotApplyMachineSettings (const CMachine &machine, const COMResult &res); 198 198 void cannotSaveMachineSettings (const CMachine &machine, … … 211 211 void cannotSaveMachineState (const CConsole &console); 212 212 void cannotSaveMachineState (const CProgress &progress); 213 void cannotCreateClone(const CMachine &machine, QWidget *pParent = 0); 214 void cannotCreateClone(const CMachine &machine, const CProgress &progress, QWidget *pParent = 0); 213 215 void cannotTakeSnapshot (const CConsole &console); 214 216 void cannotTakeSnapshot (const CProgress &progress); … … 396 398 return formatErrorInfo (aRC.errorInfo(), aRC.rc()); 397 399 } 400 401 void showGenericError(COMBaseWithEI *object, QWidget *pParent = 0); 398 402 399 403 /* Stuff supporting interthreading: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp
r35634 r37468 34 34 m_Shortcuts[AddVMShortcut] = UIKeySequence("AddVM", "Ctrl+A"); 35 35 m_Shortcuts[SettingsVMShortcut] = UIKeySequence("SettingsVM", "Ctrl+S"); 36 m_Shortcuts[CloneVMShortcut] = UIKeySequence("CloneVM", "Ctrl+C"); 36 37 m_Shortcuts[RemoveVMShortcut] = UIKeySequence("RemoveVM", "Ctrl+R"); 37 38 m_Shortcuts[StartVMShortcut] = UIKeySequence("StartVM"); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h
r35634 r37468 36 36 AddVMShortcut, 37 37 SettingsVMShortcut, 38 CloneVMShortcut, 38 39 RemoveVMShortcut, 39 40 StartVMShortcut, -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r37109 r37468 26 26 #include "UIIconPool.h" 27 27 #include "UIImportApplianceWzd.h" 28 #include "UICloneVMWizard.h" 28 29 #include "UINewVMWzd.h" 29 30 #include "UIVMDesktop.h" … … 141 142 ":/vm_settings_32px.png", ":/settings_16px.png", 142 143 ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png")); 144 mVmCloneAction = new QAction(this); 145 mVmCloneAction->setIcon(UIIconPool::iconSet( 146 ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")); 143 147 mVmDeleteAction = new QAction(this); 144 148 mVmDeleteAction->setIcon(UIIconPool::iconSetFull( … … 288 292 mVMMenu->addAction(mVmAddAction); 289 293 mVMMenu->addAction(mVmConfigAction); 294 mVMMenu->addAction(mVmCloneAction); 290 295 mVMMenu->addAction(mVmDeleteAction); 291 296 mVMMenu->addSeparator(); … … 306 311 mVMCtxtMenu = new QMenu(this); 307 312 mVMCtxtMenu->addAction(mVmConfigAction); 313 mVMCtxtMenu->addAction(mVmCloneAction); 308 314 mVMCtxtMenu->addAction(mVmDeleteAction); 309 315 mVMCtxtMenu->addSeparator(); … … 435 441 436 442 connect(mVmConfigAction, SIGNAL(triggered()), this, SLOT(vmSettings())); 443 connect(mVmCloneAction, SIGNAL(triggered()), this, SLOT(vmClone())); 437 444 connect(mVmDeleteAction, SIGNAL(triggered()), this, SLOT(vmDelete())); 438 445 connect(mVmStartAction, SIGNAL(triggered()), this, SLOT(vmStart())); … … 725 732 UISettingsDialogMachine dlg(this, pItem->id(), strCategory, strControl); 726 733 dlg.execute(); 734 } 735 736 void VBoxSelectorWnd::vmClone(const QString &aUuid /* = QString::null */) 737 { 738 UIVMItem *item = aUuid.isNull() ? mVMListView->selectedItem() : mVMModel->itemById(aUuid); 739 740 AssertMsgReturnVoid(item, ("Item must be always selected here")); 741 742 CMachine machine = item->machine(); 743 744 UICloneVMWizard wzd(this, machine, false); 745 wzd.exec(); 727 746 } 728 747 … … 1201 1220 (mVmConfigAction->shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(mVmConfigAction->shortcut().toString()))); 1202 1221 1222 mVmCloneAction->setText(tr("&Clone")); 1223 mVmCloneAction->setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut)); 1224 mVmCloneAction->setStatusTip(tr("Clone the selected virtual machine")); 1225 1203 1226 mVmDeleteAction->setText(tr("&Remove")); 1204 1227 mVmDeleteAction->setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut)); … … 1308 1331 /* enable/disable modify actions */ 1309 1332 mVmConfigAction->setEnabled(modifyEnabled); 1333 mVmCloneAction->setEnabled(!running); 1310 1334 mVmDeleteAction->setEnabled(!running); 1311 1335 mVmDiscardAction->setEnabled(state == KMachineState_Saved && !running); … … 1438 1462 /* disable modify actions */ 1439 1463 mVmConfigAction->setEnabled(false); 1464 mVmCloneAction->setEnabled(false); 1440 1465 mVmDeleteAction->setEnabled(item != NULL); 1441 1466 mVmDiscardAction->setEnabled(false); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.h
r35415 r37468 71 71 void vmAdd(const QString &strFile = ""); 72 72 void vmSettings(const QString &aCategory = QString::null, const QString &aControl = QString::null, const QString & = QString::null); 73 void vmClone(const QString & = QString::null); 73 74 void vmDelete(const QString & = QString::null); 74 75 void vmStart(const QString & = QString::null); … … 95 96 const QAction *vmAddAction() const { return mVmAddAction; } 96 97 const QAction *vmConfigAction() const { return mVmConfigAction; } 98 const QAction *vmCloneAction() const { return mVmCloneAction; } 97 99 const QAction *vmDeleteAction() const { return mVmDeleteAction; } 98 100 const QAction *vmStartAction() const { return mVmStartAction; } … … 165 167 QAction *mVmAddAction; 166 168 QAction *mVmConfigAction; 169 QAction *mVmCloneAction; 167 170 QAction *mVmDeleteAction; 168 171 QAction *mVmStartAction; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r36011 r37468 27 27 #include "VBoxSnapshotsWgt.h" 28 28 #include "VBoxTakeSnapshotDlg.h" 29 #include "UICloneVMWizard.h" 29 30 #include "UIToolBar.h" 30 31 #include "UIVirtualBoxEventHandler.h" 32 #include "UISelectorShortcuts.h" 31 33 32 34 /* Global includes */ … … 136 138 } 137 139 140 CMachine machine() const { return mMachine; } 138 141 CSnapshot snapshot() const { return mSnapshot; } 139 142 QString snapshotId() const { return mId; } … … 330 333 , mShowSnapshotDetailsAction (new QAction (mSnapshotActionGroup)) 331 334 , mTakeSnapshotAction (new QAction (mCurStateActionGroup)) 335 , mCloneSnapshotAction(new QAction(mCurStateActionGroup)) 332 336 { 333 337 /* Apply UI decorations */ … … 359 363 toolBar->addAction (mRestoreSnapshotAction); 360 364 toolBar->addAction (mDeleteSnapshotAction); 365 toolBar->addSeparator(); 366 toolBar->addAction(mCloneSnapshotAction); 361 367 toolBar->addSeparator(); 362 368 toolBar->addAction (mShowSnapshotDetailsAction); … … 381 387 ":/take_snapshot_22px.png", ":/take_snapshot_16px.png", 382 388 ":/take_snapshot_dis_22px.png", ":/take_snapshot_dis_16px.png")); 389 mCloneSnapshotAction->setIcon(UIIconPool::iconSet( 390 ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")); 383 391 384 392 mRestoreSnapshotAction->setShortcut (QString ("Ctrl+Shift+R")); … … 386 394 mShowSnapshotDetailsAction->setShortcut (QString ("Ctrl+Space")); 387 395 mTakeSnapshotAction->setShortcut (QString ("Ctrl+Shift+S")); 396 mCloneSnapshotAction->setShortcut(QString ("Ctrl+Shift+C")); 388 397 389 398 mAgeUpdateTimer.setSingleShot (true); … … 401 410 connect (mDeleteSnapshotAction, SIGNAL (triggered()), this, SLOT (sltDeleteSnapshot())); 402 411 connect (mShowSnapshotDetailsAction, SIGNAL (triggered()), this, SLOT (sltShowSnapshotDetails())); 412 connect (mCloneSnapshotAction, SIGNAL(triggered()), this, SLOT(sltCloneSnapshot())); 403 413 404 414 connect (gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), … … 441 451 mShowSnapshotDetailsAction->setText (tr ("S&how Details")); 442 452 mTakeSnapshotAction->setText (tr ("Take &Snapshot")); 453 mCloneSnapshotAction->setText(tr("&Clone")); 454 443 455 444 456 mRestoreSnapshotAction->setStatusTip (tr ("Restore the selected snapshot of the virtual machine")); … … 446 458 mShowSnapshotDetailsAction->setStatusTip (tr ("Show the details of the selected snapshot")); 447 459 mTakeSnapshotAction->setStatusTip (tr ("Take a snapshot of the current virtual machine state")); 460 mCloneSnapshotAction->setStatusTip(tr("Clone the selected virtual machine")); 448 461 449 462 mRestoreSnapshotAction->setToolTip (mRestoreSnapshotAction->text().remove ('&').remove ('.') + … … 455 468 mTakeSnapshotAction->setToolTip (mTakeSnapshotAction->text().remove ('&').remove ('.') + 456 469 QString (" (%1)").arg (mTakeSnapshotAction->shortcut().toString())); 470 mCloneSnapshotAction->setToolTip(mCloneSnapshotAction->text().remove('&').remove('.') + 471 QString(" (%1)").arg(mCloneSnapshotAction->shortcut().toString())); 457 472 } 458 473 … … 498 513 && mCurSnapshotItem && item && item->isCurrentStateItem()) 499 514 || (item && !mCurSnapshotItem)); 515 516 /* Enable/disable cloning snapshots */ 517 mCloneSnapshotAction->setEnabled(!busy && item); 500 518 } 501 519 … … 514 532 menu.addAction (mDeleteSnapshotAction); 515 533 menu.addSeparator(); 534 menu.addAction(mCloneSnapshotAction); 535 menu.addSeparator(); 516 536 menu.addAction (mShowSnapshotDetailsAction); 517 537 } 518 538 else 539 { 519 540 menu.addAction (mTakeSnapshotAction); 541 menu.addSeparator(); 542 menu.addAction(mCloneSnapshotAction); 543 } 520 544 521 545 menu.exec (mTreeWidget->viewport()->mapToGlobal (aPoint)); … … 653 677 if (dlg.exec() == QDialog::Accepted) 654 678 dlg.putBackToSnapshot(); 679 } 680 681 void VBoxSnapshotsWgt::sltCloneSnapshot() 682 { 683 SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 : 684 static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem()); 685 AssertReturn (item, (void) 0); 686 687 CMachine machine; 688 bool fShowChildsOption = false; 689 if (item->isCurrentStateItem()) 690 machine = item->machine(); 691 else 692 { 693 const CSnapshot &snap = item->snapshot(); 694 AssertReturn(!snap.isNull(), (void)0); 695 machine = snap.GetMachine(); 696 if (snap.GetChildrenCount() > 0) 697 fShowChildsOption = true; 698 } 699 AssertReturn(!machine.isNull(), (void)0); 700 701 UICloneVMWizard wzd(this, machine, fShowChildsOption); 702 wzd.exec(); 655 703 } 656 704 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.h
r36011 r37468 67 67 void sltDeleteSnapshot(); 68 68 void sltShowSnapshotDetails(); 69 void sltCloneSnapshot(); 69 70 70 71 /* Main API event handlers: */ … … 102 103 QAction *mShowSnapshotDetailsAction; 103 104 QAction *mTakeSnapshotAction; 105 QAction *mCloneSnapshotAction; 104 106 105 107 QTimer mAgeUpdateTimer;
Note:
See TracChangeset
for help on using the changeset viewer.