2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2012-01-01 22:51:51 +00:00
|
|
|
Copyright 2006-2012 Xavier Guerrin
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2008-07-30 12:44:57 +00:00
|
|
|
#include <QtGui>
|
2009-04-03 19:30:25 +00:00
|
|
|
#include "qettabwidget.h"
|
2006-10-27 15:47:22 +00:00
|
|
|
#include "aboutqet.h"
|
2007-10-04 17:32:41 +00:00
|
|
|
#include "qet.h"
|
2009-05-01 14:41:33 +00:00
|
|
|
#include "qeticons.h"
|
2006-10-27 15:47:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Constructeur
|
|
|
|
@param parent Le QWidget parent de la boite de dialogue
|
|
|
|
*/
|
|
|
|
AboutQET::AboutQET(QWidget *parent) : QDialog(parent) {
|
|
|
|
// Titre, taille, comportement...
|
2009-04-03 19:30:25 +00:00
|
|
|
setWindowTitle(tr("\300 propos de QElectrotech", "window title"));
|
2006-10-27 15:47:22 +00:00
|
|
|
setMinimumWidth(680);
|
|
|
|
setMinimumHeight(350);
|
|
|
|
setModal(true);
|
|
|
|
|
|
|
|
// Trois onglets
|
2009-04-04 02:17:24 +00:00
|
|
|
QETTabWidget *tabs = new QETTabWidget(this);
|
2009-05-10 14:02:37 +00:00
|
|
|
tabs -> addTab(aboutTab(), tr("\300 &propos", "tab title"));
|
|
|
|
tabs -> addTab(authorsTab(), tr("A&uteurs", "tab title"));
|
|
|
|
tabs -> addTab(translatorsTab(), tr("&Traducteurs", "tab title"));
|
|
|
|
tabs -> addTab(contributorsTab(), tr("&Contributeurs", "tab title"));
|
|
|
|
tabs -> addTab(licenseTab(), tr("&Accord de licence", "tab title"));
|
2006-10-27 15:47:22 +00:00
|
|
|
|
|
|
|
// Un bouton pour fermer la boite de dialogue
|
2009-04-04 02:17:24 +00:00
|
|
|
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
|
|
|
|
connect(buttons, SIGNAL(rejected()), this, SLOT(accept()));
|
2006-10-27 15:47:22 +00:00
|
|
|
|
|
|
|
// Le tout dans une disposition verticale
|
2009-04-04 02:17:24 +00:00
|
|
|
QVBoxLayout *vlayout = new QVBoxLayout();
|
|
|
|
vlayout -> addWidget(title());
|
|
|
|
vlayout -> addWidget(tabs);
|
|
|
|
vlayout -> addWidget(buttons);
|
|
|
|
setLayout(vlayout);
|
2006-10-27 15:47:22 +00:00
|
|
|
}
|
|
|
|
|
2007-04-12 03:13:13 +00:00
|
|
|
/**
|
|
|
|
Destructeur
|
|
|
|
*/
|
|
|
|
AboutQET::~AboutQET() {
|
|
|
|
}
|
|
|
|
|
2006-10-27 15:47:22 +00:00
|
|
|
/**
|
|
|
|
@return Le titre QElectroTech avec son icone
|
|
|
|
*/
|
2009-04-04 02:17:24 +00:00
|
|
|
QWidget *AboutQET::title() const {
|
|
|
|
QWidget *icon_and_title = new QWidget();
|
2006-10-27 15:47:22 +00:00
|
|
|
// icone
|
2009-04-04 02:17:24 +00:00
|
|
|
QLabel *icon = new QLabel();
|
2009-05-10 14:02:37 +00:00
|
|
|
icon -> setPixmap(QET::Icons::QETOxygenLogo.pixmap(48, 48));
|
2006-10-27 15:47:22 +00:00
|
|
|
// label "QElectroTech"
|
2009-04-04 02:17:24 +00:00
|
|
|
QLabel *title = new QLabel("<span style=\"font-weight:0;font-size:16pt;\">QElectroTech v" + QET::displayedVersion + "</span>");
|
2013-01-27 15:46:38 +00:00
|
|
|
QString compilation_info = "<br />" + tr("Compilation : ") + __DATE__ + " " + __TIME__;
|
2013-01-27 10:34:30 +00:00
|
|
|
#ifdef __GNUC__
|
2013-01-27 15:46:38 +00:00
|
|
|
compilation_info += " - GCC " + QString(__VERSION__);
|
2013-01-29 16:42:58 +00:00
|
|
|
compilation_info += " - built with Qt " + QString(QT_VERSION_STR);
|
|
|
|
compilation_info += " - run with Qt "+ QString(qVersion());
|
2013-01-27 10:34:30 +00:00
|
|
|
#endif
|
2013-01-27 15:46:38 +00:00
|
|
|
title -> setText(title->text() + compilation_info);
|
2009-04-04 02:17:24 +00:00
|
|
|
title -> setTextFormat(Qt::RichText);
|
2012-02-20 21:21:40 +00:00
|
|
|
|
|
|
|
QHBoxLayout *hlayout = new QHBoxLayout();
|
|
|
|
hlayout -> addWidget(icon);
|
|
|
|
hlayout -> addWidget(title);
|
|
|
|
hlayout -> addStretch();
|
|
|
|
icon_and_title -> setLayout(hlayout);
|
2009-04-04 02:17:24 +00:00
|
|
|
return(icon_and_title);
|
2006-10-27 15:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-04-04 02:17:24 +00:00
|
|
|
@return Le widget contenu par l'onglet "A propos"
|
2006-10-27 15:47:22 +00:00
|
|
|
*/
|
2009-04-04 02:17:24 +00:00
|
|
|
QWidget *AboutQET::aboutTab() const {
|
|
|
|
QLabel *about = new QLabel(
|
2012-04-17 05:37:01 +00:00
|
|
|
tr("QElectroTech, une application de r\351alisation de sch\351mas \351lectriques.", "about tab, description line") +
|
2006-11-10 21:31:18 +00:00
|
|
|
"<br><br>" +
|
2012-04-17 05:37:01 +00:00
|
|
|
tr("\251 2006-2012 Les d\351veloppeurs de QElectroTech", "about tab, developers line") +
|
2006-11-10 21:31:18 +00:00
|
|
|
"<br><br>"
|
2012-04-17 05:37:01 +00:00
|
|
|
"<a href=\"http://qelectrotech.org/\">http://qelectrotech.org/</a>"
|
|
|
|
"<br><br>" +
|
2012-04-28 21:45:24 +00:00
|
|
|
tr("Contact\240: <a href=\"mailto:qet@lists.tuxfamily.org\">qet@lists.tuxfamily.org</a>", "about tab, contact line")
|
2006-10-27 15:47:22 +00:00
|
|
|
);
|
2009-04-04 02:17:24 +00:00
|
|
|
about -> setAlignment(Qt::AlignCenter);
|
|
|
|
about -> setOpenExternalLinks(true);
|
|
|
|
about -> setTextFormat(Qt::RichText);
|
|
|
|
return(about);
|
2006-10-27 15:47:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-04-04 02:17:24 +00:00
|
|
|
@return Le widget contenu par l'onglet "Auteurs"
|
2006-10-27 15:47:22 +00:00
|
|
|
*/
|
2009-04-04 02:17:24 +00:00
|
|
|
QWidget *AboutQET::authorsTab() const {
|
|
|
|
QLabel *authors = new QLabel();
|
|
|
|
addAuthor(authors, "Beno\356t Ansieau", "benoit@qelectrotech.org", tr("Id\351e originale"));
|
2012-04-01 20:29:43 +00:00
|
|
|
addAuthor(authors, "Xavier Guerrin", "xavier@qelectrotech.org", tr("D\351veloppement"));
|
2012-04-17 05:37:01 +00:00
|
|
|
addAuthor(authors, "Laurent Trinques", "scorpio@qelectrotech.org", tr("Collection d'\351l\351ments"));
|
2009-04-04 02:17:24 +00:00
|
|
|
authors -> setAlignment(Qt::AlignCenter);
|
|
|
|
authors -> setOpenExternalLinks(true);
|
|
|
|
authors -> setTextFormat(Qt::RichText);
|
|
|
|
return(authors);
|
2006-10-27 15:47:22 +00:00
|
|
|
}
|
|
|
|
|
2009-05-10 14:02:37 +00:00
|
|
|
/**
|
|
|
|
@return Le widget contenu par l'onglet "Traducteurs"
|
|
|
|
*/
|
|
|
|
QWidget *AboutQET::translatorsTab() const {
|
|
|
|
QLabel *translators = new QLabel();
|
|
|
|
|
2012-04-01 20:29:43 +00:00
|
|
|
addAuthor(translators, "Alfredo Carreto", "electronicos_mx@yahoo.com.mx",tr("Traduction en espagnol"));
|
2010-03-28 16:27:48 +00:00
|
|
|
addAuthor(translators, "Yuriy Litkevich", "yuriy@qelectrotech.org", tr("Traduction en russe"));
|
|
|
|
addAuthor(translators, "Jos\351 Carlos Martins", "jose@qelectrotech.org", tr("Traduction en portugais"));
|
|
|
|
addAuthor(translators, "Pavel Fric", "pavelfric@seznam.cz", tr("Traduction en tch\350que"));
|
2012-01-10 21:44:09 +00:00
|
|
|
addAuthor(translators, "Paweł Śmiech", "pawel32640@gmail.com", tr("Traduction en polonais"));
|
2010-05-30 16:14:14 +00:00
|
|
|
addAuthor(translators, "Markus Budde", "markus.budde@msn.com", tr("Traduction en allemand"));
|
2011-03-01 22:47:13 +00:00
|
|
|
addAuthor(translators, "Gabi Mandoc", "gabriel.mandoc@gic.ro", tr("Traduction en roumain"));
|
2011-03-02 07:15:24 +00:00
|
|
|
addAuthor(translators, "Alessandro Conti", "dr.slump@alexconti.it", tr("Traduction en italien"));
|
2012-04-01 20:29:43 +00:00
|
|
|
addAuthor(translators, "Mohamed Souabni", "souabnimohamed@yahoo.fr", tr("Traduction en arabe"));
|
2012-05-12 19:52:23 +00:00
|
|
|
addAuthor(translators, "Antun Maraković", "antun.marakovic@lolaribar.hr",tr("Traduction en croate"));
|
2012-12-06 10:57:51 +00:00
|
|
|
addAuthor(translators, "Eduard Amor\363s", "amoros@marmenuda.com", tr("Traduction en catalan"));
|
2009-05-10 14:02:37 +00:00
|
|
|
|
2011-08-17 18:58:07 +00:00
|
|
|
translators -> setOpenExternalLinks(true);
|
|
|
|
translators -> setTextFormat(Qt::RichText);
|
|
|
|
|
|
|
|
QWidget *translators_widget = new QWidget();
|
|
|
|
QHBoxLayout *translators_layout = new QHBoxLayout(translators_widget);
|
|
|
|
translators_layout -> addWidget(translators, 0, Qt::AlignCenter);
|
|
|
|
return(translators_widget);
|
2009-05-10 14:02:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@return Le widget contenu par l'onglet "Contributeurs"
|
|
|
|
*/
|
|
|
|
QWidget *AboutQET::contributorsTab() const {
|
|
|
|
QLabel *contributors = new QLabel();
|
|
|
|
|
2012-05-13 10:48:29 +00:00
|
|
|
addAuthor(contributors, "Remi Collet", "remi@fedoraproject.org", tr("Paquets Fedora et Red Hat"));
|
2009-05-10 14:02:37 +00:00
|
|
|
addAuthor(contributors, "Trem", "trem@mandriva.org", tr("Paquets Mandriva"));
|
|
|
|
addAuthor(contributors, "Laurent Trinques", "scorpio@qelectrotech.org", tr("Paquets Debian"));
|
|
|
|
addAuthor(contributors, "Nuno Pinheiro", "nuno@nuno-icons.com", tr("Ic\364nes"));
|
|
|
|
|
2012-04-01 20:29:43 +00:00
|
|
|
contributors -> setOpenExternalLinks(true);
|
|
|
|
contributors -> setTextFormat(Qt::RichText);
|
|
|
|
|
|
|
|
QWidget *contributors_widget = new QWidget();
|
|
|
|
QHBoxLayout *contributors_layout = new QHBoxLayout(contributors_widget);
|
|
|
|
contributors_layout -> addWidget(contributors, 0, Qt::AlignCenter);
|
|
|
|
return(contributors_widget);
|
2009-05-10 14:02:37 +00:00
|
|
|
}
|
|
|
|
|
2006-10-27 15:47:22 +00:00
|
|
|
/**
|
2009-04-04 02:17:24 +00:00
|
|
|
@return Le widget contenu par l'onglet "Accord de Licence"
|
2006-10-27 15:47:22 +00:00
|
|
|
*/
|
2009-04-04 02:17:24 +00:00
|
|
|
QWidget *AboutQET::licenseTab() const {
|
|
|
|
QWidget *license = new QWidget();
|
2006-10-27 15:47:22 +00:00
|
|
|
// label
|
2009-04-04 02:17:24 +00:00
|
|
|
QLabel *title_license = new QLabel(tr("Ce programme est sous licence GNU/GPL."));
|
2006-10-27 15:47:22 +00:00
|
|
|
|
|
|
|
// texte de la GNU/GPL dans une zone de texte scrollable non editable
|
2009-04-04 02:17:24 +00:00
|
|
|
QTextEdit *text_license = new QTextEdit();
|
|
|
|
text_license -> setPlainText(QET::license());
|
|
|
|
text_license -> setReadOnly(true);
|
2006-10-27 15:47:22 +00:00
|
|
|
|
|
|
|
// le tout dans une disposition verticale
|
2009-04-04 02:17:24 +00:00
|
|
|
QVBoxLayout *license_layout = new QVBoxLayout();
|
|
|
|
license_layout -> addWidget(title_license);
|
|
|
|
license_layout -> addWidget(text_license);
|
|
|
|
license -> setLayout(license_layout);
|
|
|
|
return(license);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Ajoute une personne a la liste des auteurs
|
|
|
|
@param label QLabel auquel sera ajoute la personne
|
|
|
|
@param name Nom de la personne
|
|
|
|
@param email Adresse e-mail de la personne
|
|
|
|
@param work Fonction / travail effectue par la personne
|
|
|
|
*/
|
|
|
|
void AboutQET::addAuthor(QLabel *label, const QString &name, const QString &email, const QString &work) const {
|
|
|
|
QString new_text = label -> text();
|
|
|
|
|
2012-02-20 21:21:40 +00:00
|
|
|
QString author_template = "<span style=\"text-decoration: underline;\">%1</span> : %2 <<a href=\"mailto:%3\">%3</a>>‎<br/><br/>";
|
2009-04-04 02:17:24 +00:00
|
|
|
|
|
|
|
// ajoute la fonction de la personne
|
|
|
|
new_text += author_template.arg(work).arg(name).arg(email);
|
|
|
|
label -> setText(new_text);
|
2006-10-27 15:47:22 +00:00
|
|
|
}
|