VirtualBox

Changeset 72174 in vbox for trunk/src


Ignore:
Timestamp:
May 9, 2018 1:45:33 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122596
Message:

FE/Qt: Reverting the commit 122595

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r72173 r72174  
    11601160    QString strHomeFolder = fUseLastFolder && !strLastFolder.isEmpty() ? strLastFolder :
    11611161                            strDefaultFolder.isEmpty() ? vboxGlobal().homeFolder() : strDefaultFolder;
    1162 
    11631162
    11641163    /* Prepare filters and backends: */
     
    46774676    return true;
    46784677}
     4678
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp

    r72173 r72174  
    3232# include <QPlainTextEdit>
    3333# include <QTextCursor>
     34# include <QToolButton>
    3435# include <QRadioButton>
    3536# include <QScrollArea>
     
    7879    virtual void        mousePressEvent(QMouseEvent * event) /* override */;
    7980    virtual void        mouseReleaseEvent(QMouseEvent *){}
    80     virtual void        paintEvent(QPaintEvent *event) /* override */;
     81    virtual void        paintEvent(QPaintEvent *event);
    8182
    8283private slots:
     
    8990private:
    9091
    91     void          createButtons();
    92     QIToolButton *m_pRemoveTermButton;
    93     QIToolButton *m_pClearAllButton;
    94     const int     m_iRemoveTermButtonSize;
    95     int           m_iTrailingSpaceCount;
     92    void         createButtons();
     93    QToolButton *m_pRemoveTermButton;
     94    QToolButton *m_pClearAllButton;
     95    const int    m_iRemoveTermButtonSize;
     96    int          m_iTrailingSpaceCount;
    9697};
    9798
     
    196197    if (!m_pRemoveTermButton)
    197198    {
    198         m_pRemoveTermButton = new QIToolButton(this);
     199        m_pRemoveTermButton = new QToolButton(this);
    199200        if (m_pRemoveTermButton)
    200201        {
    201202            m_pRemoveTermButton->setIcon(m_pRemoveTermButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
    202203            m_pRemoveTermButton->hide();
    203             connect(m_pRemoveTermButton, &QIToolButton::clicked, this, &UIVMFilterLineEdit::sltRemoveFilterTerm);
     204            connect(m_pRemoveTermButton, &QToolButton::clicked, this, &UIVMFilterLineEdit::sltRemoveFilterTerm);
    204205        }
    205206    }
     
    207208    if (!m_pClearAllButton)
    208209    {
    209         m_pClearAllButton = new QIToolButton(this);
     210        m_pClearAllButton = new QToolButton(this);
    210211        if (m_pClearAllButton)
    211212        {
    212213            m_pClearAllButton->setIcon(m_pClearAllButton->style()->standardIcon(QStyle::SP_LineEditClearButton));
    213             connect(m_pClearAllButton, &QIToolButton::clicked, this, &UIVMFilterLineEdit::sltClearAll);
     214            connect(m_pClearAllButton, &QToolButton::clicked, this, &UIVMFilterLineEdit::sltClearAll);
    214215        }
    215216    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r72173 r72174  
    554554        {
    555555            /* Configure widget: */
    556             //m_pNameAndSystemEditor->nameEditor()->setValidator(new QRegExpValidator(QRegExp(".+"), this));
     556            m_pNameAndSystemEditor->nameEditor()->setValidator(new QRegExpValidator(QRegExp(".+"), this));
    557557        }
    558558    }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r72173 r72174  
    668668                   UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent);
    669669                   pFileChooser->setMode(UIFilePathSelector::Mode_File_Save);
    670                    pFileChooser->setResetEnabled(true);
     670                   pFileChooser->setResetEnabled(false);
    671671                   pEditor = pFileChooser;
    672672                break;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp

    r72173 r72174  
    3131# include "UIFilePathSelector.h"
    3232# include "UINameAndSystemEditor.h"
    33 # include "UIVMNamePathSelector.h"
    3433
    3534/* COM includes: */
     
    5150    , m_fSupportsHWVirtEx(false)
    5251    , m_fSupportsLongMode(false)
     52    , m_pLabelName(0)
    5353    , m_pLabelFamily(0)
    5454    , m_pLabelType(0)
    5555    , m_pIconType(0)
    56     , m_pNamePathLabel(0)
    57     , m_pNamePathSelector(0)
     56    , m_pEditorName(0)
     57    , m_pEditorLocation(0)
    5858    , m_pComboFamily(0)
    5959    , m_pComboType(0)
     
    6565QString UINameAndSystemEditor::name() const
    6666{
    67     if (!m_pNamePathSelector)
    68         return QString();
    69     return m_pNamePathSelector->name();
    70 }
    71 
    72 QString UINameAndSystemEditor::path() const
    73 {
    74     if (!m_pNamePathSelector)
    75         return vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    76     return m_pNamePathSelector->path();
     67    if (!m_fChooseLocation)
     68        return m_pEditorName->text();
     69    else
     70        return m_pEditorLocation->path();
    7771}
    7872
    7973void UINameAndSystemEditor::setName(const QString &strName)
    8074{
    81     if (!m_pNamePathSelector)
    82         return;
    83     m_pNamePathSelector->setName(strName);
     75    if (!m_fChooseLocation)
     76        m_pEditorName->setText(strName);
     77    else
     78        m_pEditorLocation->setPath(strName);
    8479}
    8580
     
    117112void UINameAndSystemEditor::retranslateUi()
    118113{
     114    m_pLabelName->setText(tr("N&ame:"));
    119115    m_pLabelFamily->setText(tr("&Type:"));
    120116    m_pLabelType->setText(tr("&Version:"));
    121     m_pNamePathLabel->setText(tr("Path/Name:"));
    122 
     117    if (!m_fChooseLocation)
     118        m_pEditorName->setWhatsThis(tr("Holds the name of the virtual machine."));
     119    else
     120        m_pEditorLocation->setWhatsThis(tr("Holds the location of the virtual machine."));
    123121    m_pComboFamily->setWhatsThis(tr("Selects the operating system family that "
    124122                                    "you plan to install into this virtual machine."));
     
    229227        pMainLayout->setContentsMargins(0, 0, 0, 0);
    230228
    231         m_pNamePathLabel = new QLabel;
    232         if (m_pNamePathLabel)
    233         {
    234             m_pNamePathLabel->setAlignment(Qt::AlignRight);
    235             m_pNamePathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    236             pMainLayout->addWidget(m_pNamePathLabel, 0, 0, 1, 1);
    237         }
    238         m_pNamePathSelector = new UIVMNamePathSelector;
    239         if (m_pNamePathSelector)
    240         {
    241             m_pNamePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    242             pMainLayout->addWidget(m_pNamePathSelector, 0, 1, 1, 2);
     229        /* Create VM name label: */
     230        m_pLabelName = new QLabel;
     231        if (m_pLabelName)
     232        {
     233            /* Configure VM name label: */
     234            m_pLabelName->setAlignment(Qt::AlignRight);
     235            m_pLabelName->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     236            /* Add VM name label into main-layout: */
     237            pMainLayout->addWidget(m_pLabelName, 0, 0);
     238        }
     239
     240        if (!m_fChooseLocation)
     241        {
     242            /* Create VM name editor: */
     243            m_pEditorName = new QLineEdit;
     244            if (m_pEditorName)
     245            {
     246                /* Configure VM name editor: */
     247                m_pEditorName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     248                m_pLabelName->setBuddy(m_pEditorName);
     249                /* Add VM name editor into main-layout: */
     250                pMainLayout->addWidget(m_pEditorName, 0, 1, 1, 2);
     251            }
     252        }
     253        else
     254        {
     255            /* Create VM location editor: */
     256            m_pEditorLocation = new UIFilePathSelector;
     257            if (m_pEditorLocation)
     258            {
     259                /* Configure advanced VM name editor: */
     260                m_pEditorLocation->setResetEnabled(false);
     261                m_pEditorLocation->setMode(UIFilePathSelector::Mode_File_Save);
     262                m_pEditorLocation->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     263                m_pEditorLocation->setHomeDir(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder());
     264                m_pLabelName->setBuddy(m_pEditorLocation);
     265                /* Add advanced VM name editor into main-layout: */
     266                pMainLayout->addWidget(m_pEditorLocation, 0, 1, 1, 2);
     267            }
    243268        }
    244269
     
    300325                pLayoutIcon->addWidget(m_pIconType);
    301326            }
     327
    302328            /* Add stretch to sub-layout: */
    303329            pLayoutIcon->addStretch();
     
    332358{
    333359    /* Prepare connections: */
    334     connect(m_pNamePathSelector, &UIVMNamePathSelector::sigNameChanged,
    335             this, &UINameAndSystemEditor::sigNameChanged);
     360    if (!m_fChooseLocation)
     361        connect(m_pEditorName, &QLineEdit::textChanged,
     362                this, &UINameAndSystemEditor::sigNameChanged);
     363    else
     364        connect(m_pEditorLocation, &UIFilePathSelector::pathChanged,
     365                this, &UINameAndSystemEditor::sigNameChanged);
    336366    connect(m_pComboFamily, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    337367            this, &UINameAndSystemEditor::sltFamilyChanged);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h

    r72173 r72174  
    3636class QString;
    3737class UIFilePathSelector;
    38 class UIVMNamePathSelector;
    3938
    4039/** QWidget subclass providing complex editor for basic VM parameters. */
     
    5958    UINameAndSystemEditor(QWidget *pParent, bool fChooseLocation = false);
    6059
     60    /** Returns the VM name editor. */
     61    QLineEdit *nameEditor() const { return m_pEditorName; }
     62    /** Returns the VM location editor. */
     63    UIFilePathSelector *locationEditor() const { return m_pEditorLocation; }
     64
    6165    /** Returns the VM name. */
    6266    QString name() const;
    63     /** Returns path string selected by the user. */
    64     QString path() const;
    65 
    6667    /** Defines the VM @a strName. */
    6768    void setName(const QString &strName);
     
    8586    void sltTypeChanged(int iIndex);
    8687
    87  private:
     88private:
    8889
    8990    /** @name Prepare cascade.
     
    112113    bool                    m_fSupportsLongMode;
    113114
     115    /** Holds the VM name label instance. */
     116    QLabel                 *m_pLabelName;
    114117    /** Holds the VM OS family label instance. */
    115118    QLabel                 *m_pLabelFamily;
     
    118121    /** Holds the VM OS type icon instance. */
    119122    QLabel                 *m_pIconType;
    120 
    121     QLabel                 *m_pNamePathLabel;
    122     UIVMNamePathSelector   *m_pNamePathSelector;
     123    /** Holds the VM name editor instance. */
     124    QLineEdit              *m_pEditorName;
     125    /** Holds the VM location editor instance. */
     126    UIFilePathSelector     *m_pEditorLocation;
    123127    /** Holds the VM OS family combo instance. */
    124128    QComboBox              *m_pComboFamily;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIVMNamePathSelector.cpp

    r72173 r72174  
    2525
    2626/* GUI includes: */
    27 # include "QIFileDialog.h"
    2827# include "QILineEdit.h"
    2928# include "QILabel.h"
    30 # include "QIToolButton.h"
    31 # include "UIIconPool.h"
    3229# include "UIVMNamePathSelector.h"
    3330# include "VBoxGlobal.h"
     
    3835#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3936
     37
     38
    4039UIVMNamePathSelector::UIVMNamePathSelector(QWidget *pParent /* = 0 */)
    4140    : QIWithRetranslateUI<QWidget>(pParent)
     
    4443    , m_pName(0)
    4544    , m_pSeparator(0)
    46     ,m_pFileDialogButton(0)
    4745{
    4846    prepareWidgets();
    49     retranslateUi();
    5047}
    5148
     
    5552    CVirtualBox vbox = vboxGlobal().virtualBox();
    5653    /* Get default machine folder: */
    57     return vbox.GetSystemProperties().GetDefaultMachineFolder();
     54    /*const QString strDefaultMachineFolder = */return vbox.GetSystemProperties().GetDefaultMachineFolder();
    5855
    5956}
     
    6865    m_pMainLayout->setSpacing(0);
    6966    setLayout(m_pMainLayout);
    70 
    71     m_pFileDialogButton = new QIToolButton(this);
    72     if (m_pFileDialogButton)
    73     {
    74         m_pMainLayout->addWidget(m_pFileDialogButton);
    75         m_pFileDialogButton->setIcon(UIIconPool::iconSet(QString(":/sf_add_16px.png")));
    76         connect(m_pFileDialogButton, &QIToolButton::clicked, this, &UIVMNamePathSelector::sltOpenPathSelector);
    77     }
    7867
    7968    m_pPath = new QILineEdit;
     
    9584    {
    9685        m_pMainLayout->addWidget(m_pName);
    97         connect(m_pName, &QILineEdit::textChanged,
    98                 this, &UIVMNamePathSelector::sigNameChanged);
    99 
    10086    }
    10187
     
    135121void UIVMNamePathSelector::retranslateUi()
    136122{
    137     setToolTip(tr("The Virtual Machine files will be saved under ..."));
    138123}
    139 
    140 void UIVMNamePathSelector::sltOpenPathSelector()
    141 {
    142 
    143     QString strSelectedPath = QIFileDialog::getExistingDirectory(m_pPath->text(), this,
    144                                                                  QString("Select a parent folder for new Virtual Machine"));
    145     if (!strSelectedPath.isEmpty())
    146     {
    147         m_pPath->setText(strSelectedPath);
    148     }
    149 }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIVMNamePathSelector.h

    r72173 r72174  
    2929class QILabel;
    3030class QILineEdit;
    31 class QIToolButton;
     31
    3232
    3333class SHARED_LIBRARY_STUFF UIVMNamePathSelector : public QIWithRetranslateUI<QWidget>
     
    3636
    3737signals:
    38 
    39     void sigNameChanged(const QString &strName);
    4038
    4139public:
     
    5755private slots:
    5856
    59     void sltOpenPathSelector();
    6057
    6158private:
     
    6865    QILineEdit  *m_pName;
    6966    QILabel     *m_pSeparator;
    70     QIToolButton *m_pFileDialogButton;
    71 
    7267};
    7368
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp

    r72173 r72174  
    2525
    2626/* Local includes: */
    27 # include "QIRichTextLabel.h"
    28 # include "UIEmptyFilePathSelector.h"
    29 # include "UIFilePathSelector.h"
    3027# include "UIWizardImportAppPageBasic1.h"
    3128# include "UIWizardImportAppPageBasic2.h"
    3229# include "UIWizardImportApp.h"
    3330# include "VBoxGlobal.h"
    34 
    35 /* COM includes: */
    36 # include "CSystemProperties.h"
     31# include "UIEmptyFilePathSelector.h"
     32# include "QIRichTextLabel.h"
    3733
    3834#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    5854        pMainLayout->addWidget(m_pLabel);
    5955        pMainLayout->addWidget(m_pFileSelector);
    60 
    61 
    62         m_pDefaultFolderLabel = new QIRichTextLabel(this);
    63         if (m_pDefaultFolderLabel)
    64         {
    65             pMainLayout->addWidget(m_pDefaultFolderLabel);
    66         }
    67 
    68         m_pDestinationFolderSelector = new UIFilePathSelector(this);
    69         if (m_pDestinationFolderSelector)
    70         {
    71             m_pDestinationFolderSelector->setMode(UIFilePathSelector::Mode_Folder);
    72             pMainLayout->addWidget(m_pDestinationFolderSelector);
    73 
    74             m_pDestinationFolderSelector->setPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder());
    75             m_pDestinationFolderSelector->setResetEnabled(false);
    76         }
    77 
    7856        pMainLayout->addStretch();
    7957    }
     
    9270                                            "saved in the Open Virtualization Format (OVF). "
    9371                                            "To continue, select the file to import below.</p>"));
    94     m_pDefaultFolderLabel->setText(UIWizardImportApp::tr("Select a destionation folder for appliance"));
    9572    m_pFileSelector->setChooseButtonToolTip(UIWizardImportApp::tr("Choose a virtual appliance file to import..."));
    9673    m_pFileSelector->setFileDialogTitle(UIWizardImportApp::tr("Please choose a virtual appliance file to import"));
     
    130107    return pImportApplianceWidget->isValid();
    131108}
     109
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h

    r72173 r72174  
    2424/* Forward declarations: */
    2525class UIEmptyFilePathSelector;
    26 class UIFilePathSelector;
    2726class QIRichTextLabel;
    2827
     
    3736    /* Widgets: */
    3837    UIEmptyFilePathSelector *m_pFileSelector;
    39     QIRichTextLabel         *m_pDefaultFolderLabel;
    40     UIFilePathSelector      *m_pDestinationFolderSelector;
    4138};
    4239
     
    6865
    6966#endif /* __UIWizardImportAppPageBasic1_h__ */
     67
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r72173 r72174  
    217217bool UIWizardNewVMPage1::createMachineFolder()
    218218{
    219     if (!m_pNameAndSystemEditor)
    220         return false;
    221219    /* Cleanup previosly created folder if any: */
    222220    if (machineFolderCreated() && !cleanupMachineFolder())
     
    229227    CVirtualBox vbox = vboxGlobal().virtualBox();
    230228    /* Get default machine folder: */
    231     //const QString strMachineFolder = vbox.GetSystemProperties().GetDefaultMachineFolder();
    232 
     229    const QString strDefaultMachineFolder = vbox.GetSystemProperties().GetDefaultMachineFolder();
    233230    /* Compose machine filename: */
    234231    const QString strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(),
    235232                                                                   m_strGroup,
    236233                                                                   QString(),
    237                                                                    m_pNameAndSystemEditor->path());
     234                                                                   strDefaultMachineFolder);
    238235    /* Compose machine folder/basename: */
    239236    const QFileInfo fileInfo(strMachineFilePath);
     
    318315
    319316    /* Translate widgets: */
    320     m_pLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine "
     317    m_pLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name for the new virtual machine "
    321318                                        "and select the type of operating system you intend to install on it. "
    322319                                        "The name you choose will be used throughout VirtualBox "
     
    343340    return createMachineFolder();
    344341}
     342
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r72173 r72174  
    5858    QString m_strMachineBaseName;
    5959
    60     /** Provides a path selector and a line edit field for path and name entry. */
     60    /* Widgets: */
    6161    UINameAndSystemEditor *m_pNameAndSystemEditor;
    6262
    63     /** Variables: */
     63    /* Variables: */
    6464    QString m_strGroup;
    6565    bool m_fSupportsHWVirtEx;
     
    107107
    108108#endif // __UIWizardNewVMPageBasic1_h__
     109
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