# HG changeset patch # User dag10 # Date 1358219347 18000 # Node ID 0b2403003640a607565bba2df2446103c41f4ce5 # Parent 6d65ed1f832c3eae14716cbf1f3dc290460cdf83 Added "what we use" section to "about" page. From GCI. diff -r 6d65ed1f832c -r 0b2403003640 QTfrontend/res/html/about.html --- a/QTfrontend/res/html/about.html Mon Jan 14 16:04:05 2013 -0500 +++ b/QTfrontend/res/html/about.html Mon Jan 14 22:09:07 2013 -0500 @@ -90,5 +90,13 @@ Natasha Korotaeva <layout@pisem.net>
Adam Higerd (aka ahigerd at FreeNode)

+ +

What we use:

+ %COMPILER_A_OPEN%Compiler%COMPILER_A_CLOSE%: %COMPILER%
+ SDL: %SDL%
+ QT version: %QT%
+ PhysicsFS %PHYSFS%
+ %LIBAV% +

diff -r 6d65ed1f832c -r 0b2403003640 QTfrontend/ui/widget/about.cpp --- a/QTfrontend/ui/widget/about.cpp Mon Jan 14 16:04:05 2013 -0500 +++ b/QTfrontend/ui/widget/about.cpp Mon Jan 14 22:09:07 2013 -0500 @@ -23,10 +23,18 @@ #include #include #include +#include #include #include #include "hwconsts.h" #include "SDLInteraction.h" +#include "SDL.h" +#include "SDL_version.h" +#include "physfs.h" + +#ifdef VIDEOREC +#include "libavutil/version.h" +#endif #include "about.h" @@ -62,10 +70,54 @@ lbl1->setWordWrap(true); mainLayout->addWidget(lbl1, 0, 1); + QString html; + QFile file(":/res/html/about.html"); + if(!file.open(QIODevice::ReadOnly)) + QMessageBox::information(0, "Error loading about page", file.errorString()); + + QTextStream in(&file); + + while(!in.atEnd()) + html.append(in.readLine()); + + file.close(); + + /* Get information */ + + QString compilerText, compilerOpen, compilerClose; + #ifdef __GNUC__ + compilerText = "GCC " + QString(__VERSION__) + "\n"; + compilerOpen = ""; + compilerClose = ""; + #else + compilerText = "Unknown\n"; + compilerOpen = compilerClose = ""; + #endif + + /* Add information */ + + html.replace("%COMPILER_A_OPEN%", compilerOpen); + html.replace("%COMPILER_A_CLOSE%", compilerClose); + html.replace("%COMPILER%", compilerText); + html.replace("%SDL%", QString("version: %1.%2.%3") + .arg(SDL_MAJOR_VERSION) + .arg(SDL_MINOR_VERSION) + .arg(SDL_PATCHLEVEL)); + html.replace("%QT%", QT_VERSION_STR); +#ifdef VIDEOREC + html.replace("%LIBAV%", QString("Libav version: %1.%2.%3") + .arg(LIBAVUTIL_VERSION_MAJOR) + .arg(LIBAVUTIL_VERSION_MINOR) + .arg(LIBAVUTIL_VERSION_MICRO)); +#endif + html.replace("%PHYSFS%", QString("version: %1.%2.%3") + .arg(PHYSFS_VER_MAJOR) + .arg(PHYSFS_VER_MINOR) + .arg(PHYSFS_VER_PATCH)); + lbl2 = new QTextBrowser(this); lbl2->setOpenExternalLinks(true); - QUrl localpage = QUrl::fromLocalFile(":/res/html/about.html"); - lbl2->setSource(localpage); //sets the source of the label from the file above + lbl2->setHtml(html); mainLayout->addWidget(lbl2, 1, 1); setAcceptDrops(true); diff -r 6d65ed1f832c -r 0b2403003640 QTfrontend/ui/widget/about.h --- a/QTfrontend/ui/widget/about.h Mon Jan 14 16:04:05 2013 -0500 +++ b/QTfrontend/ui/widget/about.h Mon Jan 14 22:09:07 2013 -0500 @@ -23,7 +23,6 @@ #include #include - class About : public QWidget { Q_OBJECT