Changeset 78037 in vbox
- Timestamp:
- Apr 8, 2019 11:47:34 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r77388 r78037 53 53 public: 54 54 55 /** Constructs expert basicpage.55 /** Constructs expert page. 56 56 * @param selectedVMNames Brings the list of selected VM names. */ 57 57 UIWizardExportAppPageExpert(const QStringList &selectedVMNames, bool fExportToOCIByDefault); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp
r76606 r78037 138 138 }; 139 139 140 141 /********************************************************************************************************************************* 142 * Class UIWizardImportApp implementation. * 143 *********************************************************************************************************************************/ 144 140 145 UIWizardImportApp::UIWizardImportApp(QWidget *pParent, const QString &strFileName) 141 146 : UIWizard(pParent, WizardType_ImportAppliance) … … 151 156 } 152 157 158 void UIWizardImportApp::prepare() 159 { 160 /* Create corresponding pages: */ 161 switch (mode()) 162 { 163 case WizardMode_Basic: 164 { 165 if (m_strFileName.isEmpty()) 166 setPage(Page1, new UIWizardImportAppPageBasic1); 167 setPage(Page2, new UIWizardImportAppPageBasic2(m_strFileName)); 168 break; 169 } 170 case WizardMode_Expert: 171 { 172 setPage(PageExpert, new UIWizardImportAppPageExpert(m_strFileName)); 173 break; 174 } 175 default: 176 { 177 AssertMsgFailed(("Invalid mode: %d", mode())); 178 break; 179 } 180 } 181 /* Call to base-class: */ 182 UIWizard::prepare(); 183 } 184 153 185 bool UIWizardImportApp::isValid() const 154 186 { … … 182 214 } 183 215 216 void UIWizardImportApp::retranslateUi() 217 { 218 /* Call to base-class: */ 219 UIWizard::retranslateUi(); 220 221 /* Translate wizard: */ 222 setWindowTitle(tr("Import Virtual Appliance")); 223 setButtonText(QWizard::CustomButton2, tr("Restore Defaults")); 224 setButtonText(QWizard::FinishButton, tr("Import")); 225 } 226 184 227 void UIWizardImportApp::sltCurrentIdChanged(int iId) 185 228 { … … 207 250 } 208 251 209 void UIWizardImportApp::retranslateUi()210 {211 /* Call to base-class: */212 UIWizard::retranslateUi();213 214 /* Translate wizard: */215 setWindowTitle(tr("Import Virtual Appliance"));216 setButtonText(QWizard::CustomButton2, tr("Restore Defaults"));217 setButtonText(QWizard::FinishButton, tr("Import"));218 }219 220 void UIWizardImportApp::prepare()221 {222 /* Create corresponding pages: */223 switch (mode())224 {225 case WizardMode_Basic:226 {227 if (m_strFileName.isEmpty())228 setPage(Page1, new UIWizardImportAppPageBasic1);229 setPage(Page2, new UIWizardImportAppPageBasic2(m_strFileName));230 break;231 }232 case WizardMode_Expert:233 {234 setPage(PageExpert, new UIWizardImportAppPageExpert(m_strFileName));235 break;236 }237 default:238 {239 AssertMsgFailed(("Invalid mode: %d", mode()));240 break;241 }242 }243 /* Call to base-class: */244 UIWizard::prepare();245 }246 247 252 #include "UIWizardImportApp.moc" 248 253 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.h
r76581 r78037 22 22 #endif 23 23 24 /* Localincludes */24 /* GUI includes */ 25 25 #include "UIWizard.h" 26 26 27 /* Import Appliance wizard:*/27 /** Import Appliance wizard. */ 28 28 class UIWizardImportApp : public UIWizard 29 29 { … … 32 32 public: 33 33 34 /* Page IDs:*/34 /** Basic page IDs. */ 35 35 enum 36 36 { … … 39 39 }; 40 40 41 /* Page IDs:*/41 /** Expert page IDs. */ 42 42 enum 43 43 { … … 45 45 }; 46 46 47 /* Constructor: */ 47 /** Constructs export appliance wizard passing @a pParent to the base-class. 48 * @param strFileName Brings appliance file name. */ 48 49 UIWizardImportApp(QWidget *pParent, const QString &strFileName); 49 50 50 /* Pages related stuff:*/51 v oid prepare();51 /** Prepares all. */ 52 virtual void prepare() /* override */; 52 53 53 /* Is appliance valid?*/54 /** Returns whether appliance is valid. */ 54 55 bool isValid() const; 56 57 /** Imports appliance. */ 58 bool importAppliance(); 55 59 56 60 protected: 57 61 58 /* Import stuff:*/59 bool importAppliance();62 /** Handles translation event. */ 63 virtual void retranslateUi() /* override */; 60 64 61 /* Who will be able to import appliance: */ 62 friend class UIWizardImportAppPageBasic2; 63 friend class UIWizardImportAppPageExpert; 65 protected slots: 64 66 65 private slots: 66 67 /* Page change handler: */ 68 void sltCurrentIdChanged(int iId); 69 /* Custom button 2 click handler: */ 70 void sltCustomButtonClicked(int iId); 67 /** Handles change for page with @a iId. */ 68 virtual void sltCurrentIdChanged(int iId) /* override */; 69 /** Handles custom button 2 click for page with @a iId. */ 70 virtual void sltCustomButtonClicked(int iId) /* override */; 71 71 72 72 private: 73 73 74 /* Translation stuff: */ 75 void retranslateUi(); 76 77 /* Variables: */ 78 QString m_strFileName; 74 /** Handles the appliance file name. */ 75 QString m_strFileName; 79 76 }; 80 77 78 /** Safe pointer to appliance wizard. */ 81 79 typedef QPointer<UIWizardImportApp> UISafePointerWizardImportApp; 82 80 83 81 #endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportApp_h */ 84 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppDefs.h
r76581 r78037 22 22 #endif 23 23 24 /* Globalincludes: */24 /* Qt includes: */ 25 25 #include <QMetaType> 26 26 #include <QPointer> 27 27 28 /* Localincludes: */28 /* GUI includes: */ 29 29 #include "UIApplianceImportEditorWidget.h" 30 30 … … 34 34 35 35 #endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportAppDefs_h */ 36 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
r76606 r78037 16 16 */ 17 17 18 /* Globalincludes: */18 /* Qt includes: */ 19 19 #include <QFileInfo> 20 20 #include <QVBoxLayout> 21 21 22 /* Local includes: */ 22 /* GUI includes: */ 23 #include "QIRichTextLabel.h" 24 #include "VBoxGlobal.h" 25 #include "UIEmptyFilePathSelector.h" 26 #include "UIWizardImportApp.h" 23 27 #include "UIWizardImportAppPageBasic1.h" 24 28 #include "UIWizardImportAppPageBasic2.h" 25 #include "UIWizardImportApp.h"26 #include "VBoxGlobal.h"27 #include "UIEmptyFilePathSelector.h"28 #include "QIRichTextLabel.h"29 29 30 31 /********************************************************************************************************************************* 32 * Class UIWizardImportAppPage1 implementation. * 33 *********************************************************************************************************************************/ 30 34 31 35 UIWizardImportAppPage1::UIWizardImportAppPage1() … … 33 37 } 34 38 39 40 /********************************************************************************************************************************* 41 * Class UIWizardImportAppPageBasic1 implementation. * 42 *********************************************************************************************************************************/ 43 35 44 UIWizardImportAppPageBasic1::UIWizardImportAppPageBasic1() 36 45 { 37 /* Create widgets: */46 /* Create main layout: */ 38 47 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 48 if (pMainLayout) 39 49 { 50 /* Create label: */ 40 51 m_pLabel = new QIRichTextLabel(this); 52 if (m_pLabel) 53 { 54 /* Add into layout: */ 55 pMainLayout->addWidget(m_pLabel); 56 } 57 58 /* Create file-path selector: */ 41 59 m_pFileSelector = new UIEmptyFilePathSelector(this); 60 if (m_pFileSelector) 42 61 { 43 62 m_pFileSelector->setHomeDir(vboxGlobal().documentsPath()); … … 45 64 m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition); 46 65 m_pFileSelector->setEditable(true); 66 67 /* Add into layout: */ 68 pMainLayout->addWidget(m_pFileSelector); 47 69 } 48 pMainLayout->addWidget(m_pLabel); 49 pMainLayout->addWidget(m_pFileSelector);70 71 /* Add vertical stretch finally: */ 50 72 pMainLayout->addStretch(); 51 73 } … … 71 93 void UIWizardImportAppPageBasic1::initializePage() 72 94 { 73 /* Translate page: */74 95 retranslateUi(); 75 96 } … … 78 99 { 79 100 /* Make sure appliance file has allowed extension and exists: */ 80 return VBoxGlobal::hasAllowedExtension(m_pFileSelector->path().toLower(), OVFFileExts) &&81 QFile::exists(m_pFileSelector->path());101 return VBoxGlobal::hasAllowedExtension(m_pFileSelector->path().toLower(), OVFFileExts) 102 && QFile::exists(m_pFileSelector->path()); 82 103 } 83 104 … … 101 122 return pImportApplianceWidget->isValid(); 102 123 } 103 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h
r76581 r78037 22 22 #endif 23 23 24 /* Localincludes: */24 /* GUI includes: */ 25 25 #include "UIWizardPage.h" 26 26 27 27 /* Forward declarations: */ 28 class QIRichTextLabel; 28 29 class UIEmptyFilePathSelector; 29 class QIRichTextLabel;30 30 31 /* 1st page of the Import Appliance wizard (base part):*/31 /** UIWizardPageBase extension for 1st page of the Import Appliance wizard. */ 32 32 class UIWizardImportAppPage1 : public UIWizardPageBase 33 33 { 34 34 protected: 35 35 36 /* Constructor:*/36 /** Constructs 1st page base. */ 37 37 UIWizardImportAppPage1(); 38 38 39 /* Widgets:*/39 /** Holds the file selector instance. */ 40 40 UIEmptyFilePathSelector *m_pFileSelector; 41 41 }; 42 42 43 /* 1st page of the Import Appliance wizard (basic extension):*/43 /** UIWizardPage extension for 1st page of the Import Appliance wizard, extends UIWizardImportAppPage1 as well. */ 44 44 class UIWizardImportAppPageBasic1 : public UIWizardPage, public UIWizardImportAppPage1 45 45 { … … 48 48 public: 49 49 50 /* Constructor:*/50 /** Constructs 1st basic page. */ 51 51 UIWizardImportAppPageBasic1(); 52 52 53 53 private: 54 54 55 /* Translate stuff:*/56 v oid retranslateUi();55 /** Handles translation event. */ 56 virtual void retranslateUi() /* override */; 57 57 58 /* Prepare stuff:*/59 v oid initializePage();58 /** Performs page initialization. */ 59 virtual void initializePage() /* override */; 60 60 61 /* Validation stuff: */ 62 bool isComplete() const; 63 bool validatePage(); 61 /** Returns whether page is complete. */ 62 virtual bool isComplete() const /* override */; 64 63 65 /* Widgets: */ 64 /** Performs page validation. */ 65 virtual bool validatePage() /* override */; 66 67 /** Holds the label instance. */ 66 68 QIRichTextLabel *m_pLabel; 67 69 }; 68 70 69 71 #endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportAppPageBasic1_h */ 70 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp
r76606 r78037 16 16 */ 17 17 18 /* Globalincludes: */18 /* Qt includes: */ 19 19 #include <QLabel> 20 20 #include <QPointer> … … 23 23 #include <QVBoxLayout> 24 24 25 /* Localincludes: */25 /* GUI includes: */ 26 26 #include "QIDialogButtonBox.h" 27 27 #include "QIRichTextLabel.h" … … 50 50 : m_enmCertText(kCertText_Uninitialized) 51 51 { 52 /* Create widgets: */52 /* Create main layout: */ 53 53 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 54 { 54 if (pMainLayout) 55 { 56 /* Create label: */ 55 57 m_pLabel = new QIRichTextLabel(this); 58 if (m_pLabel) 59 { 60 /* Add into layout: */ 61 pMainLayout->addWidget(m_pLabel); 62 } 63 64 /* Create appliance widget: */ 56 65 m_pApplianceWidget = new UIApplianceImportEditorWidget(this); 57 66 { 58 67 m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); 59 68 m_pApplianceWidget->setFile(strFileName); 60 } 69 70 /* Add into layout: */ 71 pMainLayout->addWidget(m_pApplianceWidget); 72 } 73 74 /* Create certificate label: */ 61 75 m_pCertLabel = new QLabel("<cert label>", this); 62 pMainLayout->addWidget(m_pLabel); 63 pMainLayout->addWidget(m_pApplianceWidget); 64 pMainLayout->addWidget(m_pCertLabel); 76 if (m_pCertLabel) 77 { 78 /* Add into layout: */ 79 pMainLayout->addWidget(m_pCertLabel); 80 } 65 81 } 66 82 … … 115 131 void UIWizardImportAppPageBasic2::initializePage() 116 132 { 117 /* Acquire appliance and certificate: */133 /* Acquire appliance: */ 118 134 CAppliance *pAppliance = m_pApplianceWidget->appliance(); 119 /* Check if pAppliance is alive. If not just return here. This 120 prevents crashes when an invalid ova file is supllied: */ 135 136 /* Check if pAppliance is alive. If not just return here. 137 * This prevents crashes when an invalid ova file is supllied: */ 121 138 if (!pAppliance) 122 139 { … … 125 142 return; 126 143 } 127 CCertificate certificate = pAppliance->GetCertificate(); 128 if (certificate.isNull()) 144 145 /* Acquire certificate: */ 146 CCertificate comCertificate = pAppliance->GetCertificate(); 147 if (comCertificate.isNull()) 129 148 m_enmCertText = kCertText_Unsigned; 130 149 else 131 150 { 132 /* Pick a 'signed-by' name .*/133 m_strSignedBy = c ertificate.GetFriendlyName();151 /* Pick a 'signed-by' name: */ 152 m_strSignedBy = comCertificate.GetFriendlyName(); 134 153 135 154 /* If trusted, just select the right message: */ 136 if (c ertificate.GetTrusted())137 { 138 if (c ertificate.GetSelfSigned())139 m_enmCertText = !c ertificate.GetExpired() ? kCertText_SelfSignedTrusted : kCertText_SelfSignedExpired;155 if (comCertificate.GetTrusted()) 156 { 157 if (comCertificate.GetSelfSigned()) 158 m_enmCertText = !comCertificate.GetExpired() ? kCertText_SelfSignedTrusted : kCertText_SelfSignedExpired; 140 159 else 141 m_enmCertText = !c ertificate.GetExpired() ? kCertText_IssuedTrusted : kCertText_IssuedExpired;160 m_enmCertText = !comCertificate.GetExpired() ? kCertText_IssuedTrusted : kCertText_IssuedExpired; 142 161 } 143 162 else 144 163 { 145 164 /* Not trusted! Must ask the user whether to continue in this case: */ 146 m_enmCertText = c ertificate.GetSelfSigned() ? kCertText_SelfSignedUnverified : kCertText_IssuedUnverified;165 m_enmCertText = comCertificate.GetSelfSigned() ? kCertText_SelfSignedUnverified : kCertText_IssuedUnverified; 147 166 148 167 /* Translate page early: */ … … 150 169 151 170 /* Instantiate the dialog: */ 152 QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = new UIApplianceUnverifiedCertificateViewer(this, c ertificate);171 QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = new UIApplianceUnverifiedCertificateViewer(this, comCertificate); 153 172 AssertPtrReturnVoid(pDialog.data()); 154 173 … … 161 180 /* Delete viewer finally: */ 162 181 delete pDialog; 163 pDialog = 0;164 182 165 183 /* Dismiss the entire import-appliance wizard if user rejects certificate: */ … … 205 223 *********************************************************************************************************************************/ 206 224 207 UIApplianceUnverifiedCertificateViewer::UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &c ertificate)225 UIApplianceUnverifiedCertificateViewer::UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &comCertificate) 208 226 : QIWithRetranslateUI<QIDialog>(pParent) 209 , m_c ertificate(certificate)227 , m_comCertificate(comCertificate) 210 228 , m_pTextLabel(0) 211 229 , m_pTextBrowser(0) 212 230 { 213 /* Prepare: */214 231 prepare(); 215 232 } … … 219 236 /* Create layout: */ 220 237 QVBoxLayout *pLayout = new QVBoxLayout(this); 221 AssertPtrReturnVoid(pLayout);238 if (pLayout) 222 239 { 223 240 /* Create text-label: */ 224 241 m_pTextLabel = new QLabel; 225 AssertPtrReturnVoid(m_pTextLabel); 226 { 227 /* Configure text-label: */ 242 if (m_pTextLabel) 243 { 228 244 m_pTextLabel->setWordWrap(true); 229 /* Add text-label into layout: */ 245 246 /* Add into layout: */ 230 247 pLayout->addWidget(m_pTextLabel); 231 248 } … … 233 250 /* Create text-browser: */ 234 251 m_pTextBrowser = new QTextBrowser; 235 AssertPtrReturnVoid(m_pTextBrowser); 236 { 237 /* Configure text-browser: */ 252 if (m_pTextBrowser) 253 { 238 254 m_pTextBrowser->setMinimumSize(500, 300); 239 /* Add text-browser into layout: */ 255 256 /* Add into layout: */ 240 257 pLayout->addWidget(m_pTextBrowser); 241 258 } … … 243 260 /* Create button-box: */ 244 261 QIDialogButtonBox *pButtonBox = new QIDialogButtonBox; 245 AssertPtrReturnVoid(pButtonBox); 246 { 247 /* Configure button-box: */ 262 if (pButtonBox) 263 { 248 264 pButtonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); 249 265 pButtonBox->button(QDialogButtonBox::Yes)->setShortcut(Qt::Key_Enter); … … 251 267 connect(pButtonBox, &QIDialogButtonBox::accepted, this, &UIApplianceUnverifiedCertificateViewer::accept); 252 268 connect(pButtonBox, &QIDialogButtonBox::rejected, this, &UIApplianceUnverifiedCertificateViewer::reject); 253 /* Add button-box into layout: */ 269 270 /* Add into layout: */ 254 271 pLayout->addWidget(pButtonBox); 255 272 } 256 273 } 274 257 275 /* Translate UI: */ 258 276 retranslateUi(); … … 265 283 266 284 /* Translate text-label caption: */ 267 if (m_c ertificate.GetSelfSigned())285 if (m_comCertificate.GetSelfSigned()) 268 286 m_pTextLabel->setText(tr("<b>The appliance is signed by an unverified self signed certificate issued by '%1'. " 269 287 "We recommend to only proceed with the importing if you are sure you should trust this entity.</b>" 270 ).arg(m_c ertificate.GetFriendlyName()));288 ).arg(m_comCertificate.GetFriendlyName())); 271 289 else 272 290 m_pTextLabel->setText(tr("<b>The appliance is signed by an unverified certificate issued to '%1'. " 273 291 "We recommend to only proceed with the importing if you are sure you should trust this entity.</b>" 274 ).arg(m_c ertificate.GetFriendlyName()));292 ).arg(m_comCertificate.GetFriendlyName())); 275 293 276 294 /* Translate text-browser contents: */ 277 295 const QString strTemplateRow = tr("<tr><td>%1:</td><td>%2</td></tr>", "key: value"); 278 296 QString strTableContent; 279 strTableContent += strTemplateRow.arg(tr("Issuer"), QStringList(m_c ertificate.GetIssuerName().toList()).join(", "));280 strTableContent += strTemplateRow.arg(tr("Subject"), QStringList(m_c ertificate.GetSubjectName().toList()).join(", "));281 strTableContent += strTemplateRow.arg(tr("Not Valid Before"), m_c ertificate.GetValidityPeriodNotBefore());282 strTableContent += strTemplateRow.arg(tr("Not Valid After"), m_c ertificate.GetValidityPeriodNotAfter());283 strTableContent += strTemplateRow.arg(tr("Serial Number"), m_c ertificate.GetSerialNumber());284 strTableContent += strTemplateRow.arg(tr("Self-Signed"), m_c ertificate.GetSelfSigned() ? tr("True") : tr("False"));285 strTableContent += strTemplateRow.arg(tr("Authority (CA)"), m_c ertificate.GetCertificateAuthority() ? tr("True") : tr("False"));286 // strTableContent += strTemplateRow.arg(tr("Trusted"), m_c ertificate.GetTrusted() ? tr("True") : tr("False"));287 strTableContent += strTemplateRow.arg(tr("Public Algorithm"), tr("%1 (%2)", "value (clarification)").arg(m_c ertificate.GetPublicKeyAlgorithm()).arg(m_certificate.GetPublicKeyAlgorithmOID()));288 strTableContent += strTemplateRow.arg(tr("Signature Algorithm"), tr("%1 (%2)", "value (clarification)").arg(m_c ertificate.GetSignatureAlgorithmName()).arg(m_certificate.GetSignatureAlgorithmOID()));289 strTableContent += strTemplateRow.arg(tr("X.509 Version Number"), QString::number(m_c ertificate.GetVersionNumber()));297 strTableContent += strTemplateRow.arg(tr("Issuer"), QStringList(m_comCertificate.GetIssuerName().toList()).join(", ")); 298 strTableContent += strTemplateRow.arg(tr("Subject"), QStringList(m_comCertificate.GetSubjectName().toList()).join(", ")); 299 strTableContent += strTemplateRow.arg(tr("Not Valid Before"), m_comCertificate.GetValidityPeriodNotBefore()); 300 strTableContent += strTemplateRow.arg(tr("Not Valid After"), m_comCertificate.GetValidityPeriodNotAfter()); 301 strTableContent += strTemplateRow.arg(tr("Serial Number"), m_comCertificate.GetSerialNumber()); 302 strTableContent += strTemplateRow.arg(tr("Self-Signed"), m_comCertificate.GetSelfSigned() ? tr("True") : tr("False")); 303 strTableContent += strTemplateRow.arg(tr("Authority (CA)"), m_comCertificate.GetCertificateAuthority() ? tr("True") : tr("False")); 304 // strTableContent += strTemplateRow.arg(tr("Trusted"), m_comCertificate.GetTrusted() ? tr("True") : tr("False")); 305 strTableContent += strTemplateRow.arg(tr("Public Algorithm"), tr("%1 (%2)", "value (clarification)").arg(m_comCertificate.GetPublicKeyAlgorithm()).arg(m_comCertificate.GetPublicKeyAlgorithmOID())); 306 strTableContent += strTemplateRow.arg(tr("Signature Algorithm"), tr("%1 (%2)", "value (clarification)").arg(m_comCertificate.GetSignatureAlgorithmName()).arg(m_comCertificate.GetSignatureAlgorithmOID())); 307 strTableContent += strTemplateRow.arg(tr("X.509 Version Number"), QString::number(m_comCertificate.GetVersionNumber())); 290 308 m_pTextBrowser->setText(QString("<table>%1</table>").arg(strTableContent)); 291 309 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.h
r76581 r78037 25 25 #include "QIDialog.h" 26 26 #include "QIWithRetranslateUI.h" 27 #include "UIWizardImportAppDefs.h" 27 28 #include "UIWizardPage.h" 28 #include "UIWizardImportAppDefs.h"29 29 30 30 /* Forward declarations: */ … … 35 35 class CCertificate; 36 36 37 38 /** 2nd page of the Import Appliance wizard (base part): */ 37 /** UIWizardPageBase extension for 2nd page of the Import Appliance wizard. */ 39 38 class UIWizardImportAppPage2 : public UIWizardPageBase 40 39 { 41 40 protected: 42 41 43 /* Constructor:*/42 /** Constructs 2nd page base. */ 44 43 UIWizardImportAppPage2(); 45 44 46 /* Stuff for 'applianceWidget' field:*/45 /** Returns appliance widget instance. */ 47 46 ImportAppliancePointer applianceWidget() const { return m_pApplianceWidget; } 48 47 49 /* Widgets:*/48 /** Holds the appliance widget instance. */ 50 49 ImportAppliancePointer m_pApplianceWidget; 51 50 }; 52 51 53 /** 2nd page of the Import Appliance wizard (basic extension):*/52 /** UIWizardPage extension for 2nd page of the Import Appliance wizard, extends UIWizardImportAppPage2 as well. */ 54 53 class UIWizardImportAppPageBasic2 : public UIWizardPage, public UIWizardImportAppPage2 55 54 { … … 59 58 public: 60 59 61 /* Constructor: */ 60 /** Constructs 2nd basic page. 61 * @param strFileName Brings appliance file name. */ 62 62 UIWizardImportAppPageBasic2(const QString &strFileName); 63 63 64 64 private: 65 65 66 /* Translate stuff:*/67 v oid retranslateUi();66 /** Handles translation event. */ 67 virtual void retranslateUi() /* override */; 68 68 69 /* Prepare stuff: */ 70 void initializePage(); 71 void cleanupPage(); 69 /** Performs page initialization. */ 70 virtual void initializePage() /* override */; 71 /** Performs page cleanup. */ 72 virtual void cleanupPage() /* override */; 72 73 73 /* Validation stuff:*/74 bool validatePage();74 /** Performs page validation. */ 75 virtual bool validatePage() /* override */; 75 76 76 /* Widgets:*/77 /** Holds the label instance. */ 77 78 QIRichTextLabel *m_pLabel; 78 QLabel *m_pCertLabel; /**< Signature/certificate info label. */ 79 80 /** Holds the signature/certificate info label instance. */ 81 QLabel *m_pCertLabel; 82 83 /** Holds the certificate text template type. */ 79 84 enum { 80 85 kCertText_Uninitialized = 0, kCertText_Unsigned, … … 82 87 kCertText_SelfSignedTrusted, kCertText_SelfSignedExpired, kCertText_SelfSignedUnverified 83 88 } m_enmCertText; 89 90 /** Holds the "signed by" information. */ 84 91 QString m_strSignedBy; 85 92 }; … … 94 101 95 102 /** Constructs appliance @a certificate viewer for passed @a pParent. */ 96 UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &c ertificate);103 UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &comCertificate); 97 104 98 105 protected: … … 107 114 108 115 /** Holds the certificate reference. */ 109 const CCertificate &m_c ertificate;116 const CCertificate &m_comCertificate; 110 117 111 118 /** Holds the text-label instance. */ 112 QLabel *m_pTextLabel;119 QLabel *m_pTextLabel; 113 120 /** Holds the text-browser instance. */ 114 121 QTextBrowser *m_pTextBrowser; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp
r76606 r78037 16 16 */ 17 17 18 /* Globalincludes: */18 /* Qt includes: */ 19 19 #include <QFileInfo> 20 #include <QGroupBox> 20 21 #include <QVBoxLayout> 21 #include <QGroupBox>22 22 23 /* Local includes: */ 23 /* GUI includes: */ 24 #include "VBoxGlobal.h" 25 #include "UIApplianceImportEditorWidget.h" 26 #include "UIEmptyFilePathSelector.h" 27 #include "UIWizardImportApp.h" 24 28 #include "UIWizardImportAppPageExpert.h" 25 #include "UIWizardImportApp.h"26 #include "VBoxGlobal.h"27 #include "UIEmptyFilePathSelector.h"28 #include "UIApplianceImportEditorWidget.h"29 29 30 30 31 31 UIWizardImportAppPageExpert::UIWizardImportAppPageExpert(const QString &strFileName) 32 32 { 33 /* Create widgets: */33 /* Create main layout: */ 34 34 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 35 35 { 36 /* Create appliance container: */ 36 37 m_pApplianceCnt = new QGroupBox(this); 37 38 { 39 /* Create appliance container layout: */ 38 40 QVBoxLayout *pApplianceCntLayout = new QVBoxLayout(m_pApplianceCnt); 39 41 { 42 /* Create file-path selector: */ 40 43 m_pFileSelector = new UIEmptyFilePathSelector(m_pApplianceCnt); 41 44 { … … 44 47 m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition); 45 48 m_pFileSelector->setEditable(true); 49 m_pFileSelector->setPath(strFileName); 50 51 /* Add into layout: */ 52 pApplianceCntLayout->addWidget(m_pFileSelector); 46 53 } 47 pApplianceCntLayout->addWidget(m_pFileSelector);48 54 } 55 56 /* Add into layout: */ 57 pMainLayout->addWidget(m_pApplianceCnt); 49 58 } 59 60 /* Create settings container: */ 50 61 m_pSettingsCnt = new QGroupBox(this); 51 62 { 63 /* Create settings container layout: */ 52 64 QVBoxLayout *pSettingsCntLayout = new QVBoxLayout(m_pSettingsCnt); 53 65 { 66 /* Create appliance widget: */ 54 67 m_pApplianceWidget = new UIApplianceImportEditorWidget(m_pSettingsCnt); 55 68 { … … 57 70 m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); 58 71 m_pApplianceWidget->setFile(strFileName); 72 73 /* Add into layout: */ 74 pSettingsCntLayout->addWidget(m_pApplianceWidget); 59 75 } 60 pSettingsCntLayout->addWidget(m_pApplianceWidget);61 76 } 77 78 /* Add into layout: */ 79 pMainLayout->addWidget(m_pSettingsCnt); 62 80 } 63 pMainLayout->addWidget(m_pApplianceCnt);64 pMainLayout->addWidget(m_pSettingsCnt);65 m_pFileSelector->setPath(strFileName);66 81 } 67 82 … … 78 93 { 79 94 /* Check if set file contains valid appliance: */ 80 if ( QFile::exists(m_pFileSelector->path()) &&81 m_pApplianceWidget->setFile(m_pFileSelector->path()))95 if ( QFile::exists(m_pFileSelector->path()) 96 && m_pApplianceWidget->setFile(m_pFileSelector->path())) 82 97 { 83 98 /* Reset the modified bit if file was correctly set: */ … … 100 115 void UIWizardImportAppPageExpert::initializePage() 101 116 { 102 /* Translate page: */103 117 retranslateUi(); 104 118 } … … 107 121 { 108 122 /* Make sure appliance file has allowed extension and exists and appliance widget is valid: */ 109 return VBoxGlobal::hasAllowedExtension(m_pFileSelector->path().toLower(), OVFFileExts) &&110 QFile::exists(m_pFileSelector->path()) &&111 m_pApplianceWidget->isValid();123 return VBoxGlobal::hasAllowedExtension(m_pFileSelector->path().toLower(), OVFFileExts) 124 && QFile::exists(m_pFileSelector->path()) 125 && m_pApplianceWidget->isValid(); 112 126 } 113 127 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.h
r76581 r78037 22 22 #endif 23 23 24 /* Localincludes: */24 /* GUI includes: */ 25 25 #include "UIWizardImportAppPageBasic1.h" 26 26 #include "UIWizardImportAppPageBasic2.h" … … 29 29 class QGroupBox; 30 30 31 /* Expert page of the Import Appliance wizard:*/31 /** UIWizardPage extension for UIWizardImportAppPage1 and UIWizardImportAppPage2. */ 32 32 class UIWizardImportAppPageExpert : public UIWizardPage, 33 33 public UIWizardImportAppPage1, … … 39 39 public: 40 40 41 /* Constructor: */ 41 /** Constructs expert page. 42 * @param strFileName Brings appliance file name. */ 42 43 UIWizardImportAppPageExpert(const QString &strFileName); 43 44 44 45 private slots: 45 46 46 /* File-path change handler:*/47 /** Handles file-path change. */ 47 48 void sltFilePathChangeHandler(); 48 49 49 50 private: 50 51 51 /* Translate stuff:*/52 v oid retranslateUi();52 /** Handles translation event. */ 53 virtual void retranslateUi() /* override */; 53 54 54 /* Prepare stuff:*/55 v oid initializePage();55 /** Performs page initialization. */ 56 virtual void initializePage() /* override */; 56 57 57 /* Validation stuff: */ 58 bool isComplete() const; 59 bool validatePage(); 58 /** Returns whether page is complete. */ 59 virtual bool isComplete() const /* override */; 60 60 61 /* Widgets: */ 61 /** Performs page validation. */ 62 virtual bool validatePage() /* override */; 63 64 /** Holds the appliance container instance. */ 62 65 QGroupBox *m_pApplianceCnt; 66 /** Holds the settings container instance. */ 63 67 QGroupBox *m_pSettingsCnt; 64 68 }; 65 69 66 70 #endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportAppPageExpert_h */ 67
Note:
See TracChangeset
for help on using the changeset viewer.