/* * PDFedit - free program for PDF document manipulation. * Copyright (C) 2006, 2007 PDFedit team: Michal Hocko, * Miroslav Jahoda, * Jozef Misutka, * Martin Petricek * * Project is hosted on http://sourceforge.net/projects/pdfedit */ /** @file AboutWindow - class representing about window. Display authors, application name and version. @author Martin Petricek */ #include "aboutwindow.h" #include "version.h" #include "util.h" #include "iconcache.h" #include "imagewidget.h" #include #include #include #include #include #include namespace gui { using namespace std; /** Version of program */ QString app=APP_NAME " " VERSION; /** About Dialog flags */ const Qt::WFlags aboutDialogFlags=Qt::WDestructiveClose | Qt::WType_Dialog; /** constructor of AboutWindow, creates window and fills it with elements, parameters are ignored @param parent Parent window of this dialog @param name Name of this window (used only for debugging */ AboutWindow::AboutWindow(QWidget *parent/*=0*/,const char *name/*=0*/):QWidget(parent,name,aboutDialogFlags) { ic=new IconCache(); //Window title setCaption(app+" - "+tr("About program")); QGridLayout *l=new QGridLayout(this,2,2); l->setRowStretch(0,1); //Text in about window QString info=QString("")+tr("Free program for PDF document manipulation")+"

" +tr("Homepage")+" : http://pdfedit.petricek.net/
" +tr("Project page")+" : http://sourceforge.net/projects/pdfedit"; QString authors=QString("Copyright (C) 2006, 2007 PDFedit team:
") +QString::fromUtf8("  Michal Hocko
  Miro Jahoda
  Jozef Mišutka
  Martin Petříček
"); QLabel *lb=new QLabel(QString("

")+app+"

"+tr("Compiled")+": "+COMPILE_TIME +"
"+tr("Using Qt %1").arg(QT_VERSION_STR) +tr(", QSA %1").arg(QSA_VERSION_STRING) +"

"+info+"

"+authors+"
"+tr("This program is distributed under terms of GNU GPL")+"
", this); lb->setTextFormat(Qt::RichText); //Lower frame with Ok button QFrame *okFrame=new QFrame(this); QGridLayout *lFrame=new QGridLayout(okFrame,1,2,5); //Ok button QPushButton *ok=new QPushButton(QObject::tr("&Ok"), okFrame); lFrame->addWidget(ok,0,1); QObject::connect(ok, SIGNAL(clicked()), this, SLOT(close())); okFrame->setFixedHeight(10+ok->sizeHint().height()); //Image sizes QSize imageSize; QSize bgSize; //Logo on right QPixmap* logoImage=ic->getIcon("pdfedit_logo.png"); QWidget *logo=new ImageWidget(logoImage,QColor(255,255,255),this); if (logoImage) { imageSize=logoImage->size(); logo->setFixedWidth(imageSize.width()); } //Background of text QPixmap* bgImage=ic->getIcon("pdfedit_bg.png"); if (bgImage) { lb->setErasePixmap(*bgImage); bgSize=bgImage->size(); lb->setMaximumSize(bgSize); } //Set minumum/maximum sizes if (bgImage!=NULL && logoImage!=NULL) { // Two conditions should be met: // Background must not repeat // Logo must be shown completely setMaximumSize(QSize(bgSize.width()+imageSize.width(),10+ok->sizeHint().height()+bgSize.height())); setMinimumSize(QSize(imageSize.width(),10+ok->sizeHint().height()+imageSize.height())); } l->setResizeMode(QLayout::Minimum); l->addWidget(lb,0,0); l->addWidget(logo,0,1); l->addMultiCellWidget(okFrame,1,1,0,1); } /** default destructor */ AboutWindow::~AboutWindow() { delete ic; } } // namespace gui