| 10 |
|
} |
| 11 |
|
|
| 12 |
|
int SoundWizard::exec(){ |
| 13 |
– |
this->myWizard = new QWizard(); |
| 14 |
– |
|
| 13 |
|
QPushButton *restartButton = new QPushButton("Restart"); |
| 14 |
< |
this->myWizard->setButton(QWizard::CustomButton1,restartButton); |
| 15 |
< |
this->myWizard->setOption(QWizard::HaveCustomButton1, true); |
| 14 |
> |
this->myWizard.setButton(QWizard::CustomButton1,restartButton); |
| 15 |
> |
this->myWizard.setOption(QWizard::HaveCustomButton1, true); |
| 16 |
|
|
| 17 |
< |
connect(this->myWizard, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int))); |
| 17 |
> |
connect(&this->myWizard, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int))); |
| 18 |
|
connect(restartButton, SIGNAL(clicked(bool)), this, SLOT(restartWizard())); |
| 19 |
|
|
| 20 |
< |
this->myWizard->setWindowIcon(QIcon(":/new/icons/sound.png")); |
| 20 |
> |
this->myWizard.setWindowIcon(QIcon(":/new/icons/sound.png")); |
| 21 |
|
|
| 22 |
|
//Center and resize QWizard (http://www.thedazzlersinc.com/source/2012/06/04/qt-center-window-in-screen/) |
| 23 |
|
#ifdef Q_OS_WIN |
| 24 |
< |
this->myWizard->resize(640,480); |
| 24 |
> |
this->myWizard.resize(640,480); |
| 25 |
|
#else |
| 26 |
< |
this->myWizard->resize(800,600); // Mac OS pcs should be able to render this resolution without any problem. It's also better |
| 26 |
> |
this->myWizard.resize(800,600); // Mac OS pcs should be able to render this resolution without any problem. It's also better |
| 27 |
|
// because the components on mac use more space |
| 28 |
|
#endif |
| 29 |
< |
QRect position = this->myWizard->frameGeometry(); |
| 29 |
> |
QRect position =this->myWizard.frameGeometry(); |
| 30 |
|
position.moveCenter(QDesktopWidget().availableGeometry().center()); |
| 31 |
< |
this->myWizard->move(position.topLeft()); |
| 31 |
> |
this->myWizard.move(position.topLeft()); |
| 32 |
|
// |
| 33 |
|
|
| 34 |
|
SoundPage2 *page2 = new SoundPage2(this->appLocation); |
| 35 |
|
SoundPage3 *page3 = new SoundPage3(); |
| 36 |
|
SoundPage4 *page4 = new SoundPage4(); |
| 37 |
+ |
SoundPage5 *page5 = new SoundPage5(); |
| 38 |
|
SoundPageFinal *pageFinal = new SoundPageFinal(this->appLocation, this->soundsLocation,page2->soundTable,this->myLogger, this->commandMap); |
| 39 |
|
|
| 40 |
< |
this->myWizard->addPage(createIntroPage()); |
| 41 |
< |
this->myWizard->addPage(page2); |
| 42 |
< |
this->myWizard->addPage(page3); |
| 43 |
< |
this->myWizard->addPage(page4); |
| 44 |
< |
this->myWizard->addPage(pageFinal); |
| 40 |
> |
this->myWizard.addPage(createIntroPage()); |
| 41 |
> |
this->myWizard.addPage(page2); |
| 42 |
> |
this->myWizard.addPage(page3); |
| 43 |
> |
this->myWizard.addPage(page4); |
| 44 |
> |
this->myWizard.addPage(page5); |
| 45 |
> |
this->myWizard.addPage(pageFinal); |
| 46 |
|
|
| 47 |
< |
this->myWizard->setWindowTitle("Sound wizard"); |
| 47 |
> |
this->myWizard.setWindowTitle("Sound wizard"); |
| 48 |
|
|
| 49 |
|
//If wizard finished with sucess |
| 50 |
< |
if(this->myWizard->exec()){ //modal and wait for finalization |
| 50 |
> |
if(myWizard.exec()){ //modal and wait for finalization |
| 51 |
|
//createPackage(this->myWizard, page4); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
– |
delete this->myWizard; // not needed anymore |
| 55 |
– |
|
| 54 |
|
return 0; |
| 55 |
|
} |
| 56 |
|
|
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
void SoundWizard::restartWizard(){ |
| 73 |
< |
this->myWizard->restart(); |
| 73 |
> |
this->myWizard.restart(); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
void SoundWizard::pageChanged(int pageId){ |
| 77 |
|
// Last page? |
| 78 |
< |
if(pageId==4){ |
| 79 |
< |
this->myWizard->setOption(QWizard::HaveCustomButton1, true); // set visible |
| 80 |
< |
this->myWizard->button(QWizard::BackButton)->setEnabled(false); // disable back button, use restart if needed |
| 78 |
> |
if(pageId==5){ |
| 79 |
> |
this->myWizard.setOption(QWizard::HaveCustomButton1, true); // set visible |
| 80 |
> |
this->myWizard.button(QWizard::BackButton)->setEnabled(false); // disable back button, use restart if needed |
| 81 |
|
return; |
| 82 |
|
} |
| 83 |
< |
this->myWizard->setOption(QWizard::HaveCustomButton1, false); // set invisible |
| 84 |
< |
this->myWizard->button(QWizard::BackButton)->setEnabled(true); // set enable back button |
| 83 |
> |
this->myWizard.setOption(QWizard::HaveCustomButton1, false); // set invisible |
| 84 |
> |
this->myWizard.button(QWizard::BackButton)->setEnabled(true); // set enable back button |
| 85 |
|
} |