GUI: Set initial path for adding paths to project.
Use project file's location as base path when adding new paths (checked, included or ignored) to the project. In most cases user wants to add paths in the same project so this reduces browsing paths considerably when adding them.
This commit is contained in:
parent
0b0d890bd2
commit
3dc87be0af
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
|
, mFilePath(path)
|
||||||
{
|
{
|
||||||
mUI.setupUi(this);
|
mUI.setupUi(this);
|
||||||
|
|
||||||
|
@ -187,9 +188,11 @@ void ProjectFileDialog::SetIgnorePaths(const QStringList &paths)
|
||||||
|
|
||||||
void ProjectFileDialog::AddIncludeDir()
|
void ProjectFileDialog::AddIncludeDir()
|
||||||
{
|
{
|
||||||
|
QFileInfo inf(mFilePath);
|
||||||
|
const QString rootpath = inf.absolutePath();
|
||||||
QString selectedDir = QFileDialog::getExistingDirectory(this,
|
QString selectedDir = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Select include directory"),
|
tr("Select include directory"),
|
||||||
QString());
|
rootpath);
|
||||||
|
|
||||||
if (!selectedDir.isEmpty())
|
if (!selectedDir.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -199,9 +202,11 @@ void ProjectFileDialog::AddIncludeDir()
|
||||||
|
|
||||||
void ProjectFileDialog::AddPath()
|
void ProjectFileDialog::AddPath()
|
||||||
{
|
{
|
||||||
|
QFileInfo inf(mFilePath);
|
||||||
|
const QString rootpath = inf.absolutePath();
|
||||||
QString selectedDir = QFileDialog::getExistingDirectory(this,
|
QString selectedDir = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Select directory to check"),
|
tr("Select a directory to check"),
|
||||||
QString());
|
rootpath);
|
||||||
|
|
||||||
if (!selectedDir.isEmpty())
|
if (!selectedDir.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -237,9 +242,12 @@ void ProjectFileDialog::RemovePath()
|
||||||
|
|
||||||
void ProjectFileDialog::AddIgnorePath()
|
void ProjectFileDialog::AddIgnorePath()
|
||||||
{
|
{
|
||||||
|
QFileInfo inf(mFilePath);
|
||||||
|
const QString rootpath = inf.absolutePath();
|
||||||
|
|
||||||
QString selectedDir = QFileDialog::getExistingDirectory(this,
|
QString selectedDir = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Select directory to ignore"),
|
tr("Select directory to ignore"),
|
||||||
QString());
|
rootpath);
|
||||||
|
|
||||||
if (!selectedDir.isEmpty())
|
if (!selectedDir.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,6 +171,11 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ProjectFile mUI;
|
Ui::ProjectFile mUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Projectfile path.
|
||||||
|
*/
|
||||||
|
QString mFilePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
Loading…
Reference in New Issue