| 6 |
|
ui(new Ui::ManualCommands) |
| 7 |
|
{ |
| 8 |
|
ui->setupUi(this); |
| 9 |
< |
this->setAttribute(Qt::WA_DeleteOnClose,true); //destroy itself once finished. |
| 9 |
> |
this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished. |
| 10 |
|
this->myProcess = new QProcess(); |
| 11 |
|
this->myProcess->setProcessChannelMode(QProcess::MergedChannels); |
| 12 |
+ |
this->myProcess->setWorkingDirectory(UtilVago::getAppPath()); |
| 13 |
|
ui->leManualCommand->installEventFilter(this); |
| 14 |
|
|
| 15 |
|
this->nextInsertHistoryIdx=0; |
| 32 |
|
|
| 33 |
|
void ManualCommands::executeCommand(){ |
| 34 |
|
|
| 35 |
+ |
QString toolExecutable; |
| 36 |
+ |
|
| 37 |
+ |
if(ui->cbTargetTool->currentText() == "OniSplit"){ |
| 38 |
+ |
toolExecutable = UtilVago::getOniSplitExecutable(); |
| 39 |
+ |
} |
| 40 |
+ |
else{ |
| 41 |
+ |
toolExecutable = UtilVago::getXmlToolsExecutable(); |
| 42 |
+ |
} |
| 43 |
+ |
|
| 44 |
|
QString command=ui->leManualCommand->text().trimmed(); |
| 45 |
|
|
| 46 |
|
if(command.isEmpty()){ |
| 69 |
|
} |
| 70 |
|
} |
| 71 |
|
|
| 72 |
< |
this->myProcess->start(GlobalVars::OniSplitExeName+" "+ui->leManualCommand->text()); |
| 72 |
> |
this->myProcess->start(toolExecutable+" "+ui->leManualCommand->text()); |
| 73 |
|
this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum |
| 74 |
< |
ui->ptOutput->appendPlainText("> "+command); |
| 74 |
> |
ui->ptOutput->appendPlainText("> " + ui->cbTargetTool->currentText() + " " + command); |
| 75 |
|
ui->ptOutput->appendPlainText(this->myProcess->readAll()); |
| 76 |
|
ui->ptOutput->ensureCursorVisible(); |
| 77 |
|
ui->ptOutput->verticalScrollBar()->setValue( ui->ptOutput->verticalScrollBar()->maximum() ); |
| 144 |
|
if(this->searchHistoryIdx!=this->nextInsertHistoryIdx-1 && //for when it didn't the round |
| 145 |
|
!(this->nextInsertHistoryIdx==0 && this->searchHistoryIdx==this->limHistory-1)){ //for when it did the round |
| 146 |
|
this->searchHistoryIdx++; |
| 147 |
< |
} |
| 147 |
> |
} |
| 148 |
|
|
| 149 |
|
//rotate |
| 150 |
|
if(this->searchHistoryIdx < 0){ |