Changeset 72935 in vbox for trunk/src/VBox
- Timestamp:
- Jul 6, 2018 12:23:52 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123487
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r72930 r72935 166 166 case CloudProvider: 167 167 { 168 QString strUri("OCI://"); 169 if (!field("username").toString().isEmpty()) 170 strUri = QString("%1%2").arg(strUri).arg(field("username").toString()); 171 if (!field("password").toString().isEmpty()) 172 strUri = QString("%1:%2").arg(strUri).arg(field("password").toString()); 173 if (!field("username").toString().isEmpty() || !field("password").toString().isEmpty()) 174 strUri = QString("%1@").arg(strUri); 175 strUri = QString("%1%2/%3/%4").arg(strUri).arg(field("hostname").toString()).arg(field("bucket").toString()).arg(strPath); 176 return strUri; 168 const QString strUri("OCI://"); 169 return QString("%1%2").arg(strUri).arg(strPath); 177 170 } 178 171 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r72931 r72935 62 62 case LocalFilesystem: 63 63 { 64 m_pUsernameLabel->setVisible(false); 65 m_pUsernameEditor->setVisible(false); 66 m_pPasswordLabel->setVisible(false); 67 m_pPasswordEditor->setVisible(false); 68 m_pHostnameLabel->setVisible(false); 69 m_pHostnameEditor->setVisible(false); 70 m_pBucketLabel->setVisible(false); 71 m_pBucketEditor->setVisible(false); 64 m_pFileSelector->setChooserVisible(true); 72 65 m_pFormatComboBox->setVisible(true); 73 m_pFileSelector->setChooserVisible(true); 66 m_pAdditionalLabel->setVisible(true); 67 m_pManifestCheckbox->setVisible(true); 74 68 break; 75 69 } 76 70 case CloudProvider: 77 71 { 78 m_pUsernameLabel->setVisible(true); 79 m_pUsernameEditor->setVisible(true); 80 m_pPasswordLabel->setVisible(true); 81 m_pPasswordEditor->setVisible(true); 82 m_pHostnameLabel->setVisible(true); 83 m_pHostnameEditor->setVisible(true); 84 m_pBucketLabel->setVisible(true); 85 m_pBucketEditor->setVisible(true); 72 m_pFileSelector->setChooserVisible(false); 86 73 m_pFormatComboBox->setVisible(true); 87 m_pFileSelector->setChooserVisible(false); 74 m_pAdditionalLabel->setVisible(false); 75 m_pManifestCheckbox->setVisible(false); 88 76 break; 89 77 } … … 142 130 } 143 131 132 QString UIWizardExportAppPage3::path() const 133 { 134 return m_pFileSelector->path(); 135 } 136 137 void UIWizardExportAppPage3::setPath(const QString &strPath) 138 { 139 m_pFileSelector->setPath(strPath); 140 } 141 144 142 QString UIWizardExportAppPage3::format() const 145 143 { … … 165 163 } 166 164 167 QString UIWizardExportAppPage3::username() const168 {169 return m_pUsernameEditor->text();170 }171 172 void UIWizardExportAppPage3::setUserName(const QString &strUserName)173 {174 m_pUsernameEditor->setText(strUserName);175 }176 177 QString UIWizardExportAppPage3::password() const178 {179 return m_pPasswordEditor->text();180 }181 182 void UIWizardExportAppPage3::setPassword(const QString &strPassword)183 {184 m_pPasswordEditor->setText(strPassword);185 }186 187 QString UIWizardExportAppPage3::hostname() const188 {189 return m_pHostnameEditor->text();190 }191 192 void UIWizardExportAppPage3::setHostname(const QString &strHostname)193 {194 m_pHostnameEditor->setText(strHostname);195 }196 197 QString UIWizardExportAppPage3::bucket() const198 {199 return m_pBucketEditor->text();200 }201 202 void UIWizardExportAppPage3::setBucket(const QString &strBucket)203 {204 m_pBucketEditor->setText(strBucket);205 }206 207 QString UIWizardExportAppPage3::path() const208 {209 return m_pFileSelector->path();210 }211 212 void UIWizardExportAppPage3::setPath(const QString &strPath)213 {214 m_pFileSelector->setPath(strPath);215 }216 217 165 218 166 /********************************************************************************************************************************* … … 238 186 if (pSettingsLayout) 239 187 { 240 /* Create username editor: */241 m_pUsernameEditor = new QLineEdit;242 if (m_pUsernameEditor)243 {244 /* Add into layout: */245 pSettingsLayout->addWidget(m_pUsernameEditor, 0, 1);246 }247 /* Create username label: */248 m_pUsernameLabel = new QLabel;249 if (m_pUsernameLabel)250 {251 m_pUsernameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);252 m_pUsernameLabel->setBuddy(m_pUsernameEditor);253 254 /* Add into layout: */255 pSettingsLayout->addWidget(m_pUsernameLabel, 0, 0);256 }257 258 /* Create password editor: */259 m_pPasswordEditor = new QLineEdit;260 if (m_pPasswordEditor)261 {262 m_pPasswordEditor->setEchoMode(QLineEdit::Password);263 264 /* Add into layout: */265 pSettingsLayout->addWidget(m_pPasswordEditor, 1, 1);266 }267 /* Create password label: */268 m_pPasswordLabel = new QLabel;269 if (m_pPasswordLabel)270 {271 m_pPasswordLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);272 m_pPasswordLabel->setBuddy(m_pPasswordEditor);273 274 /* Add into layout: */275 pSettingsLayout->addWidget(m_pPasswordLabel, 1, 0);276 }277 278 /* Create hostname editor: */279 m_pHostnameEditor = new QLineEdit;280 if (m_pHostnameEditor)281 {282 /* Add into layout: */283 pSettingsLayout->addWidget(m_pHostnameEditor, 2, 1);284 }285 /* Create hostname label: */286 m_pHostnameLabel = new QLabel;287 if (m_pHostnameLabel)288 {289 m_pHostnameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);290 m_pHostnameLabel->setBuddy(m_pHostnameEditor);291 292 /* Add into layout: */293 pSettingsLayout->addWidget(m_pHostnameLabel, 2, 0);294 }295 296 /* Create bucket editor: */297 m_pBucketEditor = new QLineEdit;298 if (m_pBucketEditor)299 {300 /* Add into layout: */301 pSettingsLayout->addWidget(m_pBucketEditor, 3, 1);302 }303 /* Create bucket label: */304 m_pBucketLabel = new QLabel;305 if (m_pBucketLabel)306 {307 m_pBucketLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);308 m_pBucketLabel->setBuddy(m_pBucketEditor);309 310 /* Add into layout: */311 pSettingsLayout->addWidget(m_pBucketLabel, 3, 0);312 }313 314 188 /* Create file selector: */ 315 189 m_pFileSelector = new UIEmptyFilePathSelector; … … 391 265 392 266 /* Setup connections: */ 393 connect(m_pUsernameEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageBasic3::completeChanged);394 connect(m_pPasswordEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageBasic3::completeChanged);395 connect(m_pHostnameEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageBasic3::completeChanged);396 connect(m_pBucketEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageBasic3::completeChanged);397 267 connect(m_pFileSelector, &UIEmptyFilePathSelector::pathChanged, this, &UIWizardExportAppPageBasic3::completeChanged); 398 268 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), … … 400 270 401 271 /* Register fields: */ 272 registerField("path", this, "path"); 402 273 registerField("format", this, "format"); 403 274 registerField("manifestSelected", this, "manifestSelected"); 404 registerField("username", this, "username");405 registerField("password", this, "password");406 registerField("hostname", this, "hostname");407 registerField("bucket", this, "bucket");408 registerField("path", this, "path");409 275 } 410 276 … … 417 283 m_strDefaultApplianceName = UIWizardExportApp::tr("Appliance"); 418 284 /* Translate widgets: */ 419 m_pUsernameLabel->setText(UIWizardExportApp::tr("&Username:"));420 m_pPasswordLabel->setText(UIWizardExportApp::tr("&Password:"));421 m_pHostnameLabel->setText(UIWizardExportApp::tr("&Hostname:"));422 m_pBucketLabel->setText(UIWizardExportApp::tr("&Bucket:"));423 285 m_pFileSelectorLabel->setText(UIWizardExportApp::tr("&File:")); 424 286 m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to...")); … … 474 336 break; 475 337 case CloudProvider: 476 fResult &= !m_pUsernameEditor->text().isEmpty() &&477 !m_pPasswordEditor->text().isEmpty() &&478 !m_pHostnameEditor->text().isEmpty() &&479 !m_pBucketEditor->text().isEmpty();480 338 break; 481 339 } … … 512 370 case CloudProvider: 513 371 { 514 m_pLabel->setText(tr("Please complete the additional fields like the username, password,"515 " hostname and the bucket, and provide a filename forthe OVF target."));516 m_p UsernameEditor->setFocus();372 m_pLabel->setText(tr("Please complete the additional fields and provide a filename for " 373 "the OVF target.")); 374 m_pLabel->setFocus(); /// @todo fix it! 517 375 break; 518 376 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r72931 r72935 50 50 virtual void updateFormatComboToolTip(); 51 51 52 /** Returns path. */ 53 QString path() const; 54 /** Defines @a strPath. */ 55 void setPath(const QString &strPath); 56 52 57 /** Returns format. */ 53 58 QString format() const; … … 60 65 void setManifestSelected(bool fChecked); 61 66 62 /** Returns user name. */63 QString username() const;64 /** Defines @a strUserName. */65 void setUserName(const QString &strUserName);66 67 /** Returns password. */68 QString password() const;69 /** Defines @a strPassword. */70 void setPassword(const QString &strPassword);71 72 /** Returns hostname. */73 QString hostname() const;74 /** Defines @a strHostname. */75 void setHostname(const QString &strHostname);76 77 /** Returns bucket. */78 QString bucket() const;79 /** Defines @a strBucket. */80 void setBucket(const QString &strBucket);81 82 /** Returns path. */83 QString path() const;84 /** Defines @a strPath. */85 void setPath(const QString &strPath);86 87 67 /** Holds the default appliance name. */ 88 68 QString m_strDefaultApplianceName; 89 90 /** Holds the username label instance. */91 QLabel *m_pUsernameLabel;92 /** Holds the username editor instance. */93 QLineEdit *m_pUsernameEditor;94 95 /** Holds the password label instance. */96 QLabel *m_pPasswordLabel;97 /** Holds the password editor instance. */98 QLineEdit *m_pPasswordEditor;99 100 /** Holds the hostname label instance. */101 QLabel *m_pHostnameLabel;102 /** Holds the hostname editor instance. */103 QLineEdit *m_pHostnameEditor;104 105 /** Holds the bucket label instance. */106 QLabel *m_pBucketLabel;107 /** Holds the bucket editor instance. */108 QLineEdit *m_pBucketEditor;109 69 110 70 /** Holds the file selector label instance. */ … … 129 89 { 130 90 Q_OBJECT; 91 Q_PROPERTY(QString path READ path WRITE setPath); 131 92 Q_PROPERTY(QString format READ format WRITE setFormat); 132 93 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 133 Q_PROPERTY(QString username READ username WRITE setUserName);134 Q_PROPERTY(QString password READ password WRITE setPassword);135 Q_PROPERTY(QString hostname READ hostname WRITE setHostname);136 Q_PROPERTY(QString bucket READ bucket WRITE setBucket);137 Q_PROPERTY(QString path READ path WRITE setPath);138 94 139 95 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r72930 r72935 138 138 if (pSettingsLayout) 139 139 { 140 /* Create username editor: */141 m_pUsernameEditor = new QLineEdit;142 if (m_pUsernameEditor)143 {144 /* Add into layout: */145 pSettingsLayout->addWidget(m_pUsernameEditor, 0, 1);146 }147 /* Create username label: */148 m_pUsernameLabel = new QLabel;149 if (m_pUsernameLabel)150 {151 m_pUsernameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);152 m_pUsernameLabel->setBuddy(m_pUsernameEditor);153 154 /* Add into layout: */155 pSettingsLayout->addWidget(m_pUsernameLabel, 0, 0);156 }157 158 /* Create password editor: */159 m_pPasswordEditor = new QLineEdit;160 if (m_pPasswordEditor)161 {162 m_pPasswordEditor->setEchoMode(QLineEdit::Password);163 164 /* Add into layout: */165 pSettingsLayout->addWidget(m_pPasswordEditor, 1, 1);166 }167 /* Create password label: */168 m_pPasswordLabel = new QLabel;169 if (m_pPasswordLabel)170 {171 m_pPasswordLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);172 m_pPasswordLabel->setBuddy(m_pPasswordEditor);173 174 /* Add into layout: */175 pSettingsLayout->addWidget(m_pPasswordLabel, 1, 0);176 }177 178 /* Create hostname editor: */179 m_pHostnameEditor = new QLineEdit;180 if (m_pHostnameEditor)181 {182 /* Add into layout: */183 pSettingsLayout->addWidget(m_pHostnameEditor, 2, 1);184 }185 /* Create hostname label: */186 m_pHostnameLabel = new QLabel;187 if (m_pHostnameLabel)188 {189 m_pHostnameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);190 m_pHostnameLabel->setBuddy(m_pHostnameEditor);191 192 /* Add into layout: */193 pSettingsLayout->addWidget(m_pHostnameLabel, 2, 0);194 }195 196 /* Create bucket editor: */197 m_pBucketEditor = new QLineEdit;198 if (m_pBucketEditor)199 {200 /* Add into layout: */201 pSettingsLayout->addWidget(m_pBucketEditor, 3, 1);202 }203 /* Create bucket label: */204 m_pBucketLabel = new QLabel;205 if (m_pBucketLabel)206 {207 m_pBucketLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);208 m_pBucketLabel->setBuddy(m_pBucketEditor);209 210 /* Add into layout: */211 pSettingsLayout->addWidget(m_pBucketLabel, 3, 0);212 }213 214 140 /* Create file selector: */ 215 141 m_pFileSelector = new UIEmptyFilePathSelector; … … 287 213 connect(m_pTypeLocalFilesystem, &QRadioButton::clicked, this, &UIWizardExportAppPageExpert::sltStorageTypeChangeHandler); 288 214 connect(m_pTypeCloudServiceProvider, &QRadioButton::clicked, this, &UIWizardExportAppPageExpert::sltStorageTypeChangeHandler); 289 connect(m_pUsernameEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageExpert::completeChanged);290 connect(m_pPasswordEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageExpert::completeChanged);291 connect(m_pHostnameEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageExpert::completeChanged);292 connect(m_pBucketEditor, &QLineEdit::textChanged, this, &UIWizardExportAppPageExpert::completeChanged);293 215 connect(m_pFileSelector, &UIEmptyFilePathSelector::pathChanged, this, &UIWizardExportAppPageExpert::completeChanged); 294 216 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), … … 303 225 registerField("machineIDs", this, "machineIDs"); 304 226 registerField("storageType", this, "storageType"); 227 registerField("path", this, "path"); 305 228 registerField("format", this, "format"); 306 229 registerField("manifestSelected", this, "manifestSelected"); 307 registerField("username", this, "username");308 registerField("password", this, "password");309 registerField("hostname", this, "hostname");310 registerField("bucket", this, "bucket");311 registerField("path", this, "path");312 230 registerField("applianceWidget", this, "applianceWidget"); 313 231 } … … 325 243 m_pTypeLocalFilesystem->setText(UIWizardExportApp::tr("&Local Filesystem")); 326 244 m_pTypeCloudServiceProvider->setText(UIWizardExportApp::tr("&Cloud Service Provider")); 327 m_pUsernameLabel->setText(UIWizardExportApp::tr("&Username:"));328 m_pPasswordLabel->setText(UIWizardExportApp::tr("&Password:"));329 m_pHostnameLabel->setText(UIWizardExportApp::tr("&Hostname:"));330 m_pBucketLabel->setText(UIWizardExportApp::tr("&Bucket:"));331 245 m_pFileSelectorLabel->setText(UIWizardExportApp::tr("&File:")); 332 246 m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to...")); … … 389 303 break; 390 304 case CloudProvider: 391 fResult &= !m_pUsernameEditor->text().isEmpty() &&392 !m_pPasswordEditor->text().isEmpty() &&393 !m_pHostnameEditor->text().isEmpty() &&394 !m_pBucketEditor->text().isEmpty();395 305 break; 396 306 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r72932 r72935 41 41 Q_PROPERTY(QStringList machineIDs READ machineIDs); 42 42 Q_PROPERTY(StorageType storageType READ storageType WRITE setStorageType); 43 Q_PROPERTY(QString path READ path WRITE setPath); 43 44 Q_PROPERTY(QString format READ format WRITE setFormat); 44 45 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 45 Q_PROPERTY(QString username READ username WRITE setUserName);46 Q_PROPERTY(QString password READ password WRITE setPassword);47 Q_PROPERTY(QString hostname READ hostname WRITE setHostname);48 Q_PROPERTY(QString bucket READ bucket WRITE setBucket);49 Q_PROPERTY(QString path READ path WRITE setPath);50 46 Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget); 51 47
Note:
See TracChangeset
for help on using the changeset viewer.