--- s10k/Vago/packageWizard/packagepage2.cpp 2017/12/30 13:43:28 1092 +++ s10k/Vago/packageWizard/packagepage2.cpp 2017/12/30 13:57:32 1093 @@ -5,12 +5,12 @@ const QString PackagePage2::ZipCacheFile const QString PackagePage2::PackagesCacheUrl = "http://mods.oni2.net/jsoncache/"+ZipCacheFile; const QString PackagePage2::CacheFile = "nodes.json"; -PackagePage2::PackagePage2(Logger *myLogger, QWidget *parent) : +PackagePage2::PackagePage2(QWidget *parent) : QWizardPage(parent), ui(new Ui::PackagePage2) { ui->setupUi(this); - this->myLogger=myLogger; + this->setTitle("Mandatory Fields"); //Register fields to be accessible in another pages //Not using mandatory field, it would require empty verification too... @@ -37,21 +37,21 @@ bool PackagePage2::validatePage(){ QString description=ui->ptDescription->toPlainText(); QString number=ui->lePackageNumber->text(); - bool emptyContent=Util::checkEmptySpaces(QStringList()<lePackageNumber->text(); - if(Util::checkEmptySpaces(QStringList(number))){ - Util::showErrorPopUp("Number is empty. Please fill it first."); + if(Util::Validation::checkEmptySpaces(QStringList(number))){ + Util::Dialogs::showError("Number is empty. Please fill it first."); return; } if(number.size()!=5){ - Util::showErrorPopUp("Invalid number format. It should contain 5 numeric characters."); + Util::Dialogs::showError("Invalid number format. It should contain 5 numeric characters."); return; } - if(Util::isStringInteger(number)){ + if(Util::Validation::isStringInteger(number)){ bool necessaryToRedownload=false; @@ -107,7 +107,7 @@ void PackagePage2::on_pbCheck_clicked() } } else{ - Util::showErrorPopUp("Number is not numeric."); + Util::Dialogs::showError("Number is not numeric."); } } @@ -123,7 +123,7 @@ void PackagePage2::downloadPackagesCache } if(!file.open(QIODevice::WriteOnly)){ - UtilVago::showAndLogErrorPopUp(this->myLogger, "Error fetching package data: creating cache file."); + UtilVago::showAndLogErrorPopUp("Error fetching package data: creating cache file."); return; } file.write(result->readAll()); @@ -131,14 +131,14 @@ void PackagePage2::downloadPackagesCache //Let's extract the cache data if(JlCompress::extractFile(GlobalVars::VagoTemporaryDir+"/"+this->ZipCacheFile, "/"+this->CacheFile ,GlobalVars::VagoTemporaryDir+"/"+this->CacheFile).isEmpty()){ - UtilVago::showAndLogErrorPopUp(this->myLogger, "An error occurred while unzipping the package data."); + UtilVago::showAndLogErrorPopUp("An error occurred while unzipping the package data."); } checkForPackagesInCache(); } else{ - UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error occurred checking number availability:\n\n"+result->errorString()); + UtilVago::showAndLogErrorPopUpLogButton("An error occurred checking number availability:\n\n"+result->errorString()); } result->deleteLater(); @@ -149,7 +149,7 @@ void PackagePage2::checkForPackagesInCac QFile file(GlobalVars::VagoTemporaryDir+"/"+this->CacheFile); //let's read the chache unzipped if(!file.open(QIODevice::ReadOnly)){ - UtilVago::showAndLogErrorPopUp(this->myLogger, "Error reading downloaded package cache data."); + UtilVago::showAndLogErrorPopUp("Error reading downloaded package cache data."); return; } //Read file cache to ram @@ -176,12 +176,12 @@ void PackagePage2::checkForPackagesInCac } if(!existingModName.isEmpty()){ - Util::showRichErrorPopUp("Package "+packageNumber+" is already being used by the following mod:

"+ + Util::Dialogs::showRichError("Package "+packageNumber+" is already being used by the following mod:

"+ existingModName+"

"+ "More information here."); } else{ - Util::showPopUp("It seems that the package number " + packageNumber + " is not being used yet! :)"); + Util::Dialogs::showInfo("It seems that the package number " + packageNumber + " is not being used yet! :)"); } }