--- Vago/trunk/Vago/converter.cpp 2014/01/08 11:32:55 897 +++ s10k/Vago/converter.cpp 2017/12/30 13:43:28 1092 @@ -7,6 +7,14 @@ Converter::Converter(QString AppDir, Log this->myData=myData; } +#ifdef Q_OS_WIN +Converter::Converter(QString AppDir, Logger *myLogger, QStringList *myData, QWinTaskbarProgress *win7TaskBarProgress) + : Converter(AppDir, myLogger, myData) +{ + this->win7TaskBarProgress = win7TaskBarProgress; +} +#endif + void Converter::run() { this->processHasKilled=false; @@ -15,12 +23,30 @@ void Converter::run() QString errorMessage = ""; int numErrors=0; + this->myLogger->writeString("Setting OniSplit process working dir to "+this->AppDir+"."); myProcess->setWorkingDirectory(this->AppDir); // Set working directory (for work with AEI2/Mac OS) +#ifdef Q_OS_WIN + if(this->win7TaskBarProgress){ + this->win7TaskBarProgress->reset(); + this->win7TaskBarProgress->show(); + } +#endif + if(this->myData->size()!=1){ +#ifdef Q_OS_WIN + if(this->win7TaskBarProgress){ + this->win7TaskBarProgress->setRange(0,this->myData->size()); + } +#endif emit setupPB(this->myData->size()); } else{ +#ifdef Q_OS_WIN + if(this->win7TaskBarProgress){ + this->win7TaskBarProgress->setRange(0,0); + } +#endif emit setupPB(0); //Intermitent bar, we don't have any estimation when the task is done } @@ -35,13 +61,21 @@ void Converter::run() nextIndex=commands.indexOf(GlobalVars::OniSplitProcSeparator,currentIndex+1); commandToExec=commands.mid(currentIndex,(nextIndex-currentIndex)); - this->myProcess->start(GlobalVars::OniSplitExeName+" "+commandToExec); + this->myProcess->start(UtilVago::getOniSplitExecutable() + " " + commandToExec); this->myProcess->waitForFinished(-1); if(this->processHasKilled){ // If the process has killed there's no need to proceed with reading output or process more commands + +#ifdef Q_OS_WIN + if(this->win7TaskBarProgress){ + this->win7TaskBarProgress->hide(); + } +#endif + delete this->myProcess; //delete object and make pointer invalid this->myData->clear(); //clean list emit conversionAborted(); + return; } @@ -60,9 +94,21 @@ void Converter::run() currentIndex=nextIndex+1; //update currentIndex +1 for start after the separator } +#ifdef Q_OS_WIN + if(this->win7TaskBarProgress){ + this->win7TaskBarProgress->setValue(win7TaskBarProgress->value()+1); + } +#endif + emit taskDone(); } +#ifdef Q_OS_WIN + if(this->win7TaskBarProgress){ + this->win7TaskBarProgress->hide(); + } +#endif + delete this->myProcess; //delete object and make pointer invalid this->myData->clear(); //clean list