Changeset 1093 for s10k/Vago/packageWizard
- Timestamp:
- Dec 30, 2017, 2:57:32 PM (7 years ago)
- Location:
- s10k/Vago/packageWizard
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
s10k/Vago/packageWizard/packagepage2.cpp
r1047 r1093 6 6 const QString PackagePage2::CacheFile = "nodes.json"; 7 7 8 PackagePage2::PackagePage2( Logger *myLogger,QWidget *parent) :8 PackagePage2::PackagePage2(QWidget *parent) : 9 9 QWizardPage(parent), 10 10 ui(new Ui::PackagePage2) 11 11 { 12 12 ui->setupUi(this); 13 this->myLogger=myLogger; 13 14 14 this->setTitle("Mandatory Fields"); 15 15 … … 38 38 QString number=ui->lePackageNumber->text(); 39 39 40 bool emptyContent=Util:: checkEmptySpaces(QStringList()<<modName<<authors<<version<<description<<number);40 bool emptyContent=Util::Validation::checkEmptySpaces(QStringList()<<modName<<authors<<version<<description<<number); 41 41 42 42 43 43 if(emptyContent){ 44 Util:: showErrorPopUp("You need to fill all fields first!");44 Util::Dialogs::showError("You need to fill all fields first!"); 45 45 return false; 46 46 } 47 47 48 48 if(number.size()!=5){ 49 Util:: showErrorPopUp("Invalid number format. It should contain 5 numbers.");49 Util::Dialogs::showError("Invalid number format. It should contain 5 numbers."); 50 50 return false; 51 51 } 52 52 53 if(!Util:: isStringInteger(number)){54 Util:: showErrorPopUp("Number is not numeric.");53 if(!Util::Validation::isStringInteger(number)){ 54 Util::Dialogs::showError("Number is not numeric."); 55 55 return false; 56 56 } … … 68 68 QString number = ui->lePackageNumber->text(); 69 69 70 if(Util:: checkEmptySpaces(QStringList(number))){71 Util:: showErrorPopUp("Number is empty. Please fill it first.");70 if(Util::Validation::checkEmptySpaces(QStringList(number))){ 71 Util::Dialogs::showError("Number is empty. Please fill it first."); 72 72 return; 73 73 } 74 74 75 75 if(number.size()!=5){ 76 Util:: showErrorPopUp("Invalid number format. It should contain 5 numeric characters.");76 Util::Dialogs::showError("Invalid number format. It should contain 5 numeric characters."); 77 77 return; 78 78 } 79 79 80 if(Util:: isStringInteger(number)){80 if(Util::Validation::isStringInteger(number)){ 81 81 82 82 bool necessaryToRedownload=false; … … 108 108 } 109 109 else{ 110 Util:: showErrorPopUp("Number is not numeric.");110 Util::Dialogs::showError("Number is not numeric."); 111 111 } 112 112 } … … 124 124 125 125 if(!file.open(QIODevice::WriteOnly)){ 126 UtilVago::showAndLogErrorPopUp( this->myLogger,"Error fetching package data: creating cache file.");126 UtilVago::showAndLogErrorPopUp("Error fetching package data: creating cache file."); 127 127 return; 128 128 } … … 132 132 //Let's extract the cache data 133 133 if(JlCompress::extractFile(GlobalVars::VagoTemporaryDir+"/"+this->ZipCacheFile, "/"+this->CacheFile ,GlobalVars::VagoTemporaryDir+"/"+this->CacheFile).isEmpty()){ 134 UtilVago::showAndLogErrorPopUp( this->myLogger,"An error occurred while unzipping the package data.");134 UtilVago::showAndLogErrorPopUp("An error occurred while unzipping the package data."); 135 135 } 136 136 … … 139 139 } 140 140 else{ 141 UtilVago::showAndLogErrorPopUpLogButton( this->myLogger,"An error occurred checking number availability:\n\n"+result->errorString());141 UtilVago::showAndLogErrorPopUpLogButton("An error occurred checking number availability:\n\n"+result->errorString()); 142 142 } 143 143 … … 150 150 QFile file(GlobalVars::VagoTemporaryDir+"/"+this->CacheFile); //let's read the chache unzipped 151 151 if(!file.open(QIODevice::ReadOnly)){ 152 UtilVago::showAndLogErrorPopUp( this->myLogger,"Error reading downloaded package cache data.");152 UtilVago::showAndLogErrorPopUp("Error reading downloaded package cache data."); 153 153 return; 154 154 } … … 177 177 178 178 if(!existingModName.isEmpty()){ 179 Util:: showRichErrorPopUp("Package "+packageNumber+" is already being used by the following mod:<br/><br/>"+179 Util::Dialogs::showRichError("Package "+packageNumber+" is already being used by the following mod:<br/><br/>"+ 180 180 existingModName+"<br/><br/>"+ 181 181 "More information <a href='"+existingModUrl+"'>here</a>."); 182 182 } 183 183 else{ 184 Util:: showPopUp("It seems that the package number " + packageNumber + " is not being used yet! :)");184 Util::Dialogs::showInfo("It seems that the package number " + packageNumber + " is not being used yet! :)"); 185 185 } 186 186 } -
s10k/Vago/packageWizard/packagepage2.h
r1047 r1093 21 21 22 22 public: 23 explicit PackagePage2( Logger *myLogger,QWidget *parent = 0);23 explicit PackagePage2(QWidget *parent = 0); 24 24 25 25 ~PackagePage2(); … … 34 34 private: 35 35 Ui::PackagePage2 *ui; 36 Logger *myLogger;37 36 static const QString ZipCacheFile; 38 37 static const QString CacheFile; -
s10k/Vago/packageWizard/packagepage3.cpp
r771 r1093 33 33 if(!field.isEmpty()){ 34 34 35 QStringList list =Util:: substring(field,",");35 QStringList list =Util::String::substring(field,","); 36 36 37 37 for(int i=0; i<list.size(); i++){ 38 38 39 39 if(list.at(i).isEmpty()){ 40 Util:: showErrorPopUp("There are commas without numbers in their sides.");40 Util::Dialogs::showError("There are commas without numbers in their sides."); 41 41 return false; 42 42 } 43 43 44 if(!Util:: isStringInteger(list.at(i))){45 Util:: showErrorPopUp("Number is not numeric.");44 if(!Util::Validation::isStringInteger(list.at(i))){ 45 Util::Dialogs::showError("Number is not numeric."); 46 46 return false; 47 47 } … … 49 49 if(!isLevels){ 50 50 if(list.at(i).size()!=5){ 51 Util:: showErrorPopUp("You have invalid packages numbers. Each number must have 5 digits.");51 Util::Dialogs::showError("You have invalid packages numbers. Each number must have 5 digits."); 52 52 return false; 53 53 } -
s10k/Vago/packageWizard/packagepage4.cpp
r799 r1093 69 69 70 70 //Pre-processing (check if received only folders) 71 for each(QString myFile,resources){71 for(const QString &myFile : resources){ 72 72 if(!QDir(myFile).exists()){ 73 Util:: showErrorPopUp("Only folders are allowed for this operation.");73 Util::Dialogs::showError("Only folders are allowed for this operation."); 74 74 return; 75 75 } … … 78 78 QString type=ui->pbSwitchFiles->text().replace(" files",""); 79 79 80 for each(QString currentFolder,resources){80 for(QString currentFolder: resources){ 81 81 82 currentFolder=Util:: normalizePath(currentFolder); //normalize path82 currentFolder=Util::FileSystem::normalizePath(currentFolder); //normalize path 83 83 84 84 //Get actual number rows … … 89 89 90 90 //Add to table and list to 91 QTableWidgetItem *newFolder = new QTableWidgetItem(Util:: cutName(currentFolder));91 QTableWidgetItem *newFolder = new QTableWidgetItem(Util::FileSystem::cutName(currentFolder)); 92 92 QTableWidgetItem *newType = new QTableWidgetItem(type); 93 93 QTableWidgetItem *newFullPath = new QTableWidgetItem(currentFolder); … … 139 139 void PackagePage4::addTableContents(DropTableWidget *myTable){ 140 140 if(ui->pbSwitchFiles->text()==".oni files"){ 141 addResourcesPackage(myTable,Util:: multipleDirDialog("Choose folders with .oni files..."));141 addResourcesPackage(myTable,Util::Dialogs::multipleDirSelection("Choose folders with .oni files...")); 142 142 } 143 143 else if(ui->pbSwitchFiles->text()==".bsl files"){ 144 addResourcesPackage(myTable,Util:: multipleDirDialog("Choose folders with .bsl files..."));144 addResourcesPackage(myTable,Util::Dialogs::multipleDirSelection("Choose folders with .bsl files...")); 145 145 } 146 146 else{ 147 addResourcesPackage(myTable,Util:: multipleDirDialog("Choose folders with .oni-patch files..."));147 addResourcesPackage(myTable,Util::Dialogs::multipleDirSelection("Choose folders with .oni-patch files...")); 148 148 } 149 149 } … … 153 153 154 154 if(size==0){ 155 Util:: showPopUp("Select a row first.");155 Util::Dialogs::showInfo("Select a row first."); 156 156 return; 157 157 } 158 158 159 if(Util:: showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){159 if(Util::Dialogs::showQuestion(this,"Are you sure you want to delete the selected rows?")){ 160 160 for(int i=0; i<size; i++){ 161 161 myTable->removeRow(myTable->selectionModel()->selectedRows().at(size-i-1).row()); … … 166 166 bool PackagePage4::validatePage(){ 167 167 if(ui->twCommon->rowCount()==0 && ui->twWindows->rowCount()==0 && ui->twMac->rowCount()==0){ 168 Util:: showErrorPopUp("You need to add some folders with resources first!");168 Util::Dialogs::showError("You need to add some folders with resources first!"); 169 169 return false; 170 170 } -
s10k/Vago/packageWizard/packagewizard.cpp
r1061 r1093 1 1 #include "packagewizard.h" 2 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 5 { 6 6 this->packagesLocation=this->workspaceWizardLocation+"/Packages"; … … 8 8 9 9 void PackageWizard::exec(){ 10 PackagePage2 *page2 = new PackagePage2( this->myLogger);10 PackagePage2 *page2 = new PackagePage2(); 11 11 PackagePage3 *page3 = new PackagePage3(); 12 12 PackagePage4 *page4 = new PackagePage4(); … … 58 58 this->vagoSettings->setValue("PackageCreator/CreateZip",createZip); 59 59 60 const QString packageName=packageNumber+Util:: fullTrim(modName);60 const QString packageName=packageNumber+Util::String::fullTrim(modName); 61 61 62 62 // Start package creation... … … 88 88 89 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 91 return; 92 92 } … … 124 124 if(createZip){ 125 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 127 } 128 128 } … … 162 162 } 163 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 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 167 "Copying from "+sourceFolder+"\n to "+path); 168 168 } -
s10k/Vago/packageWizard/packagewizard.h
r1061 r1093 20 20 void beforeClose(QDialog::DialogCode resultStatus); 21 21 protected: 22 PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings , Logger *myLogger);22 PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings); 23 23 void exec(); 24 24 };
Note:
See TracChangeset
for help on using the changeset viewer.