2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2009-04-03 19:30:25 +00:00
|
|
|
Copyright 2006-2009 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>");
|
|
|
|
title -> setTextFormat(Qt::RichText);
|
2006-10-27 15:47:22 +00:00
|
|
|
// le tout dans une grille
|
2009-04-04 02:17:24 +00:00
|
|
|
QGridLayout *grid_layout = new QGridLayout();
|
|
|
|
grid_layout -> addWidget(icon, 0, 0);
|
|
|
|
grid_layout -> addWidget(title, 0, 1);
|
|
|
|
grid_layout -> setColumnStretch(0, 1);
|
|
|
|
grid_layout -> setColumnStretch(1, 100);
|
|
|
|
icon_and_title -> setLayout(grid_layout);
|
|
|
|
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(
|
2006-11-10 21:31:18 +00:00
|
|
|
tr("QElectroTech, une application de r\351alisation de sch\351mas \351lectriques.") +
|
|
|
|
"<br><br>" +
|
2009-04-03 19:30:25 +00:00
|
|
|
tr("\251 2006-2009 Les d\351veloppeurs de QElectroTech") +
|
2006-11-10 21:31:18 +00:00
|
|
|
"<br><br>"
|
2009-04-03 19:30:25 +00:00
|
|
|
"<a href=\"http://qelectrotech.org/\">"
|
|
|
|
"http://qelectrotech.org/</a>"
|
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"));
|
|
|
|
addAuthor(authors, "Xavier Guerrin", "xavier@qelectrotech.org", tr("Programmation"));
|
|
|
|
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();
|
|
|
|
|
2009-05-10 14:13:00 +00:00
|
|
|
addAuthor(translators, "Youssef Oualmakran", "youssefsan@qelectrotech.org", tr("Traduction en espagnol"));
|
2009-05-16 14:06:59 +00:00
|
|
|
addAuthor(translators, "Yuriy Litkevich", "yuriy@qelectrotech.org", tr("Traduction en russe"));
|
2009-05-10 14:02:37 +00:00
|
|
|
/*
|
2009-05-16 14:06:59 +00:00
|
|
|
addAuthor(translators, "Jos\351 Carlos Martins", "jose@qelectrotech.org", tr("Traduction en portugais"));
|
2009-05-10 14:13:00 +00:00
|
|
|
addAuthor(translators, "Luca Pedrazzi", "pedro@iworks.it", tr("Traduction en italien"));
|
2009-05-10 14:02:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
translators -> setAlignment(Qt::AlignCenter);
|
|
|
|
translators -> setOpenExternalLinks(true);
|
|
|
|
translators -> setTextFormat(Qt::RichText);
|
|
|
|
return(translators);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@return Le widget contenu par l'onglet "Contributeurs"
|
|
|
|
*/
|
|
|
|
QWidget *AboutQET::contributorsTab() const {
|
|
|
|
QLabel *contributors = new QLabel();
|
|
|
|
|
|
|
|
addAuthor(contributors, "Remi Collet", "fedora@famillecollet.com", tr("Paquets Fedora"));
|
|
|
|
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"));
|
|
|
|
|
|
|
|
contributors -> setAlignment(Qt::AlignCenter);
|
|
|
|
contributors -> setOpenExternalLinks(true);
|
|
|
|
contributors -> setTextFormat(Qt::RichText);
|
|
|
|
return(contributors);
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
QString author_template = "<span style=\"text-decoration: underline;\">%1</span> : %2 <<a href=\"mailto:%3\">%3</a>><br><br>";
|
|
|
|
|
|
|
|
// 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
|
|
|
}
|