Changeset 99200 in vbox for trunk/src/VBox
- Timestamp:
- Mar 28, 2023 3:33:06 PM (22 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r99199 r99200 470 470 , m_pWidget(0) 471 471 , m_iGeometrySaveTimerId(-1) 472 , m_fImportFromOCI(false) 472 473 { 473 474 s_pInstance = this; … … 710 711 { 711 712 /* Allow only one file at the time: */ 712 sltOpenImportApplianceWizard(strFile);713 openImportApplianceWizard(strFile); 713 714 break; 714 715 } … … 924 925 } 925 926 926 void UIVirtualBoxManager::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)927 {928 /* Initialize variables: */929 #ifdef VBOX_WS_MAC930 QString strTmpFile = ::darwinResolveAlias(strFileName);931 #else932 QString strTmpFile = strFileName;933 #endif934 935 /* If there is no file-name passed,936 * check if cloud stuff focused currently: */937 bool fOCIByDefault = false;938 if ( strTmpFile.isEmpty()939 && ( m_pWidget->isSingleCloudProviderGroupSelected()940 || m_pWidget->isSingleCloudProfileGroupSelected()941 || m_pWidget->isCloudMachineItemSelected()))942 {943 /* We can generate cloud hints as well: */944 fOCIByDefault = true;945 strTmpFile = m_pWidget->fullGroupName();946 }947 948 /* Lock the action preventing cascade calls: */949 UIQObjectPropertySetter guardBlock(actionPool()->action(UIActionIndexMN_M_File_S_ImportAppliance), "opened", true);950 connect(&guardBlock, &UIQObjectPropertySetter::sigAboutToBeDestroyed,951 this, &UIVirtualBoxManager::sltHandleUpdateActionAppearanceRequest);952 updateActionsAppearance();953 954 /* Use the "safe way" to open stack of Mac OS X Sheets: */955 QWidget *pWizardParent = windowManager().realParentWindow(this);956 UINativeWizardPointer pWizard = new UIWizardImportApp(pWizardParent, fOCIByDefault, strTmpFile);957 windowManager().registerNewParent(pWizard, pWizardParent);958 pWizard->exec();959 delete pWizard;960 }961 962 927 void UIVirtualBoxManager::sltOpenExportApplianceWizard() 963 928 { … … 1036 1001 switch (enmType) 1037 1002 { 1003 case WizardType_ImportAppliance: 1004 m_wizards[enmType] = new UIWizardImportApp(this, m_fImportFromOCI, m_strFileName); 1005 break; 1038 1006 case WizardType_NewCloudVM: 1039 1007 m_wizards[enmType] = new UIWizardNewCloudVM(this, m_pWidget->fullGroupName()); … … 2660 2628 } 2661 2629 2630 void UIVirtualBoxManager::openImportApplianceWizard(const QString &strFileName /* = QString() */) 2631 { 2632 /* Configure wizard variables: */ 2633 m_fImportFromOCI = false; 2634 #ifdef VBOX_WS_MAC 2635 m_strFileName = ::darwinResolveAlias(strFileName); 2636 #else 2637 m_strFileName = strFileName; 2638 #endif 2639 2640 /* If there is no file-name passed, 2641 * check if cloud stuff focused currently: */ 2642 if ( m_strFileName.isEmpty() 2643 && ( m_pWidget->isSingleCloudProviderGroupSelected() 2644 || m_pWidget->isSingleCloudProfileGroupSelected() 2645 || m_pWidget->isCloudMachineItemSelected())) 2646 { 2647 m_fImportFromOCI = true; 2648 /* We can generate cloud hints as well: */ 2649 m_strFileName = m_pWidget->fullGroupName(); 2650 } 2651 2652 /* Open Import Appliance Wizard: */ 2653 sltOpenWizard(WizardType_ImportAppliance); 2654 } 2655 2662 2656 /* static */ 2663 2657 void UIVirtualBoxManager::launchMachine(CMachine &comMachine, -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r99195 r99200 186 186 void sltCloseManagerWindowDefault() { sltCloseManagerWindow(); } 187 187 188 /** Handles call to open Import Appliance wizard.189 * @param strFileName can bring the name of file to import appliance from. */190 void sltOpenImportApplianceWizard(const QString &strFileName = QString());191 188 /** Handles call to open Import Appliance wizard the default way. */ 192 void sltOpenImportApplianceWizardDefault() { sltOpenImportApplianceWizard(); }189 void sltOpenImportApplianceWizardDefault() { openImportApplianceWizard(); } 193 190 /** Handles call to open Export Appliance wizard. */ 194 191 void sltOpenExportApplianceWizard(); … … 403 400 /** Opens new machine dialog specifying initial name with @a strFileName. */ 404 401 void openNewMachineWizard(const QString &strISOFilePath = QString()); 402 403 /** Opens Import Appliance wizard. 404 * @param strFileName can bring the name of file to import appliance from. */ 405 void openImportApplianceWizard(const QString &strFileName = QString()); 406 405 407 /** Launches certain @a comMachine in specified @a enmLaunchMode. */ 406 408 static void launchMachine(CMachine &comMachine, UILaunchMode enmLaunchMode = UILaunchMode_Default); … … 518 520 519 521 /** Holds the geometry save timer ID. */ 520 int m_iGeometrySaveTimerId; 522 int m_iGeometrySaveTimerId; 523 /** Holds whether OCI importing should be started by default. */ 524 bool m_fImportFromOCI; 525 /** Holds the file-name used by import wizard. */ 526 QString m_strFileName; 521 527 }; 522 528
Note:
See TracChangeset
for help on using the changeset viewer.