--- Vago/trunk/Vago/manualcommands.cpp 2013/03/31 19:02:16 771 +++ Vago/trunk/Vago/manualcommands.cpp 2016/10/30 14:42:39 1058 @@ -6,9 +6,10 @@ ManualCommands::ManualCommands(QWidget * ui(new Ui::ManualCommands) { ui->setupUi(this); - this->setAttribute(Qt::WA_DeleteOnClose,true); //destroy itself once finished. + this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished. this->myProcess = new QProcess(); this->myProcess->setProcessChannelMode(QProcess::MergedChannels); + this->myProcess->setWorkingDirectory(UtilVago::getAppPath()); ui->leManualCommand->installEventFilter(this); this->nextInsertHistoryIdx=0; @@ -31,6 +32,15 @@ void ManualCommands::on_pbInput_clicked( void ManualCommands::executeCommand(){ + QString toolExecutable; + + if(ui->cbTargetTool->currentText() == "OniSplit"){ + toolExecutable = UtilVago::getOniSplitExecutable(); + } + else{ + toolExecutable = UtilVago::getXmlToolsExecutable(); + } + QString command=ui->leManualCommand->text().trimmed(); if(command.isEmpty()){ @@ -59,9 +69,9 @@ void ManualCommands::executeCommand(){ } } - this->myProcess->start(GlobalVars::OniSplitExeName+" "+ui->leManualCommand->text()); + this->myProcess->start(toolExecutable+" "+ui->leManualCommand->text()); this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum - ui->ptOutput->appendPlainText("> "+command); + ui->ptOutput->appendPlainText("> " + ui->cbTargetTool->currentText() + " " + command); ui->ptOutput->appendPlainText(this->myProcess->readAll()); ui->ptOutput->ensureCursorVisible(); ui->ptOutput->verticalScrollBar()->setValue( ui->ptOutput->verticalScrollBar()->maximum() ); @@ -134,7 +144,7 @@ bool ManualCommands::eventFilter(QObject if(this->searchHistoryIdx!=this->nextInsertHistoryIdx-1 && //for when it didn't the round !(this->nextInsertHistoryIdx==0 && this->searchHistoryIdx==this->limHistory-1)){ //for when it did the round this->searchHistoryIdx++; - } + } //rotate if(this->searchHistoryIdx < 0){