Changeset 103610 in vbox
- Timestamp:
- Feb 29, 2024 9:35:50 AM (9 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDefaultMachineFolderEditor.cpp
r102036 r103610 107 107 m_pLabel->setBuddy(m_pSelector); 108 108 m_pSelector->setInitialPath(uiCommon().homeFolder()); 109 connect(m_pSelector, &UIFilePathSelector::pathChanged, 110 this, &UIDefaultMachineFolderEditor::sigPathChanged); 109 111 110 112 m_pLayout->addWidget(m_pSelector, 0, 1); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDefaultMachineFolderEditor.h
r101011 r103610 45 45 Q_OBJECT; 46 46 47 signals: 48 49 /** Notify listeners about @a strPath changed. */ 50 void sigPathChanged(const QString &strPath); 51 47 52 public: 48 53 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
r101717 r103610 27 27 28 28 /* Qt includes: */ 29 #include <QDir> 29 30 #include <QVBoxLayout> 30 31 … … 123 124 if (m_pEditorVRDEAuthLibrary) 124 125 m_pEditorVRDEAuthLibrary->setValue(oldData.m_strVRDEAuthLibrary); 126 127 /* Revalidate: */ 128 revalidate(); 125 129 } 126 130 … … 154 158 } 155 159 160 bool UIGlobalSettingsGeneral::validate(QList<UIValidationMessage> &messages) 161 { 162 /* Pass by default: */ 163 bool fPass = true; 164 165 /* Prepare message: */ 166 UIValidationMessage message; 167 168 /* Check for the folder presence: */ 169 if ( m_pEditorDefaultMachineFolder 170 && !QDir(m_pEditorDefaultMachineFolder->value()).exists()) 171 { 172 message.second << tr("Default machine folder is missing."); 173 fPass = false; 174 } 175 176 /* Serialize message: */ 177 if (!message.second.isEmpty()) 178 messages << message; 179 180 /* Return result: */ 181 return fPass; 182 } 183 156 184 void UIGlobalSettingsGeneral::retranslateUi() 157 185 { … … 189 217 addEditor(m_pEditorDefaultMachineFolder); 190 218 pLayout->addWidget(m_pEditorDefaultMachineFolder); 219 connect(m_pEditorDefaultMachineFolder, &UIDefaultMachineFolderEditor::sigPathChanged, 220 this, &UIGlobalSettingsGeneral::revalidate); 191 221 } 192 222 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h
r101717 r103610 72 72 virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE; 73 73 74 /** Performs validation, updates @a messages list if something is wrong. */ 75 virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE; 76 74 77 /** Handles translation event. */ 75 78 virtual void retranslateUi() RT_OVERRIDE;
Note:
See TracChangeset
for help on using the changeset viewer.