![]() |
OpenAlbum 1.0.b
|
00001 #include <qt4/QtCore/qdir.h> 00002 #include "portadawizard.h" 00003 #include "ui_portadawizard.h" 00004 #include "error.h" 00005 #include "parser.h" 00006 #include "album.h" 00007 #include "formprincipal.h" 00008 00009 00010 00011 portadaWizard::portadaWizard(QWidget *parent, FormPrincipal *form_) : 00012 QWizardPage(parent), 00013 ui(new Ui::portadaWizard) 00014 { 00015 ui->setupUi(this); 00016 this->form=form_; 00017 this->necesitaTexto=false; 00018 this->tieneTexto=false; 00019 this->ui->visorPlantillas->setStyle(new QWindowsStyle); 00020 this->ui->selectorPlantillas->setStyle(new QWindowsStyle); 00021 this->ui->groupBox->setStyle(new QWindowsStyle); 00022 this->ui->groupBox_2->setStyle(new QWindowsStyle); 00023 QIcon *iconoVentana= new QIcon(form_->GetDirectorioDeTrabajo().absolutePath() + "/data/iconlargue.png"); 00024 this->setWindowIcon(*iconoVentana); 00025 delete iconoVentana; 00026 } 00027 00028 portadaWizard::~portadaWizard() 00029 { 00030 delete ui; 00031 } 00032 00033 void portadaWizard::IntroducirTexto(){ 00034 this->form->LanzarFormTexto(this); 00035 if(this->isComplete()){ 00036 QAbstractButton *button= this->wizard()->button(QWizard::NextButton); 00037 button->setEnabled(true); 00038 } 00039 } 00040 00041 void portadaWizard::setEnabledNecesitaTexto(bool logico){ 00042 this->necesitaTexto=logico; 00043 } 00044 00045 void portadaWizard::setEnabledTieneTexto(bool logico){ 00046 this->tieneTexto=logico; 00047 } 00048 00049 void portadaWizard::visualizarPlantillas(){ 00050 this->form->visualizarPlantilla(true); 00051 if(this->isComplete()){ 00052 QAbstractButton *button= this->wizard()->button(QWizard::NextButton); 00053 button->setEnabled(true); 00054 } 00055 00056 } 00057 00058 bool portadaWizard::isComplete() const{ 00059 if(this->form->seleccionadaPlantilla() && this->necesitaTexto){ 00060 if(this->tieneTexto){ 00061 return true; 00062 }else{ 00063 return false; 00064 } 00065 00066 }else{ 00067 if(this->form->seleccionadaPlantilla() && !this->necesitaTexto){ 00068 return true; 00069 }else{ 00070 if(this->form->seleccionadaPlantilla()){ 00071 return true; 00072 }else{ 00073 return false; 00074 } 00075 00076 } 00077 } 00078 } 00079 00080 void portadaWizard::cleanupPage(){ 00081 this->form->ResetSelectorPlantilla(); 00082 } 00083 00084 void portadaWizard::activarSelectorPlantillas(){ 00085 this->form->ActivarSeleccionPlantilla(true); 00086 }