QTfrontend/ui/widget/about.cpp
author koda
Mon, 28 Oct 2013 17:03:20 +0100
changeset 9651 c0a389ccb0c1
parent 9650 1c7c87ce37fd
child 9653 327d98e165e2
permissions -rw-r--r--
correctly use USE_TOUCH_INTERFACE
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 1052
diff changeset
     2
 * Hedgewars, a free turn based strategy game
9080
9b42757d7e71 bump copyright year for Andrey entries
unc0rr
parents: 8760
diff changeset
     3
 * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     4
 *
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     8
 *
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    13
 *
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    17
 */
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    18
221
0f451dae4251 Hedgehog on About page
unc0rr
parents: 187
diff changeset
    19
#include <QGridLayout>
235
28903e620258 About page
unc0rr
parents: 221
diff changeset
    20
#include <QLabel>
6175
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
    21
#include <QList>
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
    22
#include <QUrl>
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
    23
#include <QRegExp>
8256
19dbb3209f46 GCI2012: Refactor Authors Page
koda
parents: 7930
diff changeset
    24
#include <QNetworkAccessManager>
19dbb3209f46 GCI2012: Refactor Authors Page
koda
parents: 7930
diff changeset
    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
19dbb3209f46 GCI2012: Refactor Authors Page
koda
parents: 7930
diff changeset
    27
#include <QNetworkReply>
19dbb3209f46 GCI2012: Refactor Authors Page
koda
parents: 7930
diff changeset
    28
#include <QDebug>
6175
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
    29
#include "hwconsts.h"
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
    30
#include "SDLInteraction.h"
9650
1c7c87ce37fd add possibility to compile with SDL2 automatically
koda
parents: 9337
diff changeset
    31
#if SDL_VERSION_ATLEAST(2, 0, 0)
1c7c87ce37fd add possibility to compile with SDL2 automatically
koda
parents: 9337
diff changeset
    32
#include "SDL2/SDL.h"
1c7c87ce37fd add possibility to compile with SDL2 automatically
koda
parents: 9337
diff changeset
    33
#include "SDL2/SDL_version.h"
1c7c87ce37fd add possibility to compile with SDL2 automatically
koda
parents: 9337
diff changeset
    34
#else
8390
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
    35
#include "SDL.h"
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
    36
#include "SDL_version.h"
9650
1c7c87ce37fd add possibility to compile with SDL2 automatically
koda
parents: 9337
diff changeset
    37
#endif
8390
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
    38
#include "physfs.h"
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
    39
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
    40
#ifdef VIDEOREC
8391
9f2527848ffd Fixes build.
dag10 <gottlieb.drew@gmail.com>
parents: 8390
diff changeset
    41
