# HG changeset patch # User dag10 # Date 1358622666 18000 # Node ID f06227b2ea145d050a0037b4b3b27d0fa8f516ac # Parent 659e043da6da351c7f68db4f1f141ef3ad826c19 Moved library version info out of about.html and into a QLabel beneath Hedgehog.png on about page. diff -r 659e043da6da -r f06227b2ea14 QTfrontend/res/html/about.html --- a/QTfrontend/res/html/about.html Sat Jan 19 00:55:51 2013 +0400 +++ b/QTfrontend/res/html/about.html Sat Jan 19 14:11:06 2013 -0500 @@ -90,13 +90,5 @@ 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 659e043da6da -r f06227b2ea14 QTfrontend/ui/widget/about.cpp --- a/QTfrontend/ui/widget/about.cpp Sat Jan 19 00:55:51 2013 +0400 +++ b/QTfrontend/ui/widget/about.cpp Sat Jan 19 14:11:06 2013 -0500 @@ -46,6 +46,9 @@ { QGridLayout *mainLayout = new QGridLayout(this); + QVBoxLayout * leftLayout = new QVBoxLayout(); + mainLayout->addLayout(leftLayout, 0, 0, 2, 1); + QLabel *imageLabel = new QLabel; QImage image(":/res/Hedgehog.png"); imageLabel->setPixmap(QPixmap::fromImage(image)); @@ -55,7 +58,7 @@ imageLabel->setMinimumHeight(30); imageLabel->setMaximumHeight(300); - mainLayout->addWidget(imageLabel, 0, 0, 2, 1); + leftLayout->addWidget(imageLabel, 0, Qt::AlignHCenter); QLabel *lbl1 = new QLabel(this); lbl1->setOpenExternalLinks(true); @@ -66,63 +69,55 @@ "" "

Hedgewars

" "

" + QLabel::tr("Version") + " " + *cVersionString + "

" - "

http://www.hedgewars.org/


" + + "

http://www.hedgewars.org/

" + QLabel::tr("This program is distributed under the GNU General Public License v2") + "
" ); 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); + 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 + mainLayout->addWidget(lbl2, 1, 1); - while(!in.atEnd()) - html.append(in.readLine()); - - file.close(); - - /* Get information */ + /* Library information */ - QString compilerText, compilerOpen, compilerClose; - #ifdef __GNUC__ - compilerText = "GCC " + QString(__VERSION__) + "\n"; - compilerOpen = ""; - compilerClose = ""; - #else - compilerText = "Unknown\n"; - compilerOpen = compilerClose = ""; - #endif + QString libinfo = ""; - /* Add information */ +#ifdef __GNUC__ + libinfo.append(QString("Compiler: GCC %1
").arg(__VERSION__)); +#else + libinfo.append(QString("Compiler: Unknown
").arg(__VERSION__)); +#endif - html.replace("%COMPILER_A_OPEN%", compilerOpen); - html.replace("%COMPILER_A_CLOSE%", compilerClose); - html.replace("%COMPILER%", compilerText); - html.replace("%SDL%", QString("version: %1.%2.%3") + libinfo.append(QString("SDL version: %1.%2.%3
") .arg(SDL_MAJOR_VERSION) .arg(SDL_MINOR_VERSION) .arg(SDL_PATCHLEVEL)); - html.replace("%QT%", QT_VERSION_STR); + + libinfo.append(QString("Qt version: %1
").arg(QT_VERSION_STR)); + #ifdef VIDEOREC - html.replace("%LIBAV%", QString("Libav version: %1.%2.%3") + libinfo.append(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") + + libinfo.append(QString("PhysFS version: %1.%2.%3
") .arg(PHYSFS_VER_MAJOR) .arg(PHYSFS_VER_MINOR) .arg(PHYSFS_VER_PATCH)); - lbl2 = new QTextBrowser(this); - lbl2->setOpenExternalLinks(true); - lbl2->setHtml(html); - mainLayout->addWidget(lbl2, 1, 1); - + QLabel * lblLibInfo = new QLabel(); + lblLibInfo->setText(libinfo); + lblLibInfo->setWordWrap(true); + lblLibInfo->setMaximumWidth(280); + leftLayout->addWidget(lblLibInfo, 0, Qt::AlignTop | Qt::AlignHCenter); + leftLayout->addStretch(1); + setAcceptDrops(true); }