Ignore:
Timestamp:
Dec 30, 2017, 2:57:32 PM (7 years ago)
Author:
s10k
Message:

Vago 1.4

Location:
s10k/Vago/packageWizard
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • s10k/Vago/packageWizard/packagepage2.cpp

    r1047 r1093  
    66const QString PackagePage2::CacheFile = "nodes.json";
    77
    8 PackagePage2::PackagePage2(Logger *myLogger, QWidget *parent) :
     8PackagePage2::PackagePage2(QWidget *parent) :
    99    QWizardPage(parent),
    1010    ui(new Ui::PackagePage2)
    1111{
    1212    ui->setupUi(this);
    13     this->myLogger=myLogger;
     13
    1414    this->setTitle("Mandatory Fields");
    1515
     
    3838    QString number=ui->lePackageNumber->text();
    3939
    40     bool emptyContent=Util::checkEmptySpaces(QStringList()<<modName<<authors<<version<<description<<number);
     40    bool emptyContent=Util::Validation::checkEmptySpaces(QStringList()<<modName<<authors<<version<<description<<number);
    4141
    4242
    4343    if(emptyContent){
    44         Util::showErrorPopUp("You need to fill all fields first!");
     44        Util::Dialogs::showError("You need to fill all fields first!");
    4545        return false;
    4646    }
    4747
    4848    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.");
    5050        return false;
    5151    }
    5252
    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.");
    5555        return false;
    5656    }
     
    6868    QString number = ui->lePackageNumber->text();
    6969
    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.");
    7272        return;
    7373    }
    7474
    7575    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.");
    7777        return;
    7878    }
    7979
    80     if(Util::isStringInteger(number)){
     80    if(Util::Validation::isStringInteger(number)){
    8181
    8282        bool necessaryToRedownload=false;
     
    108108    }
    109109    else{
    110         Util::showErrorPopUp("Number is not numeric.");
     110        Util::Dialogs::showError("Number is not numeric.");
    111111    }
    112112}
     
    124124
    125125        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.");
    127127            return;
    128128        }
     
    132132        //Let's extract the cache data
    133133        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.");
    135135        }
    136136
     
    139139    }
    140140    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());
    142142    }
    143143
     
    150150    QFile file(GlobalVars::VagoTemporaryDir+"/"+this->CacheFile); //let's read the chache unzipped
    151151    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.");
    153153        return;
    154154    }
     
    177177
    178178    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/>"+
    180180                                 existingModName+"<br/><br/>"+
    181181                                 "More information <a href='"+existingModUrl+"'>here</a>.");
    182182    }
    183183    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! :)");
    185185    }
    186186}
  • s10k/Vago/packageWizard/packagepage2.h

    r1047 r1093  
    2121   
    2222public:
    23     explicit PackagePage2(Logger *myLogger, QWidget *parent = 0);
     23    explicit PackagePage2(QWidget *parent = 0);
    2424
    2525    ~PackagePage2();
     
    3434private:
    3535    Ui::PackagePage2 *ui;
    36     Logger *myLogger;
    3736    static const QString ZipCacheFile;
    3837    static const QString CacheFile;
  • s10k/Vago/packageWizard/packagepage3.cpp

    r771 r1093  
    3333    if(!field.isEmpty()){
    3434
    35         QStringList list =Util::substring(field,",");
     35        QStringList list =Util::String::substring(field,",");
    3636
    3737        for(int i=0; i<list.size(); i++){
    3838
    3939            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.");
    4141                return false;
    4242            }
    4343
    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.");
    4646                return false;
    4747            }
     
    4949            if(!isLevels){
    5050                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.");
    5252                    return false;
    5353                }
  • s10k/Vago/packageWizard/packagepage4.cpp

    r799 r1093  
    6969
    7070    //Pre-processing (check if received only folders)
    71     foreach(QString myFile, resources){
     71    for(const QString &myFile : resources){
    7272        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.");
    7474            return;
    7575        }
     
    7878    QString type=ui->pbSwitchFiles->text().replace(" files","");
    7979
    80     foreach(QString currentFolder, resources){
     80    for(QString currentFolder: resources){
    8181
    82         currentFolder=Util::normalizePath(currentFolder); //normalize path
     82        currentFolder=Util::FileSystem::normalizePath(currentFolder); //normalize path
    8383
    8484        //Get actual number rows
     
    8989
    9090        //Add to table and list to
    91         QTableWidgetItem *newFolder = new QTableWidgetItem(Util::cutName(currentFolder));
     91        QTableWidgetItem *newFolder = new QTableWidgetItem(Util::FileSystem::cutName(currentFolder));
    9292        QTableWidgetItem *newType = new QTableWidgetItem(type);
    9393        QTableWidgetItem *newFullPath = new QTableWidgetItem(currentFolder);
     
    139139void PackagePage4::addTableContents(DropTableWidget *myTable){
    140140    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..."));
    142142    }
    143143    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..."));
    145145    }
    146146    else{
    147         addResourcesPackage(myTable,Util::multipleDirDialog("Choose folders with .oni-patch files..."));
     147        addResourcesPackage(myTable,Util::Dialogs::multipleDirSelection("Choose folders with .oni-patch files..."));
    148148    }
    149149}
     
    153153
    154154    if(size==0){
    155         Util::showPopUp("Select a row first.");
     155        Util::Dialogs::showInfo("Select a row first.");
    156156        return;
    157157    }
    158158
    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?")){
    160160        for(int i=0; i<size; i++){
    161161            myTable->removeRow(myTable->selectionModel()->selectedRows().at(size-i-1).row());
     
    166166bool PackagePage4::validatePage(){
    167167    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!");
    169169        return false;
    170170    }
  • s10k/Vago/packageWizard/packagewizard.cpp

    r1061 r1093  
    11#include "packagewizard.h"
    22
    3 PackageWizard::PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger)
    4     :AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, false)
     3PackageWizard::PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings)
     4    :AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, false)
    55{
    66    this->packagesLocation=this->workspaceWizardLocation+"/Packages";
     
    88
    99void PackageWizard::exec(){
    10     PackagePage2 *page2 = new PackagePage2(this->myLogger);
     10    PackagePage2 *page2 = new PackagePage2();
    1111    PackagePage3 *page3 = new PackagePage3();
    1212    PackagePage4 *page4 = new PackagePage4();
     
    5858    this->vagoSettings->setValue("PackageCreator/CreateZip",createZip);
    5959
    60     const QString packageName=packageNumber+Util::fullTrim(modName);
     60    const QString packageName=packageNumber+Util::String::fullTrim(modName);
    6161
    6262    // Start package creation...
     
    8888
    8989    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.");
    9191        return;
    9292    }
     
    124124    if(createZip){
    125125        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.");
    127127        }
    128128    }
     
    162162        }
    163163        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)
    165165
    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"
    167167                                                        "Copying from "+sourceFolder+"\n to "+path);
    168168        }
  • s10k/Vago/packageWizard/packagewizard.h

    r1061 r1093  
    2020    void beforeClose(QDialog::DialogCode resultStatus);
    2121protected:
    22     PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger);
     22    PackageWizard(const QString &appDir, QString workspaceWizardLocation, QSettings *vagoSettings);
    2323    void exec();
    2424};
Note: See TracChangeset for help on using the changeset viewer.