forked from qt-creator/qt-creator
Utils: add default file path to string aspect
Change-Id: Ia3df289b0b2dc59f6e7098332c21a335dce207f1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -874,6 +874,11 @@ void StringAspect::setFilePath(const FilePath &value)
|
|||||||
setValue(value.toUserOutput());
|
setValue(value.toUserOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StringAspect::setDefaultFilePath(const FilePath &value)
|
||||||
|
{
|
||||||
|
setDefaultValue(value.toUserOutput());
|
||||||
|
}
|
||||||
|
|
||||||
PathChooser *StringAspect::pathChooser() const
|
PathChooser *StringAspect::pathChooser() const
|
||||||
{
|
{
|
||||||
return d->m_pathChooserDisplay.data();
|
return d->m_pathChooserDisplay.data();
|
||||||
@@ -1085,6 +1090,9 @@ void StringAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
d->m_pathChooserDisplay->setEnvironmentChange(d->m_environmentChange);
|
d->m_pathChooserDisplay->setEnvironmentChange(d->m_environmentChange);
|
||||||
d->m_pathChooserDisplay->setBaseDirectory(d->m_baseFileName);
|
d->m_pathChooserDisplay->setBaseDirectory(d->m_baseFileName);
|
||||||
d->m_pathChooserDisplay->setOpenTerminalHandler(d->m_openTerminal);
|
d->m_pathChooserDisplay->setOpenTerminalHandler(d->m_openTerminal);
|
||||||
|
if (defaultValue() == value())
|
||||||
|
d->m_pathChooserDisplay->setDefaultValue(defaultValue().toString());
|
||||||
|
else
|
||||||
d->m_pathChooserDisplay->setFilePath(FilePath::fromUserInput(displayedString));
|
d->m_pathChooserDisplay->setFilePath(FilePath::fromUserInput(displayedString));
|
||||||
d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data());
|
d->updateWidgetFromCheckStatus(this, d->m_pathChooserDisplay.data());
|
||||||
addLabeledItem(builder, d->m_pathChooserDisplay);
|
addLabeledItem(builder, d->m_pathChooserDisplay);
|
||||||
|
|||||||
@@ -421,6 +421,7 @@ public:
|
|||||||
|
|
||||||
Utils::FilePath filePath() const;
|
Utils::FilePath filePath() const;
|
||||||
void setFilePath(const Utils::FilePath &value);
|
void setFilePath(const Utils::FilePath &value);
|
||||||
|
void setDefaultFilePath(const Utils::FilePath &value);
|
||||||
|
|
||||||
PathChooser *pathChooser() const; // Avoid to use.
|
PathChooser *pathChooser() const; // Avoid to use.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user