Ignore:
Timestamp:
Dec 9, 2016, 8:04:18 PM (8 years ago)
Author:
s10k
Message:

Added Vago 1.3

Location:
Vago/trunk/Vago/bgImageWizard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.h

    r1054 r1061  
    44#include <QWizardPage>
    55#include <QImage>
     6#include <pugixml.hpp>
     7
    68#include "utilvago.h"
    7 #include "libs/pugixml/pugixml.hpp"
    89#include "converter.h"
    910
  • Vago/trunk/Vago/bgImageWizard/bgimagewizard.cpp

    r1054 r1061  
    22
    33BGImageWizard::BGImageWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger)
     4:AbstractWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, true)
    45{
    56    this->appDir = appDir;
     
    1011}
    1112
    12 int BGImageWizard::exec(){
    13 
    14     QPushButton *restartButton = new QPushButton("Restart");
    15     this->myWizard.setButton(QWizard::CustomButton1,restartButton);
    16     this->myWizard.setOption(QWizard::HaveCustomButton1, true);
    17 
    18     connect(&this->myWizard, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int)));
    19     connect(restartButton, SIGNAL(clicked(bool)), this, SLOT(restartWizard()));
    20 
    21     this->myWizard.setWindowIcon(QIcon(":/new/icons/background_image.png"));
    22 
    23     //Center and resize QWizard (http://www.thedazzlersinc.com/source/2012/06/04/qt-center-window-in-screen/)
    24 #ifdef Q_OS_WIN
    25     this->myWizard.resize(640,480);
    26 #else
    27     this->myWizard.resize(800,600); // Mac OS pcs should be able to render this resolution without any problem. It's also better
    28     // because the components on mac use more space
    29 #endif
    30     QRect position = this->myWizard.frameGeometry();
    31     position.moveCenter(QDesktopWidget().availableGeometry().center());
    32     this->myWizard.move(position.topLeft());
    33     //
     13void BGImageWizard::exec(){
    3414
    3515    BGImagePage2 *page2 = new BGImagePage2(this->myLogger);
     
    3717    BGImagePageFinal *pageFinal = new BGImagePageFinal(this->appDir, this->myLogger, this->bgImagesLocation);
    3818
    39     this->myWizard.addPage(createIntroPage());
     19    this->myWizard.addPage
     20    (
     21        createIntroPage
     22        (
     23            "Welcome to the Oni Background Image Wizard.\n"
     24            "This wizard will allow you to create in a few and simple steps Oni background images (TXMB) "
     25            "that can be used in the menus or as backgrounds screens for the levels."
     26        )
     27    );
     28
    4029    this->myWizard.addPage(page2);
    4130    this->myWizard.addPage(page3);
    4231    this->myWizard.addPage(pageFinal);
    4332
    44     this->myWizard.setWindowTitle("Background Image Wizard");
    45 
    46     if(this->myWizard.exec()){ //modal and wait for finalization
    47 
    48     }
    49 
    50     return 0;
     33    showWizard("Background Image Wizard", ":/new/icons/background_image.png");
    5134}
    5235
    53 QWizardPage* BGImageWizard::createIntroPage() {
    54     QWizardPage *page = new QWizardPage;
    55     page->setTitle("Introduction");
     36void BGImageWizard::beforeClose(QDialog::DialogCode){
    5637
    57     QLabel *label = new QLabel("Welcome to the Oni Background Image Wizard.\n"
    58                                "This wizard will allow you to create in a few and simple steps Oni background images (TXMB) "
    59                                "that can be used in the menus or as backgrounds screens for the levels.");
    60     label->setWordWrap(true);
    61 
    62     QVBoxLayout *layout = new QVBoxLayout;
    63     layout->addWidget(label);
    64     page->setLayout(layout);
    65 
    66     return page;
    6738}
    68 
    69 void BGImageWizard::restartWizard(){
    70     this->myWizard.restart();
    71 }
    72 
    73 void BGImageWizard::pageChanged(int pageId){
    74     // Last page?
    75     if(pageId==3){
    76        this->myWizard.setOption(QWizard::HaveCustomButton1, true); // set visible
    77        this->myWizard.button(QWizard::BackButton)->setEnabled(false); // disable back button, use restart if needed
    78         return;
    79     }
    80    this->myWizard.setOption(QWizard::HaveCustomButton1, false); // set invisible
    81    this->myWizard.button(QWizard::BackButton)->setEnabled(true); // set enable back button
    82 }
  • Vago/trunk/Vago/bgImageWizard/bgimagewizard.h

    r1054 r1061  
    22#define BGIMAGEWIZARD_H
    33
    4 // System includes
    5 #include <QString>
    6 #include <QWizard>
    7 #include <QWizardPage>
    8 #include <QLabel>
    9 #include <QDesktopWidget>
    10 #include <QVBoxLayout>
    11 #include <QPushButton>
    12 
    134// Local includes
     5#include "abstractwizard.h"
    146#include "bgimagepage2.h"
    157#include "bgimagepage3.h"
    168#include "bgimagepagefinal.h"
    179
    18 class BGImageWizard: public QObject // for signals and slots
     10class BGImageWizard: public AbstractWizard // for signals and slots
    1911{
    20     Q_OBJECT // for signals and slots
    21 public:
     12protected:
    2213    BGImageWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger);
    23     int exec();
     14    void exec();
    2415private:
    25     QWizard myWizard;
    26     QWizardPage *createIntroPage();
    27 
    28     Logger *myLogger;
    29     QString workspaceWizardLocation;
    3016    QString bgImagesLocation;
    31     QString appDir;
    32     QSettings *vagoSettings;
    33 private slots:
    34     void restartWizard();
    35     void pageChanged(int pageId);
     17private:
     18    void beforeClose(QDialog::DialogCode resultStatus);
    3619};
    3720
Note: See TracChangeset for help on using the changeset viewer.