![]() |
OpenAlbum 1.0.b
|
00001 #include "fondoportadawizard.h" 00002 #include "ui_fondoportadawizard.h" 00003 #include "formprincipal.h" 00004 00005 class FormPrincipal; 00006 00007 fondoPortadaWizard::fondoPortadaWizard(QWidget *parent, FormPrincipal *form_) : 00008 QWizardPage(parent), 00009 ui(new Ui::fondoPortadaWizard) 00010 { 00011 ui->setupUi(this); 00012 this->ui->groupBox->setStyle(new QWindowsStyle); 00013 this->ui->groupBox_2->setStyle(new QWindowsStyle); 00014 this->ui->groupBox_3->setStyle(new QWindowsStyle); 00015 this->form=form_; 00016 this->elegidaFrontal=false; 00017 this->elegidaTrasera=false; 00018 this->elegidoFondo=false; 00019 QIcon *iconoVentana=new QIcon(form_->GetDirectorioDeTrabajo().absolutePath() + "/data/iconlargue.png"); 00020 this->setWindowIcon(*iconoVentana); 00021 delete iconoVentana; 00022 } 00023 00024 fondoPortadaWizard::~fondoPortadaWizard() 00025 { 00026 delete ui; 00027 } 00028 00029 bool fondoPortadaWizard::isComplete() const{ 00030 if(!this->form->getAlbum()->portada->hayImagenFrontal()){ 00031 if(this->form->seleccionadoTraseraPortada() && this->form->seleccionadoFondoPortada()){ 00032 return true; 00033 }else{ 00034 return false; 00035 } 00036 }else{ 00037 if(!this->form->getAlbum()->portada->hayImagenTrasera()){ 00038 if(this->form->seleccionadoFrontalPortada() && this->form->seleccionadoFondoPortada()){ 00039 return true; 00040 }else{ 00041 return false; 00042 } 00043 }else{ 00044 if(this->form->seleccionadoTraseraPortada() && this->form->seleccionadoFrontalPortada() && this->form->seleccionadoFondoPortada()){ 00045 return true; 00046 }else{ 00047 return false; 00048 } 00049 } 00050 } 00051 00052 00053 } 00054 00055 void fondoPortadaWizard::elegirImagenFrontal(){ 00056 this->form->SeleccionarFotoFrontal(); 00057 if(this->isComplete()){ 00058 QAbstractButton *button= this->wizard()->button(QWizard::NextButton); 00059 button->setEnabled(true); 00060 } 00061 00062 00063 } 00064 00065 00066 void fondoPortadaWizard::elegirFondo(){ 00067 this->form->LanzarSelectorFondoPortada(this); 00068 if(this->isComplete()){ 00069 QAbstractButton *button= this->wizard()->button(QWizard::NextButton); 00070 button->setEnabled(true); 00071 } 00072 } 00073 00074 void fondoPortadaWizard::elegirImagenTrasera(){ 00075 this->form->SeleccionarFotoTrasera(); 00076 if(this->isComplete()){ 00077 QAbstractButton *button= this->wizard()->button(QWizard::NextButton); 00078 button->setEnabled(true); 00079 } 00080 }