VirtualBox

Changeset 75223 in vbox


Ignore:
Timestamp:
Nov 2, 2018 12:40:23 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9230: Cloud Profile Manager: Use our own QIInputDialog implementation for acquiring new profile name; that allows to reject empty names for good.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/UICloudProfileManager.cpp

    r75209 r75223  
    2222/* Qt includes: */
    2323# include <QHeaderView>
    24 # include <QInputDialog>
    2524# include <QPushButton>
    2625# include <QVBoxLayout>
     
    2827/* GUI includes: */
    2928# include "QIDialogButtonBox.h"
     29# include "QIInputDialog.h"
    3030# include "QITreeWidget.h"
    3131# include "VBoxGlobal.h"
     
    295295    if (strProfileName.isEmpty())
    296296    {
    297         QPointer<QInputDialog> pDialog = new QInputDialog(this);
    298         pDialog->setInputMode(QInputDialog::TextInput);
    299         pDialog->setWindowIcon(UIIconPool::iconSet(":/cloud_profile_add_16px.png"));
    300         pDialog->setWindowTitle(tr("Add Profile"));
    301         pDialog->setLabelText(tr("Name:"));
    302         bool fCancelled = false;
    303         if (pDialog->exec() == QDialog::Accepted)
    304             strProfileName = pDialog->textValue();
    305         else
    306             fCancelled = true;
    307         delete pDialog;
     297        bool fCancelled = true;
     298        QISafePointerInputDialog pDialog = new QIInputDialog(this);
     299        if (pDialog)
     300        {
     301            pDialog->setWindowIcon(UIIconPool::iconSet(":/cloud_profile_add_16px.png"));
     302            pDialog->setWindowTitle(tr("Add Profile"));
     303            if (pDialog->exec() == QDialog::Accepted)
     304            {
     305                strProfileName = pDialog->textValue();
     306                fCancelled = false;
     307            }
     308            delete pDialog;
     309        }
    308310        if (fCancelled)
    309311            return;
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