extern "C"
9f2527848ffd Fixes build.
dag10 <gottlieb.drew@gmail.com>
parents: 8390
diff changeset
    42
{
9f2527848ffd Fixes build.
dag10 <gottlieb.drew@gmail.com>
parents: 8390
diff changeset
    43
#include "libavutil/avutil.h"
9f2527848ffd Fixes build.
dag10 <gottlieb.drew@gmail.com>
parents: 8390
diff changeset
    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
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
    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
c9d4daae1dee sopath() for linux too
koda
parents: 9331
diff changeset
    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
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    56
#include "about.h"
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    57
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    58
About::About(QWidget * parent) :
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6175
diff changeset
    59
    QWidget(parent)
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
    60
{
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2751
diff changeset
    61
    QGridLayout *mainLayout = new QGridLayout(this);
2525
e6cdc0251cd1 remove the svg dependency
koda
parents: 2460
diff changeset
    62
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
    63
    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
    64
    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
    65
5646
1d44c448cfa4 enable a tip on osx, remove trailing whitespaces
koda
parents: 5626
diff changeset
    66
    QLabel *imageLabel = new QLabel;
1d44c448cfa4 enable a tip on osx, remove trailing whitespaces
koda
parents: 5626
diff changeset
    67
    QImage image(":/res/Hedgehog.png");
1d44c448cfa4 enable a tip on osx, remove trailing whitespaces
koda
parents: 5626
diff changeset
    68
    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
    69
    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
    70
    imageLabel->setFixedHeight(300);
5646
1d44c448cfa4 enable a tip on osx, remove trailing whitespaces
koda
parents: 5626
diff changeset
    71
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
    72
    leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
235
28903e620258 About page
unc0rr
parents: 221
diff changeset
    73
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2751
diff changeset
    74
    QLabel *lbl1 = new QLabel(this);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2751
diff changeset
    75
    lbl1->setOpenExternalLinks(true);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2751
diff changeset
    76
    lbl1->setText(
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6175
diff changeset
    77
        "<style type=\"text/css\">"
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6175
diff changeset
    78
        "a { color: #ffcc00; }"
1897
e9dcb47013c7 - Some style changes by nemo
unc0rr
parents: 1796
diff changeset
    79
//            "a:hover { color: yellow; }"
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6175
diff changeset
    80
        "</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
    81
        "<div align=\"center\"><h1>Hedgewars " + *cVersionString + "</h1>"
8652
97a30346203b uniform revision info in about page
koda
parents: 8613
diff changeset
    82
        "<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
    83
        "<p><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p>" +
8654
f523e5e84772 escape return and be more friendly with translations
koda
parents: 8653
diff changeset
    84
        QLabel::tr("This program is distributed under the %1").arg("<a \
f523e5e84772 escape return and be more friendly with translations
koda
parents: 8653
diff changeset
    85
        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
    86
        "</div>"
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6175
diff changeset
    87
    );
2948
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2751
diff changeset
    88
    lbl1->setWordWrap(true);
3f21a9dc93d0 Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents: 2751
diff changeset
    89
    mainLayout->addWidget(lbl1, 0, 1);
235
28903e620258 About page
unc0rr
parents: 221
diff changeset
    90
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
    91
    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
    92
    lbl2->setOpenExternalLinks(true);
8434
4821897a0f10 big indentation/whitespaces cleanup
sheepluva
parents: 8404
diff changeset
    93
    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
    94
    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
    95
    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
    96
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
    97
    /* Library information */
8390
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
    98
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
    99
    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
   100
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
   101
#ifdef __GNUC__
8447
250142acef7b shorten the library label a little bit
koda
parents: 8434
diff changeset
   102
    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
   103
#else
8447
250142acef7b shorten the library label a little bit
koda
parents: 8434
diff changeset
   104
    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
   105
#endif
8390
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   106
9331
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   107
    const SDL_version *sdl_ver = SDL_Linked_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
   108
    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
   109
        .arg(sdl_ver->major)
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   110
        .arg(sdl_ver->minor)
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   111
        .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
   112
9331
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   113
    const SDL_version *sdlmixer_ver = Mix_Linked_Version();
9321
1d56051f70c8 show sdl_mixer version in info page
koda
parents: 9131
diff changeset
   114
    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
   115
        .arg(sdlmixer_ver->major)
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   116
        .arg(sdlmixer_ver->minor)
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   117
        .arg(sdlmixer_ver->patch));
9321
1d56051f70c8 show sdl_mixer version in info page
koda
parents: 9131
diff changeset
   118
9331
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   119
    // 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
   120
    // 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
   121
    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
   122
    if (sdlnet_handle != NULL) {
02caf698a8f1 dynamically load sdl_net information so we don't have to link it
koda
parents: 9321
diff changeset
   123
        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
   124
        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
   125
        if (sdlnet_ver_get != NULL) {
02caf698a8f1 dynamically load sdl_net information so we don't have to link it
koda
parents: 9321
diff changeset
   126
            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
   127
            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
   128
                .arg(sdlnet_ver->major)
02caf698a8f1 dynamically load sdl_net information so we don't have to link it
koda
parents: 9321
diff changeset
   129
                .arg(sdlnet_ver->minor)
02caf698a8f1 dynamically load sdl_net information so we don't have to link it
koda
parents: 9321
diff changeset
   130
                .arg(sdlnet_ver->patch));
02caf698a8f1 dynamically load sdl_net information so we don't have to link it
koda
parents: 9321
diff changeset
   131
        }
02caf698a8f1 dynamically load sdl_net information so we don't have to link it
koda
parents: 9321
diff changeset
   132
        SDL_UnloadObject(sdlnet_handle);
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
9329
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   135
    void *sdlimage_handle = SDL_LoadObject(sopath("SDL_image"));
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   136
    if (sdlimage_handle != NULL) {
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   137
        SDL_version *(*sdlimage_ver_get)(void) = NULL;
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   138
        sdlimage_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlimage_handle, "IMG_Linked_Version");
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   139
        if (sdlimage_ver_get != NULL) {
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   140
            SDL_version *sdlimage_ver = sdlimage_ver_get();
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   141
            libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_image</a> version: %1.%2.%3<br>")
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   142
                .arg(sdlimage_ver->major)
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   143
                .arg(sdlimage_ver->minor)
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   144
                .arg(sdlimage_ver->patch));
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   145
        }
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   146
        SDL_UnloadObject(sdlnet_handle);
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   147
    }
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   148
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   149
    void *sdlttf_handle = SDL_LoadObject(sopath("SDL_ttf"));
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   150
    if (sdlttf_handle != NULL) {
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   151
        SDL_version *(*sdlttf_ver_get)(void) = NULL;
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   152
        sdlttf_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlttf_handle, "TTF_Linked_Version");
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   153
        if (sdlttf_ver_get != NULL) {
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   154
            SDL_version *sdlttf_ver = sdlttf_ver_get();
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   155
            libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_ttf</a> version: %1.%2.%3<br>")
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   156
                .arg(sdlttf_ver->major)
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   157
                .arg(sdlttf_ver->minor)
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   158
                .arg(sdlttf_ver->patch));
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   159
        }
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   160
        SDL_UnloadObject(sdlnet_handle);
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   161
    }
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   162
b825fa990e1c the same for sdl_image and sdl_ttf
koda
parents: 9327
diff changeset
   163
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
   164
    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
   165
