author | alfadur |
Sun, 14 Oct 2018 21:57:30 +0300 | |
changeset 13915 | 6c8d4e140f27 |
parent 12902 | fc47fc4af6bd |
child 14199 | e60e2e7dd43a |
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" |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
35 |
|
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
36 |
#ifdef VIDEOREC |
8391 | 37 |
extern "C" |
38 |
{ |
|
9957 | 39 |
#include "libavcodec/version.h" |
40 |
#include "libavformat/version.h" |
|
41 |
#include "libavutil/avutil.h" // version.h only from 51.36.0 |
|
8391 | 42 |
} |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
43 |
#endif |
6175 | 44 |
|
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
45 |
|
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
46 |
#if defined(Q_OS_WINDOWS) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
47 |
#define sopath(x) x ".dll" |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
48 |
#elif defined(Q_OS_MAC) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
49 |
#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
|
50 |
#else |
9337 | 51 |
#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
|
52 |
#endif |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
53 |
|
187 | 54 |
#include "about.h" |
55 |
||
56 |
About::About(QWidget * parent) : |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
57 |
QWidget(parent) |
187 | 58 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
59 |
QGridLayout *mainLayout = new QGridLayout(this); |
2525 | 60 |
|
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
|
61 |
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
|
62 |
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
|
63 |
|
5646 | 64 |
QLabel *imageLabel = new QLabel; |
65 |
QImage image(":/res/Hedgehog.png"); |
|
66 |
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
|
67 |
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
|
68 |
imageLabel->setFixedHeight(300); |
5646 | 69 |
|
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
|
70 |
leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter); |
235 | 71 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
72 |
QLabel *lbl1 = new QLabel(this); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
73 |
lbl1->setOpenExternalLinks(true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
74 |
lbl1->setText( |
12224
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
75 |
//: %1 contains Hedgewars' version number |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
76 |
"<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
|
77 |
//: “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
|
78 |
"<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
|
79 |
//: %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
|
80 |
"<p>" + QString(tr("Visit our homepage: %1")) |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
81 |
.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
|
82 |
//: %1 is the name of a license |
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
83 |
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
|
84 |
.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
|
85 |
//: 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
|
86 |
tr("GNU GPL v2")+"</a>") + |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
87 |
"</div>" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
88 |
); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
89 |
lbl1->setWordWrap(true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
90 |
mainLayout->addWidget(lbl1, 0, 1); |
235 | 91 |
|
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
|
92 |
lbl2 = new QTextBrowser(this); |
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
|
93 |
lbl2->setOpenExternalLinks(true); |
8434 | 94 |
QUrl localpage = QUrl::fromLocalFile(":/res/html/about.html"); |
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
|
95 |
lbl2->setSource(localpage); //sets the source of the label from the file above |
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
|
96 |
mainLayout->addWidget(lbl2, 1, 1); |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
97 |
|
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
|
98 |
/* Library information */ |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
99 |
|
12224
072ece492a65
Make entire top part of about screen translatable
Wuzzy <almikes@aol.com>
parents:
12223
diff
changeset
|
100 |
//: 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
|
101 |
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
|
102 |
|
13915 | 103 |
#if defined(__GNUC__) |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
104 |
libinfo.append(QString(tr("<a href=\"https://gcc.gnu.org\">GCC</a>: %1")).arg(__VERSION__)); |
13915 | 105 |
#elif defined(WIN32_VCPKG) |
106 |
libinfo.append(QString(tr("<a href=\"https://visualstudio.microsoft.com\">VC++</a>: %1")).arg(_MSC_FULL_VER)); |
|
107 |
#elif defined(__VERSION__) |
|
108 |
libinfo.append(QString(tr("Unknown Compiler: %1")).arg(__VERSION__)); |
|
109 |
#else |
|
110 |
libinfo.append(QString(tr("Unknown Compiler"))); |
|
111 |
#endif |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
112 |
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
|
113 |
|
9677 | 114 |
const SDL_version *sdl_ver; |
115 |
SDL_version sdl_version; |
|
116 |
SDL_GetVersion(&sdl_version); |
|
117 |
sdl_ver = &sdl_version; |
|
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
118 |
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
|
119 |
.arg(sdl_ver->major) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
120 |
.arg(sdl_ver->minor) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
121 |
.arg(sdl_ver->patch)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
122 |
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
|
123 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
124 |
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
|
125 |
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
|
126 |
.arg(sdlmixer_ver->major) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
127 |
.arg(sdlmixer_ver->minor) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
128 |
.arg(sdlmixer_ver->patch)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
129 |
libinfo.append(QString("<br>")); |
9321 | 130 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
131 |
// 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
|
132 |
// 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
|
133 |
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
|
134 |
if (sdlnet_handle != NULL) { |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
135 |
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
|
136 |
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
|
137 |
if (sdlnet_ver_get != NULL) { |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
138 |
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
|
139 |
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
|
140 |
.arg(sdlnet_ver->major) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
141 |
.arg(sdlnet_ver->minor) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
142 |
.arg(sdlnet_ver->patch)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
143 |
libinfo.append(QString("<br>")); |
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
144 |
} |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
145 |
SDL_UnloadObject(sdlnet_handle); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
146 |
} |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
147 |
|
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
|
148 |
void *sdlimage_handle = SDL_LoadObject(sopath("SDL2_image")); |
9329 | 149 |
if (sdlimage_handle != NULL) { |
150 |
SDL_version *(*sdlimage_ver_get)(void) = NULL; |
|
151 |
sdlimage_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlimage_handle, "IMG_Linked_Version"); |
|
152 |
if (sdlimage_ver_get != NULL) { |
|
153 |
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
|
154 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2_image</a>: %1.%2.%3")) |
9329 | 155 |
.arg(sdlimage_ver->major) |
156 |
.arg(sdlimage_ver->minor) |
|
157 |
.arg(sdlimage_ver->patch)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
158 |
libinfo.append(QString("<br>")); |
9329 | 159 |
} |
12320
0f98d45204d7
Fix incorrect SDL_UnloadObject usage in about.cpp (copy-paste fail)
Wuzzy <almikes@aol.com>
parents:
12273
diff
changeset
|
160 |
SDL_UnloadObject(sdlimage_handle); |
9329 | 161 |
} |
162 |
||
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
|
163 |
void *sdlttf_handle = SDL_LoadObject(sopath("SDL2_ttf")); |
9329 | 164 |
if (sdlttf_handle != NULL) { |
165 |
SDL_version *(*sdlttf_ver_get)(void) = NULL; |
|
166 |
sdlttf_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlttf_handle, "TTF_Linked_Version"); |
|
167 |
if (sdlttf_ver_get != NULL) { |
|
168 |
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
|
169 |
libinfo.append(QString(tr("<a href=\"https://www.libsdl.org/\">SDL2_ttf</a>: %1.%2.%3")) |
9329 | 170 |
.arg(sdlttf_ver->major) |
171 |
.arg(sdlttf_ver->minor) |
|
172 |
.arg(sdlttf_ver->patch)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
173 |
libinfo.append(QString("<br>")); |
9329 | 174 |
} |
12320
0f98d45204d7
Fix incorrect SDL_UnloadObject usage in about.cpp (copy-paste fail)
Wuzzy <almikes@aol.com>
parents:
12273
diff
changeset
|
175 |
SDL_UnloadObject(sdlttf_handle); |
9329 | 176 |
} |
177 |
||
178 |
||
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
179 |
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
|
180 |
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
|
181 |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
182 |
#ifdef VIDEOREC |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
183 |
libinfo.append(QString(tr("<a href=\"https://libav.org\">libavcodec</a>: %1.%2.%3")) |
9957 | 184 |
.arg(LIBAVCODEC_VERSION_MAJOR) |
185 |
.arg(LIBAVCODEC_VERSION_MINOR) |
|
186 |
.arg(LIBAVCODEC_VERSION_MICRO)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
187 |
libinfo.append(QString("<br>")); |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
188 |
libinfo.append(QString(tr("<a href=\"https://libav.org\">libavformat</a>: %1.%2.%3")) |
9957 | 189 |
.arg(LIBAVFORMAT_VERSION_MAJOR) |
190 |
.arg(LIBAVFORMAT_VERSION_MINOR) |
|
191 |
.arg(LIBAVFORMAT_VERSION_MICRO)); |
|
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
192 |
libinfo.append(QString("<br>")); |
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
193 |
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
|
194 |
.arg(LIBAVUTIL_VERSION_MAJOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
195 |
.arg(LIBAVUTIL_VERSION_MINOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
196 |
.arg(LIBAVUTIL_VERSION_MICRO)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
197 |
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
|
198 |
#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
|
199 |
|
12273
2eedf9e0cd6d
Replace some HTTP links with HTTPS links
Wuzzy <almikes@aol.com>
parents:
12225
diff
changeset
|
200 |
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
|
201 |
.arg(PHYSFS_VER_MAJOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
202 |
.arg(PHYSFS_VER_MINOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
203 |
.arg(PHYSFS_VER_PATCH)); |
12223
b532cc42ebd4
Make library list in about screen translatable
Wuzzy <almikes@aol.com>
parents:
11835
diff
changeset
|
204 |
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
|
205 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
206 |
// 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
|
207 |
|
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
|
208 |
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
|
209 |
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
|
210 |
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
|
211 |
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
|
212 |
lblLibInfo->setMaximumWidth(280); |
8447 | 213 |
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
|
214 |
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
|
215 |
|
6175 | 216 |
setAcceptDrops(true); |
187 | 217 |
} |
6175 | 218 |
|
219 |
void About::dragEnterEvent(QDragEnterEvent * event) |
|
220 |
{ |
|
221 |
if (event->mimeData()->hasUrls()) |
|
222 |
{ |
|
223 |
QList<QUrl> urls = event->mimeData()->urls(); |
|
224 |
QString url = urls[0].toString(); |
|
225 |
if (urls.count() == 1) |
|
226 |
if (url.contains(QRegExp("^file://.*\\.ogg$"))) |
|
227 |
event->acceptProposedAction(); |
|
228 |
} |
|
229 |
} |
|
230 |
||
231 |
void About::dropEvent(QDropEvent * event) |
|
232 |
{ |
|
233 |
QString file = |
|
234 |
event->mimeData()->urls()[0].toString().remove(QRegExp("^file://")); |
|
235 |
||
236 |
SDLInteraction::instance().setMusicTrack(file); |
|
237 |
||
238 |
event->acceptProposedAction(); |
|
239 |
} |