- Timestamp:
- May 9, 2018 1:38:13 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122595
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r71463 r72173 1160 1160 QString strHomeFolder = fUseLastFolder && !strLastFolder.isEmpty() ? strLastFolder : 1161 1161 strDefaultFolder.isEmpty() ? vboxGlobal().homeFolder() : strDefaultFolder; 1162 1162 1163 1163 1164 /* Prepare filters and backends: */ … … 4676 4677 return true; 4677 4678 } 4678 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
r72154 r72173 32 32 # include <QPlainTextEdit> 33 33 # include <QTextCursor> 34 # include <QToolButton>35 34 # include <QRadioButton> 36 35 # include <QScrollArea> … … 79 78 virtual void mousePressEvent(QMouseEvent * event) /* override */; 80 79 virtual void mouseReleaseEvent(QMouseEvent *){} 81 virtual void paintEvent(QPaintEvent *event) ;80 virtual void paintEvent(QPaintEvent *event) /* override */; 82 81 83 82 private slots: … … 90 89 private: 91 90 92 void createButtons();93 Q ToolButton *m_pRemoveTermButton;94 Q ToolButton *m_pClearAllButton;95 const int m_iRemoveTermButtonSize;96 int m_iTrailingSpaceCount;91 void createButtons(); 92 QIToolButton *m_pRemoveTermButton; 93 QIToolButton *m_pClearAllButton; 94 const int m_iRemoveTermButtonSize; 95 int m_iTrailingSpaceCount; 97 96 }; 98 97 … … 197 196 if (!m_pRemoveTermButton) 198 197 { 199 m_pRemoveTermButton = new Q ToolButton(this);198 m_pRemoveTermButton = new QIToolButton(this); 200 199 if (m_pRemoveTermButton) 201 200 { 202 201 m_pRemoveTermButton->setIcon(m_pRemoveTermButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton)); 203 202 m_pRemoveTermButton->hide(); 204 connect(m_pRemoveTermButton, &Q ToolButton::clicked, this, &UIVMFilterLineEdit::sltRemoveFilterTerm);203 connect(m_pRemoveTermButton, &QIToolButton::clicked, this, &UIVMFilterLineEdit::sltRemoveFilterTerm); 205 204 } 206 205 } … … 208 207 if (!m_pClearAllButton) 209 208 { 210 m_pClearAllButton = new Q ToolButton(this);209 m_pClearAllButton = new QIToolButton(this); 211 210 if (m_pClearAllButton) 212 211 { 213 212 m_pClearAllButton->setIcon(m_pClearAllButton->style()->standardIcon(QStyle::SP_LineEditClearButton)); 214 connect(m_pClearAllButton, &Q ToolButton::clicked, this, &UIVMFilterLineEdit::sltClearAll);213 connect(m_pClearAllButton, &QIToolButton::clicked, this, &UIVMFilterLineEdit::sltClearAll); 215 214 } 216 215 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r71924 r72173 554 554 { 555 555 /* Configure widget: */ 556 m_pNameAndSystemEditor->nameEditor()->setValidator(new QRegExpValidator(QRegExp(".+"), this));556 //m_pNameAndSystemEditor->nameEditor()->setValidator(new QRegExpValidator(QRegExp(".+"), this)); 557 557 } 558 558 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r72101 r72173 668 668 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 669 669 pFileChooser->setMode(UIFilePathSelector::Mode_File_Save); 670 pFileChooser->setResetEnabled( false);670 pFileChooser->setResetEnabled(true); 671 671 pEditor = pFileChooser; 672 672 break; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
r71924 r72173 31 31 # include "UIFilePathSelector.h" 32 32 # include "UINameAndSystemEditor.h" 33 # include "UIVMNamePathSelector.h" 33 34 34 35 /* COM includes: */ … … 50 51 , m_fSupportsHWVirtEx(false) 51 52 , m_fSupportsLongMode(false) 52 , m_pLabelName(0)53 53 , m_pLabelFamily(0) 54 54 , m_pLabelType(0) 55 55 , m_pIconType(0) 56 , m_p EditorName(0)57 , m_p EditorLocation(0)56 , m_pNamePathLabel(0) 57 , m_pNamePathSelector(0) 58 58 , m_pComboFamily(0) 59 59 , m_pComboType(0) … … 65 65 QString UINameAndSystemEditor::name() const 66 66 { 67 if (!m_fChooseLocation) 68 return m_pEditorName->text(); 69 else 70 return m_pEditorLocation->path(); 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(); 71 77 } 72 78 73 79 void UINameAndSystemEditor::setName(const QString &strName) 74 80 { 75 if (!m_fChooseLocation) 76 m_pEditorName->setText(strName); 77 else 78 m_pEditorLocation->setPath(strName); 81 if (!m_pNamePathSelector) 82 return; 83 m_pNamePathSelector->setName(strName); 79 84 } 80 85 … … 112 117 void UINameAndSystemEditor::retranslateUi() 113 118 { 114 m_pLabelName->setText(tr("N&ame:"));115 119 m_pLabelFamily->setText(tr("&Type:")); 116 120 m_pLabelType->setText(tr("&Version:")); 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.")); 121 m_pNamePathLabel->setText(tr("Path/Name:")); 122 121 123 m_pComboFamily->setWhatsThis(tr("Selects the operating system family that " 122 124 "you plan to install into this virtual machine.")); … … 227 229 pMainLayout->setContentsMargins(0, 0, 0, 0); 228 230 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 } 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); 268 243 } 269 244 … … 325 300 pLayoutIcon->addWidget(m_pIconType); 326 301 } 327 328 302 /* Add stretch to sub-layout: */ 329 303 pLayoutIcon->addStretch(); … … 358 332 { 359 333 /* Prepare connections: */ 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); 334 connect(m_pNamePathSelector, &UIVMNamePathSelector::sigNameChanged, 335 this, &UINameAndSystemEditor::sigNameChanged); 366 336 connect(m_pComboFamily, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 367 337 this, &UINameAndSystemEditor::sltFamilyChanged); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h
r71924 r72173 36 36 class QString; 37 37 class UIFilePathSelector; 38 class UIVMNamePathSelector; 38 39 39 40 /** QWidget subclass providing complex editor for basic VM parameters. */ … … 58 59 UINameAndSystemEditor(QWidget *pParent, bool fChooseLocation = false); 59 60 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 65 61 /** Returns the VM name. */ 66 62 QString name() const; 63 /** Returns path string selected by the user. */ 64 QString path() const; 65 67 66 /** Defines the VM @a strName. */ 68 67 void setName(const QString &strName); … … 86 85 void sltTypeChanged(int iIndex); 87 86 88 private:87 private: 89 88 90 89 /** @name Prepare cascade. … … 113 112 bool m_fSupportsLongMode; 114 113 115 /** Holds the VM name label instance. */116 QLabel *m_pLabelName;117 114 /** Holds the VM OS family label instance. */ 118 115 QLabel *m_pLabelFamily; … … 121 118 /** Holds the VM OS type icon instance. */ 122 119 QLabel *m_pIconType; 123 /** Holds the VM name editor instance. */ 124 QLineEdit *m_pEditorName; 125 /** Holds the VM location editor instance. */ 126 UIFilePathSelector *m_pEditorLocation; 120 121 QLabel *m_pNamePathLabel; 122 UIVMNamePathSelector *m_pNamePathSelector; 127 123 /** Holds the VM OS family combo instance. */ 128 124 QComboBox *m_pComboFamily; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIVMNamePathSelector.cpp
r72136 r72173 25 25 26 26 /* GUI includes: */ 27 # include "QIFileDialog.h" 27 28 # include "QILineEdit.h" 28 29 # include "QILabel.h" 30 # include "QIToolButton.h" 31 # include "UIIconPool.h" 29 32 # include "UIVMNamePathSelector.h" 30 33 # include "VBoxGlobal.h" … … 35 38 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 36 39 37 38 39 40 UIVMNamePathSelector::UIVMNamePathSelector(QWidget *pParent /* = 0 */) 40 41 : QIWithRetranslateUI<QWidget>(pParent) … … 43 44 , m_pName(0) 44 45 , m_pSeparator(0) 46 ,m_pFileDialogButton(0) 45 47 { 46 48 prepareWidgets(); 49 retranslateUi(); 47 50 } 48 51 … … 52 55 CVirtualBox vbox = vboxGlobal().virtualBox(); 53 56 /* Get default machine folder: */ 54 /*const QString strDefaultMachineFolder = */return vbox.GetSystemProperties().GetDefaultMachineFolder();57 return vbox.GetSystemProperties().GetDefaultMachineFolder(); 55 58 56 59 } … … 65 68 m_pMainLayout->setSpacing(0); 66 69 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 } 67 78 68 79 m_pPath = new QILineEdit; … … 84 95 { 85 96 m_pMainLayout->addWidget(m_pName); 97 connect(m_pName, &QILineEdit::textChanged, 98 this, &UIVMNamePathSelector::sigNameChanged); 99 86 100 } 87 101 … … 121 135 void UIVMNamePathSelector::retranslateUi() 122 136 { 137 setToolTip(tr("The Virtual Machine files will be saved under ...")); 123 138 } 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
r72136 r72173 29 29 class QILabel; 30 30 class QILineEdit; 31 31 class QIToolButton; 32 32 33 33 class SHARED_LIBRARY_STUFF UIVMNamePathSelector : public QIWithRetranslateUI<QWidget> … … 36 36 37 37 signals: 38 39 void sigNameChanged(const QString &strName); 38 40 39 41 public: … … 55 57 private slots: 56 58 59 void sltOpenPathSelector(); 57 60 58 61 private: … … 65 68 QILineEdit *m_pName; 66 69 QILabel *m_pSeparator; 70 QIToolButton *m_pFileDialogButton; 71 67 72 }; 68 73 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
r70805 r72173 25 25 26 26 /* Local includes: */ 27 # include "QIRichTextLabel.h" 28 # include "UIEmptyFilePathSelector.h" 29 # include "UIFilePathSelector.h" 27 30 # include "UIWizardImportAppPageBasic1.h" 28 31 # include "UIWizardImportAppPageBasic2.h" 29 32 # include "UIWizardImportApp.h" 30 33 # include "VBoxGlobal.h" 31 # include "UIEmptyFilePathSelector.h" 32 # include "QIRichTextLabel.h" 34 35 /* COM includes: */ 36 # include "CSystemProperties.h" 33 37 34 38 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 54 58 pMainLayout->addWidget(m_pLabel); 55 59 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 56 78 pMainLayout->addStretch(); 57 79 } … … 70 92 "saved in the Open Virtualization Format (OVF). " 71 93 "To continue, select the file to import below.</p>")); 94 m_pDefaultFolderLabel->setText(UIWizardImportApp::tr("Select a destionation folder for appliance")); 72 95 m_pFileSelector->setChooseButtonToolTip(UIWizardImportApp::tr("Choose a virtual appliance file to import...")); 73 96 m_pFileSelector->setFileDialogTitle(UIWizardImportApp::tr("Please choose a virtual appliance file to import")); … … 107 130 return pImportApplianceWidget->isValid(); 108 131 } 109 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h
r69500 r72173 24 24 /* Forward declarations: */ 25 25 class UIEmptyFilePathSelector; 26 class UIFilePathSelector; 26 27 class QIRichTextLabel; 27 28 … … 36 37 /* Widgets: */ 37 38 UIEmptyFilePathSelector *m_pFileSelector; 39 QIRichTextLabel *m_pDefaultFolderLabel; 40 UIFilePathSelector *m_pDestinationFolderSelector; 38 41 }; 39 42 … … 65 68 66 69 #endif /* __UIWizardImportAppPageBasic1_h__ */ 67 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r71924 r72173 217 217 bool UIWizardNewVMPage1::createMachineFolder() 218 218 { 219 if (!m_pNameAndSystemEditor) 220 return false; 219 221 /* Cleanup previosly created folder if any: */ 220 222 if (machineFolderCreated() && !cleanupMachineFolder()) … … 227 229 CVirtualBox vbox = vboxGlobal().virtualBox(); 228 230 /* Get default machine folder: */ 229 const QString strDefaultMachineFolder = vbox.GetSystemProperties().GetDefaultMachineFolder(); 231 //const QString strMachineFolder = vbox.GetSystemProperties().GetDefaultMachineFolder(); 232 230 233 /* Compose machine filename: */ 231 234 const QString strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(), 232 235 m_strGroup, 233 236 QString(), 234 strDefaultMachineFolder);237 m_pNameAndSystemEditor->path()); 235 238 /* Compose machine folder/basename: */ 236 239 const QFileInfo fileInfo(strMachineFilePath); … … 315 318 316 319 /* Translate widgets: */ 317 m_pLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name for the new virtual machine "320 m_pLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine " 318 321 "and select the type of operating system you intend to install on it. " 319 322 "The name you choose will be used throughout VirtualBox " … … 340 343 return createMachineFolder(); 341 344 } 342 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r71027 r72173 58 58 QString m_strMachineBaseName; 59 59 60 /* Widgets:*/60 /** Provides a path selector and a line edit field for path and name entry. */ 61 61 UINameAndSystemEditor *m_pNameAndSystemEditor; 62 62 63 /* Variables: */63 /** Variables: */ 64 64 QString m_strGroup; 65 65 bool m_fSupportsHWVirtEx; … … 107 107 108 108 #endif // __UIWizardNewVMPageBasic1_h__ 109
Note:
See TracChangeset
for help on using the changeset viewer.