GUI: Add check paths field to Project File -dialog.
This commit is contained in:
parent
aef0aeb974
commit
6a3bccae6f
|
@ -82,6 +82,8 @@ void Project::Edit()
|
|||
dlg.SetIncludepaths(includes);
|
||||
QStringList defines = mPFile->GetDefines();
|
||||
dlg.SetDefines(defines);
|
||||
QStringList paths = mPFile->GetCheckPaths();
|
||||
dlg.SetPaths(paths);
|
||||
int rv = dlg.exec();
|
||||
if (rv == QDialog::Accepted)
|
||||
{
|
||||
|
@ -89,6 +91,8 @@ void Project::Edit()
|
|||
mPFile->SetIncludes(includes);
|
||||
QStringList defines = dlg.GetDefines();
|
||||
mPFile->SetDefines(defines);
|
||||
QStringList paths = dlg.GetPaths();
|
||||
mPFile->SetCheckPaths(paths);
|
||||
bool writeSuccess = mPFile->Write();
|
||||
if (!writeSuccess)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,23 @@
|
|||
<string>Project File</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Paths:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>mEditPaths</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="mEditPaths"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
|
@ -73,6 +90,12 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>mEditPaths</tabstop>
|
||||
<tabstop>mEditIncludePaths</tabstop>
|
||||
<tabstop>mEditDefines</tabstop>
|
||||
<tabstop>mButtons</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
|
|
@ -63,6 +63,21 @@ QStringList ProjectFileDialog::GetDefines() const
|
|||
return defines;
|
||||
}
|
||||
|
||||
QStringList ProjectFileDialog::GetPaths() const
|
||||
{
|
||||
QString path = mUI.mEditPaths->text();
|
||||
QStringList paths;
|
||||
if (!path.isEmpty())
|
||||
{
|
||||
path = path.trimmed();
|
||||
if (path.indexOf(';') != -1)
|
||||
paths = path.split(";");
|
||||
else
|
||||
paths.append(path);
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
void ProjectFileDialog::SetIncludepaths(const QStringList &includes)
|
||||
{
|
||||
QString includestr;
|
||||
|
@ -92,3 +107,18 @@ void ProjectFileDialog::SetDefines(const QStringList &defines)
|
|||
definestr = definestr.left(definestr.length() - 1);
|
||||
mUI.mEditDefines->setText(definestr);
|
||||
}
|
||||
|
||||
void ProjectFileDialog::SetPaths(const QStringList &paths)
|
||||
{
|
||||
QString pathstr;
|
||||
QString path;
|
||||
foreach(path, paths)
|
||||
{
|
||||
pathstr += path;
|
||||
pathstr += ";";
|
||||
}
|
||||
// Remove ; from the end of the string
|
||||
if (pathstr.endsWith(';'))
|
||||
pathstr = pathstr.left(pathstr.length() - 1);
|
||||
mUI.mEditPaths->setText(pathstr);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,12 @@ public:
|
|||
*/
|
||||
QStringList GetDefines() const;
|
||||
|
||||
/**
|
||||
* @brief Return check paths from the dialog control.
|
||||
* @return List of check paths.
|
||||
*/
|
||||
QStringList GetPaths() const;
|
||||
|
||||
/**
|
||||
* @brief Set include paths to dialog control.
|
||||
* @param includes List of include paths to set to dialog control.
|
||||
|
@ -63,6 +69,12 @@ public:
|
|||
*/
|
||||
void SetDefines(const QStringList &defines);
|
||||
|
||||
/**
|
||||
* @brief Set check paths to dialog control.
|
||||
* @param paths List of path names to set to dialog control.
|
||||
*/
|
||||
void SetPaths(const QStringList &paths);
|
||||
|
||||
private:
|
||||
Ui::ProjectFile mUI;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue