ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/manualcommands.cpp
(Generate patch)

Comparing:
Vago/trunk/Vago/manualcommands.cpp (file contents), Revision 771 by s10k, Sun Mar 31 19:02:16 2013 UTC vs.
s10k/Vago/manualcommands.cpp (file contents), Revision 1093 by s10k, Sat Dec 30 13:57:32 2017 UTC

# Line 6 | Line 6 | ManualCommands::ManualCommands(QWidget *
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;
# Line 31 | Line 32 | void ManualCommands::on_pbInput_clicked(
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()){
47 <        Util::showErrorPopUp("Please input a command first.");
47 >        Util::Dialogs::showError("Please input a command first.");
48          return;
49      }
50  
# Line 59 | Line 69 | void ManualCommands::executeCommand(){
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() );
# Line 75 | Line 85 | void ManualCommands::on_pcCopyClipboard_
85  
86   void ManualCommands::on_pbClear_clicked()
87   {
88 <    if(Util::showQuestionPopUp(this,"Clear the output?")){
88 >    if(Util::Dialogs::showQuestion(this,"Clear the output?")){
89          ui->ptOutput->clear();
90      }
91   }
# Line 134 | Line 144 | bool ManualCommands::eventFilter(QObject
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){

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)