OpenAlbum 1.0.b

/home/manuel/PFC/open-album/OpenAlbum-Unix/tamannowizard.cpp

00001 #include "tamannowizard.h"
00002 #include "ui_tamannowizard.h"
00003 #include "formprincipal.h" 
00004 
00005 class FormPrincipal;
00006 
00007 tamannoWizard::tamannoWizard(QWidget *parent, FormPrincipal *form_) :
00008     QWizardPage(parent),
00009     ui(new Ui::tamannoWizard)
00010 {
00011     ui->setupUi(this);
00012     
00013     this->ui->groupBox->setStyle(new QWindowsStyle);
00014     this->completo=false;
00015     this->form=form_;
00016     this->ui->radioButtonClasico->setStyle(new QWindowsStyle);
00017     this->ui->radioButtonMaxi->setStyle(new QWindowsStyle);
00018     this->ui->radioButtonMini->setStyle(new QWindowsStyle);
00019     QString path=this->form->GetDirectorioDeTrabajo().absolutePath() + "/data/maxi.png";
00020     QPixmap *pix=new QPixmap(path);
00021     QGraphicsScene *scena=new QGraphicsScene();
00022     
00023     ui->viewMaxi->setScene(scena);
00024     scena->addPixmap(pix->scaled(62, 70, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
00025     
00026     QString path2=this->form->GetDirectorioDeTrabajo().absolutePath() + "/data/mini.png";
00027     QPixmap *pix2=new QPixmap(path2);
00028     QGraphicsScene *scena2=new QGraphicsScene();
00029     
00030     ui->viewMini->setScene(scena2);
00031     scena2->addPixmap(pix2->scaled(62, 70, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
00032     
00033     
00034     QString path3=this->form->GetDirectorioDeTrabajo().absolutePath() + "/data/clasico.png";
00035     QPixmap *pix3=new QPixmap(path3);
00036     QGraphicsScene *scena3=new QGraphicsScene();
00037     
00038     ui->viewClasico->setScene(scena3);
00039     scena3->addPixmap(pix3->scaled(62, 70, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
00040     delete pix;
00041     delete pix2;
00042     delete pix3;
00043     QIcon *iconoVentana= new QIcon(form_->GetDirectorioDeTrabajo().absolutePath() + "/data/iconlargue.png");
00044     this->setWindowIcon(*iconoVentana);
00045     delete iconoVentana;
00046 }
00047 
00048 tamannoWizard::~tamannoWizard()
00049 {
00050     delete ui;
00051 }
00052 
00053 bool tamannoWizard::validatePage(){
00054     this->hide();
00055     this->form->activarCreadoconAsistente();
00056     this->form->CargarPreview();
00057     return true;   
00058 }
00059 
00060 void tamannoWizard::seleccionarTamClasico(){
00061     int w, h;
00062     h=1172;
00063     w=1687;
00064     this->form->cargarDimensiones(w, h);
00065     this->completo=true;
00066     if(this->isComplete()){
00067         QAbstractButton *button=wizard()->button(QWizard::NextButton);
00068         button->setEnabled(true);
00069     }
00070 }
00071 
00072 bool tamannoWizard::isComplete() const{
00073     if(this->completo){
00074         return true;
00075     }else{
00076         return false;
00077     }    
00078 }
00079 
00080 void tamannoWizard::seleccionarTamMaxi(){
00081      int w, h;
00082      h=1549; 
00083      w=2229;
00084      this->form->cargarDimensiones(w, h);
00085      this->completo=true;
00086      if(this->isComplete()){
00087         QAbstractButton *button=wizard()->button(QWizard::NextButton);
00088         button->setEnabled(true);
00089     }
00090 }
00091 
00092 void tamannoWizard::seleccionarTamMini(){
00093     int w, h;
00094     h=839; 
00095     w=1207;
00096     this->form->cargarDimensiones(w, h);
00097     this->completo=true;
00098     if(this->isComplete()){
00099         QAbstractButton *button=wizard()->button(QWizard::NextButton);
00100         button->setEnabled(true);
00101     }
00102 }
 Todo Clases Archivos Funciones Variables