| 9 |
|
{ |
| 10 |
|
ui->setupUi(this); |
| 11 |
|
|
| 12 |
< |
this->AppDir=getOSIndependentAppPath(); |
| 12 |
> |
this->myLogger = new Logger(Util::getAppPath()); //start logger |
| 13 |
|
|
| 14 |
< |
this->myLogger = new Logger(this->AppDir); //start logger |
| 15 |
< |
|
| 16 |
< |
this->myLogger->writeString("Detected AppDir: "+this->AppDir); |
| 14 |
> |
this->myLogger->writeString("Detected AppDir: "+Util::getAppPath()); |
| 15 |
|
this->myLogger->writeString("True app dir: "+QDir::currentPath()); |
| 16 |
|
|
| 17 |
|
this->setWindowTitle("Vago v"+GlobalVars::AppVersion); |
| 18 |
|
|
| 19 |
< |
if(!QFile::exists(this->AppDir+"/"+GlobalVars::OniSplitString)){ |
| 19 |
> |
if(!QFile::exists(Util::getAppPath()+"/"+GlobalVars::OniSplitString)){ |
| 20 |
|
Util::showErrorPopUp("OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit."); |
| 21 |
|
exit(1); |
| 22 |
|
} |
| 23 |
|
|
| 24 |
< |
if(!QFile::exists(this->AppDir+"/"+GlobalVars::XmlToolsString)){ |
| 24 |
> |
if(!QFile::exists(Util::getAppPath()+"/"+GlobalVars::XmlToolsString)){ |
| 25 |
|
Util::showErrorPopUp("xmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit."); |
| 26 |
|
exit(1); |
| 27 |
|
} |
| 28 |
|
|
| 29 |
< |
this->vagoSettings = new QSettings(this->AppDir + "/" + this->VagoSettingsName, QSettings::IniFormat); |
| 29 |
> |
this->vagoSettings = new QSettings(Util::getAppPath() + "/" + this->VagoSettingsName, QSettings::IniFormat); |
| 30 |
|
|
| 31 |
|
//First Execution? Old configuration? Settings missed? |
| 32 |
|
bool iniChanged=false; |
| 35 |
|
iniChanged=true; |
| 36 |
|
} |
| 37 |
|
if(!this->vagoSettings->contains("Workspace")){ |
| 38 |
< |
this->vagoSettings->setValue("Workspace", this->AppDir+"/VagoWorkspace"); |
| 38 |
> |
this->vagoSettings->setValue("Workspace", Util::getAppPath()+"/VagoWorkspace"); |
| 39 |
|
iniChanged=true; |
| 40 |
|
} |
| 41 |
|
if(!this->vagoSettings->contains("AeFolder")){ |
| 118 |
|
this->listToProccess = new QStringList; |
| 119 |
|
|
| 120 |
|
//Create a thread for do the conversion in background |
| 121 |
< |
this->myConverter = new Converter(this->AppDir,this->myLogger,this->listToProccess); |
| 121 |
> |
this->myConverter = new Converter(Util::getAppPath(),this->myLogger,this->listToProccess); |
| 122 |
|
|
| 123 |
|
// User interface |
| 124 |
|
ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button |
| 186 |
|
|
| 187 |
|
void MainWindow::on_actionSound_Wizard_triggered() |
| 188 |
|
{ |
| 189 |
< |
SoundWizard myWizard (this->AppDir, this->workspaceWizardsLocation, this->myLogger, &this->commandMap); |
| 189 |
> |
SoundWizard myWizard (Util::getAppPath(), this->workspaceWizardsLocation, this->myLogger, &this->commandMap); |
| 190 |
|
myWizard.exec(); |
| 191 |
|
} |
| 192 |
|
|
| 1186 |
|
void MainWindow::on_actionCheck_OniSplit_version_triggered() |
| 1187 |
|
{ |
| 1188 |
|
QProcess *myProcess = new QProcess(); |
| 1189 |
< |
myProcess->setWorkingDirectory(this->AppDir); |
| 1190 |
< |
myProcess->start(GlobalVars::OniSplitExeName+" -version"); |
| 1189 |
> |
myProcess->setWorkingDirectory(Util::getAppPath()); |
| 1190 |
> |
myProcess->start(Util::getOniSplitExeName()+" -version"); |
| 1191 |
|
myProcess->waitForFinished(-1); |
| 1192 |
|
QString result=myProcess->readAllStandardOutput(); |
| 1193 |
|
delete myProcess; |
| 1197 |
|
void MainWindow::on_actionCheck_xmlTools_version_triggered() |
| 1198 |
|
{ |
| 1199 |
|
QProcess *myProcess = new QProcess(); |
| 1200 |
< |
myProcess->setWorkingDirectory(this->AppDir); |
| 1201 |
< |
myProcess->start(GlobalVars::XmlToolsExeName+" version"); |
| 1200 |
> |
myProcess->setWorkingDirectory(Util::getAppPath()); |
| 1201 |
> |
myProcess->start(Util::getXmlToolsExeName()+" version"); |
| 1202 |
|
myProcess->waitForFinished(-1); |
| 1203 |
|
QString result=myProcess->readLine(); |
| 1204 |
|
delete myProcess; |
| 1570 |
|
ui->pbConvertMisc->setMinimumHeight(height); |
| 1571 |
|
} |
| 1572 |
|
|
| 1575 |
– |
/** |
| 1576 |
– |
Gets application directory. In mac os gets the .app directory |
| 1577 |
– |
**/ |
| 1578 |
– |
QString MainWindow::getOSIndependentAppPath(){ |
| 1579 |
– |
#ifdef Q_OS_MAC |
| 1580 |
– |
QDir dir = QDir(QCoreApplication::applicationDirPath()); |
| 1581 |
– |
if(dir.absolutePath().contains(".app")){ // include bundle, but we don't want it |
| 1582 |
– |
dir.cdUp(); |
| 1583 |
– |
dir.cdUp(); |
| 1584 |
– |
dir.cdUp(); |
| 1585 |
– |
} |
| 1586 |
– |
return dir.absolutePath(); |
| 1587 |
– |
#else |
| 1588 |
– |
return QDir::currentPath(); |
| 1589 |
– |
#endif |
| 1590 |
– |
} |
| 1591 |
– |
|
| 1573 |
|
void MainWindow::connectSlots(){ |
| 1574 |
|
|
| 1575 |
|
//This signal is for thread that is working setup the progress bar (make it visible and set it's min-max) |