Initial commit
[keepassx] / src / dialogs / AboutDlg.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-2007 by Tarek Saidi                                *
3  *   tarek.saidi@arcor.de                                                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; version 2 of the License.               *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18  ***************************************************************************/
19
20
21 #include "AboutDlg.h"
22
23
24 AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
25 {
26         setupUi(this);
27         createBanner(&BannerPixmap,getPixmap("keepassx"),QString("%1 %2").arg(APP_DISPLAY_NAME, APP_VERSION),width());
28
29     labelAppName->setText(APP_DISPLAY_NAME);
30     labelAppFunc->setText(QString(" -  ").append(APP_LONG_FUNC));
31
32         QString AboutTr=QString("<b>%1: %2</b><br><br>").arg(tr("Current Translation")).arg(tr("None","Please replace 'None' with the language of your translation"));
33         if(isTranslationActive()){
34                 AboutTr+=QString("<b>%1:</b> %2<br>").arg(tr("Author")).arg(QApplication::translate("Translation", "$TRANSLATION_AUTHOR"));
35                 QString mail=QApplication::translate("Translation", "$TRANSLATION_AUTHOR_EMAIL","Here you can enter your email or homepage if you want.");
36                 if(!mail.isEmpty()){
37                         AboutTr+=mail+"<br>";
38                 }
39                 AboutTr+="<br>";
40         }
41         Edit_Translation->setHtml(AboutTr+tr("Information on how to translate KeePassX can be found under:")
42                 +"<br>http://www.keepassx.org/");
43         QString str;
44         str+="<b>"+tr("Team")+"</b><br>";
45         str+="<div style='margin-left:10px;'>";
46         str+="<u>Tarek Saidi</u><br>"+tr("Developer, Project Admin")+"<br>tarek_saidi@users.sf.net<br>";
47         str+="<br>";
48         str+="<u>Felix Geyer</u><br>"+tr("Developer, Project Admin")+"<br>sniperbeamer@users.sf.net<br>";
49         str+="<br>";
50         str+="<u>Brandon Mayes</u><br>"+tr("Developer")+"<br>bdmayes@users.sourceforge.net<br>";
51         str+="<br>";
52         str+="<u>Eugen Gorschenin</u><br>"+tr("Web Designer")+"<br>geugen@users.sf.de<br>";
53         str+="<br>";
54         str+="<u>Juan J Gonz&aacute;lez C&aacute;rdenas [Jota Jota]</u><br>"+tr("Developer")+"<br>myxelf@users.sf.net<br>";
55         str+="</div><br><div style='margin-left:0px;'>";
56     str+="<b>"+tr("Thanks To")+"</b><br>";
57         str+="</div><div style='margin-left:10px;'>";
58         str+="<u>Matthias Miller</u><br>"+tr("Patches for better MacOS X support")+"<br>www.outofhanwell.com<br></div>";
59         str+="<br>";
60         str+="<u>James Nicholls</u><br>"+tr("Main Application Icon")/*+"<br>"+tr("mailto:???")*/+"<br></div>";
61         str+="<br>";
62         str+="<u>Constantin Makshin</u><br>"+tr("Various fixes and improvements")+"<br>dinosaur-rus@users.sourceforge.net<br></div>";
63         Edit_Thanks->setHtml(str);
64         
65         QFile gpl(DataDir+"/license.html");
66         if (!gpl.open(QIODevice::ReadOnly)){
67                 QMessageBox::critical(this,tr("Error"),tr("File '%1' could not be found.")
68                                 .arg("'license.html'")+"\n"+tr("Make sure that the program is installed correctly.")
69                                 ,tr("OK"),0,0,2,1);
70         }
71         
72         Edit_License->setHtml(QString::fromUtf8(gpl.readAll()));
73         
74         connect(ButtonBox, SIGNAL(rejected()), SLOT(close()));
75 }
76
77 void AboutDialog::paintEvent(QPaintEvent *event){
78         QDialog::paintEvent(event);
79         QPainter painter(this);
80         painter.setClipRegion(event->region());
81         painter.drawPixmap(QPoint(0,0),BannerPixmap);
82 }