| 1 |  | #include "manualcommands.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 |  | #include "ui_manualcommands.h" | 
 
 
 
 
 
 
 
 | 3 | + | #include <QDebug> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 4 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 5 |  | ManualCommands::ManualCommands(QWidget *parent) : | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 6 |  | QMainWindow(parent), | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 |  | this->setAttribute(Qt::WA_DeleteOnClose,true); //destroy itself once finished. | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 |  | this->myProcess = new QProcess(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 12 |  | this->myProcess->setProcessChannelMode(QProcess::MergedChannels); | 
 
 
 
 
 
 
 
 | 13 | + | this->myProcess->setWorkingDirectory(Util::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 14 |  | ui->leManualCommand->installEventFilter(this); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 15 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 16 |  | this->nextInsertHistoryIdx=0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 61 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 62 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 63 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 64 | < | this->myProcess->start(GlobalVars::OniSplitExeName+" "+ui->leManualCommand->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 64 | > | QString var = Util::getOniSplitExeName() +" "+ui->leManualCommand->text(); | 
 
 
 
 
 | 65 | > |  | 
 
 
 
 
 | 66 | > | this->myProcess->start(Util::getOniSplitExeName()+" "+ui->leManualCommand->text()); | 
 
 
 
 
 
 
 
 
 
 
 | 67 |  | this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 68 |  | ui->ptOutput->appendPlainText("> "+command); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 |  | ui->ptOutput->appendPlainText(this->myProcess->readAll()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 138 |  | if(this->searchHistoryIdx!=this->nextInsertHistoryIdx-1 && //for when it didn't the round | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 139 |  | !(this->nextInsertHistoryIdx==0 && this->searchHistoryIdx==this->limHistory-1)){ //for when it did the round | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 140 |  | this->searchHistoryIdx++; | 
 
 
 
 
 
 
 
 
 
 
 | 141 | < | } | 
 
 
 
 
 
 
 
 
 | 141 | > | } | 
 
 
 
 
 
 
 
 
 
 
 | 142 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 143 |  | //rotate | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 144 |  | if(this->searchHistoryIdx < 0){ |