diff --git a/gui/project.cpp b/gui/project.cpp
index a6c1b1e6f..3503f799f 100644
--- a/gui/project.cpp
+++ b/gui/project.cpp
@@ -77,7 +77,8 @@ bool Project::Open()
void Project::Edit()
{
ProjectFileDialog dlg(mFilename, mParentWidget);
-
+ QString root = mPFile->GetRootPath();
+ dlg.SetRootPath(root);
QStringList includes = mPFile->GetIncludeDirs();
dlg.SetIncludepaths(includes);
QStringList defines = mPFile->GetDefines();
@@ -87,6 +88,8 @@ void Project::Edit()
int rv = dlg.exec();
if (rv == QDialog::Accepted)
{
+ QString root = dlg.GetRootPath();
+ mPFile->SetRootPath(root);
QStringList includes = dlg.GetIncludePaths();
mPFile->SetIncludes(includes);
QStringList defines = dlg.GetDefines();
diff --git a/gui/projectfile.ui b/gui/projectfile.ui
index a39ce006d..370b165b8 100644
--- a/gui/projectfile.ui
+++ b/gui/projectfile.ui
@@ -7,13 +7,30 @@
0
0
400
- 112
+ 131
Project File
+ -
+
+
-
+
+
+ Project:
+
+
+ mEditProjectRoot
+
+
+
+ -
+
+
+
+
-
-
@@ -91,6 +108,7 @@
+ mEditProjectRoot
mEditPaths
mEditIncludePaths
mEditDefines
diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp
index 181617340..08f7042c9 100644
--- a/gui/projectfiledialog.cpp
+++ b/gui/projectfiledialog.cpp
@@ -33,6 +33,13 @@ ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(accept()));
}
+QString ProjectFileDialog::GetRootPath() const
+{
+ QString root = mUI.mEditProjectRoot->text();
+ root = root.trimmed();
+ return root;
+}
+
QStringList ProjectFileDialog::GetIncludePaths() const
{
QString include = mUI.mEditIncludePaths->text();
@@ -78,6 +85,11 @@ QStringList ProjectFileDialog::GetPaths() const
return paths;
}
+void ProjectFileDialog::SetRootPath(const QString &root)
+{
+ mUI.mEditProjectRoot->setText(root);
+}
+
void ProjectFileDialog::SetIncludepaths(const QStringList &includes)
{
QString includestr;
diff --git a/gui/projectfiledialog.h b/gui/projectfiledialog.h
index aac13172a..783fbfb63 100644
--- a/gui/projectfiledialog.h
+++ b/gui/projectfiledialog.h
@@ -21,6 +21,7 @@
#include
#include
+#include
#include "ui_projectfile.h"
@@ -39,6 +40,12 @@ class ProjectFileDialog : public QDialog
public:
ProjectFileDialog(const QString &path, QWidget *parent = 0);
+ /**
+ * @brief Return project root path from the dialog control.
+ * @return Project root path.
+ */
+ QString GetRootPath() const;
+
/**
* @brief Return include paths from the dialog control.
* @return List of include paths.
@@ -57,6 +64,12 @@ public:
*/
QStringList GetPaths() const;
+ /**
+ * @brief Set project root path to dialog control.
+ * @param root Project root path to set to dialog control.
+ */
+ void SetRootPath(const QString &root);
+
/**
* @brief Set include paths to dialog control.
* @param includes List of include paths to set to dialog control.