Changeset 93219 in vbox
- Timestamp:
- Jan 13, 2022 10:44:20 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm
- Files:
-
- 2 edited
-
UIWizardAddCloudVMPageExpert.cpp (modified) (7 diffs)
-
UIWizardAddCloudVMPageExpert.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp
r93115 r93219 17 17 18 18 /* Qt includes: */ 19 #include <QGroupBox>20 19 #include <QHBoxLayout> 21 20 #include <QHeaderView> 22 21 #include <QListWidget> 23 22 #include <QTableWidget> 23 #include <QVBoxLayout> 24 24 25 25 /* GUI includes: */ … … 28 28 #include "UICloudNetworkingStuff.h" 29 29 #include "UIIconPool.h" 30 #include "UIToolBox.h" 30 31 #include "UIVirtualBoxEventHandler.h" 31 32 #include "UIVirtualBoxManager.h" … … 38 39 39 40 UIWizardAddCloudVMPageExpert::UIWizardAddCloudVMPageExpert() 40 : m_pCntProvider(0) 41 , m_pProviderLayout(0) 41 : m_pToolBox(0) 42 42 , m_pProviderLabel(0) 43 43 , m_pProviderComboBox(0) 44 , m_pOptionsLayout(0)45 44 , m_pProfileLabel(0) 46 45 , m_pProfileComboBox(0) … … 50 49 { 51 50 /* Prepare main layout: */ 52 Q HBoxLayout *pLayoutMain = new QHBoxLayout(this);51 QVBoxLayout *pLayoutMain = new QVBoxLayout(this); 53 52 if (pLayoutMain) 54 53 { 55 /* Prepare provider container: */56 m_p CntProvider = new QGroupBox(this);57 if (m_p CntProvider)54 /* Prepare tool-box: */ 55 m_pToolBox = new UIToolBox(this); 56 if (m_pToolBox) 58 57 { 59 /* Prepare provider layout: */60 m_pProviderLayout = new QGridLayout(m_pCntProvider);61 if ( m_pProviderLayout)58 /* Prepare location widget: */ 59 QWidget *pWidgetLocation = new QWidget(m_pToolBox); 60 if (pWidgetLocation) 62 61 { 63 /* Prepare provider selector: */ 64 m_pProviderComboBox = new QIComboBox(m_pCntProvider); 65 if (m_pProviderComboBox) 66 m_pProviderLayout->addWidget(m_pProviderComboBox, 0, 0); 67 68 /* Prepare options layout: */ 69 m_pOptionsLayout = new QGridLayout; 70 if (m_pOptionsLayout) 62 /* Prepare location layout: */ 63 QVBoxLayout *pLayoutLocation = new QVBoxLayout(pWidgetLocation); 64 if (pLayoutLocation) 71 65 { 72 m_pOptionsLayout->setContentsMargins(0, 0, 0, 0); 73 m_pOptionsLayout->setRowStretch(1, 1); 74 75 /* Prepare sub-layout: */ 76 QHBoxLayout *pSubLayout = new QHBoxLayout; 77 if (pSubLayout) 66 pLayoutLocation->setContentsMargins(0, 0, 0, 0); 67 68 /* Prepare provider combo-box: */ 69 m_pProviderComboBox = new QIComboBox(pWidgetLocation); 70 if (m_pProviderComboBox) 71 pLayoutLocation->addWidget(m_pProviderComboBox); 72 73 /* Prepare profile layout: */ 74 QHBoxLayout *pLayoutProfile = new QHBoxLayout; 75 if (pLayoutProfile) 78 76 { 79 p SubLayout->setContentsMargins(0, 0, 0, 0);80 p SubLayout->setSpacing(1);77 pLayoutProfile->setContentsMargins(0, 0, 0, 0); 78 pLayoutProfile->setSpacing(1); 81 79 82 80 /* Prepare profile combo-box: */ 83 m_pProfileComboBox = new QIComboBox( m_pCntProvider);81 m_pProfileComboBox = new QIComboBox(pWidgetLocation); 84 82 if (m_pProfileComboBox) 85 p SubLayout->addWidget(m_pProfileComboBox);83 pLayoutProfile->addWidget(m_pProfileComboBox); 86 84 87 85 /* Prepare profile tool-button: */ 88 m_pProfileToolButton = new QIToolButton( m_pCntProvider);86 m_pProfileToolButton = new QIToolButton(pWidgetLocation); 89 87 if (m_pProfileToolButton) 90 88 { 91 89 m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png", 92 90 ":/cloud_profile_manager_disabled_16px.png")); 93 p SubLayout->addWidget(m_pProfileToolButton);91 pLayoutProfile->addWidget(m_pProfileToolButton); 94 92 } 95 93 96 94 /* Add into layout: */ 97 m_pOptionsLayout->addLayout(pSubLayout, 0, 0);95 pLayoutLocation->addLayout(pLayoutProfile); 98 96 } 97 } 98 99 /* Add into tool-box: */ 100 m_pToolBox->insertPage(0, pWidgetLocation, QString()); 101 } 102 103 /* Prepare source widget: */ 104 QWidget *pWidgetSource = new QWidget(m_pToolBox); 105 if (pWidgetSource) 106 { 107 /* Prepare source layout: */ 108 QVBoxLayout *pLayoutSource = new QVBoxLayout(pWidgetSource); 109 if (pLayoutSource) 110 { 111 pLayoutSource->setContentsMargins(0, 0, 0, 0); 99 112 100 113 /* Prepare source instances table: */ 101 m_pSourceInstanceList = new QListWidget( m_pCntProvider);114 m_pSourceInstanceList = new QListWidget(pWidgetSource); 102 115 if (m_pSourceInstanceList) 103 116 { … … 114 127 115 128 /* Add into layout: */ 116 m_pOptionsLayout->addWidget(m_pSourceInstanceList, 1, 0);129 pLayoutSource->addWidget(m_pSourceInstanceList, 1, 0); 117 130 } 118 119 /* Add into layout: */120 m_pProviderLayout->addLayout(m_pOptionsLayout, 1, 0);121 131 } 132 133 /* Add into tool-box: */ 134 m_pToolBox->insertPage(1, pWidgetSource, QString()); 122 135 } 123 136 124 137 /* Add into layout: */ 125 pLayoutMain->addWidget(m_p CntProvider);138 pLayoutMain->addWidget(m_pToolBox); 126 139 } 127 140 } … … 149 162 void UIWizardAddCloudVMPageExpert::retranslateUi() 150 163 { 151 /* Translate source container: */ 152 m_pCntProvider->setTitle(UIWizardAddCloudVM::tr("Source")); 164 /* Translate tool-box: */ 165 if (m_pToolBox) 166 { 167 m_pToolBox->setPageTitle(0, UIWizardAddCloudVM::tr("Location")); 168 m_pToolBox->setPageTitle(1, UIWizardAddCloudVM::tr("Source")); 169 } 153 170 154 171 /* Translate profile stuff: */ 155 m_pProfileToolButton->setToolTip(UIWizardAddCloudVM::tr("Open Cloud Profile Manager...")); 172 if (m_pProfileToolButton) 173 m_pProfileToolButton->setToolTip(UIWizardAddCloudVM::tr("Open Cloud Profile Manager...")); 156 174 157 175 /* Translate received values of Source combo-box. 158 176 * We are enumerating starting from 0 for simplicity: */ 159 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 160 { 161 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 162 m_pProviderComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole); 163 } 177 if (m_pProviderComboBox) 178 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 179 { 180 m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString()); 181 m_pProviderComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole); 182 } 164 183 165 184 /* Update tool-tips: */ … … 169 188 void UIWizardAddCloudVMPageExpert::initializePage() 170 189 { 190 /* Choose 1st tool to be chosen initially: */ 191 m_pToolBox->setCurrentPage(0); 171 192 /* Populate providers: */ 172 193 populateProviders(m_pProviderComboBox, wizard()->notificationCenter()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.h
r93115 r93219 26 26 27 27 /* Forward declarations: */ 28 class QGroupBox;28 class UIToolBox; 29 29 class UIWizardAddCloudVM; 30 30 … … 72 72 private: 73 73 74 /** Holds the provider containerinstance. */75 QGroupBox *m_pCntProvider;74 /** Holds the tool-box instance. */ 75 UIToolBox *m_pToolBox; 76 76 77 /** Holds the provider layout instance. */78 QGridLayout *m_pProviderLayout;79 77 /** Holds the provider type label instance. */ 80 78 QLabel *m_pProviderLabel; … … 82 80 QIComboBox *m_pProviderComboBox; 83 81 84 /** Holds the options layout instance. */85 QGridLayout *m_pOptionsLayout;86 82 /** Holds the profile label instance. */ 87 83 QLabel *m_pProfileLabel; … … 90 86 /** Holds the profile management tool-button instance. */ 91 87 QIToolButton *m_pProfileToolButton; 88 92 89 /** Holds the source instance label instance. */ 93 90 QLabel *m_pSourceInstanceLabel;
Note:
See TracChangeset
for help on using the changeset viewer.