8390
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   166
#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
   167
    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
   168
        .arg(LIBAVUTIL_VERSION_MAJOR)
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   169
        .arg(LIBAVUTIL_VERSION_MINOR)
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   170
        .arg(LIBAVUTIL_VERSION_MICRO));
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   171
#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
   172
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
   173
    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
   174
        .arg(PHYSFS_VER_MAJOR)
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   175
        .arg(PHYSFS_VER_MINOR)
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   176
        .arg(PHYSFS_VER_PATCH));
0b2403003640 Added "what we use" section to "about" page. From GCI.
dag10 <gottlieb.drew@gmail.com>
parents: 8256
diff changeset
   177
9331
26f0bf0de172 use linked version for sdl and sdl_mixer too for consistency, comment some things
koda
parents: 9329
diff changeset
   178
    // 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
   179
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
   180
    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
   181
    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
   182
    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
   183
    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
   184
    lblLibInfo->setMaximumWidth(280);
8447
250142acef7b shorten the library label a little bit
koda
parents: 8434
diff changeset
   185
    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
   186
    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
   187
6175
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   188
    setAcceptDrops(true);
187
96c3154efee5 "About" page, not yet filled with content
unc0rr
parents:
diff changeset
   189
}
6175
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   190
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   191
void About::dragEnterEvent(QDragEnterEvent * event)
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   192
{
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   193
    if (event->mimeData()->hasUrls())
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   194
    {
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   195
        QList<QUrl> urls = event->mimeData()->urls();
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   196
        QString url = urls[0].toString();
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   197
        if (urls.count() == 1)
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   198
            if (url.contains(QRegExp("^file://.*\\.ogg$")))
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   199
                event->acceptProposedAction();
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   200
    }
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   201
}
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   202
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   203
void About::dropEvent(QDropEvent * event)
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   204
{
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   205
    QString file =
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   206
        event->mimeData()->urls()[0].toString().remove(QRegExp("^file://"));
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   207
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   208
    SDLInteraction::instance().setMusicTrack(file);
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   209
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   210
    event->acceptProposedAction();
a80833ddaef0 moving a file around, fixing a png, etc.
sheepluva
parents: 6067
diff changeset
   211
}