Changeset 105626 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 8, 2024 1:52:02 PM (6 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp
r105363 r105626 41 41 #include "UICloudNetworkingStuff.h" 42 42 #include "UIIconPool.h" 43 #include "UIToolBox.h"44 43 #include "UIVirtualBoxEventHandler.h" 45 44 #include "UIVirtualBoxManager.h" … … 52 51 53 52 UIWizardAddCloudVMPageExpert::UIWizardAddCloudVMPageExpert() 54 : m_pToolBox(0) 55 , m_pLayoutProvider(0) 53 : m_pLayoutProvider(0) 56 54 , m_pProviderLabel(0) 57 55 , m_pProviderComboBox(0) … … 62 60 , m_pSourceInstanceList(0) 63 61 { 64 /* Prepare mainlayout: */65 QVBoxLayout *pLayoutMain = new QVBoxLayout(this);66 if ( pLayoutMain)62 /* Prepare provider layout: */ 63 m_pLayoutProvider = new QGridLayout(this); 64 if (m_pLayoutProvider) 67 65 { 68 /* Prepare tool-box: */ 69 m_pToolBox = new UIToolBox(this); 70 if (m_pToolBox) 66 m_pLayoutProvider->setContentsMargins(0, 0, 0, 0); 67 m_pLayoutProvider->setColumnStretch(0, 0); 68 m_pLayoutProvider->setColumnStretch(1, 1); 69 m_pLayoutProvider->setRowStretch(2, 0); 70 m_pLayoutProvider->setRowStretch(3, 1); 71 72 /* Prepare provider label: */ 73 m_pProviderLabel = new QLabel(this); 74 if (m_pProviderLabel) 75 m_pLayoutProvider->addWidget(m_pProviderLabel, 0, 0, Qt::AlignRight); 76 77 /* Prepare provider combo-box: */ 78 m_pProviderComboBox = new QIComboBox(this); 79 if (m_pProviderComboBox) 71 80 { 72 /* Prepare location widget: */ 73 QWidget *pWidgetLocation = new QWidget(m_pToolBox); 74 if (pWidgetLocation) 81 m_pProviderLabel->setBuddy(m_pProviderComboBox); 82 m_pLayoutProvider->addWidget(m_pProviderComboBox, 0, 1); 83 } 84 85 /* Prepare profile label: */ 86 m_pProfileLabel = new QLabel(this); 87 if (m_pProfileLabel) 88 m_pLayoutProvider->addWidget(m_pProfileLabel, 1, 0, Qt::AlignRight); 89 90 /* Prepare profile layout: */ 91 QHBoxLayout *pLayoutProfile = new QHBoxLayout; 92 if (pLayoutProfile) 93 { 94 pLayoutProfile->setContentsMargins(0, 0, 0, 0); 95 pLayoutProfile->setSpacing(1); 96 97 /* Prepare profile combo-box: */ 98 m_pProfileComboBox = new QIComboBox(this); 99 if (m_pProfileComboBox) 75 100 { 76 /* Prepare location layout: */ 77 QVBoxLayout *pLayoutLocation = new QVBoxLayout(pWidgetLocation); 78 if (pLayoutLocation) 79 { 80 pLayoutLocation->setContentsMargins(0, 0, 0, 0); 81 82 /* Prepare provider layout: */ 83 m_pLayoutProvider = new QGridLayout; 84 if (m_pLayoutProvider) 85 { 86 m_pLayoutProvider->setContentsMargins(0, 0, 0, 0); 87 m_pLayoutProvider->setColumnStretch(0, 0); 88 m_pLayoutProvider->setColumnStretch(1, 1); 89 90 /* Prepare provider label: */ 91 m_pProviderLabel = new QLabel(this); 92 if (m_pProviderLabel) 93 m_pLayoutProvider->addWidget(m_pProviderLabel, 0, 0, Qt::AlignRight); 94 95 /* Prepare provider combo-box: */ 96 m_pProviderComboBox = new QIComboBox(pWidgetLocation); 97 if (m_pProviderComboBox) 98 { 99 m_pProviderLabel->setBuddy(m_pProviderComboBox); 100 m_pLayoutProvider->addWidget(m_pProviderComboBox, 0, 1); 101 } 102 103 /* Prepare profile label: */ 104 m_pProfileLabel = new QLabel(this); 105 if (m_pProfileLabel) 106 m_pLayoutProvider->addWidget(m_pProfileLabel, 1, 0, Qt::AlignRight); 107 108 /* Prepare profile layout: */ 109 QHBoxLayout *pLayoutProfile = new QHBoxLayout; 110 if (pLayoutProfile) 111 { 112 pLayoutProfile->setContentsMargins(0, 0, 0, 0); 113 pLayoutProfile->setSpacing(1); 114 115 /* Prepare profile combo-box: */ 116 m_pProfileComboBox = new QIComboBox(pWidgetLocation); 117 if (m_pProfileComboBox) 118 { 119 m_pProfileLabel->setBuddy(m_pProfileComboBox); 120 pLayoutProfile->addWidget(m_pProfileComboBox); 121 } 122 123 /* Prepare profile tool-button: */ 124 m_pProfileToolButton = new QIToolButton(pWidgetLocation); 125 if (m_pProfileToolButton) 126 { 127 m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png", 128 ":/cloud_profile_manager_disabled_16px.png")); 129 pLayoutProfile->addWidget(m_pProfileToolButton); 130 } 131 132 /* Add into layout: */ 133 m_pLayoutProvider->addLayout(pLayoutProfile, 1, 1); 134 } 135 136 /* Add into layout: */ 137 pLayoutLocation->addLayout(m_pLayoutProvider); 138 } 139 } 140 141 /* Add into tool-box: */ 142 m_pToolBox->insertPage(0, pWidgetLocation, QString()); 101 m_pProfileLabel->setBuddy(m_pProfileComboBox); 102 pLayoutProfile->addWidget(m_pProfileComboBox); 143 103 } 144 104 145 /* Prepare source widget: */146 QWidget *pWidgetSource = new QWidget(m_pToolBox);147 if ( pWidgetSource)105 /* Prepare profile tool-button: */ 106 m_pProfileToolButton = new QIToolButton(this); 107 if (m_pProfileToolButton) 148 108 { 149 /* Prepare source layout: */ 150 QVBoxLayout *pLayoutSource = new QVBoxLayout(pWidgetSource); 151 if (pLayoutSource) 152 { 153 pLayoutSource->setContentsMargins(0, 0, 0, 0); 154 155 /* Prepare source instances table: */ 156 m_pSourceInstanceList = new QIListWidget(pWidgetSource); 157 if (m_pSourceInstanceList) 158 { 159 /* A bit of look&feel: */ 160 m_pSourceInstanceList->setAlternatingRowColors(true); 161 /* Allow to select more than one item to add: */ 162 m_pSourceInstanceList->setSelectionMode(QAbstractItemView::ExtendedSelection); 163 164 /* Add into layout: */ 165 pLayoutSource->addWidget(m_pSourceInstanceList); 166 } 167 } 168 169 /* Add into tool-box: */ 170 m_pToolBox->insertPage(1, pWidgetSource, QString()); 109 m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png", 110 ":/cloud_profile_manager_disabled_16px.png")); 111 pLayoutProfile->addWidget(m_pProfileToolButton); 171 112 } 172 113 173 114 /* Add into layout: */ 174 pLayoutMain->addWidget(m_pToolBox); 115 m_pLayoutProvider->addLayout(pLayoutProfile, 1, 1); 116 } 117 118 /* Prepare source instance label: */ 119 m_pSourceInstanceLabel = new QLabel(this); 120 if (m_pSourceInstanceLabel) 121 m_pLayoutProvider->addWidget(m_pSourceInstanceLabel, 2, 0, Qt::AlignRight); 122 123 /* Prepare source instances table: */ 124 m_pSourceInstanceList = new QIListWidget(this); 125 if (m_pSourceInstanceList) 126 { 127 m_pSourceInstanceLabel->setBuddy(m_pSourceInstanceLabel); 128 /* Make source image list fit 50 symbols 129 * horizontally and 8 lines vertically: */ 130 const QFontMetrics fm(m_pSourceInstanceList->font()); 131 const int iFontWidth = fm.horizontalAdvance('x'); 132 const int iTotalWidth = 50 * iFontWidth; 133 const int iFontHeight = fm.height(); 134 const int iTotalHeight = 8 * iFontHeight; 135 m_pSourceInstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight)); 136 /* A bit of look&feel: */ 137 m_pSourceInstanceList->setAlternatingRowColors(true); 138 /* Allow to select more than one item to add: */ 139 m_pSourceInstanceList->setSelectionMode(QAbstractItemView::ExtendedSelection); 140 141 /* Add into layout: */ 142 m_pLayoutProvider->addWidget(m_pSourceInstanceList, 2, 1, 2, 1); 175 143 } 176 144 } … … 198 166 void UIWizardAddCloudVMPageExpert::sltRetranslateUI() 199 167 { 200 /* Translate tool-box: */201 if (m_pToolBox)202 {203 m_pToolBox->setPageTitle(0, UIWizardAddCloudVM::tr("Source"));204 m_pToolBox->setPageTitle(1, UIWizardAddCloudVM::tr("Instances"));205 }206 207 168 /* Translate provider label: */ 208 169 if (m_pProviderLabel) … … 229 190 230 191 /* Translate instances stuff: */ 192 if (m_pSourceInstanceLabel) 193 m_pSourceInstanceLabel->setText(UIWizardAddCloudVM::tr("&Instances:")); 231 194 if (m_pSourceInstanceList) 232 195 m_pSourceInstanceList->setWhatsThis(UIWizardAddCloudVM::tr("Lists all the cloud VM instances.")); … … 235 198 void UIWizardAddCloudVMPageExpert::initializePage() 236 199 { 237 /* Choose 1st tool to be chosen initially: */238 m_pToolBox->setCurrentPage(0);239 200 /* Populate providers: */ 240 201 populateProviders(m_pProviderComboBox, wizard()->notificationCenter()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.h
r104568 r105626 39 39 class QLabel; 40 40 class QIListWidget; 41 class UIToolBox;42 41 class UIWizardAddCloudVM; 43 42 … … 85 84 private: 86 85 87 /** Holds the tool-box instance. */88 UIToolBox *m_pToolBox;89 90 86 /** Holds the provider layout instance. */ 91 87 QGridLayout *m_pLayoutProvider; … … 100 96 /** Holds the profile management tool-button instance. */ 101 97 QIToolButton *m_pProfileToolButton; 102 103 98 /** Holds the source instance label instance. */ 104 99 QLabel *m_pSourceInstanceLabel; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp
r105363 r105626 284 284 if (m_pProviderLabel) 285 285 m_pProviderLayout->addWidget(m_pProviderLabel, 0, 0, Qt::AlignRight); 286 286 287 /* Prepare provider combo-box: */ 287 288 m_pProviderComboBox = new QIComboBox(this);
Note:
See TracChangeset
for help on using the changeset viewer.