VirtualBox

Changeset 78037 in vbox


Ignore:
Timestamp:
Apr 8, 2019 11:47:34 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9434: Cleanup Import Appliance wizard first of all.

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  
    5353public:
    5454
    55     /** Constructs expert basic page.
     55    /** Constructs expert page.
    5656      * @param  selectedVMNames  Brings the list of selected VM names. */
    5757    UIWizardExportAppPageExpert(const QStringList &selectedVMNames, bool fExportToOCIByDefault);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp

    r76606 r78037  
    138138};
    139139
     140
     141/*********************************************************************************************************************************
     142*   Class UIWizardImportApp implementation.                                                                                      *
     143*********************************************************************************************************************************/
     144
    140145UIWizardImportApp::UIWizardImportApp(QWidget *pParent, const QString &strFileName)
    141146    : UIWizard(pParent, WizardType_ImportAppliance)
     
    151156}
    152157
     158void 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
    153185bool UIWizardImportApp::isValid() const
    154186{
     
    182214}
    183215
     216void 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
    184227void UIWizardImportApp::sltCurrentIdChanged(int iId)
    185228{
     
    207250}
    208251
    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 
    247252#include "UIWizardImportApp.moc"
    248253
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.h

    r76581 r78037  
    2222#endif
    2323
    24 /* Local includes */
     24/* GUI includes */
    2525#include "UIWizard.h"
    2626
    27 /* Import Appliance wizard: */
     27/** Import Appliance wizard. */
    2828class UIWizardImportApp : public UIWizard
    2929{
     
    3232public:
    3333
    34     /* Page IDs: */
     34    /** Basic page IDs. */
    3535    enum
    3636    {
     
    3939    };
    4040
    41     /* Page IDs: */
     41    /** Expert page IDs. */
    4242    enum
    4343    {
     
    4545    };
    4646
    47     /* Constructor: */
     47    /** Constructs export appliance wizard passing @a pParent to the base-class.
     48      * @param  strFileName  Brings appliance file name. */
    4849    UIWizardImportApp(QWidget *pParent, const QString &strFileName);
    4950
    50     /* Pages related stuff: */
    51     void prepare();
     51    /** Prepares all. */
     52    virtual void prepare() /* override */;
    5253
    53     /* Is appliance valid? */
     54    /** Returns whether appliance is valid. */
    5455    bool isValid() const;
     56
     57    /** Imports appliance. */
     58    bool importAppliance();
    5559
    5660protected:
    5761
    58     /* Import stuff: */
    59     bool importAppliance();
     62    /** Handles translation event. */
     63    virtual void retranslateUi() /* override */;
    6064
    61     /* Who will be able to import appliance: */
    62     friend class UIWizardImportAppPageBasic2;
    63     friend class UIWizardImportAppPageExpert;
     65protected slots:
    6466
    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 */;
    7171
    7272private:
    7373
    74     /* Translation stuff: */
    75     void retranslateUi();
    76 
    77     /* Variables: */
    78     QString m_strFileName;
     74    /** Handles the appliance file name. */
     75    QString  m_strFileName;
    7976};
    8077
     78/** Safe pointer to appliance wizard. */
    8179typedef QPointer<UIWizardImportApp> UISafePointerWizardImportApp;
    8280
    8381#endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportApp_h */
    84 
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppDefs.h

    r76581 r78037  
    2222#endif
    2323
    24 /* Global includes: */
     24/* Qt includes: */
    2525#include <QMetaType>
    2626#include <QPointer>
    2727
    28 /* Local includes: */
     28/* GUI includes: */
    2929#include "UIApplianceImportEditorWidget.h"
    3030
     
    3434
    3535#endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportAppDefs_h */
    36 
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp

    r76606 r78037  
    1616 */
    1717
    18 /* Global includes: */
     18/* Qt includes: */
    1919#include <QFileInfo>
    2020#include <QVBoxLayout>
    2121
    22 /* Local includes: */
     22/* GUI includes: */
     23#include "QIRichTextLabel.h"
     24#include "VBoxGlobal.h"
     25#include "UIEmptyFilePathSelector.h"
     26#include "UIWizardImportApp.h"
    2327#include "UIWizardImportAppPageBasic1.h"
    2428#include "UIWizardImportAppPageBasic2.h"
    25 #include "UIWizardImportApp.h"
    26 #include "VBoxGlobal.h"
    27 #include "UIEmptyFilePathSelector.h"
    28 #include "QIRichTextLabel.h"
    2929
     30
     31/*********************************************************************************************************************************
     32*   Class UIWizardImportAppPage1 implementation.                                                                                 *
     33*********************************************************************************************************************************/
    3034
    3135UIWizardImportAppPage1::UIWizardImportAppPage1()
     
    3337}
    3438
     39
     40/*********************************************************************************************************************************
     41*   Class UIWizardImportAppPageBasic1 implementation.                                                                            *
     42*********************************************************************************************************************************/
     43
    3544UIWizardImportAppPageBasic1::UIWizardImportAppPageBasic1()
    3645{
    37     /* Create widgets: */
     46    /* Create main layout: */
    3847    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     48    if (pMainLayout)
    3949    {
     50        /* Create label: */
    4051        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: */
    4159        m_pFileSelector = new UIEmptyFilePathSelector(this);
     60        if (m_pFileSelector)
    4261        {
    4362            m_pFileSelector->setHomeDir(vboxGlobal().documentsPath());
     
    4564            m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition);
    4665            m_pFileSelector->setEditable(true);
     66
     67            /* Add into layout: */
     68            pMainLayout->addWidget(m_pFileSelector);
    4769        }
    48         pMainLayout->addWidget(m_pLabel);
    49         pMainLayout->addWidget(m_pFileSelector);
     70
     71        /* Add vertical stretch finally: */
    5072        pMainLayout->addStretch();
    5173    }
     
    7193void UIWizardImportAppPageBasic1::initializePage()
    7294{
    73     /* Translate page: */
    7495    retranslateUi();
    7596}
     
    7899{
    79100    /* 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());
    82103}
    83104
     
    101122    return pImportApplianceWidget->isValid();
    102123}
    103 
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h

    r76581 r78037  
    2222#endif
    2323
    24 /* Local includes: */
     24/* GUI includes: */
    2525#include "UIWizardPage.h"
    2626
    2727/* Forward declarations: */
     28class QIRichTextLabel;
    2829class UIEmptyFilePathSelector;
    29 class QIRichTextLabel;
    3030
    31 /* 1st page of the Import Appliance wizard (base part): */
     31/** UIWizardPageBase extension for 1st page of the Import Appliance wizard. */
    3232class UIWizardImportAppPage1 : public UIWizardPageBase
    3333{
    3434protected:
    3535
    36     /* Constructor: */
     36    /** Constructs 1st page base. */
    3737    UIWizardImportAppPage1();
    3838
    39     /* Widgets: */
     39    /** Holds the file selector instance. */
    4040    UIEmptyFilePathSelector *m_pFileSelector;
    4141};
    4242
    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. */
    4444class UIWizardImportAppPageBasic1 : public UIWizardPage, public UIWizardImportAppPage1
    4545{
     
    4848public:
    4949
    50     /* Constructor: */
     50    /** Constructs 1st basic page. */
    5151    UIWizardImportAppPageBasic1();
    5252
    5353private:
    5454
    55     /* Translate stuff: */
    56     void retranslateUi();
     55    /** Handles translation event. */
     56    virtual void retranslateUi() /* override */;
    5757
    58     /* Prepare stuff: */
    59     void initializePage();
     58    /** Performs page initialization. */
     59    virtual void initializePage() /* override */;
    6060
    61     /* Validation stuff: */
    62     bool isComplete() const;
    63     bool validatePage();
     61    /** Returns whether page is complete. */
     62    virtual bool isComplete() const /* override */;
    6463
    65     /* Widgets: */
     64    /** Performs page validation. */
     65    virtual bool validatePage() /* override */;
     66
     67    /** Holds the label instance. */
    6668    QIRichTextLabel *m_pLabel;
    6769};
    6870
    6971#endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportAppPageBasic1_h */
    70 
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp

    r76606 r78037  
    1616 */
    1717
    18 /* Global includes: */
     18/* Qt includes: */
    1919#include <QLabel>
    2020#include <QPointer>
     
    2323#include <QVBoxLayout>
    2424
    25 /* Local includes: */
     25/* GUI includes: */
    2626#include "QIDialogButtonBox.h"
    2727#include "QIRichTextLabel.h"
     
    5050    : m_enmCertText(kCertText_Uninitialized)
    5151{
    52     /* Create widgets: */
     52    /* Create main layout: */
    5353    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    54     {
     54    if (pMainLayout)
     55    {
     56        /* Create label: */
    5557        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: */
    5665        m_pApplianceWidget = new UIApplianceImportEditorWidget(this);
    5766        {
    5867            m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    5968            m_pApplianceWidget->setFile(strFileName);
    60         }
     69
     70            /* Add into layout: */
     71            pMainLayout->addWidget(m_pApplianceWidget);
     72        }
     73
     74        /* Create certificate label: */
    6175        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        }
    6581    }
    6682
     
    115131void UIWizardImportAppPageBasic2::initializePage()
    116132{
    117     /* Acquire appliance and certificate: */
     133    /* Acquire appliance: */
    118134    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: */
    121138    if (!pAppliance)
    122139    {
     
    125142        return;
    126143    }
    127     CCertificate certificate = pAppliance->GetCertificate();
    128     if (certificate.isNull())
     144
     145    /* Acquire certificate: */
     146    CCertificate comCertificate = pAppliance->GetCertificate();
     147    if (comCertificate.isNull())
    129148        m_enmCertText = kCertText_Unsigned;
    130149    else
    131150    {
    132         /* Pick a 'signed-by' name. */
    133         m_strSignedBy = certificate.GetFriendlyName();
     151        /* Pick a 'signed-by' name: */
     152        m_strSignedBy = comCertificate.GetFriendlyName();
    134153
    135154        /* If trusted, just select the right message: */
    136         if (certificate.GetTrusted())
    137         {
    138             if (certificate.GetSelfSigned())
    139                 m_enmCertText = !certificate.GetExpired() ? kCertText_SelfSignedTrusted : kCertText_SelfSignedExpired;
     155        if (comCertificate.GetTrusted())
     156        {
     157            if (comCertificate.GetSelfSigned())
     158                m_enmCertText = !comCertificate.GetExpired() ? kCertText_SelfSignedTrusted : kCertText_SelfSignedExpired;
    140159            else
    141                 m_enmCertText = !certificate.GetExpired() ? kCertText_IssuedTrusted     : kCertText_IssuedExpired;
     160                m_enmCertText = !comCertificate.GetExpired() ? kCertText_IssuedTrusted     : kCertText_IssuedExpired;
    142161        }
    143162        else
    144163        {
    145164            /* Not trusted!  Must ask the user whether to continue in this case: */
    146             m_enmCertText = certificate.GetSelfSigned() ? kCertText_SelfSignedUnverified : kCertText_IssuedUnverified;
     165            m_enmCertText = comCertificate.GetSelfSigned() ? kCertText_SelfSignedUnverified : kCertText_IssuedUnverified;
    147166
    148167            /* Translate page early: */
     
    150169
    151170            /* Instantiate the dialog: */
    152             QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = new UIApplianceUnverifiedCertificateViewer(this, certificate);
     171            QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = new UIApplianceUnverifiedCertificateViewer(this, comCertificate);
    153172            AssertPtrReturnVoid(pDialog.data());
    154173
     
    161180            /* Delete viewer finally: */
    162181            delete pDialog;
    163             pDialog = 0;
    164182
    165183            /* Dismiss the entire import-appliance wizard if user rejects certificate: */
     
    205223*********************************************************************************************************************************/
    206224
    207 UIApplianceUnverifiedCertificateViewer::UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &certificate)
     225UIApplianceUnverifiedCertificateViewer::UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &comCertificate)
    208226    : QIWithRetranslateUI<QIDialog>(pParent)
    209     , m_certificate(certificate)
     227    , m_comCertificate(comCertificate)
    210228    , m_pTextLabel(0)
    211229    , m_pTextBrowser(0)
    212230{
    213     /* Prepare: */
    214231    prepare();
    215232}
     
    219236    /* Create layout: */
    220237    QVBoxLayout *pLayout = new QVBoxLayout(this);
    221     AssertPtrReturnVoid(pLayout);
     238    if (pLayout)
    222239    {
    223240        /* Create text-label: */
    224241        m_pTextLabel = new QLabel;
    225         AssertPtrReturnVoid(m_pTextLabel);
    226         {
    227             /* Configure text-label: */
     242        if (m_pTextLabel)
     243        {
    228244            m_pTextLabel->setWordWrap(true);
    229             /* Add text-label into layout: */
     245
     246            /* Add into layout: */
    230247            pLayout->addWidget(m_pTextLabel);
    231248        }
     
    233250        /* Create text-browser: */
    234251        m_pTextBrowser = new QTextBrowser;
    235         AssertPtrReturnVoid(m_pTextBrowser);
    236         {
    237             /* Configure text-browser: */
     252        if (m_pTextBrowser)
     253        {
    238254            m_pTextBrowser->setMinimumSize(500, 300);
    239             /* Add text-browser into layout: */
     255
     256            /* Add into layout: */
    240257            pLayout->addWidget(m_pTextBrowser);
    241258        }
     
    243260        /* Create button-box: */
    244261        QIDialogButtonBox *pButtonBox = new QIDialogButtonBox;
    245         AssertPtrReturnVoid(pButtonBox);
    246         {
    247             /* Configure button-box: */
     262        if (pButtonBox)
     263        {
    248264            pButtonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No);
    249265            pButtonBox->button(QDialogButtonBox::Yes)->setShortcut(Qt::Key_Enter);
     
    251267            connect(pButtonBox, &QIDialogButtonBox::accepted, this, &UIApplianceUnverifiedCertificateViewer::accept);
    252268            connect(pButtonBox, &QIDialogButtonBox::rejected, this, &UIApplianceUnverifiedCertificateViewer::reject);
    253             /* Add button-box into layout: */
     269
     270            /* Add into layout: */
    254271            pLayout->addWidget(pButtonBox);
    255272        }
    256273    }
     274
    257275    /* Translate UI: */
    258276    retranslateUi();
     
    265283
    266284    /* Translate text-label caption: */
    267     if (m_certificate.GetSelfSigned())
     285    if (m_comCertificate.GetSelfSigned())
    268286        m_pTextLabel->setText(tr("<b>The appliance is signed by an unverified self signed certificate issued by '%1'. "
    269287                                 "We recommend to only proceed with the importing if you are sure you should trust this entity.</b>"
    270                                  ).arg(m_certificate.GetFriendlyName()));
     288                                 ).arg(m_comCertificate.GetFriendlyName()));
    271289    else
    272290        m_pTextLabel->setText(tr("<b>The appliance is signed by an unverified certificate issued to '%1'. "
    273291                                 "We recommend to only proceed with the importing if you are sure you should trust this entity.</b>"
    274                                  ).arg(m_certificate.GetFriendlyName()));
     292                                 ).arg(m_comCertificate.GetFriendlyName()));
    275293
    276294    /* Translate text-browser contents: */
    277295    const QString strTemplateRow = tr("<tr><td>%1:</td><td>%2</td></tr>", "key: value");
    278296    QString strTableContent;
    279     strTableContent += strTemplateRow.arg(tr("Issuer"),               QStringList(m_certificate.GetIssuerName().toList()).join(", "));
    280     strTableContent += strTemplateRow.arg(tr("Subject"),              QStringList(m_certificate.GetSubjectName().toList()).join(", "));
    281     strTableContent += strTemplateRow.arg(tr("Not Valid Before"),     m_certificate.GetValidityPeriodNotBefore());
    282     strTableContent += strTemplateRow.arg(tr("Not Valid After"),      m_certificate.GetValidityPeriodNotAfter());
    283     strTableContent += strTemplateRow.arg(tr("Serial Number"),        m_certificate.GetSerialNumber());
    284     strTableContent += strTemplateRow.arg(tr("Self-Signed"),          m_certificate.GetSelfSigned() ? tr("True") : tr("False"));
    285     strTableContent += strTemplateRow.arg(tr("Authority (CA)"),       m_certificate.GetCertificateAuthority() ? tr("True") : tr("False"));
    286 //    strTableContent += strTemplateRow.arg(tr("Trusted"),              m_certificate.GetTrusted() ? tr("True") : tr("False"));
    287     strTableContent += strTemplateRow.arg(tr("Public Algorithm"),     tr("%1 (%2)", "value (clarification)").arg(m_certificate.GetPublicKeyAlgorithm()).arg(m_certificate.GetPublicKeyAlgorithmOID()));
    288     strTableContent += strTemplateRow.arg(tr("Signature Algorithm"),  tr("%1 (%2)", "value (clarification)").arg(m_certificate.GetSignatureAlgorithmName()).arg(m_certificate.GetSignatureAlgorithmOID()));
    289     strTableContent += strTemplateRow.arg(tr("X.509 Version Number"), QString::number(m_certificate.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()));
    290308    m_pTextBrowser->setText(QString("<table>%1</table>").arg(strTableContent));
    291309}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.h

    r76581 r78037  
    2525#include "QIDialog.h"
    2626#include "QIWithRetranslateUI.h"
     27#include "UIWizardImportAppDefs.h"
    2728#include "UIWizardPage.h"
    28 #include "UIWizardImportAppDefs.h"
    2929
    3030/* Forward declarations: */
     
    3535class CCertificate;
    3636
    37 
    38 /** 2nd page of the Import Appliance wizard (base part): */
     37/** UIWizardPageBase extension for 2nd page of the Import Appliance wizard. */
    3938class UIWizardImportAppPage2 : public UIWizardPageBase
    4039{
    4140protected:
    4241
    43     /* Constructor: */
     42    /** Constructs 2nd page base. */
    4443    UIWizardImportAppPage2();
    4544
    46     /* Stuff for 'applianceWidget' field: */
     45    /** Returns appliance widget instance. */
    4746    ImportAppliancePointer applianceWidget() const { return m_pApplianceWidget; }
    4847
    49     /* Widgets: */
     48    /** Holds the appliance widget instance. */
    5049    ImportAppliancePointer m_pApplianceWidget;
    5150};
    5251
    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. */
    5453class UIWizardImportAppPageBasic2 : public UIWizardPage, public UIWizardImportAppPage2
    5554{
     
    5958public:
    6059
    61     /* Constructor: */
     60    /** Constructs 2nd basic page.
     61      * @param  strFileName  Brings appliance file name. */
    6262    UIWizardImportAppPageBasic2(const QString &strFileName);
    6363
    6464private:
    6565
    66     /* Translate stuff: */
    67     void retranslateUi();
     66    /** Handles translation event. */
     67    virtual void retranslateUi() /* override */;
    6868
    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 */;
    7273
    73     /* Validation stuff: */
    74     bool validatePage();
     74    /** Performs page validation. */
     75    virtual bool validatePage() /* override */;
    7576
    76     /* Widgets: */
     77    /** Holds the label instance. */
    7778    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. */
    7984    enum {
    8085        kCertText_Uninitialized = 0, kCertText_Unsigned,
     
    8287        kCertText_SelfSignedTrusted, kCertText_SelfSignedExpired, kCertText_SelfSignedUnverified
    8388    } m_enmCertText;
     89
     90    /** Holds the "signed by" information. */
    8491    QString m_strSignedBy;
    8592};
     
    94101
    95102    /** Constructs appliance @a certificate viewer for passed @a pParent. */
    96     UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &certificate);
     103    UIApplianceUnverifiedCertificateViewer(QWidget *pParent, const CCertificate &comCertificate);
    97104
    98105protected:
     
    107114
    108115    /** Holds the certificate reference. */
    109     const CCertificate &m_certificate;
     116    const CCertificate &m_comCertificate;
    110117
    111118    /** Holds the text-label instance. */
    112     QLabel *m_pTextLabel;
     119    QLabel       *m_pTextLabel;
    113120    /** Holds the text-browser instance. */
    114121    QTextBrowser *m_pTextBrowser;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp

    r76606 r78037  
    1616 */
    1717
    18 /* Global includes: */
     18/* Qt includes: */
    1919#include <QFileInfo>
     20#include <QGroupBox>
    2021#include <QVBoxLayout>
    21 #include <QGroupBox>
    2222
    23 /* Local includes: */
     23/* GUI includes: */
     24#include "VBoxGlobal.h"
     25#include "UIApplianceImportEditorWidget.h"
     26#include "UIEmptyFilePathSelector.h"
     27#include "UIWizardImportApp.h"
    2428#include "UIWizardImportAppPageExpert.h"
    25 #include "UIWizardImportApp.h"
    26 #include "VBoxGlobal.h"
    27 #include "UIEmptyFilePathSelector.h"
    28 #include "UIApplianceImportEditorWidget.h"
    2929
    3030
    3131UIWizardImportAppPageExpert::UIWizardImportAppPageExpert(const QString &strFileName)
    3232{
    33     /* Create widgets: */
     33    /* Create main layout: */
    3434    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    3535    {
     36        /* Create appliance container: */
    3637        m_pApplianceCnt = new QGroupBox(this);
    3738        {
     39            /* Create appliance container layout: */
    3840            QVBoxLayout *pApplianceCntLayout = new QVBoxLayout(m_pApplianceCnt);
    3941            {
     42                /* Create file-path selector: */
    4043                m_pFileSelector = new UIEmptyFilePathSelector(m_pApplianceCnt);
    4144                {
     
    4447                    m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition);
    4548                    m_pFileSelector->setEditable(true);
     49                    m_pFileSelector->setPath(strFileName);
     50
     51                    /* Add into layout: */
     52                    pApplianceCntLayout->addWidget(m_pFileSelector);
    4653                }
    47                 pApplianceCntLayout->addWidget(m_pFileSelector);
    4854            }
     55
     56            /* Add into layout: */
     57            pMainLayout->addWidget(m_pApplianceCnt);
    4958        }
     59
     60        /* Create settings container: */
    5061        m_pSettingsCnt = new QGroupBox(this);
    5162        {
     63            /* Create settings container layout: */
    5264            QVBoxLayout *pSettingsCntLayout = new QVBoxLayout(m_pSettingsCnt);
    5365            {
     66                /* Create appliance widget: */
    5467                m_pApplianceWidget = new UIApplianceImportEditorWidget(m_pSettingsCnt);
    5568                {
     
    5770                    m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    5871                    m_pApplianceWidget->setFile(strFileName);
     72
     73                    /* Add into layout: */
     74                    pSettingsCntLayout->addWidget(m_pApplianceWidget);
    5975                }
    60                 pSettingsCntLayout->addWidget(m_pApplianceWidget);
    6176            }
     77
     78            /* Add into layout: */
     79            pMainLayout->addWidget(m_pSettingsCnt);
    6280        }
    63         pMainLayout->addWidget(m_pApplianceCnt);
    64         pMainLayout->addWidget(m_pSettingsCnt);
    65         m_pFileSelector->setPath(strFileName);
    6681    }
    6782
     
    7893{
    7994    /* 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()))
    8297    {
    8398        /* Reset the modified bit if file was correctly set: */
     
    100115void UIWizardImportAppPageExpert::initializePage()
    101116{
    102     /* Translate page: */
    103117    retranslateUi();
    104118}
     
    107121{
    108122    /* 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();
    112126}
    113127
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.h

    r76581 r78037  
    2222#endif
    2323
    24 /* Local includes: */
     24/* GUI includes: */
    2525#include "UIWizardImportAppPageBasic1.h"
    2626#include "UIWizardImportAppPageBasic2.h"
     
    2929class QGroupBox;
    3030
    31 /* Expert page of the Import Appliance wizard: */
     31/** UIWizardPage extension for UIWizardImportAppPage1 and UIWizardImportAppPage2. */
    3232class UIWizardImportAppPageExpert : public UIWizardPage,
    3333                                    public UIWizardImportAppPage1,
     
    3939public:
    4040
    41     /* Constructor: */
     41    /** Constructs expert page.
     42      * @param  strFileName  Brings appliance file name. */
    4243    UIWizardImportAppPageExpert(const QString &strFileName);
    4344
    4445private slots:
    4546
    46     /* File-path change handler: */
     47    /** Handles file-path change. */
    4748    void sltFilePathChangeHandler();
    4849
    4950private:
    5051
    51     /* Translate stuff: */
    52     void retranslateUi();
     52    /** Handles translation event. */
     53    virtual void retranslateUi() /* override */;
    5354
    54     /* Prepare stuff: */
    55     void initializePage();
     55    /** Performs page initialization. */
     56    virtual void initializePage() /* override */;
    5657
    57     /* Validation stuff: */
    58     bool isComplete() const;
    59     bool validatePage();
     58    /** Returns whether page is complete. */
     59    virtual bool isComplete() const /* override */;
    6060
    61     /* Widgets: */
     61    /** Performs page validation. */
     62    virtual bool validatePage() /* override */;
     63
     64    /** Holds the appliance container instance. */
    6265    QGroupBox *m_pApplianceCnt;
     66    /** Holds the settings container instance. */
    6367    QGroupBox *m_pSettingsCnt;
    6468};
    6569
    6670#endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIWizardImportAppPageExpert_h */
    67 
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette