Changeset 77297 in vbox
- Timestamp:
- Feb 13, 2019 12:58:29 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128817
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r77255 r77297 689 689 setName(QApplication::translate("UIActionPool", "Cl&one...")); 690 690 setStatusTip(QApplication::translate("UIActionPool", "Clone selected virtual machine")); 691 } 692 }; 693 694 /** Simple action extension, used as 'Perform Export Machine' action class. */ 695 class UIActionSimpleSelectorMachinePerformExport : public UIActionSimple 696 { 697 Q_OBJECT; 698 699 public: 700 701 /** Constructs action passing @a pParent to the base-class. */ 702 UIActionSimpleSelectorMachinePerformExport(UIActionPool *pParent) 703 : UIActionSimple(pParent, ":/export_16px.png", ":/export_disabled_16px.png") 704 {} 705 706 protected: 707 708 /** Returns shortcut extra-data ID. */ 709 virtual QString shortcutExtraDataID() const /* override */ 710 { 711 return QString("ExportVM"); 712 } 713 714 /** Handles translation event. */ 715 virtual void retranslateUi() /* override */ 716 { 717 setName(QApplication::translate("UIActionPool", "&Export...")); 718 setStatusTip(QApplication::translate("UIActionPool", "Export selected virtual machine")); 691 719 } 692 720 }; … … 2659 2687 m_pool[UIActionIndexST_M_Machine_S_Settings] = new UIActionSimpleSelectorMachineShowSettings(this); 2660 2688 m_pool[UIActionIndexST_M_Machine_S_Clone] = new UIActionSimpleSelectorMachinePerformClone(this); 2689 m_pool[UIActionIndexST_M_Machine_S_Export] = new UIActionSimpleSelectorMachinePerformExport(this); 2661 2690 m_pool[UIActionIndexST_M_Machine_S_Move] = new UIActionSimpleSelectorMachinePerformMove(this); 2662 2691 m_pool[UIActionIndexST_M_Machine_S_Remove] = new UIActionSimpleSelectorMachinePerformRemove(this); … … 3003 3032 pMenu->addAction(action(UIActionIndexST_M_Machine_S_Settings)); 3004 3033 pMenu->addAction(action(UIActionIndexST_M_Machine_S_Clone)); 3034 pMenu->addAction(action(UIActionIndexST_M_Machine_S_Export)); 3005 3035 pMenu->addAction(action(UIActionIndexST_M_Machine_S_Move)); 3006 3036 pMenu->addAction(action(UIActionIndexST_M_Machine_S_Remove)); … … 3369 3399 case UIActionIndexST_M_Machine: 3370 3400 { 3371 3372 3401 actions << action(UIActionIndexST_M_Machine_S_New) 3373 3402 << action(UIActionIndexST_M_Machine_S_Add) 3374 3403 << action(UIActionIndexST_M_Machine_S_Settings) 3375 3404 << action(UIActionIndexST_M_Machine_S_Clone) 3405 << action(UIActionIndexST_M_Machine_S_Export) 3376 3406 << action(UIActionIndexST_M_Machine_S_Move) 3377 3407 << action(UIActionIndexST_M_Machine_S_Remove) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r77255 r77297 90 90 UIActionIndexST_M_Machine_S_Settings, 91 91 UIActionIndexST_M_Machine_S_Clone, 92 UIActionIndexST_M_Machine_S_Export, 92 93 UIActionIndexST_M_Machine_S_Move, 93 94 UIActionIndexST_M_Machine_S_Remove, -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r76949 r77297 530 530 /* Lock the action preventing cascade calls: */ 531 531 actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)->setProperty("opened", true); 532 actionPool()->action(UIActionIndexST_M_Machine_S_Export)->setProperty("opened", true); 532 533 updateActionsAppearance(); 534 535 /* Check what was the action invoked us: */ 536 UIAction *pAction = qobject_cast<UIAction*>(sender()); 533 537 534 538 /* Use the "safe way" to open stack of Mac OS X Sheets: */ 535 539 QWidget *pWizardParent = windowManager().realParentWindow(this); 536 UISafePointerWizard pWizard = new UIWizardExportApp(pWizardParent, names); 540 UISafePointerWizard pWizard = new UIWizardExportApp(pWizardParent, names, 541 pAction && 542 pAction == actionPool()->action(UIActionIndexST_M_Machine_S_Export)); 537 543 windowManager().registerNewParent(pWizard, pWizardParent); 538 544 pWizard->prepare(); … … 544 550 { 545 551 actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)->setProperty("opened", QVariant()); 552 actionPool()->action(UIActionIndexST_M_Machine_S_Export)->setProperty("opened", QVariant()); 546 553 updateActionsAppearance(); 547 554 } … … 1429 1436 connect(actionPool()->action(UIActionIndexST_M_Machine_S_Clone), &UIAction::triggered, 1430 1437 this, &UIVirtualBoxManager::sltOpenCloneMachineWizard); 1438 connect(actionPool()->action(UIActionIndexST_M_Machine_S_Export), &UIAction::triggered, 1439 this, &UIVirtualBoxManager::sltOpenExportApplianceWizard); 1431 1440 connect(actionPool()->action(UIActionIndexST_M_Machine_S_Move), &UIAction::triggered, 1432 1441 this, &UIVirtualBoxManager::sltPerformMachineMove); … … 1712 1721 actionPool()->action(UIActionIndexST_M_Machine_S_Settings)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Settings, items)); 1713 1722 actionPool()->action(UIActionIndexST_M_Machine_S_Clone)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Clone, items)); 1723 actionPool()->action(UIActionIndexST_M_Machine_S_Export)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Export, items)); 1714 1724 actionPool()->action(UIActionIndexST_M_Machine_S_Move)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Move, items)); 1715 1725 actionPool()->action(UIActionIndexST_M_Machine_S_Remove)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Remove, items)); … … 1876 1886 UIVirtualMachineItem::isItemEditable(pItem); 1877 1887 } 1888 case UIActionIndexST_M_Machine_S_Export: 1889 { 1890 return !actionPool()->action(iActionIndex)->property("opened").toBool() && 1891 items.size() == 1; 1892 } 1878 1893 case UIActionIndexST_M_Machine_S_Remove: 1879 1894 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r77228 r77297 1414 1414 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings)); 1415 1415 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Clone)); 1416 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Export)); 1416 1417 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Move)); 1417 1418 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Remove)); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r76606 r77297 17 17 18 18 /* Qt includes: */ 19 #include <QAbstractButton> 19 20 #include <QFileInfo> 20 21 #include <QVariant> … … 37 38 38 39 39 UIWizardExportApp::UIWizardExportApp(QWidget *pParent, const QStringList &selectedVMNames) 40 UIWizardExportApp::UIWizardExportApp(QWidget *pParent, 41 const QStringList &selectedVMNames /* = QStringList() */, 42 bool fFastTraverToPage2 /* = false */) 40 43 : UIWizard(pParent, WizardType_ExportAppliance) 41 44 , m_selectedVMNames(selectedVMNames) 45 , m_fFastTraverToPage2(fFastTraverToPage2) 42 46 { 43 47 #ifndef VBOX_WS_MAC … … 226 230 /* Call to base-class: */ 227 231 UIWizard::prepare(); 232 233 /* Now, when we are ready, we can 234 * fast traver to page 2 if requested: */ 235 if (m_fFastTraverToPage2) 236 button(QWizard::NextButton)->click(); 228 237 } 229 238 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.h
r76581 r77297 51 51 /** Constructs export appliance wizard passing @a pParent to the base-class. 52 52 * @param selectedVMNames Brings the names of VMs to be exported. */ 53 UIWizardExportApp(QWidget *pParent, const QStringList &selectedVMNames = QStringList() );53 UIWizardExportApp(QWidget *pParent, const QStringList &selectedVMNames = QStringList(), bool fFastTraverToPage2 = false); 54 54 55 55 /** Exports full appliance. */ … … 82 82 83 83 /** Holds the names of VMs to be exported. */ 84 QStringList m_selectedVMNames; 84 QStringList m_selectedVMNames; 85 /** Holds whether we should fast travel to page 2. */ 86 bool m_fFastTraverToPage2; 85 87 }; 86 88
Note:
See TracChangeset
for help on using the changeset viewer.