# # # patch "MonotoneThread.cpp" # from [0363d27105d7e6e21dfc57795daf3653530cd7b5] # to [912ff26be8be97522e5c733fe40969b52867fcd9] # # patch "MonotoneThread.h" # from [7e2fa231c46b06ccea13cf85d92a035f7cc5de08] # to [239946ac9d1bbe53129a40e97c0ae3b292941628] # # patch "test.cpp" # from [2e56517014b8cb86c7b786f1f75c13203c1cc46a] # to [56d10690b8d91dfcd000a9c5fe604d54eab3f11d] # # patch "test.ui" # from [b2a46ced3e70c2fa341ae1e2e52ab100f9572c5d] # to [88ffed0d1832c280871ea42179af6e8d309f87eb] # ============================================================ --- MonotoneThread.cpp 0363d27105d7e6e21dfc57795daf3653530cd7b5 +++ MonotoneThread.cpp 912ff26be8be97522e5c733fe40969b52867fcd9 @@ -54,6 +54,13 @@ void MonotoneTask::init(const QList("MonotoneTask"); + initialized = true; + } } QList MonotoneTask::stringToByteArrayList(const QStringList & list) @@ -108,9 +115,7 @@ MonotoneThread::MonotoneThread(const QSt MonotoneThread::MonotoneThread(const QString & mtn, const QString & database, const QString & workspace) : QThread(), doAbort(false), mtnBinary(mtn), databasePath(database), workspacePath(workspace) -{ - qRegisterMetaType("MonotoneTask"); -} +{} MonotoneThread::~MonotoneThread() {} ============================================================ --- MonotoneThread.h 7e2fa231c46b06ccea13cf85d92a035f7cc5de08 +++ MonotoneThread.h 239946ac9d1bbe53129a40e97c0ae3b292941628 @@ -35,11 +35,12 @@ public: MonotoneTask(const QList &); MonotoneTask(const QList &, const QList &); - QByteArray getEncodedInput() const; - void setOutput(const QByteArray & out) { output = out; } void setReturnCode(int code) { returnCode = code; } + QByteArray getEncodedInput() const; + QList getArguments() const { return arguments; } + QList getOptions() const { return options; } QByteArray getOutput() const { return output; } QString getOutputUtf8() const { return QString::fromUtf8(output); } bool getReturnCode() const { return returnCode; } ============================================================ --- test.cpp 2e56517014b8cb86c7b786f1f75c13203c1cc46a +++ test.cpp 56d10690b8d91dfcd000a9c5fe604d54eab3f11d @@ -24,7 +24,7 @@ TestDlg::TestDlg() : QDialog(0) { setupUi(this); - mtn = new MonotoneThread("mtn", "../guitone.mtn", "."); + mtn = new MonotoneThread("mtn", "~/Entwicklung/guitone.mtn", "."); mtn->start(); connect( @@ -53,8 +53,21 @@ void TestDlg::execute() void TestDlg::execute() { QStringList in = input->text().split(" "); + if (outputasinput->isChecked()) + { + QString out = output->toPlainText(); + if (splitoutput->isChecked()) + { + in << out.split("\n"); + } + else + { + in << out; + } + } + MonotoneTask task(in); - mtn->enqueueTask(in); + mtn->enqueueTask(task); } void TestDlg::finished(const MonotoneTask & task) @@ -65,6 +78,7 @@ void TestDlg::threadAborted(const QStrin void TestDlg::threadAborted(const QString & err) { error->setText(err); + mtn->start(); } void TestDlg::accept() ============================================================ --- test.ui b2a46ced3e70c2fa341ae1e2e52ab100f9572c5d +++ test.ui 88ffed0d1832c280871ea42179af6e8d309f87eb @@ -39,6 +39,23 @@ + + + use output + + + + + + + false + + + split + + + + exec @@ -51,10 +68,18 @@ - + + + false + + - + + + false + + @@ -105,8 +130,8 @@ accept() - 436 - 394 + 522 + 442 301 @@ -114,5 +139,21 @@ + + outputasinput + toggled(bool) + splitoutput + setEnabled(bool) + + + 289 + 26 + + + 377 + 35 + + +