author | Wuzzy <Wuzzy2@mail.ru> |
Thu, 13 Dec 2018 22:50:14 +0100 | |
changeset 14438 | a88c61d8976a |
parent 14436 | 6f6d9fe79830 |
child 14441 | 3f679f2fb45a |
permissions | -rw-r--r-- |
187 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
187 | 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 |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
10015
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
187 | 17 |
*/ |
18 |
||
221 | 19 |
#include <QGridLayout> |
235 | 20 |
#include <QLabel> |
6175 | 21 |
#include <QList> |
22 |
#include <QUrl> |
|
23 |
#include <QRegExp> |
|
8256 | 24 |
#include <QNetworkAccessManager> |
25 |
#include <QNetworkRequest> |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
26 |
#include <QMessageBox> |
8256 | 27 |
#include <QNetworkReply> |
28 |
#include <QDebug> |
|
12902
fc47fc4af6bd
Finish porting. Seems to work, but no thorough testing has been performed
unc0rr
parents:
12392
diff
changeset
|
29 |
#include <QMimeData> |
6175 | 30 |
#include "hwconsts.h" |
31 |
#include "SDLInteraction.h" |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
32 |
#include "SDL.h" |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
33 |
#include "SDL_version.h" |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
34 |
#include "physfs.h" |
14433
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
35 |
#include "creditsmessages.h" |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
36 |
#include "HWApplication.h" |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
37 |
|
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
38 |
#ifdef VIDEOREC |
8391 | 39 |
extern "C" |
40 |
{ |
|
9957 | 41 |
#include "libavcodec/version.h" |
42 |
#include "libavformat/version.h" |
|
43 |
#include "libavutil/avutil.h" // version.h only from 51.36.0 |
|
8391 | 44 |
} |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
45 |
#endif |
6175 | 46 |
|
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
47 |
|
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
48 |
#if defined(Q_OS_WINDOWS) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
49 |
#define sopath(x) x ".dll" |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
50 |
#elif defined(Q_OS_MAC) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
51 |
#define sopath(x) "@executable_path/../Frameworks/" x ".framework/" x |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
52 |
#else |
9337 | 53 |
#define sopath(x) "lib" x ".so" |
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
54 |
#endif |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
55 |
|
187 | 56 |
#include "about.h" |
57 |
||
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
58 |
QString About::getCreditsHtml() |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
59 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
60 |
// Open the credits file |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
61 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
62 |
/* *** FILE FORMAT OF CREDITS FILE *** |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
63 |
The credits file is an RFC-4180-compliant CSV file with 4 columns. |
14436 | 64 |
The first column (column 1) is always 1 letter long and is the row type. |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
65 |
The row type determines the meaning of the other columns. |
14436 | 66 |
|
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
67 |
The following row types are supported: |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
68 |
|
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
69 |
* E: Credits entry |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
70 |
* Column 2: Task/contribution |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
71 |
* Column 3: Contributor name |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
72 |
* Column 4: Contributor e-mail |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
73 |
* M: Alternative credits entry that is a placeholder for other or unknown authors |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
74 |
* Columns 2-4: Unused |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
75 |
* S: Section |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
76 |
* Column 2: Section name |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
77 |
* Columns 3-4: Unused |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
78 |
* U: Subsection |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
79 |
* Column 2: Subsection name |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
80 |
* Columns 3-4: Unused |
14436 | 81 |
|
82 |
Column 2 MUST be in US-ASCII. |
|
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
83 |
*/ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
84 |
QFile creditsFile(":/res/credits.csv"); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
85 |
if (!creditsFile.open(QIODevice::ReadOnly)) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
86 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
87 |
qWarning("ERROR: Credits file could not be opened!"); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
88 |
return "<p>ERROR: Credits file could not be opened!</p>"; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
89 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
90 |
QString creditsString = creditsFile.readAll(); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
91 |
QString out = QString("<h1>" + tr("Credits") + "</h1>\n"); |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
92 |
QStringList cells = QStringList() << QString("") << QString("") << QString("") << QString(""); |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
93 |
bool firstSection = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
94 |
unsigned long int column = 0; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
95 |
unsigned long int charInCell = 0; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
96 |
bool isInQuote = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
97 |
bool ignoreChar = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
98 |
bool lineComplete = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
99 |
QChar currChar; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
100 |
QChar prevChar; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
101 |
for(long long int i = 0; i<creditsString.length(); i++) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
102 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
103 |
currChar = creditsString.at(i); |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
104 |
QString type, task, name, mail; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
105 |
if(currChar == '"') |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
106 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
107 |
if(charInCell == 0) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
108 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
109 |
isInQuote = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
110 |
ignoreChar = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
111 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
112 |
else if(isInQuote && prevChar != '"') |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
113 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
114 |
ignoreChar = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
115 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
116 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
117 |
else if(isInQuote && charInCell > 0 && prevChar == '"' && (currChar == '\r' || currChar == ',')) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
118 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
119 |
isInQuote = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
120 |
ignoreChar = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
121 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
122 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
123 |
charInCell++; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
124 |
if(!isInQuote && currChar == ',') |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
125 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
126 |
column++; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
127 |
charInCell = 0; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
128 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
129 |
else if(!isInQuote && currChar == '\n' && prevChar == '\r') |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
130 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
131 |
lineComplete = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
132 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
133 |
if(!isInQuote && (currChar == '\r' || currChar == '\n' || currChar == ',')) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
134 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
135 |
ignoreChar = true; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
136 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
137 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
138 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
139 |
if(!ignoreChar) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
140 |
{ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
141 |
cells[column].append(currChar); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
142 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
143 |
ignoreChar = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
144 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
145 |
if(lineComplete) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
146 |
{ |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
147 |
type = cells[0]; |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
148 |
task = cells[1]; |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
149 |
name = cells[2]; |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
150 |
mail = cells[3]; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
151 |
|
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
152 |
if(type == "S") |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
153 |
{ |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
154 |
// section |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
155 |
if (!firstSection) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
156 |
out = out + "</ul>\n"; |
14435
5b5aff91cebb
Make captions in credits translatable, too
Wuzzy <Wuzzy2@mail.ru>
parents:
14434
diff
changeset
|
157 |
out = out + "<h2>" + HWApplication::translate("credits", task.toLatin1().constData()) + "</h2>\n<ul>\n"; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
158 |
firstSection = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
159 |
} |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
160 |
else if(type == "U") |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
161 |
{ |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
162 |
// subsection |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
163 |
out = out + "</ul>\n"; |
14435
5b5aff91cebb
Make captions in credits translatable, too
Wuzzy <Wuzzy2@mail.ru>
parents:
14434
diff
changeset
|
164 |
out = out + "<h3>" + HWApplication::translate("credits", task.toLatin1().constData()) + "</h3>\n<ul>\n"; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
165 |
} |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
166 |
else if(type == "M") |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
167 |
{ |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
168 |
// other people |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
169 |
out = out + "<li>" + tr("Other people") + "</li>" + "\n"; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
170 |
} |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
171 |
else if(type == "E") |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
172 |
{ |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
173 |
// credits list entry |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
174 |
QString mailLink = QString("<a href=\"mailto:%1\">%1</a>").arg(mail); |
14438
a88c61d8976a
Clean up CREDITS file, move more credits to credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14436
diff
changeset
|
175 |
if(task.isEmpty() && mail.isEmpty() && !name.isEmpty()) |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
176 |
{ |
14433
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
177 |
// Name only |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
178 |
out = out + "<li>" + name + "</li>\n"; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
179 |
} |
14438
a88c61d8976a
Clean up CREDITS file, move more credits to credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14436
diff
changeset
|
180 |
else if(name.isEmpty() && mail.isEmpty() && !task.isEmpty()) |
a88c61d8976a
Clean up CREDITS file, move more credits to credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14436
diff
changeset
|
181 |
{ |
a88c61d8976a
Clean up CREDITS file, move more credits to credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14436
diff
changeset
|
182 |
// Task only |
a88c61d8976a
Clean up CREDITS file, move more credits to credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14436
diff
changeset
|
183 |
out = out + "<li>" + HWApplication::translate("credits", task.toLatin1().constData()) + "</li>\n"; |
a88c61d8976a
Clean up CREDITS file, move more credits to credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14436
diff
changeset
|
184 |
} |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
185 |
else if(task.isEmpty()) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
186 |
{ |
14433
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
187 |
// Name and e-mail |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
188 |
//: Part of credits. %1: Contribution name. %2: E-mail address |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
189 |
out = out + "<li>" + tr("%1 <%2>").arg(name).arg(mailLink) + "</li>\n"; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
190 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
191 |
else if(mail.isEmpty()) |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
192 |
{ |
14433
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
193 |
// Contribution and name |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
194 |
//: Part of credits. %1: Description of contribution. %2: Contributor name |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
195 |
out = out + "<li>" + tr("%1: %2") |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
196 |
.arg(HWApplication::translate("credits", task.toLatin1().constData())) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
197 |
.arg(name) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
198 |
+ "</li>\n"; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
199 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
200 |
else |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
201 |
{ |
14433
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
202 |
// Contribution, name and e-mail |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
203 |
//: Part of credits. %1: Description of contribution. %2: Contributor name. %3: E-mail address |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
204 |
out = out + "<li>" + tr("%1: %2 <%3>") |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
205 |
.arg(HWApplication::translate("credits", task.toLatin1().constData())) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
206 |
.arg(name) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
207 |
.arg(mailLink) |
fbe5e49462aa
Make about dialog in frontend translatable
Wuzzy <Wuzzy2@mail.ru>
parents:
14431
diff
changeset
|
208 |
+ "</li>\n"; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
209 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
210 |
} |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
211 |
else |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
212 |
{ |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
213 |
qWarning("Invalid row type in credits.csv: %s", qPrintable(type)); |
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
214 |
} |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
215 |
lineComplete = false; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
216 |
column = 0; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
217 |
cells[0] = ""; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
218 |
cells[1] = ""; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
219 |
cells[2] = ""; |
14434
e64b9ea24cd8
Add row type column in credits.csv
Wuzzy <Wuzzy2@mail.ru>
parents:
14433
diff
changeset
|
220 |
cells[3] = ""; |
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
221 |
charInCell = 0; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
222 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
223 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
224 |
prevChar = currChar; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
225 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
226 |
creditsFile.close(); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
227 |
out = out + "</ul>"; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
228 |
return out; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
229 |
} |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
230 |
|
187 | 231 |
About::About(QWidget * parent) : |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
232 |
QWidget(parent) |
187 | 233 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
234 |
QGridLayout *mainLayout = new QGridLayout(this); |
2525 | 235 |
|
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
236 |
QVBoxLayout * leftLayout = new QVBoxLayout(); |
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
237 |
mainLayout->addLayout(leftLayout, 0, 0, 2, 1); |
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
238 |
|
5646 | 239 |
QLabel *imageLabel = new QLabel; |
240 |
QImage image(":/res/Hedgehog.png"); |
|
241 |
imageLabel->setPixmap(QPixmap::fromImage(image)); |
|
9131
07f3bf8d98a3
Hedgewars.png had a resolution more than twice as high as required; also fixed some (mostly obsolete) code that also contained a typo that would cause a warning/note in clang
sheepluva
parents:
9080
diff
changeset
|
242 |
imageLabel->setFixedWidth(273); |
07f3bf8d98a3
Hedgewars.png had a resolution more than twice as high as required; also fixed some (mostly obsolete) code that also contained a typo that would cause a warning/note in clang
sheepluva
parents:
9080
diff
changeset
|
243 |
imageLabel->setFixedHeight(300); |
5646 | 244 |
|
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
245 |
leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter); |
235 | 246 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
247 |
QLabel *lbl1 = new QLabel(this); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
248 |
lbl1->setOpenExternalLinks(true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
249 |
lbl1->setText( |
12224
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
250 |
//: %1 contains Hedgewars' version number |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
251 |
"<div align=\"center\"><h1>"+QString(tr("Hedgewars %1")).arg(*cVersionString) + "</h1>" |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
252 |
//: “Revision” stands for a revision in Mercurial, a distributed version control system. %1 is the revision, %2 is the hexadecimal hash. |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
253 |
"<h3>" + QString(tr("Revision %1 (%2)")).arg(*cRevisionString, *cHashString) + "</h3>" |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
254 |
//: %1 is replaced by the URL of Hedgewars. |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
255 |
"<p>" + QString(tr("Visit our homepage: %1")) |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
256 |
.arg("<a href=\"https://www.hedgewars.org/\">https://www.hedgewars.org/</a>") + "</p>" + |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
257 |
//: %1 is the name of a license |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
258 |
tr("This program is distributed under the %1.") |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
259 |
.arg("<a href=\"https://www.gnu.org/licenses/gpl-2.0.html\">"+ |
12224
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
260 |
//: Short for “GNU General Public License version 2” |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
261 |
tr("GNU GPL v2")+"</a>") + |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
262 |
"</div>" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
263 |
); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
264 |
lbl1->setWordWrap(true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
265 |
mainLayout->addWidget(lbl1, 0, 1); |
235 | 266 |
|
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
267 |
/* Credits */ |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
268 |
creditsBrowser = new QTextBrowser(this); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
269 |
creditsBrowser->setOpenExternalLinks(true); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
270 |
QString credits = getCreditsHtml(); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
271 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
272 |
QString header = |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
273 |
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
274 |
"<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
275 |
"<head>" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
276 |
"<title>Hedgewars Credits</title>" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
277 |
"<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
278 |
"<style type=\"text/css\">" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
279 |
" body { color: orange; }" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
280 |
" a { color: #ffe270; }" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
281 |
" a:hover { color: yellow; }" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
282 |
" ul { list-style-type: none; }" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
283 |
"</style>" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
284 |
"</head>" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
285 |
"<body>" |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
286 |
""; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
287 |
QString footer = |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
288 |
"" |
14431 | 289 |
"<h2>" + tr("Extended Credits") + "</h2>" |
290 |
"<p>" + tr("An extended credits list can be found in the CREDITS text file.") + "</p>" |
|
14430
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
291 |
"</body></html>"; |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
292 |
|
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
293 |
creditsBrowser->setHtml(header + credits + footer); |
bf0ec13a21ea
Move credits to RFC-4180-conforming CSV file
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
294 |
mainLayout->addWidget(creditsBrowser, 1, 1); |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
295 |
|
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
296 |
/* Library information */ |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
297 |
|
12224
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
298 |
//: For the version numbers of Hedgewars' software dependencies |
12225
a7c08e4748ff
Use the same link color consistently in frontend
Wuzzy <almikes@aol.com>
parents:
12224
diff
changeset
|
299 |
QString libinfo = QString(tr("Dependency versions:") + QString("<br>")); |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
300 |
|
13915 | 301 |
#if defined(__GNUC__) |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
302 |
libinfo.append(QString(tr("<a href=\"https://gcc.gnu.org\">GCC</a>: %1")).arg(__VERSION__)); |
14422
b2d0c72b5d89
Backed out changeset e60e2e7dd43a to restore pre-0.9.25 string changes
Wuzzy <Wuzzy2@mail.ru>
parents:
14199
diff
changeset
|
303 |
#elif defined(WIN32_VCPKG) |
b2d0c72b5d89
Backed out changeset e60e2e7dd43a to restore pre-0.9.25 string changes
Wuzzy <Wuzzy2@mail.ru>
parents:
14199
diff
changeset
|
304 |
libinfo.append(QString(tr("<a href=\"https://visualstudio.microsoft.com\">VC++</a>: %1")).arg(_MSC_FULL_VER)); |
b2d0c72b5d89
Backed out changeset e60e2e7dd43a to restore pre-0.9.25 string changes
Wuzzy <Wuzzy2@mail.ru>
parents:
14199
diff
changeset
|
305 |
#elif defined(__VERSION__) |
b2d0c72b5d89
Backed out changeset e60e2e7dd43a to restore pre-0.9.25 string changes
Wuzzy <Wuzzy2@mail.ru>
parents:
14199
diff
changeset
|
306 |
libinfo.append(QString(tr("Unknown Compiler: %1")).arg(__VERSION__)); |
14199
e60e2e7dd43a
Remove 2 strings violating the 0.9.25 string freeze. Backout this changeset after 0.9.25 got released
Wuzzy <Wuzzy2@mail.ru>
parents:
13915
diff
changeset
|
307 |
#else |
13915 | 308 |
libinfo.append(QString(tr("Unknown Compiler"))); |
309 |
#endif |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
310 |
libinfo.append(QString("<br>")); |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
311 |
|
9677 | 312 |
const SDL_version *sdl_ver; |
313 |
SDL_version sdl_version; |
|
314 |
SDL_GetVersion(&sdl_version); |
|
315 |
sdl_ver = &sdl_version; |
|
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
316 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2</a>: %1.%2.%3")) |
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
317 |
.arg(sdl_ver->major) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
318 |
.arg(sdl_ver->minor) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
319 |
.arg(sdl_ver->patch)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
320 |
libinfo.append(QString("<br>")); |
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
321 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
322 |
const SDL_version *sdlmixer_ver = Mix_Linked_Version(); |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
323 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2_mixer</a>: %1.%2.%3")) |
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
324 |
.arg(sdlmixer_ver->major) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
325 |
.arg(sdlmixer_ver->minor) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
326 |
.arg(sdlmixer_ver->patch)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
327 |
libinfo.append(QString("<br>")); |
9321 | 328 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
329 |
// the remaining sdl modules used only in engine, so instead of needlessly linking them here |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
330 |
// we dynamically call the function returning the linked version |
12392
cfcbc960337e
very elaborate change to the confusing and convoluted code for detecting (non-)linked SDL-libs versions in frontend
sheepluva
parents:
12320
diff
changeset
|
331 |
void *sdlnet_handle = SDL_LoadObject(sopath("SDL2_net")); |
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
332 |
if (sdlnet_handle != NULL) { |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
333 |
SDL_version *(*sdlnet_ver_get)(void) = NULL; |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
334 |
sdlnet_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlnet_handle, "SDLNet_Linked_Version"); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
335 |
if (sdlnet_ver_get != NULL) { |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
336 |
SDL_version *sdlnet_ver = sdlnet_ver_get(); |
12392
cfcbc960337e
very elaborate change to the confusing and convoluted code for detecting (non-)linked SDL-libs versions in frontend
sheepluva
parents:
12320
diff
changeset
|
337 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2_net</a>: %1.%2.%3")) |
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
338 |
.arg(sdlnet_ver->major) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
339 |
.arg(sdlnet_ver->minor) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
340 |
.arg(sdlnet_ver->patch)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
341 |
libinfo.append(QString("<br>")); |
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
342 |
} |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
343 |
SDL_UnloadObject(sdlnet_handle); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
344 |
} |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
345 |
|
12392
cfcbc960337e
very elaborate change to the confusing and convoluted code for detecting (non-)linked SDL-libs versions in frontend
sheepluva
parents:
12320
diff
changeset
|
346 |
void *sdlimage_handle = SDL_LoadObject(sopath("SDL2_image")); |
9329 | 347 |
if (sdlimage_handle != NULL) { |
348 |
SDL_version *(*sdlimage_ver_get)(void) = NULL; |
|
349 |
sdlimage_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlimage_handle, "IMG_Linked_Version"); |
|
350 |
if (sdlimage_ver_get != NULL) { |
|
351 |
SDL_version *sdlimage_ver = sdlimage_ver_get(); |
|
12392
cfcbc960337e
very elaborate change to the confusing and convoluted code for detecting (non-)linked SDL-libs versions in frontend
sheepluva
parents:
12320
diff
changeset
|
352 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2_image</a>: %1.%2.%3")) |
9329 | 353 |
.arg(sdlimage_ver->major) |
354 |
.arg(sdlimage_ver->minor) |
|
355 |
.arg(sdlimage_ver->patch)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
356 |
libinfo.append(QString("<br>")); |
9329 | 357 |
} |
12320
0f98d45204d7
Fix incorrect SDL_UnloadObject usage in about.cpp (copy-paste fail)
Wuzzy <almikes@aol.com>
parents:
12273
diff
changeset
|
358 |
SDL_UnloadObject(sdlimage_handle); |
9329 | 359 |
} |
360 |
||
12392
cfcbc960337e
very elaborate change to the confusing and convoluted code for detecting (non-)linked SDL-libs versions in frontend
sheepluva
parents:
12320
diff
changeset
|
361 |
void *sdlttf_handle = SDL_LoadObject(sopath("SDL2_ttf")); |
9329 | 362 |
if (sdlttf_handle != NULL) { |
363 |
SDL_version *(*sdlttf_ver_get)(void) = NULL; |
|
364 |
sdlttf_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlttf_handle, "TTF_Linked_Version"); |
|
365 |
if (sdlttf_ver_get != NULL) { |
|
366 |
SDL_version *sdlttf_ver = sdlttf_ver_get(); |
|
12392
cfcbc960337e
very elaborate change to the confusing and convoluted code for detecting (non-)linked SDL-libs versions in frontend
sheepluva
parents:
12320
diff
changeset
|
367 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2_ttf</a>: %1.%2.%3")) |
9329 | 368 |
.arg(sdlttf_ver->major) |
369 |
.arg(sdlttf_ver->minor) |
|
370 |
.arg(sdlttf_ver->patch)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
371 |
libinfo.append(QString("<br>")); |
9329 | 372 |
} |
12320
0f98d45204d7
Fix incorrect SDL_UnloadObject usage in about.cpp (copy-paste fail)
Wuzzy <almikes@aol.com>
parents:
12273
diff
changeset
|
373 |
SDL_UnloadObject(sdlttf_handle); |
9329 | 374 |
} |
375 |
||
376 |
||
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
377 |
libinfo.append(QString(tr("<a href=\"https://www.qt.io/developers/\">Qt</a>: %1")).arg(QT_VERSION_STR)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
378 |
libinfo.append(QString("<br>")); |
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
379 |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
380 |
#ifdef VIDEOREC |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
381 |
libinfo.append(QString(tr("<a href=\"https://libav.org\">libavcodec</a>: %1.%2.%3")) |
9957 | 382 |
.arg(LIBAVCODEC_VERSION_MAJOR) |
383 |
.arg(LIBAVCODEC_VERSION_MINOR) |
|
384 |
.arg(LIBAVCODEC_VERSION_MICRO)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
385 |
libinfo.append(QString("<br>")); |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
386 |
libinfo.append(QString(tr("<a href=\"https://libav.org\">libavformat</a>: %1.%2.%3")) |
9957 | 387 |
.arg(LIBAVFORMAT_VERSION_MAJOR) |
388 |
.arg(LIBAVFORMAT_VERSION_MINOR) |
|
389 |
.arg(LIBAVFORMAT_VERSION_MICRO)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
390 |
libinfo.append(QString("<br>")); |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
391 |
libinfo.append(QString(tr("<a href=\"https://libav.org\">libavutil</a>: %1.%2.%3")) |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
392 |
.arg(LIBAVUTIL_VERSION_MAJOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
393 |
.arg(LIBAVUTIL_VERSION_MINOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
394 |
.arg(LIBAVUTIL_VERSION_MICRO)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
395 |
libinfo.append(QString("<br>")); |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
396 |
#endif |
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
397 |
|
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
398 |
libinfo.append(QString(tr("<a href=\"https://icculus.org/physfs/\">PhysFS</a>: %1.%2.%3")) |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
399 |
.arg(PHYSFS_VER_MAJOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
400 |
.arg(PHYSFS_VER_MINOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
401 |
.arg(PHYSFS_VER_PATCH)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
402 |
libinfo.append(QString("<br>")); |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
403 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
404 |
// TODO: how to add Lua information? |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
405 |
|
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
406 |
QLabel * lblLibInfo = new QLabel(); |
8760
534e30885b66
enable/fix links on about page. why don't people test that stuff when they insert it? it's just one click...
sheepluva
parents:
8654
diff
changeset
|
407 |
lblLibInfo->setOpenExternalLinks(true); |
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
408 |
lblLibInfo->setText(libinfo); |
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
409 |
lblLibInfo->setWordWrap(true); |
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
410 |
lblLibInfo->setMaximumWidth(280); |
8447 | 411 |
leftLayout->addWidget(lblLibInfo, 0, Qt::AlignHCenter); |
8404
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
412 |
leftLayout->addStretch(1); |
f06227b2ea14
Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page.
dag10 <gottlieb.drew@gmail.com>
parents:
8391
diff
changeset
|
413 |
|
6175 | 414 |
setAcceptDrops(true); |
187 | 415 |
} |
6175 | 416 |
|
417 |
void About::dragEnterEvent(QDragEnterEvent * event) |
|
418 |
{ |
|
419 |
if (event->mimeData()->hasUrls()) |
|
420 |
{ |
|
421 |
QList<QUrl> urls = event->mimeData()->urls(); |
|
422 |
QString url = urls[0].toString(); |
|
423 |
if (urls.count() == 1) |
|
424 |
if (url.contains(QRegExp("^file://.*\\.ogg$"))) |
|
425 |
event->acceptProposedAction(); |
|
426 |
} |
|
427 |
} |
|
428 |
||
429 |
void About::dropEvent(QDropEvent * event) |
|
430 |
{ |
|
431 |
QString file = |
|
432 |
event->mimeData()->urls()[0].toString().remove(QRegExp("^file://")); |
|
433 |
||
434 |
SDLInteraction::instance().setMusicTrack(file); |
|
435 |
||
436 |
event->acceptProposedAction(); |
|
437 |
} |