| 1 |
|
#include "packagewizard.h" |
| 2 |
|
|
| 3 |
< |
PackageWizard::PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger) |
| 4 |
< |
:AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, false) |
| 3 |
> |
PackageWizard::PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings) |
| 4 |
> |
:AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, false) |
| 5 |
|
{ |
| 6 |
|
this->packagesLocation=this->workspaceWizardLocation+"/Packages"; |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
void PackageWizard::exec(){ |
| 10 |
< |
PackagePage2 *page2 = new PackagePage2(this->myLogger); |
| 10 |
> |
PackagePage2 *page2 = new PackagePage2(); |
| 11 |
|
PackagePage3 *page3 = new PackagePage3(); |
| 12 |
|
PackagePage4 *page4 = new PackagePage4(); |
| 13 |
|
this->page4Pointer = page4; // save the pointer in class variable |
| 57 |
|
this->vagoSettings->setValue("PackageCreator/OpenFolder",openFolder); |
| 58 |
|
this->vagoSettings->setValue("PackageCreator/CreateZip",createZip); |
| 59 |
|
|
| 60 |
< |
const QString packageName=packageNumber+Util::fullTrim(modName); |
| 60 |
> |
const QString packageName=packageNumber+Util::String::fullTrim(modName); |
| 61 |
|
|
| 62 |
|
// Start package creation... |
| 63 |
|
|
| 87 |
|
QFile modInfo(modDir+"Mod_Info.cfg"); |
| 88 |
|
|
| 89 |
|
if (!modInfo.open(QIODevice::WriteOnly | QIODevice::Text)){ //open to write |
| 90 |
< |
UtilVago::showAndLogErrorPopUp(this->myLogger, "Couldn't create Mod_Info.cfg file when creating AE Package."); |
| 90 |
> |
UtilVago::showAndLogErrorPopUp("Couldn't create Mod_Info.cfg file when creating AE Package."); |
| 91 |
|
return; |
| 92 |
|
} |
| 93 |
|
|
| 123 |
|
|
| 124 |
|
if(createZip){ |
| 125 |
|
if(!JlCompress::compressDir(this->packagesLocation+"/"+packageName+".zip", modDir)){ |
| 126 |
< |
UtilVago::showAndLogErrorPopUp(this->myLogger, "An error occurred while zipping the package."); |
| 126 |
> |
UtilVago::showAndLogErrorPopUp("An error occurred while zipping the package."); |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
|
| 161 |
|
} |
| 162 |
|
} |
| 163 |
|
QDir().mkpath(path); //create path if doesn't exist |
| 164 |
< |
if(!Util::copyDir(sourceFolder,path,false)){//copy contents (creates dest destination automatically if not exists yet) |
| 164 |
> |
if(!Util::FileSystem::copyDir(sourceFolder,path,false)){//copy contents (creates dest destination automatically if not exists yet) |
| 165 |
|
|
| 166 |
< |
UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error occurred while copying the folder/files to the package folder: \n" |
| 166 |
> |
UtilVago::showAndLogErrorPopUpLogButton("An error occurred while copying the folder/files to the package folder: \n" |
| 167 |
|
"Copying from "+sourceFolder+"\n to "+path); |
| 168 |
|
} |
| 169 |
|
} |