2007-12-01 10:47:15 +00:00
|
|
|
|
/*
|
2008-02-06 19:40:45 +00:00
|
|
|
|
Copyright 2006-2008 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/>.
|
|
|
|
|
*/
|
2006-10-27 15:47:22 +00:00
|
|
|
|
#include "aboutqet.h"
|
2007-10-04 17:32:41 +00:00
|
|
|
|
#include "qet.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...
|
|
|
|
|
setWindowTitle(tr("\300 propos de QElectrotech"));
|
|
|
|
|
setMinimumWidth(680);
|
|
|
|
|
setMinimumHeight(350);
|
|
|
|
|
setModal(true);
|
|
|
|
|
|
|
|
|
|
// Trois onglets
|
|
|
|
|
QTabWidget *onglets = new QTabWidget(this);
|
|
|
|
|
onglets -> addTab(ongletAPropos(), tr("\300 &propos"));
|
|
|
|
|
onglets -> addTab(ongletAuteurs(), tr("A&uteurs"));
|
|
|
|
|
onglets -> addTab(ongletLicence(), tr("&Accord de licence"));
|
|
|
|
|
|
|
|
|
|
// Un bouton pour fermer la boite de dialogue
|
|
|
|
|
QDialogButtonBox *boutons = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
|
connect(boutons, SIGNAL(accepted()), this, SLOT(accept()));
|
|
|
|
|
connect(boutons, SIGNAL(rejected()), this, SLOT(accept()));
|
|
|
|
|
|
|
|
|
|
// Le tout dans une disposition verticale
|
|
|
|
|
QVBoxLayout *disposition = new QVBoxLayout();
|
|
|
|
|
disposition -> addWidget(titre());
|
|
|
|
|
disposition -> addWidget(onglets);
|
|
|
|
|
disposition -> addWidget(boutons);
|
|
|
|
|
setLayout(disposition);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
*/
|
2007-01-20 18:11:42 +00:00
|
|
|
|
QWidget *AboutQET::titre() const {
|
2006-10-27 15:47:22 +00:00
|
|
|
|
QWidget *icone_et_titre = new QWidget();
|
|
|
|
|
// icone
|
|
|
|
|
QLabel *icone = new QLabel();
|
|
|
|
|
icone -> setPixmap(QIcon(":/ico/qelectrotech.png").pixmap(48, 48));
|
|
|
|
|
// label "QElectroTech"
|
2007-10-04 17:32:41 +00:00
|
|
|
|
QLabel *titre = new QLabel("<span style=\"font-weight:0;font-size:16pt;\">QElectroTech v" + QET::version + "</span>");
|
2006-10-27 15:47:22 +00:00
|
|
|
|
titre -> setTextFormat(Qt::RichText);
|
|
|
|
|
// le tout dans une grille
|
|
|
|
|
QGridLayout *dispo_horiz = new QGridLayout();
|
|
|
|
|
dispo_horiz -> addWidget(icone, 0, 0);
|
|
|
|
|
dispo_horiz -> addWidget(titre, 0, 1);
|
|
|
|
|
dispo_horiz -> setColumnStretch(0, 1);
|
|
|
|
|
dispo_horiz -> setColumnStretch(1, 100);
|
|
|
|
|
icone_et_titre -> setLayout(dispo_horiz);
|
|
|
|
|
return(icone_et_titre);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@return Le widget contenu par l'onglet <EFBFBD> A propos <EFBFBD>
|
|
|
|
|
*/
|
2007-01-20 18:11:42 +00:00
|
|
|
|
QWidget *AboutQET::ongletAPropos() const {
|
2006-10-27 15:47:22 +00:00
|
|
|
|
QLabel *apropos = new QLabel(
|
2006-11-10 21:31:18 +00:00
|
|
|
|
tr("QElectroTech, une application de r\351alisation de sch\351mas \351lectriques.") +
|
|
|
|
|
"<br><br>" +
|
2008-02-06 19:40:45 +00:00
|
|
|
|
tr("\251 2006-2008 Les d\351veloppeurs de QElectroTech") +
|
2006-11-10 21:31:18 +00:00
|
|
|
|
"<br><br>"
|
|
|
|
|
"<a href=\"http://qelectrotech.tuxfamily.org/\">"
|
|
|
|
|
"http://qelectrotech.tuxfamily.org/</a>"
|
2006-10-27 15:47:22 +00:00
|
|
|
|
);
|
|
|
|
|
apropos -> setAlignment(Qt::AlignCenter);
|
2006-11-10 21:31:18 +00:00
|
|
|
|
apropos -> setOpenExternalLinks(true);
|
|
|
|
|
apropos -> setTextFormat(Qt::RichText);
|
2006-10-27 15:47:22 +00:00
|
|
|
|
return(apropos);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@return Le widget contenu par l'onglet <EFBFBD> Auteurs <EFBFBD>
|
|
|
|
|
*/
|
2007-01-20 18:11:42 +00:00
|
|
|
|
QWidget *AboutQET::ongletAuteurs() const {
|
2006-10-27 15:47:22 +00:00
|
|
|
|
QLabel *auteurs = new QLabel(
|
2006-11-10 21:31:18 +00:00
|
|
|
|
"<span style=\"text-decoration: underline;\">" +
|
|
|
|
|
tr("Id\351e originale") +
|
|
|
|
|
"</span> : Beno\356t Ansieau "
|
|
|
|
|
"<<a href=\"mailto:benoit.ansieau@gmail.com\">"
|
|
|
|
|
"benoit.ansieau@gmail.com</a>>"
|
|
|
|
|
"<br><br>"
|
|
|
|
|
"<span style=\"text-decoration: underline;\">" +
|
|
|
|
|
tr("Programmation") +
|
|
|
|
|
"</span> : Xavier Guerrin "
|
|
|
|
|
"<<a href=\"mailto:xavier.guerrin@gmail.com\">"
|
|
|
|
|
"xavier.guerrin@gmail.com</a>>"
|
2006-10-27 15:47:22 +00:00
|
|
|
|
);
|
|
|
|
|
auteurs -> setAlignment(Qt::AlignCenter);
|
2006-11-10 21:31:18 +00:00
|
|
|
|
auteurs -> setOpenExternalLinks(true);
|
|
|
|
|
auteurs -> setTextFormat(Qt::RichText);
|
2006-10-27 15:47:22 +00:00
|
|
|
|
return(auteurs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@return Le widget contenu par l'onglet <EFBFBD> Accord de Licence <EFBFBD>
|
|
|
|
|
*/
|
2007-01-20 18:11:42 +00:00
|
|
|
|
QWidget *AboutQET::ongletLicence() const {
|
2006-10-27 15:47:22 +00:00
|
|
|
|
QWidget *licence = new QWidget();
|
|
|
|
|
// label
|
|
|
|
|
QLabel *titre_licence = new QLabel(tr("Ce programme est sous licence GNU/GPL."));
|
|
|
|
|
|
|
|
|
|
// texte de la GNU/GPL dans une zone de texte scrollable non editable
|
|
|
|
|
QTextEdit *texte_licence = new QTextEdit();
|
2007-10-28 01:32:57 +00:00
|
|
|
|
texte_licence -> setPlainText(QET::license());
|
2006-10-27 15:47:22 +00:00
|
|
|
|
texte_licence -> setReadOnly(true);
|
|
|
|
|
|
|
|
|
|
// le tout dans une disposition verticale
|
|
|
|
|
QVBoxLayout *dispo_licence = new QVBoxLayout();
|
|
|
|
|
dispo_licence -> addWidget(titre_licence);
|
|
|
|
|
dispo_licence -> addWidget(texte_licence);
|
|
|
|
|
licence -> setLayout(dispo_licence);
|
|
|
|
|
return(licence);
|
|
|
|
|
}
|