Changeset 1093 for s10k


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

Vago 1.4

Location:
s10k/Vago
Files:
3 added
7 deleted
49 edited

Legend:

Unmodified
Added
Removed
  • s10k/Vago/Vago.pro

    r1061 r1093  
    1212}
    1313CONFIG   += c++14
     14CONFIG   += quazip
    1415
    1516INCLUDEPATH += ./packageWizard
     
    2021INCLUDEPATH += ./windowMessagesWizard
    2122
     23include(../CommonUtils/CommonUtils.pri)
     24include(../CommonLibs/CommonLibs.pri)
     25
    2226# Used this great tutorial to build zlib and quazip:
    2327# http://www.antonioborondo.com/2014/10/22/zipping-and-unzipping-files-with-qt/
    24 INCLUDEPATH += ../Libs/zlib-1.2.8
    25 LIBS += -L../Libs/zlib-1.2.8 -lz
    26 INCLUDEPATH += ../Libs/quazip-0.7.2/quazip
    27 win32 {
    28 LIBS += -L../Libs/quazip-0.7.2/quazip/release -lquazip
    29 }
    30 macx {
    31 LIBS += -L../Libs/quazip-0.7.2/quazip -lquazip
    32 }
    3328
    3429macx {
     
    3934INCLUDEPATH += ./libs/DropTableWidget
    4035INCLUDEPATH += ./libs/DropLineEdit
    41 INCLUDEPATH += ../Libs/pugixml
    4236
    4337win32 {
     
    4943
    5044SOURCES += \
    51     util.cpp \
    5245    preferences.cpp \
    5346    manualcommands.cpp \
    5447    mainwindow.cpp \
    5548    main.cpp \
    56     logger.cpp \
    5749    converter.cpp \
    5850    about.cpp \
     
    7567    bgImageWizard/bgimagepagefinal.cpp \
    7668    xmlToolsInterface/xmltoolsinterface.cpp \
    77     libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp \
    7869    xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp \
    79     libs/LineNumberDisplay/LineNumberDisplay.cpp \
    8070    abstractwizard.cpp \
    8171    windowMessagesWizard/wmsetuppage.cpp \
     
    8676    ./libs/DropTableWidget/droptablewidget.cpp \
    8777    ./libs/DropLineEdit/droplineedit.cpp \
    88     ../Libs/pugixml/pugixml.cpp
     78    xmlParsers/projectfilevago.cpp
    8979
    9080HEADERS  += \
    91     util.h \
    9281    preferences.h \
    9382    manualcommands.h \
    9483    mainwindow.h \
    95     logger.h \
    9684    converter.h \
    9785    about.h \
     
    114102    bgImageWizard/bgimagepagefinal.h \
    115103    xmlToolsInterface/xmltoolsinterface.h \
    116     libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h \
    117104    xmlToolsInterface/xmltoolsinterfacecommandpreview.h \
    118     libs/LineNumberDisplay/LineNumberDisplay.h \
    119105    wizardfactory.h \
    120106    abstractwizard.h \
     
    126112    ./libs/DropTableWidget/droptablewidget.h \
    127113    ./libs/DropLineEdit/droplineedit.h \
    128     ../Libs/pugixml/pugixml.hpp
     114    xmlParsers/projectfilevago.h
    129115
    130116FORMS    += \
  • s10k/Vago/abstractwizard.cpp

    r1061 r1093  
    11#include "abstractwizard.h"
    22
    3 AbstractWizard::AbstractWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, const bool hasRestartButton)
     3AbstractWizard::AbstractWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, const bool hasRestartButton)
    44{
    55    this->appDir = appDir;
    66    this->workspaceWizardLocation=workspaceWizardLocation;
    77    this->vagoSettings=vagoSettings;
    8     this->myLogger=myLogger;
    98    this->hasRestartButton = hasRestartButton;
    109    this->myWizard.setWindowFlags(Qt::Window); // add minimize button in QWizard
  • s10k/Vago/abstractwizard.h

    r1061 r1093  
    11#ifndef ABSTRACTWIZARD_H
    22#define ABSTRACTWIZARD_H
    3 
    4 #include "logger.h"
    53
    64#include <QLabel>
     
    2422    QString workspaceWizardLocation;
    2523        QSettings *vagoSettings;
    26         Logger *myLogger;
    2724    QString appDir;
    2825protected:
    29     AbstractWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, const bool hasRestartButton);
     26    AbstractWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, const bool hasRestartButton);
    3027    virtual void exec()=0;
    3128        void showWizard(const QString &windowsTitle, const QString &windowsIcon);
  • s10k/Vago/bgImageWizard/bgimagepage2.cpp

    r1058 r1093  
    22#include "ui_bgimagepage2.h"
    33
    4 BGImagePage2::BGImagePage2(Logger *myLogger, QWidget *parent) :
     4BGImagePage2::BGImagePage2(QWidget *parent) :
    55    QWizardPage(parent),
    66    ui(new Ui::BGImagePage2)
    77{
    88    ui->setupUi(this);
    9     this->myLogger = myLogger;
    109
    1110    this->setTitle("Image to use as background");
     
    4645bool BGImagePage2::validateField(QString &field){
    4746    if(field.isEmpty()){
    48         Util::showErrorPopUp("You need to choose an image.");
     47        Util::Dialogs::showError("You need to choose an image.");
    4948        return false;
    5049    }
     
    6665        QImage myImage;
    6766        if(!myImage.load(selectedImage)){
    68             UtilVago::showAndLogErrorPopUp(this->myLogger,"Couldn't load image '" + Util::cutNameWithoutBackSlash(selectedImage) + "'. Is the image corrupt?");
     67            UtilVago::showAndLogErrorPopUp("Couldn't load image '" + Util::FileSystem::cutNameWithoutBackSlash(selectedImage) + "'. Is the image corrupt?");
    6968            return;
    7069        }
    7170
    7271        if(myImage.width() < 256 || myImage.height() < 256){
    73             UtilVago::showAndLogErrorPopUp(this->myLogger,"Image '" + Util::cutNameWithoutBackSlash(selectedImage) +
     72            UtilVago::showAndLogErrorPopUp("Image '" + Util::FileSystem::cutNameWithoutBackSlash(selectedImage) +
    7473                                           "' does not have a width and height >= 256.");
    7574            return;
  • s10k/Vago/bgImageWizard/bgimagepage2.h

    r1054 r1093  
    44#include <QWizardPage>
    55#include <QBitmap>
     6#include <QDateTime>
    67
    78#include "utilvago.h"
    8 #include "logger.h"
    99
    1010namespace Ui {
     
    1717   
    1818public:
    19     explicit BGImagePage2(Logger *myLogger, QWidget *parent = 0);
     19    explicit BGImagePage2(QWidget *parent = 0);
    2020    ~BGImagePage2();
    2121   
     
    2424
    2525private:
    26     Logger *myLogger;
    2726
    2827    Ui::BGImagePage2 *ui;
  • s10k/Vago/bgImageWizard/bgimagepage3.cpp

    r1058 r1093  
    5252void BGImagePage3::on_leLevelId_textChanged(const QString &arg1)
    5353{
    54     if(!arg1.isEmpty() && !Util::isStringInteger(arg1)){
    55         Util::showErrorPopUp("Level id must be a number.");
     54    if(!arg1.isEmpty() && !Util::Validation::isStringInteger(arg1)){
     55        Util::Dialogs::showError("Level id must be a number.");
    5656        ui->leLevelId->clear();
    5757        return;
     
    136136
    137137    if(ui->leImageName->text().trimmed().isEmpty()){
    138         Util::showErrorPopUp("You need to input a name to the image!");
     138        Util::Dialogs::showError("You need to input a name to the image!");
    139139        return false;
    140140    }
    141141
    142142    if(ui->cbCreateTXMB->isChecked() && ui->leTXMBName->text().trimmed().isEmpty()){
    143         Util::showErrorPopUp("You need to input a name to the TXMB file!");
     143        Util::Dialogs::showError("You need to input a name to the TXMB file!");
    144144        return false;
    145145    }
  • s10k/Vago/bgImageWizard/bgimagepagefinal.cpp

    r1058 r1093  
    22#include "ui_BGImagePageFinal.h"
    33
    4 BGImagePageFinal::BGImagePageFinal(QString appDir, Logger *myLogger, QString bgImagesLocation, QWidget *parent) :
     4BGImagePageFinal::BGImagePageFinal(QString appDir, QString bgImagesLocation, QWidget *parent) :
    55    QWizardPage(parent),
    66    ui(new Ui::BGImagePageFinal)
     
    88    ui->setupUi(this);
    99    this->appDir = appDir;
    10     this->myLogger = myLogger;
    1110    this->bgImagesLocation = bgImagesLocation;
    1211    this->oniSplitCommands = new QStringList();
    13     this->myOniSplitConverter = new Converter(this->appDir, this->myLogger, this->oniSplitCommands);
     12    this->myOniSplitConverter = new Converter(this->appDir, this->oniSplitCommands);
    1413
    1514    ui->lbComplete->setText("<html>The wizard is now complete. The images have been created. "
     
    6564
    6665        for(const QString &currentFile : imagesSplitted){
    67             this->oniSplitCommands->append("-create:txmp " + Util::insertQuotes(this->bgImagesLocation) + " -format:bgr32 " + Util::insertQuotes(currentFile));
     66            this->oniSplitCommands->append("-create:txmp " + Util::String::insertQuotes(this->bgImagesLocation) + " -format:bgr32 " + Util::String::insertQuotes(currentFile));
    6867        }
    6968
     
    7776            if(txmbXmlFile.isEmpty())
    7877            {
    79                 UtilVago::showAndLogErrorPopUp(this->myLogger, "Couldn't create TXMB xml file!");
     78                UtilVago::showAndLogErrorPopUp("Couldn't create TXMB xml file!");
    8079                return;
    8180            }
     
    8382            // Create TXMB oni files
    8483            this->oniSplitCommands->clear();
    85             this->oniSplitCommands->append("-create " + Util::insertQuotes(this->bgImagesLocation) + " " + Util::insertQuotes(txmbXmlFile));
     84            this->oniSplitCommands->append("-create " + Util::String::insertQuotes(this->bgImagesLocation) + " " + Util::String::insertQuotes(txmbXmlFile));
    8685            this->myOniSplitConverter->start();
    8786            this->myOniSplitConverter->wait();
     
    109108    {
    110109        QFileInfo currImageFile(currSplittedImage);
    111         texturesNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(currImageFile.baseName()));
    112     }
    113 
    114     txmbNode.append_attribute("id").set_value(Util::qStrToCstr(levelId));
    115 
    116     if(!doc.save_file(Util::qStrToCstr(filePath))){
     110        texturesNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(currImageFile.baseName()));
     111    }
     112
     113    txmbNode.append_attribute("id").set_value(QSTR_TO_CSTR(levelId));
     114
     115    if(!doc.save_file(QSTR_TO_CSTR(filePath))){
    117116        return "";
    118117    }
     
    148147
    149148            if(!dividedImage.save(imageDestinationPath)){
    150                 UtilVago::showAndLogErrorPopUp(this->myLogger, "Couldn't save image " + imageDestinationPath + "! Files weren't created correctly.");
     149                UtilVago::showAndLogErrorPopUp("Couldn't save image " + imageDestinationPath + "! Files weren't created correctly.");
    151150                return QList<QString>();
    152151            }
  • s10k/Vago/bgImageWizard/bgimagepagefinal.h

    r1061 r1093  
    44#include <QWizardPage>
    55#include <QImage>
    6 #include <pugixml.hpp>
     6#include <pugixml/pugixml.hpp>
    77
    88#include "utilvago.h"
     
    1818
    1919public:
    20     explicit BGImagePageFinal(QString appDir, Logger *myLogger, QString bgImagesLocation, QWidget *parent = 0);
     20    explicit BGImagePageFinal(QString appDir, QString bgImagesLocation, QWidget *parent = 0);
    2121    ~BGImagePageFinal();
    2222
     
    2525    QString appDir;
    2626    QString bgImagesLocation;
    27     Logger *myLogger;
    2827    Converter *myOniSplitConverter;
    2928    QStringList *oniSplitCommands;
  • s10k/Vago/bgImageWizard/bgimagewizard.cpp

    r1061 r1093  
    11#include "bgimagewizard.h"
    22
    3 BGImageWizard::BGImageWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger)
    4 :AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, true)
     3BGImageWizard::BGImageWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings)
     4:AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, true)
    55{
    66    this->appDir = appDir;
    77    this->workspaceWizardLocation=workspaceWizardLocation;
    88    this->vagoSettings=vagoSettings;
    9     this->myLogger=myLogger;
    109    this->bgImagesLocation=this->workspaceWizardLocation+"/BGImages";
    1110}
     
    1312void BGImageWizard::exec(){
    1413
    15     BGImagePage2 *page2 = new BGImagePage2(this->myLogger);
     14    BGImagePage2 *page2 = new BGImagePage2();
    1615    BGImagePage3 *page3 = new BGImagePage3();
    17     BGImagePageFinal *pageFinal = new BGImagePageFinal(this->appDir, this->myLogger, this->bgImagesLocation);
     16    BGImagePageFinal *pageFinal = new BGImagePageFinal(this->appDir, this->bgImagesLocation);
    1817
    1918    this->myWizard.addPage
  • s10k/Vago/bgImageWizard/bgimagewizard.h

    r1061 r1093  
    1111{
    1212protected:
    13     BGImageWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger);
     13    BGImageWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings);
    1414    void exec();
    1515private:
  • s10k/Vago/converter.cpp

    r1054 r1093  
    11#include "converter.h"
    22
    3 Converter::Converter(QString AppDir, Logger *myLogger, QStringList *myData)
     3Converter::Converter(QString AppDir, QStringList *myData)
    44{
    55    this->AppDir=AppDir;
    6     this->myLogger=myLogger;
    76    this->myData=myData;
    87}
    98
    109#ifdef Q_OS_WIN
    11 Converter::Converter(QString AppDir, Logger *myLogger, QStringList *myData, QWinTaskbarProgress *win7TaskBarProgress)
    12     : Converter(AppDir, myLogger, myData)
     10Converter::Converter(QString AppDir, QStringList *myData, QWinTaskbarProgress *win7TaskBarProgress)
     11    : Converter(AppDir, myData)
    1312{
    1413    this->win7TaskBarProgress = win7TaskBarProgress;
     
    1817void Converter::run()
    1918{
    20     this->processHasKilled=false;
    21     this->myProcess = new QProcess();
     19    this->myProcess = std::make_unique<QProcess>();
    2220    QString result = QString();
    2321    QString errorMessage = "";
    2422    int numErrors=0;
    2523
    26     this->myLogger->writeString("Setting OniSplit process working dir to "+this->AppDir+".");
    27     myProcess->setWorkingDirectory(this->AppDir); // Set working directory (for work with AEI2/Mac OS)
     24    this->myProcess->setWorkingDirectory(this->AppDir); // Set working directory (for work with AEI2/Mac OS)
     25
     26    LOG_INFO << "Setting OniSplit process working dir to " + this->AppDir + ".";
    2827
    2928#ifdef Q_OS_WIN
     
    6564            this->myProcess->waitForFinished(-1);
    6665
    67             if(this->processHasKilled){ // If the process has killed there's no need to proceed with reading output or process more commands
     66             // If the process has killed there's no need to proceed with reading output or process more commands
     67            if(this->myProcess == nullptr){
    6868
    6969#ifdef Q_OS_WIN
     
    7373#endif
    7474
    75                 delete this->myProcess; //delete object and make pointer invalid
     75                this->myProcess.reset(); //delete object and make pointer invalid
    7676                this->myData->clear(); //clean list
    7777                emit conversionAborted();
     
    8080            }
    8181
    82             result=this->myProcess->readAllStandardError();
     82            result = this->myProcess->readAllStandardError();
    8383
    8484            if(!result.isEmpty()){ //if(!result.startsWith("Importing",Qt::CaseSensitive) && !result.startsWith("Importing",Qt::CaseSensitive)){ //case sensitive is faster
    8585                //catch exception
    86                 myLogger->writeString("Oni Split Error: \n"+this->myData->at(i)+"\n"+result);
     86                LOG_ERROR << "Oni Split Error: \n" + this->myData->at(i) + "\n" + result;
    8787                errorMessage=result;
    8888                numErrors++;
     
    110110#endif
    111111
    112     delete this->myProcess; //delete object and make pointer invalid
     112    this->myProcess.reset(); //delete object and make pointer invalid
    113113    this->myData->clear(); //clean list
    114114
     
    126126// Kill the process if requested
    127127void Converter::terminateCurrProcess(){
    128     this->myProcess->kill();
    129     this->processHasKilled=true;
    130     this->myLogger->writeString("Received signal to kill current OniSplit operation (user requested).");
     128    if(this->myProcess != nullptr){
     129        this->myProcess->kill();
     130        this->myProcess.reset();
     131    }
     132
     133    LOG_INFO << "Received signal to kill current OniSplit operation (user requested).";
    131134}
  • s10k/Vago/converter.h

    r1047 r1093  
    1414     Q_OBJECT
    1515public:
    16     Converter(QString AppDir, Logger *myLogger, QStringList *myData);
     16    Converter(QString AppDir, QStringList *myData);
    1717
    1818    #ifdef Q_OS_WIN
    19     Converter(QString AppDir, Logger *myLogger, QStringList *myData, QWinTaskbarProgress *win7TaskBarProgress);
     19    Converter(QString AppDir, QStringList *myData, QWinTaskbarProgress *win7TaskBarProgress);
    2020    #endif
    2121private:
    2222    QString AppDir;
    23     Logger *myLogger;
    2423    QStringList *myData;
    25     QProcess *myProcess;
    26     bool processHasKilled;
     24    std::unique_ptr<QProcess> myProcess;
    2725    #ifdef Q_OS_WIN
    2826    QWinTaskbarProgress *win7TaskBarProgress = nullptr;
  • s10k/Vago/libs/DropTableWidget/droptablewidget.cpp

    r1061 r1093  
    146146
    147147    int idxFileName=fileCommand.indexOf(this->item(row,0)->text()); //Search first for the file name
    148     int fileAbsoluteStartIdx=Util::indexOfBackward(fileCommand,"\"",idxFileName);
     148
     149    int fileAbsoluteStartIdx=fileCommand.lastIndexOf("\"",idxFileName);
    149150
    150151    fileCommand.remove(0,fileAbsoluteStartIdx);
    151     int fileAbsoluteEndIdx=fileCommand.indexOf('"',1); //1 to find the end quoate and not the start
    152152
    153     return fileCommand.remove(fileAbsoluteEndIdx,(fileCommand.size()-1)-fileAbsoluteEndIdx);
     153    int fileAbsoluteEndIdx=fileCommand.indexOf('"',1); //1 to find the end quote and not the start
     154
     155    return fileCommand.remove(fileAbsoluteEndIdx+1,(fileCommand.size()-1)-fileAbsoluteEndIdx);
    154156}
    155157
     
    161163    command.remove(fileAbsoluteEndIdx,command.size()-1);
    162164
    163     int fileAbsoluteStartIdx=Util::indexOfBackward(command,"\"",command.size()-1)+1;
     165    int fileAbsoluteStartIdx=command.lastIndexOf("\"",command.size()-1)+1;
    164166
    165167    return command.remove(0,fileAbsoluteStartIdx);
  • s10k/Vago/mainwindow.cpp

    r1061 r1093  
    88    ui(new Ui::MainWindow)
    99{
     10    // We use this appender because it is the native way to have \r\n in windows in plog library
     11    // example: https://github.com/SergiusTheBest/plog/blob/master/samples/NativeEOL/Main.cpp
     12    static plog::RollingFileAppender<plog::TxtFormatter, plog::NativeEOLConverter<>> fileAppender
     13            (QSTR_TO_CSTR(Util::FileSystem::getAppPath() + "/" + GlobalVars::AppLogName), 1024*5 /* 5 Mb max log size */, 3);
     14    plog::init(plog::info, &fileAppender);
     15
    1016    ui->setupUi(this);
    1117
    12     this->myLogger = new Logger(UtilVago::getAppPath(), GlobalVars::AppLogName); //start logger
    13 
    14     this->myLogger->writeString("Detected AppDir: "+UtilVago::getAppPath());
    15     this->myLogger->writeString("True app dir: "+QDir::currentPath());
     18    LOG_INFO << "Detected AppDir: " + UtilVago::getAppPath();
     19    LOG_INFO << "True app dir: "+QDir::currentPath();
    1620
    1721    setVagoWindowTitle();
    1822
    1923    if(!QFile::exists(UtilVago::getOniSplitExecutableAbsolutePath())){
    20         UtilVago::showAndLogErrorPopUp(this->myLogger, "OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it the Vago's tools folder. \n\nProgram will now exit.");
     24        UtilVago::showAndLogErrorPopUp("OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it the Vago's tools folder. \n\nProgram will now exit.");
    2125        exit(1);
    2226    }
    2327
    2428    if(!QFile::exists(UtilVago::getXmlToolsExecutableAbsolutePath())){
    25         UtilVago::showAndLogErrorPopUp(this->myLogger, "XmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it the Vago's tools folder. \n\nProgram will now exit.");
     29        UtilVago::showAndLogErrorPopUp("XmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it the Vago's tools folder. \n\nProgram will now exit.");
    2630        exit(1);
    2731    }
     
    4145    if(!this->vagoSettings->contains("AeFolder")){
    4246
    43         Util::showPopUp("Seems it's the first time you are executing Vago. \n\nPlease input your Anniversary Edition (AE) Folder.");
    44         QString aefolder=Util::normalizePath(QFileDialog::getExistingDirectory(this,"Choose Anniversary Edition (AE) folder..."));
     47        Util::Dialogs::showInfo("Seems it's the first time you are executing Vago. \n\nPlease input your Anniversary Edition (AE) Folder.");
     48        QString aefolder=Util::FileSystem::normalizePath(QFileDialog::getExistingDirectory(this,"Choose Anniversary Edition (AE) folder..."));
    4549
    4650        if(aefolder.isEmpty()){
    47             UtilVago::showAndLogErrorPopUp(this->myLogger, "AE folder is mandatory. Application will now exit.");
     51            UtilVago::showAndLogErrorPopUp("AE folder is mandatory. Application will now exit.");
    4852            exit(1);
    4953        }
    5054
    5155        if(!aefolder.endsWith("AE")){
    52             Util::showWarningPopUp("Seems the folder you selected isn't called 'AE'. \n\nIf you run in any problems you can always change it in Vago preferences window.");
     56            Util::Dialogs::showWarning("Seems the folder you selected isn't called 'AE'. \n\nIf you run in any problems you can always change it in Vago preferences window.");
    5357        }
    5458
     
    177181{
    178182    delete ui;
    179     this->myLogger->writeString("Application Exited.");
     183    LOG_INFO << "Application Exited.";
    180184}
    181185
     
    207211
    208212    //Create a thread for do the conversion in background
    209     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess, this->win7TaskBarProgress);
     213    this->myConverter = new Converter(UtilVago::getAppPath(), &this->listToProccess, this->win7TaskBarProgress);
    210214#else
    211     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess);
     215    this->myConverter = new Converter(UtilVago::getAppPath(), &this->listToProccess);
    212216#endif
    213217
    214218    connectSlots();
    215219
    216     this->myLogger->writeString("Application started.");
     220    LOG_INFO << "Application started.";
    217221
    218222    this->applicationIsFullyLoaded = true;
     
    221225
    222226    if(!lastSavedProject.isEmpty() && this->vagoSettings->value("AskToOpenLastProject").toBool()){
    223         if(Util::showQuestionPopUp(this,"Do you want to load latest project?\n\nLatest project was '" + Util::cutNameWithoutBackSlash(lastSavedProject) + "'.")){
     227        if(Util::Dialogs::showQuestion(this,"Do you want to load latest project?\n\nLatest project was '" + Util::FileSystem::cutNameWithoutBackSlash(lastSavedProject) + "'.")){
    224228            loadProjectState(lastSavedProject);
    225229        }
     
    243247{
    244248    // it deletes itself once closed
    245     WizardFactory<PackageWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger);
     249    WizardFactory<PackageWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings);
    246250}
    247251
     
    249253{
    250254    // it deletes itself once closed
    251     WizardFactory<SoundWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger, &this->commandMap);
     255    WizardFactory<SoundWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, &this->commandMap);
    252256}
    253257
     
    255259{
    256260    // it deletes itself once closed
    257     WizardFactory<BGImageWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger);
     261    WizardFactory<BGImageWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings);
    258262}
    259263
     
    261265{
    262266    // it deletes itself once closed
    263     WizardFactory<WmWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger);
     267    WizardFactory<WmWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings);
    264268}
    265269
     
    280284
    281285    if(!QProcess::startDetached(this->AeLocation+"/"+GlobalVars::OniExe,arguments,this->AeLocation)){
    282         showErrStatusMessage("Oni could not be started!");
     286        Util::StatusBar::showError(ui->statusBar, "Oni could not be started!");
    283287    }
    284288}
     
    289293
    290294    if(!QDesktopServices::openUrl("file:///"+this->AeLocation+"/AEInstaller/bin/AEInstaller2.jar")){
    291         showErrStatusMessage("Could not start AE Installer!");
     295        Util::StatusBar::showError(ui->statusBar, "Could not start AE Installer!");
    292296    }
    293297}
     
    303307    //We pass no parent because we want to have an independent window for XmlToolsInterface,
    304308    //so we can minimize it or maximize indepently from the MainWindow
    305     XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(this->myLogger);
     309    XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface();
    306310    xmlToolsWindow->show(); //it destroys itself when finished.
    307311}
     
    309313void MainWindow::on_tbAbortConversion_clicked()
    310314{
    311     if(Util::showQuestionPopUp(this,"Are you sure you want to abort the current conversion?")){
     315    if(Util::Dialogs::showQuestion(this,"Are you sure you want to abort the current conversion?")){
    312316        emit terminateCurrProcess();
    313317    }
     
    324328}
    325329
     330void MainWindow::on_cbSpecificFilesLevels_toggled(bool checked)
     331{
     332    ui->leSpecificFilesLevels->setEnabled(checked);
     333}
     334
    326335void MainWindow::on_cbWithAnimation_toggled(bool checked)
    327336{
    328337    ui->leAnimationName->setEnabled(checked);
    329 }
    330 
    331 void MainWindow::on_cbSpecificFilesLevels_toggled(bool checked)
    332 {
    333     ui->leSpecificFilesLevels->setEnabled(checked);
    334338}
    335339
     
    357361
    358362        if(newVersion!=GlobalVars::AppVersion){
    359             Util::showRichPopUp("There's a new version of Vago! (v"+newVersion+")<br/><br/>"+
    360                                 "You can download it <a href='"+GlobalVars::VagoWebUrl+"'>here</a>.");
     363            Util::Dialogs::showRichInfo("There's a new version of Vago! (v"+newVersion+")<br/><br/>"+
     364                                        "You can download it <a href='"+GlobalVars::VagoWebUrl+"'>here</a>.");
    361365        }
    362366        else{
    363             Util::showPopUp("You are using last version.");
     367            Util::Dialogs::showInfo("You are using last version.");
    364368        }
    365369    }
    366370    else{
    367         UtilVago::showAndLogErrorPopUp(this->myLogger, "An error occurred checking last version:\n\n"+result->errorString());
     371        UtilVago::showAndLogErrorPopUp("An error occurred checking last version:\n\n"+result->errorString());
    368372    }
    369373    result->deleteLater();
     
    393397{
    394398    if(QString::compare(ui->cbFromLevels->currentText(),"ONI FILES",Qt::CaseSensitive)==0 && QString::compare(ui->cbToLevels->currentText(),"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster)
    395         addFilesSource(ui->twSourcesLevels,Util::multipleDirDialog("Choose folders with ONIs..."));
     399        addFilesSource(ui->twSourcesLevels,Util::Dialogs::multipleDirSelection("Choose folders with ONIs..."));
    396400    }
    397401    else{
     
    415419        myOutputFolder+="/"+QString(fromTo).replace(" / ","_").replace(" > "," - ");
    416420    }
    417     return Util::insertQuotes(myOutputFolder+"/");
     421    return Util::String::insertQuotes(myOutputFolder+"/");
    418422}
    419423
     
    428432    to = QString(fromTo).remove(0,fromTo.lastIndexOf("> ")+2); //+2 to start after "> "
    429433
    430     //Pre-processing (check if the files/folders received are valid), e.g. check for ONI->DAT if are only given folders and not files
     434    //Pre-processing (check if the files/folders received are valid), e.g. check for ONI FILES->DAT if are only given folders and not files
    431435    if(from=="ONI FILES" && to=="DAT"){
    432436        //check if it's a folder
    433         foreach(QString myFile, files){
     437        for(const QString &myFile : files){
    434438            if(!QDir(myFile).exists()){
    435                 showErrStatusMessage("Only folders are allowed for this operation.");
     439                Util::StatusBar::showError(ui->statusBar, "Only folders are allowed for this operation.");
    436440                return;
    437441            }
     
    440444    }
    441445    else{
    442         foreach(QString myFile, files){
     446        for(const QString &myFile : files){
     447
    443448            //check if it's a file
    444449            if(QDir(myFile).exists()){
    445                 showErrStatusMessage("Only files are allowed for this operation.");
     450                Util::StatusBar::showError(ui->statusBar, "Only files are allowed for this operation.");
     451                return;
     452            }
     453
     454            // Check if the given files have the expected extensions
     455            QFileInfo fileInfo(myFile);
     456
     457            QStringList expectedExtensions;
     458
     459            bool extensionIsValid = false;
     460
     461            if(
     462                    from == "DAT / TXMP ONI" ||
     463                    from == "DAT / SNDD ONI" ||
     464                    from == "DAT / SUBT ONI"
     465                    ){
     466                expectedExtensions << "DAT" << "ONI";
     467            }
     468            else if(from == "TGA / DDS / PNG / JPG"){
     469                expectedExtensions << "TGA" << "DDS" << "PNG" << "JPG";
     470            }
     471            else if(
     472                    from == "TRAM ONI" ||
     473                    from == "TRBS / ONCC ONI" ||
     474                    from == "M3GM ONI" ||
     475                    from == "ONWC ONI" ||
     476                    from == "OBAN ONI (cam)" ||
     477                    from == "AKEV ONI"
     478                    ){
     479                expectedExtensions << "ONI";
     480            }
     481            else if(from == "TRBS XML" || from == "MASTER XML"){
     482                expectedExtensions << "XML";
     483            }
     484            else if(from == "TRBS DAE"){
     485                expectedExtensions << "DAE";
     486            }
     487            else if(from == "FILM DAT"){
     488                expectedExtensions << "DAT";
     489            }
     490            else if(from == "WAV / AIF"){
     491                expectedExtensions << "WAV" << "AIF";
     492            }
     493            else{
     494                expectedExtensions << from;
     495            }
     496
     497            for(const QString &currExpectedExtension : expectedExtensions){
     498                if(fileInfo.suffix().toUpper() == currExpectedExtension){
     499                    extensionIsValid = true;
     500                    break;
     501                }
     502            }
     503
     504            if(!extensionIsValid){
     505                QString errorMsg = "Can't add the file '" + fileInfo.fileName() + "'. It isn't a " + expectedExtensions.join(" or ") + " file.";
     506                Util::Dialogs::showError(errorMsg);
     507                Util::StatusBar::showError(ui->statusBar, errorMsg);
    446508                return;
    447509            }
     
    455517
    456518    //if folder doesn't exist onisplit will create it for us :)
    457     foreach(QString currentFile, files){
    458 
    459         currentFile=Util::normalizeAndQuote(currentFile); //insert quotes ("") in file
     519    for(QString currentFile : files){
     520
     521        currentFile=Util::FileSystem::normalizeAndQuote(currentFile); //insert quotes ("") in file
    460522
    461523        if(lastFileName.isEmpty()){ //Optimization: all commands are the same for each file, just replace the filename
     
    466528                return; //stop adding files
    467529            }
    468             currentFile=Util::cutName(currentFile);
     530            currentFile=Util::FileSystem::cutName(currentFile);
    469531        }else{ //one parsing was already made just replace the filename by the old one in the command
    470532
    471             currentFile=Util::cutName(currentFile);
     533            currentFile=Util::FileSystem::cutName(currentFile);
    472534
    473535            command.replace(lastFileName,currentFile,Qt::CaseSensitive); //case sentive is faster
     
    503565    if(ui->gbTextures->isEnabled()){ //faster than compare strings (if is DAT/ONI)
    504566
    505         if(ui->cbMipMapsTextures->isChecked()){
     567        if(ui->cbMipMapsTextures->isEnabled() && ui->cbMipMapsTextures->isChecked()){
    506568            command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbMipMapsTextures->text());
    507569        }
    508570
    509         if(ui->cbNoUwrap->isChecked()){
     571        if(ui->cbNoUwrap->isEnabled() && ui->cbNoUwrap->isChecked()){
    510572            command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbNoUwrap->text());
    511573        }
    512574
    513         if(ui->cbNoVwrap->isChecked()){
     575        if(ui->cbNoVwrap->isEnabled() && ui->cbNoVwrap->isChecked()){
    514576            command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbNoVwrap->text());
    515577        }
    516578
    517         if(ui->cbLarge->isChecked()){
     579        if(ui->cbLarge->isEnabled() && ui->cbLarge->isChecked()){
    518580            command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbLarge->text());
    519581        }
     
    521583        command+=" "+this->commandMap.value(tabTitle+"->"+getTextureRBCheckedTypeTexture()->text());
    522584
    523         if(ui->cbEnvMap->isChecked()){
     585        if(ui->cbEnvMap->isEnabled() && ui->cbEnvMap->isChecked()){
    524586            if(ui->leEnvMapTexture->text().isEmpty()){
    525                 showErrStatusMessage("Checkbox '"+ui->cbEnvMap->text()+"' is selected. The name texture name cannot be empty.");
     587                Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbEnvMap->text()+"' is selected. The name texture name cannot be empty.");
    526588                return "";
    527589            }
     
    535597QString MainWindow::fileParsingCharacters(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){
    536598
    537     QString command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder + " " + file ;
    538 
    539 
    540     if(ui->cbCellShading->isChecked()){
    541         command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbCellShading->text());
    542     }
    543 
    544     if(ui->cbNormals->isChecked()){
    545         command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbNormals->text());
    546     }
    547 
    548     if(ui->cbWithTRBS_ONCC->isChecked()){
     599    QString command=this->commandMap.value(tabTitle + "->" + from + "->" + to) + " " + myOutputFolder + " " + file ;
     600
     601
     602    if(ui->cbCellShading->isEnabled() && ui->cbCellShading->isChecked()){
     603        command+=" "+this->commandMap.value(tabTitle + "->" + ui->cbCellShading->text());
     604    }
     605
     606    if(ui->cbNormals->isEnabled() && ui->cbNormals->isChecked()){
     607        command+=" "+this->commandMap.value(tabTitle + "->" + ui->cbNormals->text());
     608    }
     609
     610    if(ui->cbStandingPose->isEnabled() && ui->cbStandingPose->isChecked()){
     611        command+=" "+this->commandMap.value(tabTitle + "->" + ui->cbStandingPose->text());
     612    }
     613
     614    if(ui->cbWithTRBS_ONCC->isEnabled() && ui->cbWithTRBS_ONCC->isChecked()){
    549615        if(ui->leTRBS_ONCC->text().isEmpty()){
    550             showErrStatusMessage("Checkbox '"+ui->cbWithTRBS_ONCC->text()+"' is selected. The name cannot be empty.");
     616            Util::StatusBar::showError(ui->statusBar, "Checkbox '" + ui->cbWithTRBS_ONCC->text() + "' is selected. The name cannot be empty.");
    551617            return "";
    552618        }
    553619
    554         command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbWithTRBS_ONCC->text())+Util::normalizeAndQuote(ui->leTRBS_ONCC->text());
     620        command+= " " + this->commandMap.value(tabTitle + "->" + ui->cbWithTRBS_ONCC->text()) + Util::FileSystem::normalizeAndQuote(ui->leTRBS_ONCC->text());
    555621    }
    556622
     
    563629    QString command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder;
    564630
    565     if(ui->cbTexture->isChecked()){
     631    if(ui->cbTexture->isEnabled() && ui->cbTexture->isChecked()){
    566632        if(ui->leTextureName->text().isEmpty()){
    567             showErrStatusMessage("Checkbox '"+ui->cbTexture->text()+"' is selected. The file source cannot be empty.");
     633            Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbTexture->text()+"' is selected. The file source cannot be empty.");
    568634            return "";
    569635        }
    570636        command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbTexture->text()) + ui->leTextureName->text();
    571637    }
    572     else if(ui->cbWithAnimation->isChecked()){
     638    else if(ui->cbWithAnimation->isEnabled() && ui->cbWithAnimation->isChecked()){
    573639        if(ui->leAnimationName->text().isEmpty()){
    574             showErrStatusMessage("Checkbox '"+ui->cbWithAnimation->text()+"' is selected. The file source cannot be empty.");
     640            Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbWithAnimation->text()+"' is selected. The file source cannot be empty.");
    575641            return "";
    576642        }
    577         command+=" "+Util::normalizeAndQuote(ui->leAnimationName->text()) + " " + this->commandMap.value(tabTitle+"->"+ui->cbWithAnimation->text()) + file;
     643        command+=" "+Util::FileSystem::normalizeAndQuote(ui->leAnimationName->text()) + " " + this->commandMap.value(tabTitle+"->"+ui->cbWithAnimation->text()) + file;
    578644        return command;
    579645    }
     
    594660        command=this->commandMap.value(tabTitle+"->"+from+"->"+to);
    595661
    596         if(ui->cbSpecificFilesLevels->isChecked()){
     662        if(ui->cbSpecificFilesLevels->isEnabled() && ui->cbSpecificFilesLevels->isChecked()){
    597663
    598664            if(ui->leSpecificFilesLevels->text().isEmpty()){
    599                 showErrStatusMessage("Checkbox '"+ui->cbSpecificFilesLevels->text()+"' is selected. The files pattern cannot be empty.");
     665                Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbSpecificFilesLevels->text()+"' is selected. The files pattern cannot be empty.");
    600666                return "";
    601667            }
     
    605671
    606672        if(from=="DAT" && to=="ONI FILES"){ // extract files to a subdir with the files name ex: level0_Final
    607             command += " " + myOutputFolder.insert(myOutputFolder.size()-2,QString(Util::cutName(file)).replace(".dat","")) + " " + file;
     673            command += " " + myOutputFolder.insert(myOutputFolder.size()-2,QString(Util::FileSystem::cutName(file)).replace(".dat","")) + " " + file;
    608674        }
    609675        else{
     
    620686        }
    621687
    622         if(ui->cbDatLevels->isChecked()){
     688        if(ui->cbDatLevels->isEnabled() && ui->cbDatLevels->isChecked()){
    623689            if(ui->leTargetDatLevels->text().isEmpty()){
    624                 showErrStatusMessage("Checkbox '"+ui->cbDatLevels->text()+"' is selected. The name cannot be empty.");
     690                Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbDatLevels->text()+"' is selected. The name cannot be empty.");
    625691                return "";
    626692            }
     
    632698        else{
    633699            if(from=="ONI FILES"){
    634                 datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/")+".dat"); //if none iputted set the same name of input file
     700                datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::FileSystem::cutName(file).remove("/")+".dat"); //if none iputted set the same name of input file
    635701            }
    636702            else if(from=="MASTER XML"){
    637                 datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/").replace(".xml",".dat",Qt::CaseInsensitive)); //if none iputted set the same name of input file
     703                datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::FileSystem::cutName(file).remove("/").replace(".xml",".dat",Qt::CaseInsensitive)); //if none iputted set the same name of input file
    638704            }
    639705        }
    640706        if(from=="ONI FILES"){
    641             if(ui->actionWindows->isChecked()){ //is target plataform select windows?
     707            if(ui->actionWindows->isEnabled() && ui->actionWindows->isChecked()){ //is target plataform select windows?
    642708                return command=this->commandMap.value(tabTitle+"->"+from+"->"+to+"(PC)")+" "+ file + " "+datName;
    643709            }
     
    647713        }
    648714        else if(from=="MASTER XML"){
    649             if(ui->actionWindows->isChecked()){ //is target plataform select windows?
     715            if(ui->actionWindows->isEnabled() && ui->actionWindows->isChecked()){ //is target plataform select windows?
    650716                command+=this->commandMap.value(tabTitle+"->ONI FILES->"+to+"(PC)")+" "+myOutputFolder+" "+datName; //add second command
    651717            }
     
    656722    }
    657723
    658     if(ui->cbBnvLevels->isChecked()){
    659 
    660         if(ui->leBnvLevels->text().isEmpty()){
    661             showErrStatusMessage("Checkbox '"+ui->cbBnvLevels->text()+"' is selected. The BNV file cannot be empty.");
     724    if(ui->cbBnvLevels->isEnabled() && ui->cbBnvLevels->isChecked()){
     725
     726        if(ui->leBnvLevels->isEnabled() && ui->leBnvLevels->text().isEmpty()){
     727            Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbBnvLevels->text()+"' is selected. The BNV file cannot be empty.");
    662728            return "";
    663729        }
    664         command+=" "+Util::normalizeAndQuote(ui->leBnvLevels->text());
    665     }
    666 
    667     if(ui->cbAdditionalSourcesLevels->isChecked()){
     730        command+=" "+Util::FileSystem::normalizeAndQuote(ui->leBnvLevels->text());
     731    }
     732
     733    if(ui->cbAdditionalSourcesLevels->isEnabled() && ui->cbAdditionalSourcesLevels->isChecked()){
    668734
    669735        if(ui->leAdditSourcesLevels->text().isEmpty()){
    670             showErrStatusMessage("Checkbox '"+ui->cbAdditionalSourcesLevels->text()+"' is selected. The source files cannot be empty.");
     736            Util::StatusBar::showError(ui->statusBar, "Checkbox '"+ui->cbAdditionalSourcesLevels->text()+"' is selected. The source files cannot be empty.");
    671737            return "";
    672738        }
     
    680746            nextIndex=additionalFiles.indexOf(";",currentIndex+1);
    681747
    682             command += " "+Util::normalizeAndQuote(additionalFiles.mid(currentIndex,(nextIndex-currentIndex)));
     748            command += " "+Util::FileSystem::normalizeAndQuote(additionalFiles.mid(currentIndex,(nextIndex-currentIndex)));
    683749
    684750            if(nextIndex==-1){ //we got to the end, stop parsing
     
    689755    }
    690756
    691     if(ui->cbGridsLevels->isChecked()){
    692         command+=GlobalVars::OniSplitProcSeparator+this->commandMap.value(tabTitle+"->"+ui->cbGridsLevels->text())+" "+Util::normalizeAndQuote(ui->leBnvLevels->text())+" "+file+" -out:"+myOutputFolder;
     757    if(ui->cbGridsLevels->isEnabled() && ui->cbGridsLevels->isChecked()){
     758        command+=GlobalVars::OniSplitProcSeparator+this->commandMap.value(tabTitle+"->"+ui->cbGridsLevels->text())+" "+Util::FileSystem::normalizeAndQuote(ui->leBnvLevels->text())+" "+file+" -out:"+myOutputFolder;
    693759    }
    694760
     
    743809
    744810    if(!ready){
    745         showErrStatusMessage("Please add sources to convert first.");
     811        Util::StatusBar::showError(ui->statusBar, "Please add sources to convert first.");
    746812        return;
    747813    }
    748814
    749815    if(this->myBar->isVisible()){
    750         Util::showErrorPopUp("Another conversion is progress. Please wait until it finishes.");
     816        Util::Dialogs::showError("Another conversion is progress. Please wait until it finishes.");
    751817        return;
    752818    }
     
    782848        if(numErrors>1){
    783849            UtilVago::showErrorPopUpLogButton(result+"\n This is the last of "+sNumErrors+" errors.");
    784             showErrStatusMessage("Something gone wrong. Check log file ("+sNumErrors+" errors).");
     850            Util::StatusBar::showError(ui->statusBar, "Something gone wrong. Check log file ("+sNumErrors+" errors).");
    785851        }
    786852        else{
    787853            UtilVago::showErrorPopUpLogButton(result);
    788             showErrStatusMessage("Something gone wrong. Check log file.");
     854            Util::StatusBar::showError(ui->statusBar, "Something gone wrong. Check log file.");
    789855        }
    790856    }
    791857    else{
    792         showSuccessStatusMessage("Everything went well!");
     858        Util::StatusBar::showSuccess(ui->statusBar, "Everything went well!");
    793859    }
    794860}
     
    798864    ui->tbAbortConversion->hide();
    799865
    800     showErrStatusMessage("Conversion was aborted.");
    801 }
    802 
    803 void MainWindow::showErrStatusMessage(QString message){
    804 
    805     QPalette myPalete = QPalette();
    806     myPalete.setColor( QPalette::WindowText, QColor(255,0,0));
    807     statusBar()->setPalette( myPalete );
    808     ui->statusBar->showMessage(message,10000); //display by 10 seconds
    809 
    810 }
    811 
    812 void MainWindow::showSuccessStatusMessage(QString message){
    813 
    814     QPalette myPalete = QPalette();
    815     myPalete.setColor( QPalette::WindowText, QColor(0,150,0));
    816     statusBar()->setPalette( myPalete );
    817     ui->statusBar->showMessage(message,10000); //display by 10 seconds
    818 
     866    Util::StatusBar::showError(ui->statusBar, "Conversion was aborted.");
    819867}
    820868
     
    865913    this->commandMap.insert("characters->"+ui->cbCellShading->text(),"-cel");
    866914    this->commandMap.insert("characters->"+ui->cbNormals->text(),"-normals");
     915    this->commandMap.insert("characters->"+ui->cbStandingPose->text(),"-noanim");
    867916    //Possible Combinations
    868917    this->commandMap.insertMulti("characters->TRAM ONI","XML / XML & DAE");
     
    880929    this->commandMap.insert("objects->OBAN ONI (cam)->DAE","-extract:dae");
    881930    this->commandMap.insert("objects->OBJ->M3GM ONI","-create:m3gm");
    882     //######################Characters Options
     931    //######################Objects Options
    883932    this->commandMap.insert("objects->"+ui->cbTexture->text(),"-tex:");
    884933    this->commandMap.insert("objects->"+ui->cbWithAnimation->text(),"-geom:");
     
    9671016        identifier = ui->tabWidget->tabText(TexturesTabIndex);
    9681017
    969         //Options are only used for DAT/ONI -> Image
    970         if(QString::compare(arg1,"DAT / ONI",Qt::CaseSensitive)==0){ //case sensitive is faster
     1018        //Options are only used for DAT/TXMP ONI -> Image
     1019        if(QString::compare(arg1,"DAT / TXMP ONI",Qt::CaseSensitive)==0){ //case sensitive is faster
    9711020            ui->gbTextures->setEnabled(false);
    9721021        }
    9731022        else{
    9741023            ui->gbTextures->setEnabled(true);
     1024            ui->leEnvMapTexture->setEnabled(ui->cbEnvMap->isChecked());
    9751025        }
    9761026    }
     
    9791029
    9801030        ui->cbWithTRBS_ONCC->setEnabled(false);
    981         ui->cbWithTRBS_ONCC->setChecked(false);
    9821031        ui->cbCellShading->setEnabled(false);
    983         ui->cbCellShading->setChecked(false);
    9841032        ui->cbNormals->setEnabled(false);
    985         ui->cbNormals->setChecked(false);
    986 //#error add drag and drop to Extract TRAM with TRBS/ONCC
     1033        ui->cbStandingPose->setEnabled(false);
     1034        ui->leTRBS_ONCC->setEnabled(false);
     1035
     1036        //#error add drag and drop to Extract TRAM with TRBS/ONCC
    9871037        if(QString::compare(arg1,"TRAM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster
    9881038            ui->cbWithTRBS_ONCC->setEnabled(true);
     1039            ui->leTRBS_ONCC->setEnabled(ui->cbWithTRBS_ONCC->isChecked());
    9891040        }
    9901041        else if(QString::compare(arg1,"TRBS DAE",Qt::CaseSensitive)==0){
     
    9921043            ui->cbCellShading->setEnabled(true);
    9931044        }
     1045        else if(QString::compare(arg1,"TRBS / ONCC ONI",Qt::CaseSensitive)==0){
     1046            ui->cbStandingPose->setEnabled(true);
     1047        }
    9941048
    9951049    }
     
    9981052
    9991053        ui->cbTexture->setEnabled(false);
    1000         ui->cbTexture->setChecked(false);
     1054        ui->leTextureName->setEnabled(false);
    10011055        ui->cbWithAnimation->setEnabled(false);
    1002         ui->cbWithAnimation->setChecked(false);
     1056        ui->leAnimationName->setEnabled(false);
    10031057
    10041058        if(QString::compare(arg1,"M3GM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster
    10051059            ui->cbWithAnimation->setEnabled(true);
     1060            ui->leAnimationName->setEnabled(ui->cbWithAnimation->isChecked());
    10061061        }
    10071062        else if(QString::compare(arg1,"OBJ",Qt::CaseSensitive)==0){
    10081063            ui->cbTexture->setEnabled(true);
     1064            ui->leTextureName->setEnabled(ui->cbTexture->isChecked());
    10091065        }
    10101066    }
     
    10131069
    10141070        ui->cbSpecificFilesLevels->setEnabled(false);
    1015         ui->cbSpecificFilesLevels->setChecked(false);
     1071        ui->leSpecificFilesLevels->setEnabled(false);
    10161072        ui->cbDatLevels->setEnabled(false);
    1017         ui->cbDatLevels->setChecked(false);
     1073        ui->leTargetDatLevels->setEnabled(false);
    10181074        ui->cbBnvLevels->setEnabled(false);
    1019         ui->cbBnvLevels->setChecked(false);
     1075        ui->leBnvLevels->setEnabled(false);
    10201076        ui->cbAdditionalSourcesLevels->setEnabled(false);
    1021         ui->cbAdditionalSourcesLevels->setChecked(false);
     1077        ui->leAdditSourcesLevels->setEnabled(false);
    10221078        ui->cbGridsLevels->setEnabled(false);
    1023         ui->cbGridsLevels->setChecked(false);
    10241079
    10251080        if(arg1=="DAT"){ //case sensitive is faster
    10261081            ui->cbSpecificFilesLevels->setEnabled(true);
     1082            ui->leSpecificFilesLevels->setEnabled( ui->cbSpecificFilesLevels->isChecked());
    10271083        }
    10281084        else if(arg1=="ONI FILES"){ //case sensitive is faster
    10291085            ui->cbDatLevels->setEnabled(true);
     1086            ui->leTargetDatLevels->setEnabled(ui->cbDatLevels->isChecked());
    10301087        }
    10311088        else if(arg1=="DAE"){
    10321089            ui->cbBnvLevels->setEnabled(true);
     1090            ui->leBnvLevels->setEnabled(ui->cbBnvLevels->isChecked());
    10331091            ui->cbAdditionalSourcesLevels->setEnabled(true);
     1092            ui->leAdditSourcesLevels->setEnabled(ui->cbAdditionalSourcesLevels->isChecked());
    10341093        }
    10351094    }
     
    11321191
    11331192    if(size==0){
    1134         Util::showPopUp("Select a row first.");
     1193        Util::Dialogs::showInfo("Select a row first.");
    11351194        return;
    11361195    }
     
    11461205
    11471206
    1148     if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?",defaultButton)){
     1207    if(Util::Dialogs::showQuestion(this,"Are you sure you want to delete the selected rows?",defaultButton)){
    11491208        for(int i=0; i<size; i++){
    11501209            //myTable->removeRow(myTable->selectedItems().at(size-i-1)->row());
     
    11611220
    11621221    if(myTable->rowCount()==0){
    1163         Util::showPopUp("Nothing to clear.");
     1222        Util::Dialogs::showInfo("Nothing to clear.");
    11641223        return;
    11651224    }
     
    11741233#endif
    11751234
    1176     if(Util::showQuestionPopUp(this,"Are you sure you want to clear the content?",defaultButton)){
     1235    if(Util::Dialogs::showQuestion(this,"Are you sure you want to clear the content?",defaultButton)){
    11771236        clearTableNoPrompt(myTable);
    11781237        updateItemsLoaded(myTable);
     
    12101269QMessageBox::StandardButton MainWindow::askToSaveCurrentProject(){
    12111270    QMessageBox::StandardButton result =
    1212             Util::showQuestionPopUpWithCancel(this,"There are unsaved changes. Do you want to save the current project?", QMessageBox::StandardButton::Yes);
     1271            Util::Dialogs::showQuestionWithCancel(this,"There are unsaved changes. Do you want to save the current project?", QMessageBox::StandardButton::Yes);
    12131272
    12141273    if(result == QMessageBox::StandardButton::Yes){
     
    12841343    QString result=myProcess.readAllStandardOutput();
    12851344
    1286     Util::showPopUp("This Vago version was built with base in OniSplit version "+GlobalVars::BuiltOniSplitVersion+"\n\nCurrent version is:\n"+result.trimmed());
     1345    Util::Dialogs::showInfo("This Vago version was built with base in OniSplit version "+GlobalVars::BuiltOniSplitVersion+"\n\nCurrent version is:\n"+result.trimmed());
    12871346}
    12881347
     
    12951354    QString result=myProcess.readLine();
    12961355
    1297     Util::showPopUp("This Vago version was built with base in XmlTools version "+GlobalVars::BuiltXmlToolsVersion+"\n\nCurrent version is:\n"+result.trimmed());
     1356    Util::Dialogs::showInfo("This Vago version was built with base in XmlTools version "+GlobalVars::BuiltXmlToolsVersion+"\n\nCurrent version is:\n"+result.trimmed());
    12981357}
    12991358
     
    13351394    this->outputFolder=this->workspaceLocation;
    13361395    ui->tbOpenFolder->setToolTip("Open Vago workspace");
    1337     showSuccessStatusMessage("Vago is now outputting the NEW items for Vago workspace.");
     1396    Util::StatusBar::showSuccess(ui->statusBar, "Vago is now outputting the NEW items for Vago workspace.");
    13381397}
    13391398
     
    13411400{
    13421401    QString newDir=QFileDialog::getExistingDirectory(this,"Choose the folder for output NEW files directly...",this->AeLocation+"/GameDataFolder");
    1343     newDir=Util::normalizePath(newDir);
     1402    newDir=Util::FileSystem::normalizePath(newDir);
    13441403
    13451404    if(newDir.isEmpty()){
     
    13581417    this->outputFolder=newDir;
    13591418
    1360     QString newDirName=Util::cutName(newDir);
     1419    QString newDirName=Util::FileSystem::cutName(newDir);
    13611420    ui->tbOpenFolder->setToolTip("Open "+newDirName+" output folder");
    1362     showSuccessStatusMessage("Vago is now outputting the NEW items for "+newDirName+".");
     1421    Util::StatusBar::showSuccess(ui->statusBar, "Vago is now outputting the NEW items for "+newDirName+".");
    13631422}
    13641423
     
    14991558    QList<int> selectedRows = QList<int>();
    15001559
    1501     foreach(QModelIndex rowItem, myTable->selectionModel()->selectedRows()){
     1560    for(const QModelIndex &rowItem : myTable->selectionModel()->selectedRows()){
    15021561        selectedRows << rowItem.row();
    15031562    }
     
    15371596    //Can we change the settings? (the conversion must be the same)
    15381597    QString currentSettings = (getTypeConversion(myTable)); //call function at the mainWindow with a signal (different threads?)
    1539     foreach(int row, selectedRows){
     1598    for(const int row : selectedRows){
    15401599        if( myTable->item(row,1)->text() != currentSettings){ //If we find out any of the selected items can't be convert disable operation
    15411600            changeOptions->setEnabled(false);
     
    15671626
    15681627        QApplication::clipboard()->setText(toCopy);
    1569         showSuccessStatusMessage(QString::number(size) + (size==1?" item ":" items ")+ "copied to the clipboard");
     1628        Util::StatusBar::showSuccess(ui->statusBar, QString::number(size) + (size==1?" item ":" items ")+ "copied to the clipboard");
    15701629    }
    15711630    else if(selectedOption==moveUp.get()){
     
    15911650
    15921651        QString newDir=QFileDialog::getExistingDirectory(this,"Choose the folder for the output of the files selected...",this->AeLocation+"/GameDataFolder");
    1593         newDir=Util::normalizePath(newDir);
     1652        newDir=Util::FileSystem::normalizePath(newDir);
    15941653
    15951654        if(newDir.isEmpty()){
     
    16371696
    16381697        rowsWereChangedInDropTableWidget();
    1639         showSuccessStatusMessage(result);
     1698        Util::StatusBar::showSuccess(ui->statusBar, result);
    16401699    }
    16411700}
     
    16501709    QString command;
    16511710
    1652     foreach(int row, rows){
    1653 
     1711    for(int row : rows){
    16541712        command=getCommand(myTable,getFileOutputFolder(fromTo,myTable->getOutputAbsolute(row)),from,to,myTable->getFileAbsolute(row));
    16551713
     
    16631721
    16641722    rowsWereChangedInDropTableWidget();
    1665     showSuccessStatusMessage(QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed to the current settings");
     1723    Util::StatusBar::showSuccess(ui->statusBar, QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed to the current settings");
    16661724}
    16671725
     
    16701728    QString command, currentAbsoluteFile, fromTo, from, to;
    16711729
    1672     foreach(int row, rows){ //No optimization possible here, commands may be different
     1730    for(const int row : rows){ //No optimization possible here, commands may be different
    16731731        fromTo=myTable->item(row,1)->text();
    16741732        from = QString(fromTo).remove(fromTo.indexOf(" >"),fromTo.size()-1); //parse the string to get the from
     
    16871745
    16881746    rowsWereChangedInDropTableWidget();
    1689     showSuccessStatusMessage(QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed the output to "+(newOutput!=this->workspaceLocation?Util::cutName(newOutput):"Vago workspace"));
     1747    Util::StatusBar::showSuccess(ui->statusBar, QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed the output to "+(newOutput!=this->workspaceLocation?Util::FileSystem::cutName(newOutput):"Vago workspace"));
    16901748}
    16911749
     
    17711829void MainWindow::saveProjectState(const QString &filePath)
    17721830{
    1773 
    1774     QList<DropTableWidget*> tableWidgets = getAllTableWidgets();
    1775 
    1776     pugi::xml_document doc;
    1777 
    1778     pugi::xml_node rootNode = doc.append_child("VagoProject");
    1779     rootNode.append_attribute("vagoVersion").set_value(GlobalVars::LastCompatibleVersion.toUtf8().constData());
    1780 
    1781     foreach(DropTableWidget* const &myTable, tableWidgets){
    1782         saveProjectWidget(rootNode, myTable);
    1783     }
    1784 
    1785     if(!doc.save_file(filePath.toUtf8().constData(), PUGIXML_TEXT("\t"), pugi::format_default | pugi::format_write_bom, pugi::xml_encoding::encoding_utf8)){
    1786         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while trying to save the project file. Please try another path.");
    1787         return;
    1788     }
    1789 
    1790     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path());
    1791 
    1792     this->lastProjectFilePath = filePath;
    1793     this->unsavedChangesExist = false;
    1794 
    1795     addNewRecentProject(filePath);
    1796 
    1797     setVagoWindowTitle();
    1798 
    1799     showSuccessStatusMessage("Project saved sucessfully.");
    1800 }
    1801 
    1802 void MainWindow::saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table)
    1803 {
    1804     QString from;
    1805     QString to;
    1806     QString tabName = getTabNameByTableWidget(table);
    1807 
    1808     pugi::xml_node currentNodeTable = rootNode.append_child("tempName");
    1809     pugi::xml_node options;
    1810 
    1811     if(table==ui->twSourcesXML){ //So we only need to parse one command.
    1812         from = ui->cbFromXML->currentText().toUtf8().constData();
    1813         to = ui->cbToXML->currentText().toUtf8().constData();
    1814     }
    1815     else if(table==ui->twSourcesTextures){
    1816         from = ui->cbFromTextures->currentText().toUtf8().constData();
    1817         to = ui->cbToTextures->currentText().toUtf8().constData();
    1818         options = currentNodeTable.append_child("Options");
    1819         options.append_attribute("type").set_value(Util::qStrToCstr(getTextureRBCheckedTypeTexture()->text()));
    1820         options.append_attribute("genMipMaps").set_value(Util::boolToCstr(ui->cbMipMapsTextures->isChecked()));
    1821         options.append_attribute("noUwrap").set_value(Util::boolToCstr(ui->cbNoUwrap->isChecked()));
    1822         options.append_attribute("noVwrap").set_value(Util::boolToCstr(ui->cbNoVwrap->isChecked()));
    1823         options.append_attribute("large").set_value(Util::boolToCstr(ui->cbLarge->isChecked()));
    1824         options.append_attribute("envMap").set_value(Util::boolToCstr(ui->cbEnvMap->isChecked()));
    1825         options.append_attribute("envMapValue").set_value(Util::qStrToCstr(ui->leEnvMapTexture->text()));
    1826     }
    1827     else if(table==ui->twSourcesCharacters){
    1828         from = ui->cbFromCharacters->currentText().toUtf8().constData();
    1829         to = ui->cbToCharacters->currentText().toUtf8().constData();
    1830         options = currentNodeTable.append_child("Options");
    1831         options.append_attribute("cellShading").set_value(Util::boolToCstr(ui->cbCellShading->isChecked()));
    1832         options.append_attribute("normals").set_value(Util::boolToCstr(ui->cbNormals->isChecked()));
    1833         options.append_attribute("extractTRBSONCC").set_value(Util::boolToCstr(ui->cbWithTRBS_ONCC->isChecked()));
    1834         options.append_attribute("extractTRBSONCCValue").set_value(Util::qStrToCstr(ui->leTRBS_ONCC->text()));
    1835     }
    1836     else if(table==ui->twSourcesObjects){
    1837         from = ui->cbFromObjects->currentText().toUtf8().constData();
    1838         to = ui->cbToObjects->currentText().toUtf8().constData();
    1839         options = currentNodeTable.append_child("Options");
    1840         options.append_attribute("texture").set_value(Util::boolToCstr(ui->cbTexture->isChecked()));
    1841         options.append_attribute("textureValue").set_value(Util::qStrToCstr(ui->leTextureName->text()));
    1842         options.append_attribute("withAnimation").set_value(Util::boolToCstr(ui->cbWithAnimation->isChecked()));
    1843         options.append_attribute("withAnimationValue").set_value(Util::qStrToCstr(ui->leAnimationName->text()));
    1844     }
    1845     else if(table==ui->twSourcesLevels){
    1846         from = ui->cbFromLevels->currentText().toUtf8().constData();
    1847         to = ui->cbToLevels->currentText().toUtf8().constData();
    1848         options = currentNodeTable.append_child("Options");
    1849         options.append_attribute("extractWithFiles").set_value(Util::boolToCstr(ui->cbSpecificFilesLevels->isChecked()));
    1850         options.append_attribute("extractWithFilesValue").set_value(Util::qStrToCstr(ui->leSpecificFilesLevels->text()));
    1851         options.append_attribute("datFilename").set_value(Util::boolToCstr(ui->cbDatLevels->isChecked()));
    1852         options.append_attribute("datFilenameValue").set_value(Util::qStrToCstr(ui->leTargetDatLevels->text()));
    1853         options.append_attribute("bnvSource").set_value(Util::boolToCstr(ui->cbBnvLevels->isChecked()));
    1854         options.append_attribute("bnvSourceValue").set_value(Util::qStrToCstr(ui->leBnvLevels->text()));
    1855         options.append_attribute("generateGrids").set_value(Util::boolToCstr(ui->cbGridsLevels->isChecked()));
    1856         options.append_attribute("additionalSources").set_value(Util::boolToCstr(ui->cbAdditionalSourcesLevels->isChecked()));
    1857         options.append_attribute("additionalSourcesValue").set_value(Util::qStrToCstr(ui->leAdditSourcesLevels->text()));
    1858     }
    1859     else{
    1860         from = ui->cbFromMisc->currentText().toUtf8().constData();
    1861         to = ui->cbToMisc->currentText().toUtf8().constData();
    1862     }
    1863 
    1864     currentNodeTable.set_name(tabName.toUtf8().constData());
    1865 
    1866     currentNodeTable.append_attribute("from").set_value(from.toUtf8().constData());
    1867     currentNodeTable.append_attribute("to").set_value(to.toUtf8().constData());
    1868 
    1869 
    1870     for(int i=0; i<table->rowCount(); i++){
    1871 
    1872         QString currFileFolder = table->item(i,0)->text();
    1873         QString currFromTo = table->item(i,1)->text();
    1874         QString currCommand = table->item(i,2)->text();
    1875 
    1876         pugi::xml_node currentRow = currentNodeTable.append_child("Row");
    1877 
    1878 
    1879         currentRow.append_attribute("fileFolder").set_value(Util::qStrToCstr(currFileFolder));
    1880         currentRow.append_attribute("fromTo").set_value(Util::qStrToCstr(currFromTo));
    1881         currentRow.append_attribute("command").set_value(Util::qStrToCstr(currCommand));
    1882 
    1883         if(table->item(i,2)->background()==table->disabledBackStyle){
    1884             currentRow.append_attribute("disabled").set_value(true);
    1885         }
    1886 
    1887     }
     1831    try{
     1832        ProjectFileVago::saveProjectDataToFile(filePath, fetchCurrentProjectData());
     1833
     1834        this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path());
     1835
     1836        this->lastProjectFilePath = filePath;
     1837        this->unsavedChangesExist = false;
     1838
     1839        addNewRecentProject(filePath);
     1840
     1841        setVagoWindowTitle();
     1842
     1843        Util::StatusBar::showSuccess(ui->statusBar, "Project saved sucessfully.");
     1844    }
     1845    catch(const std::exception& e){
     1846        QString errorMessage = "An error ocurred while trying to save the project file. Please try another path.";
     1847        UtilVago::showAndLogErrorPopUpLogButton(errorMessage);
     1848        Util::StatusBar::showError(ui->statusBar, "Couldn't save project file.");
     1849    }
     1850}
     1851
     1852ProjectFileVago::ProjectData MainWindow::fetchCurrentProjectData(){
     1853
     1854    ProjectFileVago::ProjectData currentProjectData;
     1855
     1856    auto fFetchTabGenericData =
     1857            [](ProjectFileVago::ProjectTable &projectTable,
     1858            const QComboBox * const cbFrom,
     1859            const QComboBox * const cbTo,
     1860            DropTableWidget const * const table) ->void{
     1861
     1862        projectTable.from = cbFrom->currentText();
     1863        projectTable.to = cbTo->currentText();
     1864
     1865        for(int i=0; i<table->rowCount(); i++){
     1866
     1867            ProjectFileVago::ProjectTableRow currentRow;
     1868
     1869            currentRow.fileFolder = table->item(i,0)->text();
     1870            currentRow.fromTo = table->item(i,1)->text();
     1871            currentRow.command= table->item(i,2)->text();
     1872
     1873            if(table->item(i,2)->background()==table->disabledBackStyle){
     1874                currentRow.isDisabled = true;
     1875            }
     1876
     1877            projectTable.rows.append(currentRow);
     1878        }
     1879    };
     1880
     1881    // XML tab
     1882    fFetchTabGenericData(currentProjectData.xmlTable, ui->cbFromXML, ui->cbToXML, ui->twSourcesXML);
     1883
     1884    // Textures tab
     1885    fFetchTabGenericData(currentProjectData.texturesTable, ui->cbFromTextures, ui->cbToTextures, ui->twSourcesTextures);
     1886    currentProjectData.texturesTable.rbTexturesType = getTextureRBCheckedTypeTexture()->text();
     1887    currentProjectData.texturesTable.cbGenMipMaps = ui->cbMipMapsTextures->isChecked();
     1888    currentProjectData.texturesTable.cbNoUwrap = ui->cbNoUwrap->isChecked();
     1889    currentProjectData.texturesTable.cbNoVwrap = ui->cbNoVwrap->isChecked();
     1890    currentProjectData.texturesTable.cbLarge = ui->cbLarge->isChecked();
     1891    currentProjectData.texturesTable.cbEnvMap = ui->cbEnvMap->isChecked();
     1892    currentProjectData.texturesTable.leEnvMapTexture = ui->leEnvMapTexture->text();
     1893
     1894    // Characters tab
     1895    fFetchTabGenericData(currentProjectData.charactersTable, ui->cbFromCharacters, ui->cbToCharacters, ui->twSourcesCharacters);
     1896    currentProjectData.charactersTable.cbCellShading = ui->cbCellShading->isChecked();
     1897    currentProjectData.charactersTable.cbNormals = ui->cbNormals->isChecked();
     1898    currentProjectData.charactersTable.cbStandingPose = ui->cbStandingPose->isChecked();
     1899    currentProjectData.charactersTable.cbWithTRBS_ONCC = ui->cbWithTRBS_ONCC->isChecked();
     1900    currentProjectData.charactersTable.leTRBS_ONCC = ui->leTRBS_ONCC->text();
     1901
     1902    // Objects tab
     1903    fFetchTabGenericData(currentProjectData.objectsTable, ui->cbFromObjects, ui->cbToObjects, ui->twSourcesObjects);
     1904    currentProjectData.objectsTable.cbTexture = ui->cbTexture->isChecked();
     1905    currentProjectData.objectsTable.leTextureName = ui->leTextureName->text();
     1906    currentProjectData.objectsTable.cbWithAnimation = ui->cbWithAnimation->isChecked();
     1907    currentProjectData.objectsTable.leAnimationName = ui->leAnimationName->text();
     1908
     1909    // Levels tab
     1910    fFetchTabGenericData(currentProjectData.levelsTable, ui->cbFromLevels, ui->cbToLevels, ui->twSourcesLevels);
     1911    currentProjectData.levelsTable.cbSpecificFilesLevels = ui->cbSpecificFilesLevels->isChecked();
     1912    currentProjectData.levelsTable.leSpecificFilesLevels = ui->leSpecificFilesLevels->text();
     1913    currentProjectData.levelsTable.cbDatLevels = ui->cbDatLevels->isChecked();
     1914    currentProjectData.levelsTable.leTargetDatLevels = ui->leTargetDatLevels->text();
     1915    currentProjectData.levelsTable.cbBnvLevels = ui->cbBnvLevels->isChecked();
     1916    currentProjectData.levelsTable.leBnvLevels = ui->leBnvLevels->text();
     1917    currentProjectData.levelsTable.cbGridsLevels = ui->cbGridsLevels->isChecked();
     1918    currentProjectData.levelsTable.cbAdditionalSourcesLevels = ui->cbAdditionalSourcesLevels->isChecked();
     1919    currentProjectData.levelsTable.leAdditSourcesLevels = ui->leAdditSourcesLevels->text();
     1920
     1921    // Misc tab
     1922    fFetchTabGenericData(currentProjectData.miscTable, ui->cbFromMisc, ui->cbToMisc, ui->twSourcesMisc);
     1923
     1924    return currentProjectData;
    18881925}
    18891926
     
    19411978    }
    19421979    else{
    1943         vagoTitle += Util::cutNameWithoutBackSlash(this->lastProjectFilePath);
     1980        vagoTitle += Util::FileSystem::cutNameWithoutBackSlash(this->lastProjectFilePath);
    19441981    }
    19451982
     
    20192056void MainWindow::loadProjectState(const QString &filePath)
    20202057{
     2058
     2059    auto fLoadTabGenericData =
     2060            [this]( // we are capturing this only to call the addRowTable function...
     2061                const ProjectFileVago::ProjectTable &tableData,
     2062                DropTableWidget * const table,
     2063                QComboBox * const cbFrom,
     2064                QComboBox * const cbTo) -> void{
     2065
     2066        cbFrom->setCurrentText(tableData.from);
     2067        cbTo->setCurrentText(tableData.to);
     2068
     2069        // Add rows
     2070        for(const ProjectFileVago::ProjectTableRow &currentRow : tableData.rows){
     2071            addRowTable(table,currentRow.fileFolder,currentRow.fromTo,currentRow.command, currentRow.isDisabled);
     2072        }
     2073
     2074    };
    20212075
    20222076    this->projectIsLoading = true;
     
    20302084    }
    20312085
    2032     QString statusError = "Couldn't load project.";
    2033 
    2034     pugi::xml_document doc;
    2035 
    2036     pugi::xml_parse_result result = doc.load_file(Util::qStrToCstr(filePath));
    2037 
    2038     if(result.status!=pugi::status_ok){
    2039         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while loading project file.\n" + QString(result.description()));
    2040         showErrStatusMessage(statusError);
     2086    try{
     2087        ProjectFileVago::ProjectData projectData = ProjectFileVago::readProjectDataFromFile(filePath);
     2088
     2089        // XML tab
     2090        fLoadTabGenericData(projectData.xmlTable, ui->twSourcesXML, ui->cbFromXML, ui->cbToXML);
     2091
     2092        // Textures tab
     2093        fLoadTabGenericData(projectData.texturesTable, ui->twSourcesTextures, ui->cbFromTextures, ui->cbToTextures);
     2094        getTextureRBTypeTextureByName(projectData.texturesTable.rbTexturesType)->setChecked(true);
     2095        ui->cbMipMapsTextures->setChecked(projectData.texturesTable.cbGenMipMaps);
     2096        ui->cbNoUwrap->setChecked(projectData.texturesTable.cbNoUwrap);
     2097        ui->cbNoVwrap->setChecked(projectData.texturesTable.cbNoVwrap);
     2098        ui->cbLarge->setChecked(projectData.texturesTable.cbLarge);
     2099        ui->cbEnvMap->setChecked(projectData.texturesTable.cbEnvMap);
     2100        ui->leEnvMapTexture->setText(projectData.texturesTable.leEnvMapTexture);
     2101
     2102        // Characters tab
     2103        fLoadTabGenericData(projectData.charactersTable, ui->twSourcesCharacters, ui->cbFromCharacters, ui->cbToCharacters);
     2104
     2105        ui->cbCellShading->setChecked(projectData.charactersTable.cbCellShading);
     2106        ui->cbNormals->setChecked(projectData.charactersTable.cbNormals);
     2107        ui->cbStandingPose->setChecked(projectData.charactersTable.cbStandingPose);
     2108        ui->cbWithTRBS_ONCC->setChecked(projectData.charactersTable.cbWithTRBS_ONCC);
     2109        ui->leTRBS_ONCC->setText(projectData.charactersTable.leTRBS_ONCC);
     2110
     2111        // Objects tab
     2112        fLoadTabGenericData(projectData.objectsTable, ui->twSourcesObjects, ui->cbFromObjects, ui->cbToObjects);
     2113
     2114        ui->cbTexture->setChecked(projectData.objectsTable.cbTexture);
     2115        ui->leTextureName->setText(projectData.objectsTable.leTextureName);
     2116        ui->cbWithAnimation->setChecked(projectData.objectsTable.cbWithAnimation);
     2117        ui->leAnimationName->setText(projectData.objectsTable.leAnimationName);
     2118
     2119        // Levels tab
     2120        fLoadTabGenericData(projectData.levelsTable, ui->twSourcesLevels, ui->cbFromLevels, ui->cbToLevels);
     2121
     2122        ui->cbSpecificFilesLevels->setChecked(projectData.levelsTable.cbSpecificFilesLevels);
     2123        ui->leSpecificFilesLevels->setText(projectData.levelsTable.leSpecificFilesLevels);
     2124        ui->cbDatLevels->setChecked(projectData.levelsTable.cbDatLevels);
     2125        ui->leTargetDatLevels->setText(projectData.levelsTable.leTargetDatLevels);
     2126        ui->cbBnvLevels->setChecked(projectData.levelsTable.cbBnvLevels);
     2127        ui->leBnvLevels->setText(projectData.levelsTable.leBnvLevels);
     2128        ui->cbGridsLevels->setChecked(projectData.levelsTable.cbGridsLevels);
     2129        ui->cbAdditionalSourcesLevels->setChecked(projectData.levelsTable.cbAdditionalSourcesLevels);
     2130        ui->leAdditSourcesLevels->setText(projectData.levelsTable.leAdditSourcesLevels);
     2131
     2132        // Misc tab
     2133        fLoadTabGenericData(projectData.miscTable, ui->twSourcesMisc, ui->cbFromMisc, ui->cbToMisc);
     2134
     2135        this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path());
     2136
     2137        this->lastProjectFilePath = filePath;
     2138        this->unsavedChangesExist = false;
     2139
     2140        addNewRecentProject(filePath);
     2141
     2142        setVagoWindowTitle();
     2143
    20412144        this->projectIsLoading = false;
    2042         return;
    2043     }
    2044 
    2045 
    2046     if(QString(doc.root().first_child().name()) != "VagoProject"){
    2047         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, QString(doc.root().name()) + "The file opened is not a valid VagoProject file. Load aborted.");
    2048         showErrStatusMessage(statusError);
     2145
     2146        Util::StatusBar::showSuccess(ui->statusBar, "Project loaded sucessfully.");
     2147    }
     2148    catch(const std::exception& e){
    20492149        this->projectIsLoading = false;
    2050         return;
    2051     }
    2052 
    2053     QString projVagoVersion;
    2054 
    2055     try{
    2056         projVagoVersion = QString(doc.select_node("/VagoProject/@vagoVersion").attribute().value());
    2057     }
    2058     catch (const pugi::xpath_exception& e)
    2059     {
    2060         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't find the vagoVersion of the current project. Load aborted.\n" + QString(e.what()));
    2061         showErrStatusMessage(statusError);
    2062         this->projectIsLoading = false;
    2063         return;
    2064     }
    2065 
    2066     if(!projVagoVersion.startsWith(GlobalVars::LastCompatibleVersion)){
    2067         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "The project that you are trying to load seems it is not compatible with your Vago Version. Please update Vago and try again.");
    2068         showErrStatusMessage(statusError);
    2069         this->projectIsLoading = false;
    2070         return;
    2071     }
    2072 
    2073     // After the initial validations begin loading the project data
    2074 
    2075     QList<DropTableWidget*> tableWidgets = getAllTableWidgets();
    2076 
    2077     try{
    2078         foreach(DropTableWidget* const &myTable, tableWidgets){
    2079             loadProjectWidget(doc, myTable);
    2080         }
    2081     }
    2082     catch(const std::exception& e){
    2083         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't load the vago project. Error: " + QString(e.what()));
    2084         showErrStatusMessage(statusError);
    2085         this->projectIsLoading = false;
    2086         return;
    2087     }
    2088 
    2089     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path());
    2090 
    2091     this->lastProjectFilePath = filePath;
    2092     this->unsavedChangesExist = false;
    2093 
    2094     addNewRecentProject(filePath);
    2095 
    2096     setVagoWindowTitle();
    2097 
    2098     this->projectIsLoading = false;
    2099 
    2100     showSuccessStatusMessage("Project loaded sucessfully.");
    2101 }
    2102 
    2103 
    2104 void MainWindow::loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table)
    2105 {
    2106     QString tabName = getTabNameByTableWidget(table);
    2107     QString from (doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/@from")).attribute().value());
    2108     QString to (doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/@to")).attribute().value());
    2109 
    2110     if(table==ui->twSourcesXML){
    2111         ui->cbFromXML->setCurrentText(from);
    2112         on_cbFromXML_currentIndexChanged(from);
    2113         ui->cbToXML->setCurrentText(to);
    2114     }
    2115     else if(table==ui->twSourcesTextures){
    2116         //ui->cbFromTextures->setCurrentText(from);
    2117         on_cbFromTextures_currentIndexChanged(from);
    2118         ui->cbToTextures->setCurrentText(to);
    2119 
    2120         getTextureRBTypeTextureByName((doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@type")).attribute().value()))->setChecked(true);
    2121         ui->cbMipMapsTextures->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@genMipMaps")).attribute().as_bool());
    2122         ui->cbNoUwrap->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@noUwrap")).attribute().as_bool());
    2123         ui->cbNoVwrap->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@noVwrap")).attribute().as_bool());
    2124         ui->cbLarge->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@large")).attribute().as_bool());
    2125         ui->cbEnvMap->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@envMap")).attribute().as_bool());
    2126         ui->leEnvMapTexture->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@envMapValue")).attribute().value()));
    2127     }
    2128     else if(table==ui->twSourcesCharacters){
    2129         ui->cbFromCharacters->setCurrentText(from);
    2130         on_cbFromCharacters_currentIndexChanged(from);
    2131         ui->cbToCharacters->setCurrentText(to);
    2132 
    2133 
    2134         ui->cbCellShading->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@cellShading")).attribute().as_bool());
    2135         ui->cbNormals->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@normals")).attribute().as_bool());
    2136         ui->cbWithTRBS_ONCC->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractTRBSONCC")).attribute().as_bool());
    2137         ui->leTRBS_ONCC->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractTRBSONCCValue")).attribute().value()));
    2138     }
    2139     else if(table==ui->twSourcesObjects){
    2140         ui->cbFromObjects->setCurrentText(from);
    2141         on_cbFromObjects_currentIndexChanged(from);
    2142         ui->cbToObjects->setCurrentText(to);
    2143 
    2144         ui->cbTexture->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@texture")).attribute().as_bool());
    2145         ui->leTextureName->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@textureValue")).attribute().value()));
    2146         ui->cbWithAnimation->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@withAnimation")).attribute().as_bool());
    2147         ui->leAnimationName->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@withAnimationValue")).attribute().value()));
    2148     }
    2149     else if(table==ui->twSourcesLevels){
    2150         ui->cbFromLevels->setCurrentText(from);
    2151         on_cbFromLevels_currentIndexChanged(from);
    2152         ui->cbToLevels->setCurrentText(to);
    2153 
    2154         ui->cbSpecificFilesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractWithFiles")).attribute().as_bool());
    2155         ui->leSpecificFilesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractWithFilesValue")).attribute().value()));
    2156         ui->cbDatLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@datFilename")).attribute().as_bool());
    2157         ui->leTargetDatLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@datFilenameValue")).attribute().value()));
    2158         ui->cbBnvLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSource")).attribute().as_bool());
    2159         ui->leBnvLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSourceValue")).attribute().value()));
    2160         ui->cbGridsLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@generateGrids")).attribute().as_bool());
    2161         ui->cbAdditionalSourcesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSources")).attribute().as_bool());
    2162         ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSourcesValue")).attribute().value()));
    2163     }
    2164     else{
    2165         ui->cbFromMisc->setCurrentText(from);
    2166         on_cbFromMisc_currentIndexChanged(from);
    2167         ui->cbToMisc->setCurrentText(to);
    2168     }
    2169 
    2170     // Clean previous rows
    2171     clearTableNoPrompt(table);
    2172 
    2173     for(const pugi::xpath_node &xPathNode : doc.select_nodes(Util::qStrToCstr("/VagoProject/"+tabName+"/Row"))){
    2174         pugi::xml_node currNode = xPathNode.node();
    2175 
    2176         QString currFileFolder = currNode.attribute("fileFolder").value();
    2177         QString currFromTo = currNode.attribute("fromTo").value();
    2178         QString currCommand = currNode.attribute("command").value();
    2179 
    2180         bool isToDisable = false;
    2181         pugi::xml_attribute disabledAttr = currNode.attribute("disabled");
    2182         isToDisable = disabledAttr.empty() ? false : disabledAttr.as_bool();
    2183 
    2184         addRowTable(table,currFileFolder,currFromTo,currCommand, isToDisable);
    2185     }
     2150        QString errorMessage = "Couldn't load the Vago project. Error: " + QString(e.what());
     2151        LOG_ERROR << errorMessage;
     2152        Util::Dialogs::showError(errorMessage);
     2153        Util::StatusBar::showError(ui->statusBar, "Couldn't load project.");
     2154    }
     2155
    21862156}
    21872157
  • s10k/Vago/mainwindow.h

    r1061 r1093  
    1313#include "xmltoolsinterface.h"
    1414#include "wizardfactory.h"
     15#include "xmlParsers/projectfilevago.h"
    1516
    1617#include <QMainWindow>
     
    3334#include <QScriptValueIterator>
    3435#include <droptablewidget.h>
    35 #include <pugixml.hpp>
     36#include <pugixml/pugixml.hpp>
    3637#ifdef Q_OS_WIN
    3738#include <QWinTaskbarProgress>
     
    170171    void on_cbWithTRBS_ONCC_toggled(bool checked);
    171172
     173    void on_cbFromXML_currentIndexChanged(const QString &arg1);
     174
     175    void on_cbSpecificFilesLevels_toggled(bool checked);
     176
     177    void on_tbAbortConversion_clicked();
     178
     179    void on_tabWidget_currentChanged(int);
     180
     181    void on_actionSave_Project_triggered();
     182
     183    void on_actionSave_triggered();
     184
     185    void on_actionLoad_Project_triggered();
     186
     187    void on_actionProject1_triggered();
     188
     189    void on_actionProject2_triggered();
     190
     191    void on_actionProject3_triggered();
     192
     193    void on_actionProject4_triggered();
     194
     195    void on_actionProject5_triggered();
     196
     197    void on_actionBackground_Image_Wizard_triggered();
     198
     199    void on_actionNew_Project_triggered();
     200
     201    void on_tbXmlToolsInterface_clicked();
     202
     203    void on_actionWindow_Messages_Wizard_triggered();
     204
    172205    void on_cbWithAnimation_toggled(bool checked);
    173 
    174     void on_cbFromXML_currentIndexChanged(const QString &arg1);
    175 
    176     void on_cbSpecificFilesLevels_toggled(bool checked);
    177 
    178     void on_tbAbortConversion_clicked();
    179 
    180     void on_tabWidget_currentChanged(int);
    181 
    182     void on_actionSave_Project_triggered();
    183 
    184     void on_actionSave_triggered();
    185 
    186     void on_actionLoad_Project_triggered();
    187 
    188     void on_actionProject1_triggered();
    189 
    190     void on_actionProject2_triggered();
    191 
    192     void on_actionProject3_triggered();
    193 
    194     void on_actionProject4_triggered();
    195 
    196     void on_actionProject5_triggered();
    197 
    198     void on_actionBackground_Image_Wizard_triggered();
    199 
    200     void on_actionNew_Project_triggered();
    201 
    202     void on_tbXmlToolsInterface_clicked();
    203 
    204     void on_actionWindow_Messages_Wizard_triggered();
    205206
    206207private:
    207208    Ui::MainWindow *ui;
    208     Logger *myLogger;
    209209    QString workspaceLocation; //Workspace location
    210210    QString workspaceWizardsLocation; //Workspace wizard location
     
    241241    enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex};
    242242
     243private:
    243244    void connectSlots();
    244     void showErrStatusMessage(QString message);
    245     void showSuccessStatusMessage(QString message);
    246245    void mapCommands();
    247246    void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false);
     
    256255    void setConverterButtonsSize();
    257256    void saveProjectState(const QString &filePath);
    258     void saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table);
    259257    void loadProjectState(const QString &filePath);
    260258    void setVagoWindowTitle();
    261     void loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table);
    262259    void saveRecentProjects();
    263260    void loadRecentProjects();
     
    284281    QList<DropTableWidget*> getAllTableWidgets();
    285282    QMessageBox::StandardButton askToSaveCurrentProject();
     283    ProjectFileVago::ProjectData fetchCurrentProjectData();
    286284
    287285signals:
  • s10k/Vago/mainwindow.ui

    r1061 r1093  
    701701          <layout class="QHBoxLayout" name="horizontalLayout_3">
    702702           <item>
     703            <widget class="QCheckBox" name="cbStandingPose">
     704             <property name="toolTip">
     705              <string>Export the model in a &quot;standing pose&quot;. If not checked model is exported in the &quot;wrapped form&quot; (all body parts set to 0)</string>
     706             </property>
     707             <property name="text">
     708              <string>Standing Pose</string>
     709             </property>
     710            </widget>
     711           </item>
     712           <item>
    703713            <widget class="QCheckBox" name="cbCellShading">
    704714             <property name="enabled">
     
    905915             </property>
    906916             <property name="toolTip">
    907               <string>Give model a texture. 
     917              <string>Give model a texture.
    908918It's the name of a TXMP.oni file, don't include the extension.</string>
    909919             </property>
     
    922932             </property>
    923933             <property name="toolTip">
    924               <string>Give model a texture.
    925 It's the name of a TXMP.oni file, don't include the extension.</string>
     934              <string>Extract M3GM.oni with an animation file (OBAN.oni).
     935Add the full path to the OBAN.oni file (include extension).</string>
    926936             </property>
    927937             <property name="text">
     
    936946             </property>
    937947             <property name="toolTip">
    938               <string>Give model a texture.
    939 It's the name of a TXMP.oni file, don't include the extension.</string>
     948              <string>Extract M3GM.oni with an animation file (OBAN.oni).
     949Add the full path to the OBAN.oni file (include extension).</string>
    940950             </property>
    941951             <property name="placeholderText">
  • s10k/Vago/manualcommands.cpp

    r1058 r1093  
    4545
    4646    if(command.isEmpty()){
    47         Util::showErrorPopUp("Please input a command first.");
     47        Util::Dialogs::showError("Please input a command first.");
    4848        return;
    4949    }
     
    8686void ManualCommands::on_pbClear_clicked()
    8787{
    88     if(Util::showQuestionPopUp(this,"Clear the output?")){
     88    if(Util::Dialogs::showQuestion(this,"Clear the output?")){
    8989        ui->ptOutput->clear();
    9090    }
  • 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};
  • s10k/Vago/preferences.cpp

    r1054 r1093  
    3838void Preferences::accept (){
    3939    QStringList options;
    40     QRect screenRes = Util::getScreenResolution();
     40    QRect screenRes = Util::System::getScreenResolution();
    4141
    4242    options << ui->leAEfolder->text() << ui->leWorkspace->text() << ui->leWidth->text() << ui->leHeight->text();
    4343
    44     if(Util::checkEmptySpaces(options)){
    45         Util::showErrorPopUp("Setting not saved! There are empty settings.");
     44    if(Util::Validation::checkEmptySpaces(options)){
     45        Util::Dialogs::showError("Setting not saved! There are empty settings.");
    4646        return;
    4747    }
    4848
    49     if(Util::checkIfIntegers(QStringList() << ui->leWidth->text() << ui->leHeight->text() )){
    50         Util::showErrorPopUp("Setting not saved! Width and Height must be numbers.");
     49    if(Util::Validation::checkIfIntegers(QStringList() << ui->leWidth->text() << ui->leHeight->text() )){
     50        Util::Dialogs::showError("Setting not saved! Width and Height must be numbers.");
    5151        return;
    5252    }
    5353
    5454    if(ui->leWidth->text().toInt() > screenRes.width() || ui->leHeight->text().toInt() > screenRes.height()){
    55         Util::showErrorPopUp("Setting not saved! Width or Height specified are greater than actual screen resolution.");
     55        Util::Dialogs::showError("Setting not saved! Width or Height specified are greater than actual screen resolution.");
    5656        return;
    5757    }
    5858
    5959    if(ui->leWidth->text().toInt() <= 0  || ui->leHeight->text().toInt() <= 0 ){
    60         Util::showErrorPopUp("Settings not saved! Width and Height must be greater than 0.");
     60        Util::Dialogs::showError("Settings not saved! Width and Height must be greater than 0.");
    6161        return;
    6262    }
     
    7474#endif
    7575
    76     Util::showPopUp("You need to restart the application to all changes take effect.");
     76    Util::Dialogs::showInfo("You need to restart the application to all changes take effect.");
    7777
    7878    QDialog::accept();
     
    8282{
    8383    QString newDir=QFileDialog::getExistingDirectory(this,"Choose workspace folder...");
    84     newDir=Util::normalizePath(newDir);
     84    newDir=Util::FileSystem::normalizePath(newDir);
    8585
    8686    if(!newDir.isEmpty()){
     
    9292{
    9393    QString newDir=QFileDialog::getExistingDirectory(this,"Choose AE folder...");
    94     newDir=Util::normalizePath(newDir);
     94    newDir=Util::FileSystem::normalizePath(newDir);
    9595
    9696    if(!newDir.isEmpty()){
  • s10k/Vago/readme.txt

    r1062 r1093  
    11Readme.txt
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3 Vago GUI v1.3
     3Vago GUI v1.4
    44~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    55
     
    3737----------------------------------
    3838Change Log:
     39----------------------------------
     401.4, 30-12-2017
     41- Fixed crash when abort window was confirmed after the conversion has finished
     42- Replaced our custom log class by the plog library
     43- Fixed paragraphs not being created in "Window messages wizard"
     44- Added extensions validations to the conversions
     45- Add "Standing Pose" to ONCC extraction (-noanim)
     46- Fixed some inconsistencies of disabled options, now if a option changes states to invalid
     47(can't be used with current conversion), it is simply disabled and not used, but will remain
     48with the state unchanged (e.g. the checkbox may remain checked)
     49- Fixed bug in Textures tab, options didn't get disabled once enabled (when TGA -> TXMP)
     50- Added internal upgrade vago projects feature (so the vago projects can be updated over time depending on each
     51Vago version changes)
     52- Some code refactoring to make the code more modular and easier to build (now uses s10k's "shared" libraries for
     53qtcreator projects)
    3954----------------------------------
    40551.3, 09-12-2016
  • s10k/Vago/soundWizard/soundpage2.cpp

    r801 r1093  
    5555
    5656    if(size==0){
    57         Util::showPopUp("Select a row first.");
     57        Util::Dialogs::showInfo("Select a row first.");
    5858        return;
    5959    }
    6060
    61     if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){
     61    if(Util::Dialogs::showQuestion(this,"Are you sure you want to delete the selected rows?")){
    6262        for(int i=0; i<size; i++){
    6363            ui->twSoundFiles->removeRow(ui->twSoundFiles->selectionModel()->selectedRows().at(size-i-1).row());
     
    7171
    7272    //Pre-processing (check if received only folders)
    73     foreach(QString myFile, resources){
     73    for(const QString &myFile : resources){
    7474        QString currFileExt="."+QFileInfo(myFile).completeSuffix();
    7575        if(QDir(myFile).exists()){
    76             Util::showErrorPopUp("Only files are allowed for this operation.");
     76            Util::Dialogs::showError("Only files are allowed for this operation.");
    7777            return;
    7878        }
    7979
    80         foreach(QString vext, this->allowedFiles){
     80        for(QString vext : this->allowedFiles){
    8181            vext.remove("*");
    8282            if(currFileExt.endsWith(vext)){
     
    8787
    8888        if(!fileExtValid){
    89             Util::showErrorPopUp("Files must be in the follow formats:\n" +
     89            Util::Dialogs::showError("Files must be in the follow formats:\n" +
    9090                                 this->allowedFiles.join(" "));
    9191            return;
     
    9393    }
    9494
    95     foreach(QString currentFile, resources){
     95    for(const QString &currentFile : resources){
    9696
    9797        //Get actual number rows
     
    103103        //Add to table and list to
    104104        QTableWidgetItem *newName = new QTableWidgetItem(QFileInfo(currentFile).baseName());
    105         QTableWidgetItem *newFileLocation = new QTableWidgetItem(Util::normalizePath(currentFile));
     105        QTableWidgetItem *newFileLocation = new QTableWidgetItem(Util::FileSystem::normalizePath(currentFile));
    106106
    107107        myTable->setItem(twSize,0,newName);
     
    125125
    126126    if(ui->twSoundFiles->rowCount()==0){
    127         Util::showErrorPopUp("You need to add some sound files first!");
     127        Util::Dialogs::showError("You need to add some sound files first!");
    128128        return false;
    129129    }
     
    133133    }
    134134
    135     if(ui->rbOther->isChecked() && Util::checkEmptySpaces(QStringList() << ui->leOtherLocation->text())){
    136         Util::showErrorPopUp("Please input a directory to output the files.");
     135    if(ui->rbOther->isChecked() && Util::Validation::checkEmptySpaces(QStringList() << ui->leOtherLocation->text())){
     136        Util::Dialogs::showError("Please input a directory to output the files.");
    137137        return false;
    138138    }
    139139
    140140    if(ui->rbOther->isChecked() && !QDir(ui->leOtherLocation->text()).exists()){
    141         Util::showErrorPopUp("Invalid directory specified in other location. Please fix it.");
     141        Util::Dialogs::showError("Invalid directory specified in other location. Please fix it.");
    142142        return false;
    143143    }
  • s10k/Vago/soundWizard/soundpage3.cpp

    r771 r1093  
    3434                       << ui->leTreshold->text();
    3535
    36     if(Util::checkEmptySpaces(leContents)){
    37         Util::showErrorPopUp("Please fill all fields first!");
     36    if(Util::Validation::checkEmptySpaces(leContents)){
     37        Util::Dialogs::showError("Please fill all fields first!");
    3838        return false;
    3939    }
    4040
    41     if(Util::checkIfDoubles(leContents)){
    42         Util::showErrorPopUp("All fields must contains numbers!");
     41    if(Util::Validation::checkIfDoubles(leContents)){
     42        Util::Dialogs::showError("All fields must contains numbers!");
    4343        return false;
    4444    }
  • s10k/Vago/soundWizard/soundpage4.cpp

    r771 r1093  
    3030               << ui->leWeight->text();
    3131
    32     if(Util::checkEmptySpaces(leContents)){
    33         Util::showErrorPopUp("Please fill all fields first!");
     32    if(Util::Validation::checkEmptySpaces(leContents)){
     33        Util::Dialogs::showError("Please fill all fields first!");
    3434        return false;
    3535    }
    3636
    37     if(Util::checkIfDoubles(leContents)){
    38         Util::showErrorPopUp("All fields must contains numbers!");
     37    if(Util::Validation::checkIfDoubles(leContents)){
     38        Util::Dialogs::showError("All fields must contains numbers!");
    3939        return false;
    4040    }
  • s10k/Vago/soundWizard/soundpage5.cpp

    r1054 r1093  
    2929                  ui->leImpactVelocity->text() << ui->leMinOcclusion->text();
    3030
    31     if(Util::checkEmptySpaces(leContents)){
    32         Util::showErrorPopUp("Please fill all fields first!");
     31    if(Util::Validation::checkEmptySpaces(leContents)){
     32        Util::Dialogs::showError("Please fill all fields first!");
    3333        return false;
    3434    }
    3535
    36     if(Util::checkIfDoubles(leContents)){
    37         Util::showErrorPopUp("All fields must contains numbers!");
     36    if(Util::Validation::checkIfDoubles(leContents)){
     37        Util::Dialogs::showError("All fields must contains numbers!");
    3838        return false;
    3939    }
  • s10k/Vago/soundWizard/soundpagefinal.cpp

    r1061 r1093  
    22#include "ui_soundpagefinal.h"
    33
    4 SoundPageFinal::SoundPageFinal(QString AppDir, QString soundsLocation, DropTableWidget *page2Table, Logger *myLogger, QHash<QString, QString> *commandMap, QWidget *parent) :
     4SoundPageFinal::SoundPageFinal(QString AppDir, QString soundsLocation, DropTableWidget *page2Table, QHash<QString, QString> *commandMap, QWidget *parent) :
    55    QWizardPage(parent),
    66    ui(new Ui::soundpagefinal)
     
    99    this->soundsLocation=soundsLocation;
    1010    this->page2Table=page2Table;
    11     this->myLogger=myLogger;
    1211    this->commandMap=commandMap;
    1312
    1413    this->xmlCommands = new QStringList();
    1514    this->oniSplitCommands = new QStringList();
    16     this->myXmlProcessor = new XmlProcessor(AppDir, this->myLogger,this->xmlCommands);
    17     this->myConverter = new Converter(AppDir, this->myLogger,this->oniSplitCommands);
     15    this->myXmlProcessor = new XmlProcessor(AppDir, this->xmlCommands);
     16    this->myConverter = new Converter(AppDir,this->oniSplitCommands);
    1817
    1918    ui->lbComplete->setText("<html>The wizard is now complete. The sounds have been converted. "
     
    126125    }
    127126
    128     sphereRadious=Util::normalizeDecimalSeparator(field("leSphereRadious").toString());
    129     minElapsedTime=Util::normalizeDecimalSeparator(field("leMinElapsedTime").toString());
    130     maxElapsedTime=Util::normalizeDecimalSeparator(field("leMaxElapsedTime").toString());
    131     minVolumeDistance=Util::normalizeDecimalSeparator(field("leMinVolumeDistance").toString());
    132     maxVolumeDistance=Util::normalizeDecimalSeparator(field("leMaxVolumeDistance").toString());
    133     minOcclusion=Util::normalizeDecimalSeparator(field("leMinOcclusion").toString());
    134     treshold=Util::normalizeDecimalSeparator(field("leTreshold").toString());
     127    sphereRadious=Util::String::normalizeDecimalSeparator(field("leSphereRadious").toString());
     128    minElapsedTime=Util::String::normalizeDecimalSeparator(field("leMinElapsedTime").toString());
     129    maxElapsedTime=Util::String::normalizeDecimalSeparator(field("leMaxElapsedTime").toString());
     130    minVolumeDistance=Util::String::normalizeDecimalSeparator(field("leMinVolumeDistance").toString());
     131    maxVolumeDistance=Util::String::normalizeDecimalSeparator(field("leMaxVolumeDistance").toString());
     132    minOcclusion=Util::String::normalizeDecimalSeparator(field("leMinOcclusion").toString());
     133    treshold=Util::String::normalizeDecimalSeparator(field("leTreshold").toString());
    135134
    136135    // Get data page 4
    137136
    138     volume=Util::normalizeDecimalSeparator(field("leVolume").toString());
    139     minVolume=Util::normalizeDecimalSeparator(field("leMinVolume").toString());
    140     maxVolume=Util::normalizeDecimalSeparator(field("leMaxVolume").toString());
    141     pitch=Util::normalizeDecimalSeparator(field("lePitch").toString());
    142     minPitch=Util::normalizeDecimalSeparator(field("leMinPitch").toString());
    143     maxPitch=Util::normalizeDecimalSeparator(field("leMaxPitch").toString());
    144     weight=Util::normalizeDecimalSeparator(field("leWeight").toString());
     137    volume=Util::String::normalizeDecimalSeparator(field("leVolume").toString());
     138    minVolume=Util::String::normalizeDecimalSeparator(field("leMinVolume").toString());
     139    maxVolume=Util::String::normalizeDecimalSeparator(field("leMaxVolume").toString());
     140    pitch=Util::String::normalizeDecimalSeparator(field("lePitch").toString());
     141    minPitch=Util::String::normalizeDecimalSeparator(field("leMinPitch").toString());
     142    maxPitch=Util::String::normalizeDecimalSeparator(field("leMaxPitch").toString());
     143    weight=Util::String::normalizeDecimalSeparator(field("leWeight").toString());
    145144
    146145    preventRepeat=field("cbPreventRepeat").toBool();
     
    176175    }
    177176
    178     minVolumeDistanceImp=Util::normalizeDecimalSeparator(field("leMinVolumeDistanceImp").toString());
    179     maxVolumeDistanceImp=Util::normalizeDecimalSeparator(field("leMaxVolumeDistanceImp").toString());
    180     minAngleImp=Util::normalizeDecimalSeparator(field("leMinAngleImp").toString());
    181     maxAngleImp=Util::normalizeDecimalSeparator(field("leMaxAngleImp").toString());
    182     minAttenuationImp=Util::normalizeDecimalSeparator(field("leMinAttenuationImp").toString());
    183     impactVelocityImp=Util::normalizeDecimalSeparator(field("leImpactVelocityImp").toString());
    184     minOcclusionImp=Util::normalizeDecimalSeparator(field("leMinOcclusionImp").toString());
     177    minVolumeDistanceImp=Util::String::normalizeDecimalSeparator(field("leMinVolumeDistanceImp").toString());
     178    maxVolumeDistanceImp=Util::String::normalizeDecimalSeparator(field("leMaxVolumeDistanceImp").toString());
     179    minAngleImp=Util::String::normalizeDecimalSeparator(field("leMinAngleImp").toString());
     180    maxAngleImp=Util::String::normalizeDecimalSeparator(field("leMaxAngleImp").toString());
     181    minAttenuationImp=Util::String::normalizeDecimalSeparator(field("leMinAttenuationImp").toString());
     182    impactVelocityImp=Util::String::normalizeDecimalSeparator(field("leImpactVelocityImp").toString());
     183    minOcclusionImp=Util::String::normalizeDecimalSeparator(field("leMinOcclusionImp").toString());
    185184
    186185    //######################################################### Starting xml processing
    187186
    188187    // Clean tmp dir
    189     if(!Util::rmDir(GlobalVars::VagoTemporaryDir)){       
    190         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't clean vago temp dir for complete sound wizard. Aborting.\n"+GlobalVars::VagoTemporaryDir);
     188    if(!Util::FileSystem::rmDir(GlobalVars::VagoTemporaryDir)){
     189        UtilVago::showAndLogErrorPopUpLogButton("Couldn't clean vago temp dir for complete sound wizard. Aborting.\n"+GlobalVars::VagoTemporaryDir);
    191190        return;
    192191    }
    193192
    194193    if(!QDir(QDir::tempPath()).mkpath("VagoTemp")){
    195         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't reconstruct vago temp dir for complete sound wizard. Aborting.\n"+GlobalVars::VagoTemporaryDir);
     194        UtilVago::showAndLogErrorPopUpLogButton("Couldn't reconstruct vago temp dir for complete sound wizard. Aborting.\n"+GlobalVars::VagoTemporaryDir);
    196195    }
    197196
     
    205204
    206205    (*this->xmlCommands)
    207      << "--replace-all-values -e Priority -n "+Util::insertQuotes(priority)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    208      << "--replace-all-values -e Flags -n "+(flags.join(" ").isEmpty() ? Util::insertQuotes("") : Util::insertQuotes(flags.join(" ")))+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    209      << "--replace-all-values -e SphereRadius -n "+Util::insertQuotes(sphereRadious)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    210      << "--replace-all-values -e Treshold -n "+Util::insertQuotes(treshold)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    211      << "--replace-all-values -e MinOcclusion -n "+Util::insertQuotes(minOcclusion)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    212      << "--replace-all-values --parent-element-name ElapsedTime -e  Max -n "+Util::insertQuotes(maxElapsedTime)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    213      << "--replace-all-values --parent-element-name ElapsedTime -e  Min -n "+Util::insertQuotes(minElapsedTime)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    214      << "--replace-all-values --parent-element-name Distance -e  Max -n "+Util::insertQuotes(maxVolumeDistance)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    215      << "--replace-all-values --parent-element-name Distance -e  Min -n "+Util::insertQuotes(minVolumeDistance)+" -f "+Util::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
    216      << "--replace-all-values --parent-element-name SoundGroup -e  Volume -n "+Util::insertQuotes(volume)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    217      << "--replace-all-values --parent-element-name SoundGroup -e  Pitch -n "+Util::insertQuotes(pitch)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    218      << "--replace-all-values --parent-element-name SoundGroup -e  NumberOfChannels -n "+Util::insertQuotes(numberChannels)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    219      << "--replace-all-values --parent-element-name Volume -e  Min -n "+Util::insertQuotes(minVolume)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    220      << "--replace-all-values --parent-element-name Volume -e  Max -n "+Util::insertQuotes(maxVolume)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    221      << "--replace-all-values --parent-element-name Pitch -e  Min -n "+Util::insertQuotes(minPitch)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    222      << "--replace-all-values --parent-element-name Pitch -e  Max -n "+Util::insertQuotes(maxPitch)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    223      << "--replace-all-values -e  Weight -n "+Util::insertQuotes(weight)+" -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
    224      << "--replace-all-values -e  Priority -n "+Util::insertQuotes(priorityImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    225      << "--replace-all-values --parent-element-name Distance -e  Min -n "+Util::insertQuotes(minVolumeDistanceImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    226      << "--replace-all-values --parent-element-name Distance -e  Max -n "+Util::insertQuotes(maxVolumeDistanceImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    227      << "--replace-all-values --parent-element-name Angle -e  Min -n "+Util::insertQuotes(minAngleImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    228      << "--replace-all-values --parent-element-name Angle -e  Max -n "+Util::insertQuotes(maxAngleImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    229      << "--replace-all-values -e  MinAttenuation -n "+Util::insertQuotes(minAttenuationImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    230      << "--replace-all-values -e  ImpactVelocity -n "+Util::insertQuotes(impactVelocityImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
    231      << "--replace-all-values -e  MinOcclusion -n "+Util::insertQuotes(minOcclusionImp)+" -f "+Util::insertQuotes(impFileLocation)+" --no-backups --no-verbose";
     206     << "--replace-all-values -e Priority -n "+Util::String::insertQuotes(priority)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     207     << "--replace-all-values -e Flags -n "+(flags.join(" ").isEmpty() ? Util::String::insertQuotes("") : Util::String::insertQuotes(flags.join(" ")))+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     208     << "--replace-all-values -e SphereRadius -n "+Util::String::insertQuotes(sphereRadious)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     209     << "--replace-all-values -e Treshold -n "+Util::String::insertQuotes(treshold)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     210     << "--replace-all-values -e MinOcclusion -n "+Util::String::insertQuotes(minOcclusion)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     211     << "--replace-all-values --parent-element-name ElapsedTime -e  Max -n "+Util::String::insertQuotes(maxElapsedTime)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     212     << "--replace-all-values --parent-element-name ElapsedTime -e  Min -n "+Util::String::insertQuotes(minElapsedTime)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     213     << "--replace-all-values --parent-element-name Distance -e  Max -n "+Util::String::insertQuotes(maxVolumeDistance)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     214     << "--replace-all-values --parent-element-name Distance -e  Min -n "+Util::String::insertQuotes(minVolumeDistance)+" -f "+Util::String::insertQuotes(ambFileLocation)+" --no-backups --no-verbose"
     215     << "--replace-all-values --parent-element-name SoundGroup -e  Volume -n "+Util::String::insertQuotes(volume)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     216     << "--replace-all-values --parent-element-name SoundGroup -e  Pitch -n "+Util::String::insertQuotes(pitch)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     217     << "--replace-all-values --parent-element-name SoundGroup -e  NumberOfChannels -n "+Util::String::insertQuotes(numberChannels)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     218     << "--replace-all-values --parent-element-name Volume -e  Min -n "+Util::String::insertQuotes(minVolume)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     219     << "--replace-all-values --parent-element-name Volume -e  Max -n "+Util::String::insertQuotes(maxVolume)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     220     << "--replace-all-values --parent-element-name Pitch -e  Min -n "+Util::String::insertQuotes(minPitch)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     221     << "--replace-all-values --parent-element-name Pitch -e  Max -n "+Util::String::insertQuotes(maxPitch)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     222     << "--replace-all-values -e  Weight -n "+Util::String::insertQuotes(weight)+" -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose"
     223     << "--replace-all-values -e  Priority -n "+Util::String::insertQuotes(priorityImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     224     << "--replace-all-values --parent-element-name Distance -e  Min -n "+Util::String::insertQuotes(minVolumeDistanceImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     225     << "--replace-all-values --parent-element-name Distance -e  Max -n "+Util::String::insertQuotes(maxVolumeDistanceImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     226     << "--replace-all-values --parent-element-name Angle -e  Min -n "+Util::String::insertQuotes(minAngleImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     227     << "--replace-all-values --parent-element-name Angle -e  Max -n "+Util::String::insertQuotes(maxAngleImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     228     << "--replace-all-values -e  MinAttenuation -n "+Util::String::insertQuotes(minAttenuationImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     229     << "--replace-all-values -e  ImpactVelocity -n "+Util::String::insertQuotes(impactVelocityImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose"
     230     << "--replace-all-values -e  MinOcclusion -n "+Util::String::insertQuotes(minOcclusionImp)+" -f "+Util::String::insertQuotes(impFileLocation)+" --no-backups --no-verbose";
    232231
    233232    if(preventRepeat){
    234         (*this->xmlCommands) << "--replace-all-values --parent-element-name SoundGroup -e Flags -n PreventRepeat -f "+Util::insertQuotes(grpFileLocation)+" --no-backups --no-verbose";
     233        (*this->xmlCommands) << "--replace-all-values --parent-element-name SoundGroup -e Flags -n PreventRepeat -f "+Util::String::insertQuotes(grpFileLocation)+" --no-backups --no-verbose";
    235234    }
    236235
     
    245244    for(int i=0; i<this->page2Table->rowCount(); i++){
    246245
    247         (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::insertQuotes(outputFolder)+" "+Util::insertQuotes(this->page2Table->item(i,1)->text()); // add location of sound file to convert
     246        (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::String::insertQuotes(outputFolder)+" "+Util::String::insertQuotes(this->page2Table->item(i,1)->text()); // add location of sound file to convert
    248247
    249248        currFileName=this->page2Table->item(i,0)->text(); // get current file name
     
    256255        QFile::copy(impFileLocation, currImpFileLocation);
    257256
    258         (*this->xmlCommands) << "--replace-all-values -e BaseTrack1 -n "+Util::insertQuotes(currFileName)+" -f "+Util::insertQuotes(currAmbFileLocation)+" --no-backups --no-verbose" // process the xml
    259                              << "--replace-all-values -e Sound -n "+Util::insertQuotes(currFileName)+" -f "+Util::insertQuotes(currGrpFileLocation)+" --no-backups --no-verbose"
    260                              << "--replace-all-values -e Group -n "+Util::insertQuotes(currFileName)+" -f "+Util::insertQuotes(currImpFileLocation)+" --no-backups --no-verbose";
     257        (*this->xmlCommands) << "--replace-all-values -e BaseTrack1 -n "+Util::String::insertQuotes(currFileName)+" -f "+Util::String::insertQuotes(currAmbFileLocation)+" --no-backups --no-verbose" // process the xml
     258                             << "--replace-all-values -e Sound -n "+Util::String::insertQuotes(currFileName)+" -f "+Util::String::insertQuotes(currGrpFileLocation)+" --no-backups --no-verbose"
     259                             << "--replace-all-values -e Group -n "+Util::String::insertQuotes(currFileName)+" -f "+Util::String::insertQuotes(currImpFileLocation)+" --no-backups --no-verbose";
    261260
    262261        myXmlProcessor->start();
    263262        myXmlProcessor->wait(); // Wait until all xml is edited
    264263
    265         (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::insertQuotes(outputFolder)+" "+Util::insertQuotes(currAmbFileLocation);
    266         (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::insertQuotes(outputFolder)+" "+Util::insertQuotes(currGrpFileLocation);
    267         (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::insertQuotes(outputFolder)+" "+Util::insertQuotes(currImpFileLocation);
     264        (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::String::insertQuotes(outputFolder)+" "+Util::String::insertQuotes(currAmbFileLocation);
     265        (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::String::insertQuotes(outputFolder)+" "+Util::String::insertQuotes(currGrpFileLocation);
     266        (*this->oniSplitCommands) << this->commandMap->value("xml->XML->ONI")+" "+Util::String::insertQuotes(outputFolder)+" "+Util::String::insertQuotes(currImpFileLocation);
    268267    }
    269268
  • s10k/Vago/soundWizard/soundpagefinal.h

    r1061 r1093  
    77#include <droptablewidget.h>
    88
    9 #include "logger.h"
    109#include "xmlprocessor.h"
    1110#include "converter.h"
     
    2019   
    2120public:
    22     explicit SoundPageFinal(QString AppDir, QString soundsLocation, DropTableWidget *page2Table, Logger *myLogger, QHash<QString, QString> *commandMap, QWidget *parent = 0);
     21    explicit SoundPageFinal(QString AppDir, QString soundsLocation, DropTableWidget *page2Table, QHash<QString, QString> *commandMap, QWidget *parent = 0);
    2322    ~SoundPageFinal();
    2423   
     
    2726    Ui::soundpagefinal *ui;
    2827    DropTableWidget *page2Table;
    29     Logger *myLogger;
    3028    XmlProcessor *myXmlProcessor;
    3129    Converter *myConverter;
  • s10k/Vago/soundWizard/soundwizard.cpp

    r1061 r1093  
    11#include "soundwizard.h"
    22
    3 SoundWizard::SoundWizard(QString appDir, QString workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, QHash<QString, QString> *commandMap)
    4     :AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, true)
     3SoundWizard::SoundWizard(QString appDir, QString workspaceWizardLocation, QSettings *vagoSettings, QHash<QString, QString> *commandMap)
     4    :AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, true)
    55{
    66    this->appDir=appDir;
     
    1414    SoundPage4 *page4 = new SoundPage4();
    1515    SoundPage5 *page5 = new SoundPage5();
    16     SoundPageFinal *pageFinal = new SoundPageFinal(this->appDir, this->soundsLocation,page2->soundTable,this->myLogger, this->commandMap);
     16    SoundPageFinal *pageFinal = new SoundPageFinal(this->appDir, this->soundsLocation,page2->soundTable, this->commandMap);
    1717
    1818    this->myWizard.addPage
  • s10k/Vago/soundWizard/soundwizard.h

    r1061 r1093  
    1414#include "util.h"
    1515#include "abstractwizard.h"
    16 #include "logger.h"
    1716#include "soundpage2.h"
    1817#include "soundpage3.h"
     
    2423{
    2524protected:
    26     SoundWizard(QString appLocation, QString workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, QHash<QString, QString> *commandMap);
     25    SoundWizard(QString appLocation, QString workspaceWizardLocation, QSettings *vagoSettings, QHash<QString, QString> *commandMap);
    2726    void exec();
    2827    QHash<QString, QString> *commandMap;
  • s10k/Vago/utilvago.cpp

    r1054 r1093  
    77}
    88
    9 void showAndLogWarningPopUp(Logger *logger, const QString &message){
    10     logger->writeString(message);
     9void showAndLogWarningPopUp(const QString &message){
     10    LOG_WARNING << message;
    1111
    1212    QMessageBox msgBox;
     
    3030
    3131//Same of above but also writtes directly to the log file the error
    32 void showAndLogWarningPopUpLogButton(Logger *logger, const QString &message){
     32void showAndLogWarningPopUpLogButton(const QString &message){
    3333
    34     logger->writeString(message);
     34    LOG_WARNING << message;
    3535
    3636    QMessageBox msgBox;
     
    4545}
    4646
    47 void showAndLogErrorPopUp(Logger *logger, const QString &message){
     47void showAndLogErrorPopUp(const QString &message){
    4848
    49     logger->writeString(message);
     49    LOG_ERROR << message;
    5050
    5151    QMessageBox msgBox;
     
    6969
    7070//Same of above but also writtes directly to the log file the error
    71 void showAndLogErrorPopUpLogButton(Logger *logger, const QString &message){
     71void showAndLogErrorPopUpLogButton(const QString &message){
    7272
    73     logger->writeString(message);
     73    LOG_ERROR << message;
    7474
    7575    QMessageBox msgBox;
     
    118118
    119119#ifdef Q_OS_MAC
    120     return getMonoExecutablePath() + " " + Util::insertQuotes(getOniSplitExecutableAbsolutePath());
     120    return getMonoExecutablePath() + " " + Util::String::insertQuotes(getOniSplitExecutableAbsolutePath());
    121121#else
    122     return Util::insertQuotes(getOniSplitExecutableAbsolutePath());
     122    return Util::String::insertQuotes(getOniSplitExecutableAbsolutePath());
    123123#endif
    124124}
    125125
    126126QString getXmlToolsExecutable(){
    127     return Util::insertQuotes(getXmlToolsExecutableAbsolutePath());
     127    return Util::String::insertQuotes(getXmlToolsExecutableAbsolutePath());
    128128}
    129129
     
    144144#endif
    145145
     146QString getDateTimeFormatForFilename(const QDateTime &currentDateTime){
     147    return currentDateTime.toString("yyyy-MM-dd_hh-mm-ss");
    146148}
     149
     150}
  • s10k/Vago/utilvago.h

    r1061 r1093  
    22#define UTILVAGO_H
    33
    4 #include "util.h"
    5 #include "logger.h"
     4#include <util.h>
     5#include <cpp17optional/optional.hpp>
     6#include <plog/Log.h>
     7#include <plog/Converters/NativeEOLConverter.h>
     8
     9#include <QDateTime>
    610
    711namespace GlobalVars{
    812
    9 const QString AppVersion="1.3";
    10 const QString LastCompatibleVersion = "1.0";
     13const QString AppVersion="1.4";
     14const QString LastCompatibleVersion = "1.4";
    1115const QString ToolsFolder = "tools";
    1216const QString OniSplitString="OniSplit.exe";
     
    4650namespace UtilVago{
    4751void openLogFile();
    48 void showAndLogWarningPopUp(Logger *logger, const QString &message);
     52void showAndLogWarningPopUp(const QString &message);
    4953void showWarningPopUpLogButton(const QString &message);
    50 void showAndLogWarningPopUpLogButton(Logger *logger, const QString &message);
    51 void showAndLogErrorPopUp(Logger *logger, const QString &message);
     54void showAndLogWarningPopUpLogButton(const QString &message);
     55void showAndLogErrorPopUp(const QString &message);
    5256void showErrorPopUpLogButton(const QString &message);
    53 void showAndLogErrorPopUpLogButton(Logger *logger, const QString &message);
     57void showAndLogErrorPopUpLogButton(const QString &message);
    5458QString getOSIndependentAppPath();
    5559QString getAppPath();
     
    6165QString getMonoExecutablePath();
    6266#endif
     67QString getDateTimeFormatForFilename(const QDateTime &currentDateTime);
    6368}
    6469
  • s10k/Vago/windowMessagesWizard/wmfinalpage.cpp

    r1063 r1093  
    22#include "ui_wmfinalpage.h"
    33
    4 WmFinalPage::WmFinalPage(QString AppDir, QString wmLocation, Logger *myLogger, QList<std::shared_ptr<WmPage> > &pages, QWidget *parent) :
     4WmFinalPage::WmFinalPage(QString AppDir, QString wmLocation, QList<std::shared_ptr<WmPage> > &pages, QWidget *parent) :
    55    QWizardPage(parent), ui(new Ui::wmfinalpage), pages(pages)
    66{
    77    ui->setupUi(this);
    88    this->wmLocation=wmLocation;
    9     this->myLogger=myLogger;
    109
    1110    this->oniSplitCommands = new QStringList();
    12     this->myConverter = new Converter(AppDir, this->myLogger,this->oniSplitCommands);
     11    this->myConverter = new Converter(AppDir, this->oniSplitCommands);
    1312
    1413    ui->lbComplete->setText("<html>The wizard is now complete. The window messages have been converted. "
     
    5554        typeNode = rootNode.append_child("OPge");
    5655        typeNode.append_attribute("id").set_value(++globalSectionCounter);
    57         typeNode.append_child("LevelNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(field("leLevelId").toString()));
    58         typeNode.append_child("Pages").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(QString("#") + QString::number(++globalSectionCounter)));
     56        typeNode.append_child("LevelNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(field("leLevelId").toString()));
     57        typeNode.append_child("Pages").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(QString("#") + QString::number(++globalSectionCounter)));
    5958        pugi::xml_node igpaNode = rootNode.append_child("IGPA");
    6059        igpaNode.append_attribute("id").set_value(globalSectionCounter);
     
    6261        currentIGPGId = globalSectionCounter;
    6362        for(int i=0; i<this->pages.size(); i++){
    64             pagesNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     63            pagesNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    6564        }
    6665        break;
     
    6968        typeNode = rootNode.append_child("DPge");
    7069        typeNode.append_attribute("id").set_value(++globalSectionCounter);
    71         typeNode.append_child("LevelNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(field("leLevelId").toString()));
    72         typeNode.append_child("PageNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(field("lePageNumber").toString()));
    73         typeNode.append_child("IsLearnedMove").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(QString::number(static_cast<int>(field("cbIsLearnedMove").toBool()))));
    74         currentIGPGId = globalSectionCounter;
    75         typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     70        typeNode.append_child("LevelNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(field("leLevelId").toString()));
     71        typeNode.append_child("PageNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(field("lePageNumber").toString()));
     72        typeNode.append_child("IsLearnedMove").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(QString::number(static_cast<int>(field("cbIsLearnedMove").toBool()))));
     73        currentIGPGId = globalSectionCounter;
     74        typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    7675        break;
    7776    case  WINDOW_TYPE::HELP:
     
    7978        typeNode.append_attribute("id").set_value(++globalSectionCounter);
    8079        currentIGPGId = globalSectionCounter;
    81         typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     80        typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    8281        break;
    8382    case  WINDOW_TYPE::TEXT_CONSOLE:
     
    8584        typeNode = rootNode.append_child("TxtC");
    8685        typeNode.append_attribute("id").set_value(++globalSectionCounter);
    87         typeNode.append_child("Pages").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     86        typeNode.append_child("Pages").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    8887        pugi::xml_node igpaNode = rootNode.append_child("IGPA");
    8988        igpaNode.append_attribute("id").set_value(globalSectionCounter);
     
    9190        pugi::xml_node pagesNode = igpaNode.append_child("Pages");
    9291        for(int i=0; i<this->pages.size(); i++){
    93             pagesNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     92            pagesNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    9493        }
    9594        break;
     
    9897        typeNode = rootNode.append_child("WPge");
    9998        typeNode.append_attribute("id").set_value(++globalSectionCounter);
    100         typeNode.append_child("WeaponClass").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(field("leWeaponClassName").toString()));
    101         currentIGPGId = globalSectionCounter;
    102         typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     99        typeNode.append_child("WeaponClass").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(field("leWeaponClassName").toString()));
     100        currentIGPGId = globalSectionCounter;
     101        typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    103102        break;
    104103    case  WINDOW_TYPE::ITEM:
    105104        typeNode = rootNode.append_child("IPge");
    106105        typeNode.append_attribute("id").set_value(++globalSectionCounter);
    107         typeNode.append_child("PageNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(field("lePageNumber").toString()));
    108         currentIGPGId = globalSectionCounter;
    109         typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     106        typeNode.append_child("PageNumber").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(field("lePageNumber").toString()));
     107        currentIGPGId = globalSectionCounter;
     108        typeNode.append_child("Page").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    110109        break;
    111110    case WINDOW_TYPE::ENUM_END:
    112         UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFinalPage::startProcessing invalid WINDOW_TYPE");
     111        UtilVago::showAndLogErrorPopUp("An error ocurred: WmFinalPage::startProcessing invalid WINDOW_TYPE");
    113112        break;
    114113    }
     
    132131
    133132            this->oniSplitCommands->clear();
    134             this->oniSplitCommands->append("-create:txmp " + Util::insertQuotes(this->wmLocation) + " -format:bgr32 " + Util::insertQuotes(imageLocation));
     133            this->oniSplitCommands->append("-create:txmp " + Util::String::insertQuotes(this->wmLocation) + " -format:bgr32 " + Util::String::insertQuotes(imageLocation));
    135134
    136135            this->myConverter->start(); // finally process the onisplit commands
     
    152151        currentIGSAId = globalSectionCounter;
    153152
    154         igpgNode.append_child("Image").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(imageTXMPName));
    155         igpgNode.append_child("Text1").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
    156         igpgNode.append_child("Text2").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     153        igpgNode.append_child("Image").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(imageTXMPName));
     154        igpgNode.append_child("Text1").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
     155        igpgNode.append_child("Text2").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    157156
    158157        // IGSA
     
    166165
    167166        for(int i=0; i<mainTextNumberOfRows; i++){
    168             igsaMainTextStringsNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     167            igsaMainTextStringsNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    169168        }
    170169
     
    174173        pugi::xml_node igsaFooterTextStringsNode = igsaFooterTextNode.append_child("Strings");
    175174        for(int i=0; i<footerTextNumberOfRows; i++){
    176             igsaFooterTextStringsNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("#" + QString::number(++globalSectionCounter)));
     175            igsaFooterTextStringsNode.append_child("Link").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("#" + QString::number(++globalSectionCounter)));
    177176        }
    178177
     
    202201
    203202                pugi::xml_node igstMainTextFontNode = igstMainTextNode.append_child("Font");
    204                 igstMainTextFontNode.append_child("Family").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr("TSFF" + format.font().family()));
    205                 igstMainTextFontNode.append_child("Style").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(style));
    206                 igstMainTextFontNode.append_child("Color").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(colorRGB));
    207                 igstMainTextFontNode.append_child("Size").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(QString::number(format.font().pointSize())));
     203                igstMainTextFontNode.append_child("Family").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR("TSFF" + format.font().family()));
     204                igstMainTextFontNode.append_child("Style").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(style));
     205                igstMainTextFontNode.append_child("Color").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(colorRGB));
     206                igstMainTextFontNode.append_child("Size").append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(QString::number(format.font().pointSize())));
    208207                igstMainTextFontNode.append_child("Flags").append_child(pugi::xml_node_type::node_pcdata).set_value("Family Style Color Size");
    209208
    210                 igstMainTextNode.append_child("Text").append_child(pugi::xml_node_type::node_pcdata).set_value(Util::qStrToCstr(currentCursor.selection().toPlainText()));
     209                QString currentRowText = currentCursor.selection().toPlainText();
     210
     211                pugi::xml_node currentIGStNode = igstMainTextNode.append_child("Text");
     212
     213                if(!currentRowText.trimmed().isEmpty()){
     214                    currentIGStNode.append_child(pugi::xml_node_type::node_pcdata).set_value(QSTR_TO_CSTR(currentRowText));
     215                }
     216                else{
     217                    // Empty paragraph use OniSplit correct representation (<Text xml:space="preserve"> </Text>)
     218                    currentIGStNode.append_child(pugi::xml_node_type::node_pcdata).set_value(" ");
     219                    currentIGStNode.append_attribute("xml:space").set_value("preserve");
     220                }
    211221            }
    212222
     
    220230    }
    221231
    222     if(!doc.save_file(Util::qStrToCstr(filePath))){
    223         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't create " + filePath + " file!");
     232    if(!doc.save_file(QSTR_TO_CSTR(filePath))){
     233        UtilVago::showAndLogErrorPopUpLogButton("Couldn't create " + filePath + " file!");
    224234        return;
    225235    }
     
    227237    // Convert XML file to Oni
    228238    this->oniSplitCommands->clear();
    229     this->oniSplitCommands->append("-create " + Util::insertQuotes(this->wmLocation) + " " +  Util::insertQuotes(filePath));
     239    this->oniSplitCommands->append("-create " + Util::String::insertQuotes(this->wmLocation) + " " +  Util::String::insertQuotes(filePath));
    230240
    231241    this->myConverter->start(); // finally process the onisplit commands
  • s10k/Vago/windowMessagesWizard/wmfinalpage.h

    r1061 r1093  
    66#include <QUrl>
    77#include <droptablewidget.h>
    8 #include <pugixml.hpp>
     8#include <pugixml/pugixml.hpp>
    99
    10 #include "logger.h"
    1110#include "xmlprocessor.h"
    1211#include "converter.h"
     
    2322   
    2423public:
    25     explicit WmFinalPage(QString AppDir, QString wmLocation, Logger *myLogger, QList<std::shared_ptr<WmPage> > &pages, QWidget *parent = 0);
     24    explicit WmFinalPage(QString AppDir, QString wmLocation, QList<std::shared_ptr<WmPage> > &pages, QWidget *parent = 0);
    2625    ~WmFinalPage();
    2726   
     
    2928    QString wmLocation;
    3029    Ui::wmfinalpage *ui;
    31     Logger *myLogger;
    3230    Converter *myConverter;
    3331    QStringList *oniSplitCommands;
  • s10k/Vago/windowMessagesWizard/wmformatpage.cpp

    r1061 r1093  
    22#include "ui_wmformatpage.h"
    33
    4 WmFormatPage::WmFormatPage(Logger *myLogger, QWidget *parent) :
     4WmFormatPage::WmFormatPage(QWidget *parent) :
    55    QWizardPage(parent),
    66    ui(new Ui::WmFormatPage)
    77{
    88    ui->setupUi(this);
    9 
    10     this->myLogger = myLogger;
    119
    1210    this->setTitle("Pages Formatting");
     
    5149        break;
    5250    case WINDOW_TYPE::ENUM_END:
    53         UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFormatPage::initializePage invalid WINDOW_TYPE");
     51        UtilVago::showAndLogErrorPopUp("An error ocurred: WmFormatPage::initializePage invalid WINDOW_TYPE");
    5452        break;
    5553    }
     
    7270                )
    7371        {
    74             Util::showErrorPopUp("You need to fill at least one text section in all pages!");
     72            Util::Dialogs::showError("You need to fill at least one text section in all pages!");
    7573            return false;
    7674        }
     
    8078    // If we can add more than one page, ask the user if he already added them all
    8179    if(ui->pbAddPageAfter->isEnabled()){
    82         return Util::showQuestionPopUp(this, "Have you added all the window pages?");
     80        return Util::Dialogs::showQuestion(this, "Have you added all the window pages?");
    8381    }
    8482
     
    126124        break;
    127125    case WINDOW_TYPE::ENUM_END:
    128         UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFormatPage::addPage invalid WINDOW_TYPE");
     126        UtilVago::showAndLogErrorPopUp("An error ocurred: WmFormatPage::addPage invalid WINDOW_TYPE");
    129127        break;
    130128    }
     
    190188
    191189    if(textEdits.size() == 0){
    192         Util::showPopUp("Select some text first.");
     190        Util::Dialogs::showInfo("Select some text first.");
    193191        return;
    194192    }
     
    252250
    253251                if(!ok){
    254                     Util::showErrorPopUp("The inputted font size is not valid!");
     252                    Util::Dialogs::showError("The inputted font size is not valid!");
    255253                    ui->cbTextSize->setCurrentIndex(0); // reset to default number
    256254                    return;
     
    279277{
    280278    if(ui->twPages->count() <= 1){
    281         Util::showErrorPopUp("You must have at least one page!");
     279        Util::Dialogs::showError("You must have at least one page!");
    282280        return;
    283281    }
    284282
    285     if(Util::showQuestionPopUp(this, "Are you sure do you want to delete the current page?")){
     283    if(Util::Dialogs::showQuestion(this, "Are you sure do you want to delete the current page?")){
    286284        int indexToDelete = ui->twPages->currentIndex();
    287285
  • s10k/Vago/windowMessagesWizard/wmformatpage.h

    r1061 r1093  
    2020   
    2121public:
    22     explicit WmFormatPage(Logger *myLogger, QWidget *parent = 0);
     22    explicit WmFormatPage(QWidget *parent = 0);
    2323    QList<std::shared_ptr<WmPage> >& getCurrentPages();
    2424
     
    5656    QList<std::shared_ptr<WmPage>> currentPages;
    5757    bool windowsIsInitialized = false;
    58     Logger *myLogger;
    5958
    6059private:
  • s10k/Vago/windowMessagesWizard/wmsetuppage.cpp

    r1061 r1093  
    4646    }
    4747
    48     if(Util::checkEmptySpaces(stringsToCheck)){
    49         Util::showErrorPopUp("You need to fill all fields first!");
     48    if(Util::Validation::checkEmptySpaces(stringsToCheck)){
     49        Util::Dialogs::showError("You need to fill all fields first!");
    5050        return false;
    5151    }
     
    6262    }
    6363
    64     if(!Util::isStringInteger(arg1)){
    65         Util::showErrorPopUp("The level id inputted is invalid! It must be a number.");
     64    if(!Util::Validation::isStringInteger(arg1)){
     65        Util::Dialogs::showError("The level id inputted is invalid! It must be a number.");
    6666        return;
    6767    }
     
    9191    }
    9292
    93     if(!Util::isStringInteger(arg1)){
    94         Util::showErrorPopUp("The page number inputted is invalid! It must be a number.");
     93    if(!Util::Validation::isStringInteger(arg1)){
     94        Util::Dialogs::showError("The page number inputted is invalid! It must be a number.");
    9595        return;
    9696    }
  • s10k/Vago/windowMessagesWizard/wmwizard.cpp

    r1061 r1093  
    11#include "wmwizard.h"
    22
    3 WmWizard::WmWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger)
    4 :AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, true)
     3WmWizard::WmWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings)
     4:AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, true)
    55{
    66    this->bgImagesLocation=this->workspaceWizardLocation+"/WindowMessages";
     
    1010
    1111    WmSetupPage *setupPage = new WmSetupPage();
    12     WmFormatPage *formatPage = new WmFormatPage(this->myLogger);
    13     WmFinalPage *finalPage = new WmFinalPage(this->appDir, this->bgImagesLocation, this->myLogger, formatPage->getCurrentPages());
     12    WmFormatPage *formatPage = new WmFormatPage();
     13    WmFinalPage *finalPage = new WmFinalPage(this->appDir, this->bgImagesLocation, formatPage->getCurrentPages());
    1414
    1515    this->myWizard.addPage
  • s10k/Vago/windowMessagesWizard/wmwizard.h

    r1061 r1093  
    1111{
    1212protected:
    13     WmWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger);
     13    WmWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings);
    1414    void exec();
    1515private:
  • s10k/Vago/wizardfactory.h

    r1061 r1093  
    99{
    1010public:
    11     static void startInstance(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger){
    12         (new WizardFactory<T>(appDir, workspaceWizardLocation, vagoSettings, myLogger))->exec();
     11    static void startInstance(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings){
     12        (new WizardFactory<T>(appDir, workspaceWizardLocation, vagoSettings))->exec();
    1313    }
    1414private:
     
    1818            const QString &appDir,
    1919            const QString &workspaceWizardLocation,
    20             QSettings *vagoSettings,
    21             Logger *myLogger
    22     ):T(appDir, workspaceWizardLocation, vagoSettings, myLogger){}
     20            QSettings *vagoSettings
     21    ):T(appDir, workspaceWizardLocation, vagoSettings){}
    2322};
    2423
     
    2827{
    2928public:
    30     static void startInstance(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, QHash<QString, QString> *commandMap){
    31         (new WizardFactory(appDir, workspaceWizardLocation, vagoSettings, myLogger, commandMap))->exec();
     29    static void startInstance(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, QHash<QString, QString> *commandMap){
     30        (new WizardFactory(appDir, workspaceWizardLocation, vagoSettings, commandMap))->exec();
    3231    }
    3332private:
     
    3736            const QString &workspaceWizardLocation,
    3837            QSettings *vagoSettings,
    39             Logger *myLogger,
    4038            QHash<QString, QString> *commandMap
    41     ):SoundWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, commandMap){}
     39    ):SoundWizard(appDir, workspaceWizardLocation, vagoSettings, commandMap){}
    4240};
    4341
  • s10k/Vago/xmlToolsInterface/xmltoolsinterface.cpp

    r1059 r1093  
    22#include "ui_xmltoolsinterface.h"
    33
    4 XmlToolsInterface::XmlToolsInterface(Logger *myLogger, QWidget *parent) :
     4XmlToolsInterface::XmlToolsInterface(QWidget *parent) :
    55    QMainWindow(parent),
    66    ui(new Ui::XmlToolsInterface),
     
    99    ui->setupUi(this);
    1010    this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished.
    11     this->myLogger = myLogger;
    12     this->xmlProcessor = new XmlProcessor(UtilVago::getAppPath(), this->myLogger, &this->listToProccess);
     11    this->xmlProcessor = new XmlProcessor(UtilVago::getAppPath(), &this->listToProccess);
    1312
    1413    // setup the correct input options for the current selection
     
    162161    if(oldFile.exists()){
    163162        if(!oldFile.remove()){
    164             UtilVago::showAndLogErrorPopUpLogButton(this->myLogger,
    165                                                     "Couldn't remove old temporary file to preview XML patch! Existing file:\n"
     163            UtilVago::showAndLogErrorPopUpLogButton("Couldn't remove old temporary file to preview XML patch! Existing file:\n"
    166164                                                    + previewFileLocation
    167165                                                    );
     
    170168
    171169    if(!QFile::copy(currentFileLocation, previewFileLocation)){
    172         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger,
    173                                                 "Couldn't create temporary file to preview the XML patch!\nFrom: " +
     170        UtilVago::showAndLogErrorPopUpLogButton("Couldn't create temporary file to preview the XML patch!\nFrom: " +
    174171                                                currentFileLocation +
    175172                                                "\nTo: " + previewFileLocation
     
    204201
    205202    if(ui->leInputInputFiles->text().trimmed().isEmpty()){
    206         Util::showErrorPopUp("You must provide an Input File!");
     203        Util::Dialogs::showError("You must provide an Input File!");
    207204        return false;
    208205    }
    209206
    210207    if(ui->rbFilterRelativeElements->isChecked() && ui->leFilterElement->text().trimmed().isEmpty()){
    211         Util::showErrorPopUp("With Relative Elements checked you must provide a Element Name!");
     208        Util::Dialogs::showError("With Relative Elements checked you must provide a Element Name!");
    212209        return false;
    213210    }
    214211
    215212    if(ui->cbFilterParentElement->isChecked() && ui->leFilterParentElement->text().trimmed().isEmpty()){
    216         Util::showErrorPopUp("Parent Element is checked but none was provided!");
     213        Util::Dialogs::showError("Parent Element is checked but none was provided!");
    217214        return false;
    218215    }
     
    221218        if(ui->leFilterAttributeName->text().trimmed().isEmpty())
    222219        {
    223             Util::showErrorPopUp("Attribute Name is checked but none was provided!");
     220            Util::Dialogs::showError("Attribute Name is checked but none was provided!");
    224221            return false;
    225222        }
     
    227224        if(ui->leFilterAttributeValue->text().trimmed().isEmpty())
    228225        {
    229             Util::showErrorPopUp("With Attribute Name checked you must provide a Attribute Value!");
     226            Util::Dialogs::showError("With Attribute Name checked you must provide a Attribute Value!");
    230227            return false;
    231228        }
     
    234231    if(ui->rbFilterXPathExpression->isChecked() && ui->leFilterXPathExpression->text().trimmed().isEmpty())
    235232    {
    236         Util::showErrorPopUp("X-Path Expression is checked but none was provided!");
     233        Util::Dialogs::showError("X-Path Expression is checked but none was provided!");
    237234        return false;
    238235    }
    239236
    240237    if(ui->cbXmlToolsOperation->currentText() == "Add Values" && ui->leInputNewValues->text().isEmpty()){
    241         Util::showErrorPopUp(R"|(With "Add Values" operation selected you must provide the "New Value(s)" to be added.)|");
     238        Util::Dialogs::showError(R"|(With "Add Values" operation selected you must provide the "New Value(s)" to be added.)|");
    242239        return false;
    243240    }
    244241
    245242    if(ui->cbXmlToolsOperation->currentText() == "Remove Values" && ui->leInputCurrentValues->text().isEmpty()){
    246         Util::showErrorPopUp(R"|(With "Remove Value" operation selected you must provide the "Current Value(s)" to be removed.)|");
     243        Util::Dialogs::showError(R"|(With "Remove Value" operation selected you must provide the "Current Value(s)" to be removed.)|");
    247244        return false;
    248245    }
     
    269266        // if there's a preview in progress don't display the message below
    270267        if(!this->previewInProgress){
    271             Util::showPopUp("File(s) processed with sucess!");
     268            Util::Dialogs::showInfo("File(s) processed with sucess!");
    272269        }
    273270    }
     
    305302
    306303    if(ui->leInputNewValues->isEnabled()){
    307         currCommand += "--new-val " + Util::insertQuotes(ui->leInputNewValues->text()) + " ";
     304        currCommand += "--new-val " + Util::String::insertQuotes(ui->leInputNewValues->text()) + " ";
    308305    }
    309306
    310307    if(ui->leInputCurrentValues->isEnabled()){
    311         currCommand += "--current-val " + Util::insertQuotes(ui->leInputCurrentValues->text()) + " ";
     308        currCommand += "--current-val " + Util::String::insertQuotes(ui->leInputCurrentValues->text()) + " ";
    312309    }
    313310
    314311    if(ui->leInputPositions->isEnabled() && !ui->leInputPositions->text().trimmed().isEmpty()){
    315         currCommand += "--positions " + Util::insertQuotes(ui->leInputPositions->text()) + " ";
     312        currCommand += "--positions " + Util::String::insertQuotes(ui->leInputPositions->text()) + " ";
    316313    }
    317314
    318315    if(ui->leInputDiffOldNewValue->isEnabled()){
    319         currCommand += "--diff-old-new-val " + Util::insertQuotes(ui->leInputDiffOldNewValue->text()) + " ";
     316        currCommand += "--diff-old-new-val " + Util::String::insertQuotes(ui->leInputDiffOldNewValue->text()) + " ";
    320317    }
    321318
    322319    if(ui->rbFilterRelativeElements->isChecked()){
    323320        if(ui->leFilterElement->isEnabled()){
    324             currCommand += "--element-name " + Util::insertQuotes(ui->leFilterElement->text()) + " ";
     321            currCommand += "--element-name " + Util::String::insertQuotes(ui->leFilterElement->text()) + " ";
    325322        }
    326323        if(ui->leFilterParentElement->isEnabled()){
    327             currCommand += "--parent-element-name " + Util::insertQuotes(ui->leFilterParentElement->text()) + " ";
     324            currCommand += "--parent-element-name " + Util::String::insertQuotes(ui->leFilterParentElement->text()) + " ";
    328325        }
    329326        if(ui->leFilterAttributeName->isEnabled()){
    330             currCommand += "--attribute-name " + Util::insertQuotes(ui->leFilterAttributeName->text()) + " ";
    331             currCommand += "--attribute-value " + Util::insertQuotes(ui->leFilterAttributeValue->text()) + " ";
     327            currCommand += "--attribute-name " + Util::String::insertQuotes(ui->leFilterAttributeName->text()) + " ";
     328            currCommand += "--attribute-value " + Util::String::insertQuotes(ui->leFilterAttributeValue->text()) + " ";
    332329        }
    333330    }
    334331    else{
    335332        if(ui->leFilterXPathExpression->isEnabled()){
    336             currCommand += "--xpath-expression " + Util::insertQuotes(ui->leFilterXPathExpression->text()) + " ";
     333            currCommand += "--xpath-expression " + Util::String::insertQuotes(ui->leFilterXPathExpression->text()) + " ";
    337334        }
    338335    }
    339336
    340337    if(alternativeFileLocation.isEmpty()){
    341         currCommand += "--files " + Util::insertQuotes(ui->leInputInputFiles->text());
     338        currCommand += "--files " + Util::String::insertQuotes(ui->leInputInputFiles->text());
    342339    }
    343340    else{
    344         currCommand += "--files " + Util::insertQuotes(alternativeFileLocation);
     341        currCommand += "--files " + Util::String::insertQuotes(alternativeFileLocation);
    345342    }
    346343
  • s10k/Vago/xmlToolsInterface/xmltoolsinterface.h

    r1058 r1093  
    2424   
    2525public:
    26     explicit XmlToolsInterface(Logger *myLogger, QWidget *parent = 0);
     26    explicit XmlToolsInterface(QWidget *parent = 0);
    2727    ~XmlToolsInterface();
    2828
     
    7373private:
    7474    Ui::XmlToolsInterface *ui;
    75     Logger *myLogger = nullptr;
    7675    QStringList listToProccess; //commands to execute
    7776    XmlProcessor *xmlProcessor = nullptr;
  • s10k/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp

    r1058 r1093  
    2323    ui->tePreviewFileText->setText(this->previewText);
    2424
    25     highlighterCurrentFile = new BasicXMLSyntaxHighlighter(ui->teCurrentFileText);
    26     highlighterPreviewFile = new BasicXMLSyntaxHighlighter(ui->tePreviewFileText);
     25    highlighterCurrentFile.setDocument(ui->teCurrentFileText->document());
     26    highlighterPreviewFile.setDocument(ui->tePreviewFileText->document());
    2727
    2828    previewFile.close();
     
    172172    }
    173173
    174     highlighterPreviewFile->rehighlight();
    175     highlighterCurrentFile->rehighlight();
     174    highlighterPreviewFile.rehighlight();
     175    highlighterCurrentFile.rehighlight();
    176176}
    177177
    178178XmlToolsInterfaceCommandPreview::~XmlToolsInterfaceCommandPreview()
    179179{
    180     delete this->highlighterCurrentFile;
    181     delete this->highlighterPreviewFile;
    182180    delete this->lineNumberDisplayCurrentFile;
    183181    delete this->lineNumberDisplayPreviewFile;
  • s10k/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.h

    r1058 r1093  
    66#include <QScrollBar>
    77
    8 #include "../libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h"
    9 #include "../libs/LineNumberDisplay/LineNumberDisplay.h"
     8#include <BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h>
     9#include <LineNumberDisplay/LineNumberDisplay.h>
    1010#include "util.h"
    1111
     
    2424private:
    2525    Ui::XmlToolsInterfaceCommandPreview *ui;
    26     BasicXMLSyntaxHighlighter *highlighterCurrentFile;
    27     BasicXMLSyntaxHighlighter *highlighterPreviewFile;
     26    BasicXMLSyntaxHighlighter highlighterCurrentFile;
     27    BasicXMLSyntaxHighlighter highlighterPreviewFile;
    2828    LineNumberDisplay *lineNumberDisplayCurrentFile;
    2929    LineNumberDisplay *lineNumberDisplayPreviewFile;
  • s10k/Vago/xmlprocessor.cpp

    r1052 r1093  
    11#include "xmlprocessor.h"
    22
    3 XmlProcessor::XmlProcessor(QString AppDir, Logger *myLogger, QStringList *commands)
     3XmlProcessor::XmlProcessor(QString AppDir, QStringList *commands)
    44{
    55    this->AppDir=AppDir;
    6     this->myLogger=myLogger;
    76    this->commands=commands;
    87}
     
    2524        if(!result.isEmpty()){
    2625            //catch exception
    27             myLogger->writeString("Xml Tools Error: \n"+this->commands->at(i)+"\n"+result);
     26            LOG_ERROR << "Xml Tools Error: \n" + this->commands->at(i) + "\n"+result;
    2827            errorMessage=result;
    2928            numErrors++;
  • s10k/Vago/xmlprocessor.h

    r1047 r1093  
    1010     Q_OBJECT
    1111public:
    12     XmlProcessor(QString AppDir, Logger *myLogger, QStringList *commands);
     12    XmlProcessor(QString AppDir, QStringList *commands);
    1313private:
    1414    QString AppDir;
    15     Logger *myLogger;
    1615    QStringList *commands;
    1716
Note: See TracChangeset for help on using the changeset viewer.