mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:43:35 +02:00
Can select temporary folder.
This commit is contained in:
parent
5cffdafd22
commit
0728794e38
3 changed files with 32 additions and 3 deletions
|
@ -93,7 +93,7 @@ void Nitpick::setup() {
|
||||||
if (_testRunnerMobile) {
|
if (_testRunnerMobile) {
|
||||||
delete _testRunnerMobile;
|
delete _testRunnerMobile;
|
||||||
}
|
}
|
||||||
_testRunnerMobile = new TestRunnerMobile();
|
_testRunnerMobile = new TestRunnerMobile(_ui.workingFolderRunOnMobileLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Nitpick::startTestsEvaluation(const bool isRunningFromCommandLine,
|
void Nitpick::startTestsEvaluation(const bool isRunningFromCommandLine,
|
||||||
|
@ -324,4 +324,5 @@ void Nitpick::appendLogWindow(const QString& message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Nitpick::on_setWorkingFolderRunOnMobileButton_clicked() {
|
void Nitpick::on_setWorkingFolderRunOnMobileButton_clicked() {
|
||||||
|
_testRunnerMobile->setWorkingFolder();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,29 @@
|
||||||
#include "Nitpick.h"
|
#include "Nitpick.h"
|
||||||
extern Nitpick* nitpick;
|
extern Nitpick* nitpick;
|
||||||
|
|
||||||
TestRunnerMobile::TestRunnerMobile(QObject* parent) : QObject(parent) {
|
TestRunnerMobile::TestRunnerMobile(QLabel* workingFolderLabel, QObject* parent) : QObject(parent) {
|
||||||
|
_workingFolderLabel = workingFolderLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestRunnerMobile::~TestRunnerMobile() {
|
TestRunnerMobile::~TestRunnerMobile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestRunnerMobile::setWorkingFolder() {
|
||||||
|
// Everything will be written to this folder
|
||||||
|
QString previousSelection = _workingFolder;
|
||||||
|
QString parent = previousSelection.left(previousSelection.lastIndexOf('/'));
|
||||||
|
if (!parent.isNull() && parent.right(1) != "/") {
|
||||||
|
parent += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
_workingFolder = QFileDialog::getExistingDirectory(nullptr, "Please select a temporary folder for installation", parent,
|
||||||
|
QFileDialog::ShowDirsOnly);
|
||||||
|
|
||||||
|
// If user canceled then restore previous selection and return
|
||||||
|
if (_workingFolder == "") {
|
||||||
|
_workingFolder = previousSelection;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_workingFolderLabel->setText(QDir::toNativeSeparators(_workingFolder));
|
||||||
|
}
|
|
@ -10,12 +10,19 @@
|
||||||
|
|
||||||
#ifndef hifi_testRunnerMobile_h
|
#ifndef hifi_testRunnerMobile_h
|
||||||
#define hifi_testRunnerMobile_h
|
#define hifi_testRunnerMobile_h
|
||||||
|
#include <QLabel>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class TestRunnerMobile : public QObject {
|
class TestRunnerMobile : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TestRunnerMobile(QObject* parent = 0);
|
explicit TestRunnerMobile(QLabel* workingFolderLabel, QObject* parent = 0);
|
||||||
~TestRunnerMobile();
|
~TestRunnerMobile();
|
||||||
|
|
||||||
|
void setWorkingFolder();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QLabel* _workingFolderLabel;
|
||||||
|
QString _workingFolder;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue