--- Vago/trunk/Vago/manualcommands.cpp 2013/03/31 19:02:16 771 +++ s10k/Vago/manualcommands.cpp 2017/12/30 13:57:32 1093 @@ -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,10 +32,19 @@ 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()){ - Util::showErrorPopUp("Please input a command first."); + Util::Dialogs::showError("Please input a command first."); return; } @@ -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() ); @@ -75,7 +85,7 @@ void ManualCommands::on_pcCopyClipboard_ void ManualCommands::on_pbClear_clicked() { - if(Util::showQuestionPopUp(this,"Clear the output?")){ + if(Util::Dialogs::showQuestion(this,"Clear the output?")){ ui->ptOutput->clear(); } } @@ -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){