author | unc0rr |
Wed, 06 Nov 2013 00:59:33 +0400 | |
branch | sdl2transition |
changeset 9677 | 71626318f80e |
parent 9653 | 327d98e165e2 |
child 11362 | ed5a6478e710 |
permissions | -rw-r--r-- |
187 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
9080 | 3 |
* Copyright (c) 2004-2013 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 |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
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> |
|
6175 | 29 |
#include "hwconsts.h" |
30 |
#include "SDLInteraction.h" |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
31 |
#include "SDL.h" |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
32 |
#include "SDL_version.h" |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
33 |
#include "physfs.h" |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
34 |
|
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
35 |
#ifdef VIDEOREC |
8391 | 36 |
extern "C" |
37 |
{ |
|
38 |
#include "libavutil/avutil.h" |
|
39 |
} |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
40 |
#endif |
6175 | 41 |
|
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
42 |
|
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
43 |
#if defined(Q_OS_WINDOWS) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
44 |
#define sopath(x) x ".dll" |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
45 |
#elif defined(Q_OS_MAC) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
46 |
#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
|
47 |
#else |
9337 | 48 |
#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
|
49 |
#endif |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
50 |
|
187 | 51 |
#include "about.h" |
52 |
||
53 |
About::About(QWidget * parent) : |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
54 |
QWidget(parent) |
187 | 55 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
56 |
QGridLayout *mainLayout = new QGridLayout(this); |
2525 | 57 |
|
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
|
58 |
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
|
59 |
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
|
60 |
|
5646 | 61 |
QLabel *imageLabel = new QLabel; |
62 |
QImage image(":/res/Hedgehog.png"); |
|
63 |
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
|
64 |
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
|
65 |
imageLabel->setFixedHeight(300); |
5646 | 66 |
|
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
|
67 |
leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter); |
235 | 68 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
69 |
QLabel *lbl1 = new QLabel(this); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
70 |
lbl1->setOpenExternalLinks(true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
71 |
lbl1->setText( |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
72 |
"<style type=\"text/css\">" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
73 |
"a { color: #ffcc00; }" |
1897 | 74 |
// "a:hover { color: yellow; }" |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
75 |
"</style>" |
8613
82c649dfc7c3
split cVersionString into its three separate components (version, revision, hash) and apply the new values sensibly on the frontend (esp. title, info and feedback)
koda
parents:
8447
diff
changeset
|
76 |
"<div align=\"center\"><h1>Hedgewars " + *cVersionString + "</h1>" |
8652 | 77 |
"<h3>" + QLabel::tr("Revision") + " " + *cRevisionString + " (" + *cHashString + ")</h3>" |
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
|
78 |
"<p><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p>" + |
8654 | 79 |
QLabel::tr("This program is distributed under the %1").arg("<a \ |
80 |
href=\"http://www.gnu.org/licenses/gpl-2.0.html\">GNU GPL v2</a>") + |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
81 |
"</div>" |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6175
diff
changeset
|
82 |
); |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
83 |
lbl1->setWordWrap(true); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2751
diff
changeset
|
84 |
mainLayout->addWidget(lbl1, 0, 1); |
235 | 85 |
|
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
|
86 |
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
|
87 |
lbl2->setOpenExternalLinks(true); |
8434 | 88 |
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
|
89 |
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
|
90 |
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
|
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 |
/* Library information */ |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
93 |
|
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
|
94 |
QString libinfo = "<style type=text/css>a:link { color: #FFFF6E; }</style>"; |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
95 |
|
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
|
96 |
#ifdef __GNUC__ |
8447 | 97 |
libinfo.append(QString("<a href=\"http://gcc.gnu.org\">GCC</a> %1<br>").arg(__VERSION__)); |
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 |
#else |
8447 | 99 |
libinfo.append(QString(tr("Unknown Compiler")).arg(__VERSION__) + 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
|
100 |
#endif |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
101 |
|
9677 | 102 |
const SDL_version *sdl_ver; |
103 |
SDL_version sdl_version; |
|
104 |
#if SDL_MAJOR_VERSION == 2 |
|
105 |
SDL_GetVersion(&sdl_version); |
|
106 |
sdl_ver = &sdl_version; |
|
107 |
#else |
|
108 |
sdl_ver = SDL_Linked_Version(); |
|
109 |
#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
|
110 |
libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL</a> version: %1.%2.%3<br>") |
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
111 |
.arg(sdl_ver->major) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
112 |
.arg(sdl_ver->minor) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
113 |
.arg(sdl_ver->patch)); |
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
|
114 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
115 |
const SDL_version *sdlmixer_ver = Mix_Linked_Version(); |
9321 | 116 |
libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_mixer</a> version: %1.%2.%3<br>") |
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
117 |
.arg(sdlmixer_ver->major) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
118 |
.arg(sdlmixer_ver->minor) |
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
119 |
.arg(sdlmixer_ver->patch)); |
9321 | 120 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
121 |
// 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
|
122 |
// we dynamically call the function returning the linked version |
9327
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
123 |
void *sdlnet_handle = SDL_LoadObject(sopath("SDL_net")); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
124 |
if (sdlnet_handle != NULL) { |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
125 |
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
|
126 |
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
|
127 |
if (sdlnet_ver_get != NULL) { |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
128 |
SDL_version *sdlnet_ver = sdlnet_ver_get(); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
129 |
libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_net</a> version: %1.%2.%3<br>") |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
130 |
.arg(sdlnet_ver->major) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
131 |
.arg(sdlnet_ver->minor) |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
132 |
.arg(sdlnet_ver->patch)); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
133 |
} |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
134 |
SDL_UnloadObject(sdlnet_handle); |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
135 |
} |
02caf698a8f1
dynamically load sdl_net information so we don't have to link it
koda
parents:
9321
diff
changeset
|
136 |
|
9329 | 137 |
void *sdlimage_handle = SDL_LoadObject(sopath("SDL_image")); |
138 |
if (sdlimage_handle != NULL) { |
|
139 |
SDL_version *(*sdlimage_ver_get)(void) = NULL; |
|
140 |
sdlimage_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlimage_handle, "IMG_Linked_Version"); |
|
141 |
if (sdlimage_ver_get != NULL) { |
|
142 |
SDL_version *sdlimage_ver = sdlimage_ver_get(); |
|
143 |
libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_image</a> version: %1.%2.%3<br>") |
|
144 |
.arg(sdlimage_ver->major) |
|
145 |
.arg(sdlimage_ver->minor) |
|
146 |
.arg(sdlimage_ver->patch)); |
|
147 |
} |
|
148 |
SDL_UnloadObject(sdlnet_handle); |
|
149 |
} |
|
150 |
||
151 |
void *sdlttf_handle = SDL_LoadObject(sopath("SDL_ttf")); |
|
152 |
if (sdlttf_handle != NULL) { |
|
153 |
SDL_version *(*sdlttf_ver_get)(void) = NULL; |
|
154 |
sdlttf_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlttf_handle, "TTF_Linked_Version"); |
|
155 |
if (sdlttf_ver_get != NULL) { |
|
156 |
SDL_version *sdlttf_ver = sdlttf_ver_get(); |
|
157 |
libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_ttf</a> version: %1.%2.%3<br>") |
|
158 |
.arg(sdlttf_ver->major) |
|
159 |
.arg(sdlttf_ver->minor) |
|
160 |
.arg(sdlttf_ver->patch)); |
|
161 |
} |
|
162 |
SDL_UnloadObject(sdlnet_handle); |
|
163 |
} |
|
164 |
||
165 |
||
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
|
166 |
libinfo.append(QString("<a href=\"http://qt-project.org/\">Qt</a> version: %1<br>").arg(QT_VERSION_STR)); |
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
|
167 |
|
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
168 |
#ifdef VIDEOREC |
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
|
169 |
libinfo.append(QString("<a href=\"http://libav.org\">Libav</a> version: %1.%2.%3<br>") |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
170 |
.arg(LIBAVUTIL_VERSION_MAJOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
171 |
.arg(LIBAVUTIL_VERSION_MINOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
172 |
.arg(LIBAVUTIL_VERSION_MICRO)); |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
173 |
#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
|
174 |
|
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
|
175 |
libinfo.append(QString("<a href=\"http://icculus.org/physfs/\">PhysFS</a> version: %1.%2.%3<br>") |
8390
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
176 |
.arg(PHYSFS_VER_MAJOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
177 |
.arg(PHYSFS_VER_MINOR) |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
178 |
.arg(PHYSFS_VER_PATCH)); |
0b2403003640
Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents:
8256
diff
changeset
|
179 |
|
9331
26f0bf0de172
use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents:
9329
diff
changeset
|
180 |
// 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
|
181 |
|
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
|
182 |
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
|
183 |
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
|
184 |
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
|
185 |
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
|
186 |
lblLibInfo->setMaximumWidth(280); |
8447 | 187 |
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
|
188 |
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
|
189 |
|
6175 | 190 |
setAcceptDrops(true); |
187 | 191 |
} |
6175 | 192 |
|
193 |
void About::dragEnterEvent(QDragEnterEvent * event) |
|
194 |
{ |
|
195 |
if (event->mimeData()->hasUrls()) |
|
196 |
{ |
|
197 |
QList<QUrl> urls = event->mimeData()->urls(); |
|
198 |
QString url = urls[0].toString(); |
|
199 |
if (urls.count() == 1) |
|
200 |
if (url.contains(QRegExp("^file://.*\\.ogg$"))) |
|
201 |
event->acceptProposedAction(); |
|
202 |
} |
|
203 |
} |
|
204 |
||
205 |
void About::dropEvent(QDropEvent * event) |
|
206 |
{ |
|
207 |
QString file = |
|
208 |
event->mimeData()->urls()[0].toString().remove(QRegExp("^file://")); |
|
209 |
||
210 |
SDLInteraction::instance().setMusicTrack(file); |
|
211 |
||
212 |
event->acceptProposedAction(); |
|
213 |
} |