|
1 /* |
|
2 * Hedgewars, a free turn based strategy game |
|
3 * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
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 Free Software |
|
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 */ |
|
18 |
|
19 #include <QGridLayout> |
|
20 #include <QLabel> |
|
21 #include <QList> |
|
22 #include <QUrl> |
|
23 #include <QRegExp> |
|
24 #include "hwconsts.h" |
|
25 #include "SDLInteraction.h" |
|
26 |
|
27 #include "about.h" |
|
28 |
|
29 About::About(QWidget * parent) : |
|
30 QWidget(parent) |
|
31 { |
|
32 QGridLayout *mainLayout = new QGridLayout(this); |
|
33 |
|
34 QLabel *imageLabel = new QLabel; |
|
35 QImage image(":/res/Hedgehog.png"); |
|
36 imageLabel->setPixmap(QPixmap::fromImage(image)); |
|
37 imageLabel->setScaledContents(true); |
|
38 imageLabel->setMinimumWidth(2.8); |
|
39 imageLabel->setMaximumWidth(280); |
|
40 imageLabel->setMinimumHeight(30); |
|
41 imageLabel->setMaximumHeight(300); |
|
42 |
|
43 mainLayout->addWidget(imageLabel, 0, 0, 2, 1); |
|
44 |
|
45 QLabel *lbl1 = new QLabel(this); |
|
46 lbl1->setOpenExternalLinks(true); |
|
47 lbl1->setText( |
|
48 "<style type=\"text/css\">" |
|
49 "a { color: #ffcc00; }" |
|
50 // "a:hover { color: yellow; }" |
|
51 "</style>" |
|
52 "<div align=\"center\"><h1>Hedgewars</h1>" |
|
53 "<h3>" + QLabel::tr("Version") + " " + *cVersionString + "</h3>" |
|
54 "<p><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p><br>" + |
|
55 QLabel::tr("This program is distributed under the GNU General Public License v2") + |
|
56 "</div>" |
|
57 ); |
|
58 lbl1->setWordWrap(true); |
|
59 mainLayout->addWidget(lbl1, 0, 1); |
|
60 |
|
61 lbl2 = new QTextBrowser(this); |
|
62 |
|
63 lbl2->setOpenExternalLinks(true); |
|
64 lbl2->setText( |
|
65 "<style type=\"text/css\">" |
|
66 "a { color: #ffcc00; }" |
|
67 // "a:hover { color: yellow; }" |
|
68 "</style>" + |
|
69 QString("<h2>") + |
|
70 QLabel::tr("Developers:") + |
|
71 "</h2><p>" |
|
72 "Engine, frontend, net server: Andrey Korotaev <<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>><br>" |
|
73 "Many frontend improvements: Igor Ulyanov <<a href=\"mailto:disinbox@gmail.com\">disinbox@gmail.com</a>><br>" |
|
74 "Many engine and frontend improvements: Derek Pomery <<a href=\"mailto:nemo@m8y.org\">nemo@m8y.org</a>><br>" |
|
75 "Drill rocket, Ballgun, RC Plane weapons: Martin Boze <<a href=\"mailto:afffect@gmail.com\">afffect@gmail.com</a>><br>" |
|
76 "Mine number and time game settings: David A. Cuadrado <<a href=\"mailto:krawek@gmail.com\">krawek@gmail.com</a>><br>" |
|
77 "Frontend improvements: Martin Minarik <<a href=\"mailto:ttsmj@pokec.sk\">ttsmj@pokec.sk</a>><br>" |
|
78 "Frontend improvements: Kristian Lehmann <<a href=\"mailto:email@thexception.net\">email@thexception.net</a>><br>" |
|
79 "Mac OS X/iPhone port, OpenGL-ES conversion: Vittorio Giovara <<a href=\"mailto:vittorio.giovara@gmail.com\">vittorio.giovara@gmail.com</a>><br>" |
|
80 "Many engine and frontend improvements (and bugs): Richard Karolyi <<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>><br>" |
|
81 "Gamepad and Lua integration: Mario Liebisch <<a href=\"mailto:mario.liebisch@gmail.com\">mario.liebisch@gmail.com</a>><br>" |
|
82 "Many engine improvements and graphics: Carlos Vives <<a href=\"mailto:mail@carlosvives.es\">mail@carlosvives.es</a>><br>" |
|
83 "Maze maps: Henning Kühn <<a href=\"mailto:prg@cooco.de\">prg@cooco.de</a>><br>" |
|
84 "Engine and frontend improvements: Henrik Rostedt <<a href=\"mailto:henrik.rostedt@gmail.com\">henrik.rostedt@gmail.com</a>><br>" |
|
85 "Lua game modes and missions: John Lambert <<a href=\"mailto:redgrinner@gmail.com\">redgrinner@gmail.com</a>><br>" |
|
86 "Frontend improvements: Mayur Pawashe <<a href=\"mailto:zorgiepoo@gmail.com\">zorgiepoo@gmail.com</a>><br>" |
|
87 "Android port: Richard Deurwaarder <<a href=\"mailto:xeli@xelification.com\">xeli@xelification.com</a>><br>" |
|
88 "</p><h2>" + |
|
89 |
|
90 QLabel::tr("Art:") + "</h2>" |
|
91 + QString::fromUtf8( |
|
92 "<p>John Dum <<a href=\"mailto:fizzy@gmail.com\">fizzy@gmail.com</a>>" |
|
93 "<br>" |
|
94 "Joshua Frese <<a href=\"mailto:joshfrese@gmail.com\">joshfrese@gmail.com</a>>" |
|
95 "<br>" |
|
96 "Stanko Tadić <<a href=\"mailto:stanko@mfhinc.net\">stanko@mfhinc.net</a>>" |
|
97 "<br>" |
|
98 "Julien Koesten <<a href=\"mailto:julienkoesten@aol.com\">julienkoesten@aol.com</a>>" |
|
99 "<br>" |
|
100 "Joshua O'Sullivan <<a href=\"mailto:coheedftw@hotmail.co.uk\">coheedftw@hotmail.co.uk</a>>" |
|
101 "<br>" |
|
102 "Nils Lück <<a href=\"mailto:nils.luck.design@gmail.com\">nils.luck.design@gmail.com</a>>" |
|
103 "<br>" |
|
104 "Guillaume Englert <<a href=\"mailto:genglert@hybird.org\">genglert@hybird.org</a>>" |
|
105 "<br>" |
|
106 "Hats: Trey Perry <<a href=\"mailto:tx.perry.j@gmail.com\">tx.perry.j@gmail.com</a>>" |
|
107 "</p><h2>") + |
|
108 QLabel::tr("Sounds:") + "</h2>" |
|
109 "Hedgehogs voice: Stephen Alexander <<a href=\"mailto:ArmagonNo1@gmail.com\">ArmagonNo1@gmail.com</a>>" |
|
110 "<br>" |
|
111 "John Dum <<a href=\"mailto:fizzy@gmail.com\">fizzy@gmail.com</a>>" |
|
112 "<br>" |
|
113 "Jonatan Nilsson <<a href=\"mailto:jonatanfan@gmail.com\">jonatanfan@gmail.com</a>>" |
|
114 "<br>" |
|
115 "Daniel Martin <<a href=\"mailto:elhombresinremedio@gmail.com\">elhombresinremedio@gmail.com</a>>" |
|
116 "</p><h2>" + |
|
117 |
|
118 QLabel::tr("Translations:") + "</h2><p>" |
|
119 + QString::fromUtf8( |
|
120 "Brazilian Portuguese: Romulo Fernandes Machado <<a href=\"mailto:abra185@gmail.com\">abra185@gmail.com</a>><br>" |
|
121 "Bulgarian: Svetoslav Stefanov<br>" |
|
122 "Czech: Petr Řezáček <<a href=\"mailto:rezacek@gmail.com\">rezacek@gmail.com</a>><br>" |
|
123 "Chinese: Jie Luo <<a href=\"mailto:lililjlj@gmail.com\">lililjlj@gmail.com</a>><br>" |
|
124 "English: Andrey Korotaev <<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>><br>" |
|
125 "Finnish: Nina Kuisma <<a href=\"mailto:ninnnu@gmail.com\">ninnnu@gmail.com</a>><br>" |
|
126 "French: Antoine Turmel <<a href=\"mailto:geekshadow@gmail.com\">geekshadow@gmail.com</a>><br>" |
|
127 "German: Peter Hüwe <<a href=\"mailto:PeterHuewe@gmx.de\">PeterHuewe@gmx.de</a>>, Mario Liebisch <<a href=\"mailto:mario.liebisch@gmail.com\">mario.liebisch@gmail.com</a>>, Richard Karolyi <<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>><br>" |
|
128 "Greek: <<a href=\"mailto:talos_kriti@yahoo.gr\">talos_kriti@yahoo.gr</a>><br>" |
|
129 "Italian: Luca Bonora <<a href=\"mailto:bonora.luca@gmail.com\">bonora.luca@gmail.com</a>>, Marco Bresciani<br>" |
|
130 "Japanese: ADAM Etienne <<a href=\"mailto:etienne.adam@gmail.com\">etienne.adam@gmail.com</a>><br>" |
|
131 "Korean: Anthony Bellew <<a href=\"mailto:webmaster@anthonybellew.com\">webmaster@anthonybellew.com</a>><br>" |
|
132 "Lithuanian: Lukas Urbonas <<a href=\"mailto:lukasu08@gmail.com\">lukasu08@gmail.com</a>><br>" |
|
133 "Polish: Maciej Mroziński <<a href=\"mailto:mynick2@o2.pl\">mynick2@o2.pl</a>>, Wojciech Latkowski <<a href=\"mailto:magik17l@gmail.com\">magik17l@gmail.com</a>>, Piotr Mitana, Maciej Górny<br>" |
|
134 "Portuguese: Fábio Canário <<a href=\"mailto:inufabie@gmail.com\">inufabie@gmail.com</a>><br>" |
|
135 "Russian: Andrey Korotaev <<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>><br>" |
|
136 "Slovak: Jose Riha<br>" |
|
137 "Spanish: Carlos Vives <<a href=\"mailto:mail@carlosvives.es\">mail@carlosvives.es</a>><br>" |
|
138 "Swedish: Niklas Grahn <<a href=\"mailto:raewolusjoon@yaoo.com\">raewolusjoon@yaoo.com</a>>, Henrik Rostedt <<a href=\"mailto:henrik.rostedt@gmail.com\">henrik.rostedt@gmail.com</a>><br>" |
|
139 "Ukrainian: Eugene V. Lyubimkin <<a href=\"mailto:jackyf.devel@gmail.com\">jackyf.devel@gmail.com</a>>, Igor Paliychuk <<a href=\"mailto:mansonigor@gmail.com\">mansonigor@gmail.com</a>>, Eugene Sakara <<a href=\"mailto:eresid@gmail.com\">eresid@gmail.com</a>>" |
|
140 "</p><h2>") + |
|
141 |
|
142 QLabel::tr("Special thanks:") + "</h2><p>" |
|
143 "Aleksey Andreev <<a href=\"mailto:blaknayabr@gmail.com\">blaknayabr@gmail.com</a>><br>" |
|
144 "Aleksander Rudalev <<a href=\"mailto:alexv@pomorsu.ru\">alexv@pomorsu.ru</a>><br>" |
|
145 "Natasha Korotaeva <<a href=\"mailto:layout@pisem.net\">layout@pisem.net</a>><br>" |
|
146 "Adam Higerd (aka ahigerd at FreeNode)" |
|
147 "</p>" |
|
148 ); |
|
149 mainLayout->addWidget(lbl2, 1, 1); |
|
150 |
|
151 setAcceptDrops(true); |
|
152 } |
|
153 |
|
154 void About::dragEnterEvent(QDragEnterEvent * event) |
|
155 { |
|
156 if (event->mimeData()->hasUrls()) |
|
157 { |
|
158 QList<QUrl> urls = event->mimeData()->urls(); |
|
159 QString url = urls[0].toString(); |
|
160 if (urls.count() == 1) |
|
161 if (url.contains(QRegExp("^file://.*\\.ogg$"))) |
|
162 event->acceptProposedAction(); |
|
163 } |
|
164 } |
|
165 |
|
166 void About::dropEvent(QDropEvent * event) |
|
167 { |
|
168 QString file = |
|
169 event->mimeData()->urls()[0].toString().remove(QRegExp("^file://")); |
|
170 |
|
171 SDLInteraction::instance().setMusicTrack(file); |
|
172 |
|
173 event->acceptProposedAction(); |
|
174 } |