mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@364 bfdf4180-ca20-0410-9c96-a3a8aa849046
140 lines
4.4 KiB
C++
140 lines
4.4 KiB
C++
/*
|
||
Copyright 2006-2008 Xavier Guerrin
|
||
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/>.
|
||
*/
|
||
#include <QtGui>
|
||
#include "aboutqet.h"
|
||
#include "qet.h"
|
||
|
||
/**
|
||
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);
|
||
}
|
||
|
||
/**
|
||
Destructeur
|
||
*/
|
||
AboutQET::~AboutQET() {
|
||
}
|
||
|
||
/**
|
||
@return Le titre QElectroTech avec son icone
|
||
*/
|
||
QWidget *AboutQET::titre() const {
|
||
QWidget *icone_et_titre = new QWidget();
|
||
// icone
|
||
QLabel *icone = new QLabel();
|
||
icone -> setPixmap(QIcon(":/ico/qelectrotech.png").pixmap(48, 48));
|
||
// label "QElectroTech"
|
||
QLabel *titre = new QLabel("<span style=\"font-weight:0;font-size:16pt;\">QElectroTech v" + QET::version + "</span>");
|
||
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 <20> A propos <20>
|
||
*/
|
||
QWidget *AboutQET::ongletAPropos() const {
|
||
QLabel *apropos = new QLabel(
|
||
tr("QElectroTech, une application de r\351alisation de sch\351mas \351lectriques.") +
|
||
"<br><br>" +
|
||
tr("\251 2006-2008 Les d\351veloppeurs de QElectroTech") +
|
||
"<br><br>"
|
||
"<a href=\"http://qelectrotech.tuxfamily.org/\">"
|
||
"http://qelectrotech.tuxfamily.org/</a>"
|
||
);
|
||
apropos -> setAlignment(Qt::AlignCenter);
|
||
apropos -> setOpenExternalLinks(true);
|
||
apropos -> setTextFormat(Qt::RichText);
|
||
return(apropos);
|
||
}
|
||
|
||
/**
|
||
@return Le widget contenu par l'onglet <20> Auteurs <20>
|
||
*/
|
||
QWidget *AboutQET::ongletAuteurs() const {
|
||
QLabel *auteurs = new QLabel(
|
||
"<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>>"
|
||
);
|
||
auteurs -> setAlignment(Qt::AlignCenter);
|
||
auteurs -> setOpenExternalLinks(true);
|
||
auteurs -> setTextFormat(Qt::RichText);
|
||
return(auteurs);
|
||
}
|
||
|
||
/**
|
||
@return Le widget contenu par l'onglet <20> Accord de Licence <20>
|
||
*/
|
||
QWidget *AboutQET::ongletLicence() const {
|
||
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();
|
||
texte_licence -> setPlainText(QET::license());
|
||
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);
|
||
}
|