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

Vago 1.4

Location:
s10k/Vago/bgImageWizard
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • 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:
Note: See TracChangeset for help on using the changeset viewer.