|
| 1 | +/***************************************************************************//** |
| 2 | +* @brief Thumbnail me 3.0 |
| 3 | +* Thumbnail me is a user interface for Movie thumbnailer. |
| 4 | +* Generate thumbnails from any movie is now easier ! |
| 5 | +* |
| 6 | +* @file About.cpp |
| 7 | +* @class About |
| 8 | +* Cette classe génère une QFrame "A propos" de Thumbnail me. |
| 9 | +* |
| 10 | +* @author Quentin Rousseau\n |
| 11 | +* @note Copyright (C) 2011-2012 Quentin Rousseau\n |
| 12 | +* License: GNU General Public License version 2 (GPLv2) - http://www.gnu.org/licenses/gpl-2.0.html\n |
| 13 | +* Site web: www.thumbnailme.com\n |
| 14 | + |
| 15 | +* |
| 16 | +* @since 3.0 |
| 17 | +* @version 3.0 |
| 18 | +* @date 2011-2012 |
| 19 | +*******************************************************************************/ |
| 20 | + |
| 21 | +#include "About.h" |
| 22 | +#include "QtHelper.h" |
| 23 | +#include "defines.h" |
| 24 | + |
| 25 | +/** |
| 26 | +*@brief Constructeur. |
| 27 | +*/ |
| 28 | +About::About(QWidget *parent) |
| 29 | +{ |
| 30 | + //this->setWindowFlags(Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::WindowOkButtonHint | Qt::Dialog); |
| 31 | + this->setWindowModality(Qt::ApplicationModal); |
| 32 | + this->setWindowIcon(parent->windowIcon()); |
| 33 | + this->setAttribute(Qt::WA_DeleteOnClose); |
| 34 | + this->retranslate(); |
| 35 | + |
| 36 | + QGridLayout *layout = new QGridLayout(this); |
| 37 | + |
| 38 | + QLabel *logoLabel = new QLabel(this); |
| 39 | + logoLabel->setPixmap(QPixmap(":/sprites/about.png")); |
| 40 | + |
| 41 | + QLabel *aboutLabel = new QLabel(this); |
| 42 | + |
| 43 | + aboutLabel->setText( |
| 44 | + "<h2>What's "+APPLICATION_NAME+" ?</h2>"+ |
| 45 | + "<p>"+APPLICATION_NAME+" is a free and open source thumbnails generator built on movie thumbnailer binary.</p>"+ |
| 46 | + "<p>"+APPLICATION_NAME+" is coded in C++ and uses the <a href='http://qt.nokia.com/'>Qt library</a>.</p>"+ |
| 47 | + "<h2>Who is involved ?</h2>"+ |
| 48 | + "<p><b>Quentin Rousseau</b> : Developer - <a href=\"mailto:"+AUTHOR_EMAIL+"\">"+AUTHOR_EMAIL+"</a> - <a href=\"http://www.quentinrousseau.fr\">www.quentinrousseau.fr</a></p>"+ |
| 49 | + "<p><b>Christ Azika-Eros</b> : Linux compilation & ImageShack API Developer - <a href=\"mailto:[email protected]\">[email protected]</a> - <a href=\"http://azika-eros.org\">azika-eros.org</a></p>" |
| 50 | + "<h2>Special thanks to :</h2></br>"+ |
| 51 | + "<p><b>Pierre Arnout</b> : Splashscreen logo Designer - <a href=\"mailto:[email protected]\">[email protected]</a> - <a href=\"http://artpi.lescigales.org\">http://artpi.lescigales.org</a></p>"+ |
| 52 | + "<p><b>Antonio José Berenguer Verdú</b> : Spanish translation - <a href=\"mailto:[email protected]\">[email protected]</a></p>"+ |
| 53 | + "<p><b>Samuele Pilleri</b> : Italian translation - <a href=\"mailto:[email protected]\">[email protected]</a></p>"+ |
| 54 | + "<p><b>Philippe Da Silva</b> : Portugese translation - <a href=\"mailto:[email protected]\">[email protected]</a> - <a href=\"http://www.philippedasilva.fr\">www.philippedasilva.fr</a></p>"+ |
| 55 | + "<p><b>Qinlin Zha</b> : Chinese translation - <a href=\"mailto:[email protected]\">[email protected]</a></p>"+ |
| 56 | + "<p><b>Dmitry Bochkov</b> : Russian translation - <a href=\"mailto:[email protected]\">[email protected]</a></p>"+ |
| 57 | + "<h2>Websites :</h2><p>"+ |
| 58 | + "<a href='"+WEBSITE_URL+"'>"+WEBSITE_URL+"</a><br/><br/>"+ |
| 59 | + "<a href=\"http://moviethumbnail.sourceforge.net\">http://moviethumbnail.sourceforge.net</a> (Original Project)</p>"+ |
| 60 | + "<h2>License :</h2>"+ |
| 61 | + "<p>This work is licensed under a <a rel=\"license\" href=\"http://www.gnu.org/licenses/gpl-2.0.html\">GNU General Public License version 2 (GPLv2)</a>.</p>" |
| 62 | + ); |
| 63 | + |
| 64 | + aboutLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard); |
| 65 | + aboutLabel->setOpenExternalLinks(true); |
| 66 | + |
| 67 | + |
| 68 | + QHBoxLayout *topLayout = new QHBoxLayout; |
| 69 | + topLayout->addStretch(1); |
| 70 | + topLayout->addWidget(logoLabel,Qt::AlignHCenter); |
| 71 | + |
| 72 | + QHBoxLayout *bottomLayout = new QHBoxLayout; |
| 73 | + QDialogButtonBox *acceptButton = new QDialogButtonBox(QDialogButtonBox::Ok); |
| 74 | + bottomLayout->addWidget(acceptButton,Qt::AlignRight); |
| 75 | + |
| 76 | + layout->addLayout(topLayout,0,0,Qt::AlignHCenter);; |
| 77 | + layout->addWidget(aboutLabel,1,0,Qt::AlignHCenter); |
| 78 | + layout->addWidget(QtHelper::addHSeparator(),2,0); |
| 79 | + layout->addLayout(bottomLayout,3,0); |
| 80 | + |
| 81 | + this->setLayout(layout); |
| 82 | + |
| 83 | + /*Connections*/ |
| 84 | + connect(acceptButton,SIGNAL(accepted ()),this,SLOT(close())); |
| 85 | +} |
| 86 | + |
| 87 | +/** |
| 88 | +*@brief Destructeur. |
| 89 | +*/ |
| 90 | +About::~About() |
| 91 | +{ |
| 92 | +} |
| 93 | + |
| 94 | +/** |
| 95 | +*@brief ChangeEvent |
| 96 | +*@param *e Evenement. |
| 97 | +*/ |
| 98 | +void About::changeEvent(QEvent *e) |
| 99 | +{ |
| 100 | + if (e->type() == QEvent::LanguageChange) |
| 101 | + retranslate(); |
| 102 | + QWidget::changeEvent(e); |
| 103 | +} |
| 104 | + |
| 105 | +/** |
| 106 | +*@brief KeyPressEvent |
| 107 | +*@param *e Evenement. |
| 108 | +*/ |
| 109 | +void About::keyPressEvent(QKeyEvent *e) |
| 110 | +{ |
| 111 | + if(e->key() == Qt::Key_Escape) |
| 112 | + this->close(); |
| 113 | + QWidget::keyPressEvent(e); |
| 114 | +} |
| 115 | + |
| 116 | +/** |
| 117 | +*@brief Fonction de traduction dynamique. |
| 118 | +*/ |
| 119 | +void About::retranslate() |
| 120 | +{ |
| 121 | + this->setWindowTitle(tr("About")); |
| 122 | +} |
0 commit comments