VirtualBox

Changeset 72935 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 6, 2018 12:23:52 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123487
Message:

FE/Qt: bugref:9152: Export Appliance wizard: Storage page: Remove excessive fields.

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  
    166166        case CloudProvider:
    167167        {
    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);
    177170        }
    178171    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r72931 r72935  
    6262        case LocalFilesystem:
    6363        {
    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);
    7265            m_pFormatComboBox->setVisible(true);
    73             m_pFileSelector->setChooserVisible(true);
     66            m_pAdditionalLabel->setVisible(true);
     67            m_pManifestCheckbox->setVisible(true);
    7468            break;
    7569        }
    7670        case CloudProvider:
    7771        {
    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);
    8673            m_pFormatComboBox->setVisible(true);
    87             m_pFileSelector->setChooserVisible(false);
     74            m_pAdditionalLabel->setVisible(false);
     75            m_pManifestCheckbox->setVisible(false);
    8876            break;
    8977        }
     
    142130}
    143131
     132QString UIWizardExportAppPage3::path() const
     133{
     134    return m_pFileSelector->path();
     135}
     136
     137void UIWizardExportAppPage3::setPath(const QString &strPath)
     138{
     139    m_pFileSelector->setPath(strPath);
     140}
     141
    144142QString UIWizardExportAppPage3::format() const
    145143{
     
    165163}
    166164
    167 QString UIWizardExportAppPage3::username() const
    168 {
    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() const
    178 {
    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() const
    188 {
    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() const
    198 {
    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() const
    208 {
    209     return m_pFileSelector->path();
    210 }
    211 
    212 void UIWizardExportAppPage3::setPath(const QString &strPath)
    213 {
    214     m_pFileSelector->setPath(strPath);
    215 }
    216 
    217165
    218166/*********************************************************************************************************************************
     
    238186        if (pSettingsLayout)
    239187        {
    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 
    314188            /* Create file selector: */
    315189            m_pFileSelector = new UIEmptyFilePathSelector;
     
    391265
    392266    /* 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);
    397267    connect(m_pFileSelector, &UIEmptyFilePathSelector::pathChanged, this, &UIWizardExportAppPageBasic3::completeChanged);
    398268    connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     
    400270
    401271    /* Register fields: */
     272    registerField("path", this, "path");
    402273    registerField("format", this, "format");
    403274    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");
    409275}
    410276
     
    417283    m_strDefaultApplianceName = UIWizardExportApp::tr("Appliance");
    418284    /* 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:"));
    423285    m_pFileSelectorLabel->setText(UIWizardExportApp::tr("&File:"));
    424286    m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to..."));
     
    474336                    break;
    475337                case CloudProvider:
    476                     fResult &= !m_pUsernameEditor->text().isEmpty() &&
    477                                !m_pPasswordEditor->text().isEmpty() &&
    478                                !m_pHostnameEditor->text().isEmpty() &&
    479                                !m_pBucketEditor->text().isEmpty();
    480338                    break;
    481339            }
     
    512370        case CloudProvider:
    513371        {
    514             m_pLabel->setText(tr("Please complete the additional fields like the username, password, "
    515                                  "hostname and the bucket, and provide a filename for the OVF target."));
    516             m_pUsernameEditor->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!
    517375            break;
    518376        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r72931 r72935  
    5050    virtual void updateFormatComboToolTip();
    5151
     52    /** Returns path. */
     53    QString path() const;
     54    /** Defines @a strPath. */
     55    void setPath(const QString &strPath);
     56
    5257    /** Returns format. */
    5358    QString format() const;
     
    6065    void setManifestSelected(bool fChecked);
    6166
    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 
    8767    /** Holds the default appliance name. */
    8868    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;
    10969
    11070    /** Holds the file selector label instance. */
     
    12989{
    13090    Q_OBJECT;
     91    Q_PROPERTY(QString path READ path WRITE setPath);
    13192    Q_PROPERTY(QString format READ format WRITE setFormat);
    13293    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);
    13894
    13995public:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r72930 r72935  
    138138            if (pSettingsLayout)
    139139            {
    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 
    214140                /* Create file selector: */
    215141                m_pFileSelector = new UIEmptyFilePathSelector;
     
    287213    connect(m_pTypeLocalFilesystem, &QRadioButton::clicked,         this, &UIWizardExportAppPageExpert::sltStorageTypeChangeHandler);
    288214    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);
    293215    connect(m_pFileSelector, &UIEmptyFilePathSelector::pathChanged, this, &UIWizardExportAppPageExpert::completeChanged);
    294216    connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     
    303225    registerField("machineIDs", this, "machineIDs");
    304226    registerField("storageType", this, "storageType");
     227    registerField("path", this, "path");
    305228    registerField("format", this, "format");
    306229    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");
    312230    registerField("applianceWidget", this, "applianceWidget");
    313231}
     
    325243    m_pTypeLocalFilesystem->setText(UIWizardExportApp::tr("&Local Filesystem"));
    326244    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:"));
    331245    m_pFileSelectorLabel->setText(UIWizardExportApp::tr("&File:"));
    332246    m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to..."));
     
    389303                    break;
    390304                case CloudProvider:
    391                     fResult &= !m_pUsernameEditor->text().isEmpty() &&
    392                                !m_pPasswordEditor->text().isEmpty() &&
    393                                !m_pHostnameEditor->text().isEmpty() &&
    394                                !m_pBucketEditor->text().isEmpty();
    395305                    break;
    396306            }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r72932 r72935  
    4141    Q_PROPERTY(QStringList machineIDs READ machineIDs);
    4242    Q_PROPERTY(StorageType storageType READ storageType WRITE setStorageType);
     43    Q_PROPERTY(QString path READ path WRITE setPath);
    4344    Q_PROPERTY(QString format READ format WRITE setFormat);
    4445    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);
    5046    Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget);
    5147
Note: See TracChangeset for help on using the changeset viewer.

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