diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagedata.cpp --- a/QTfrontend/ui/page/pagedata.cpp Tue Nov 10 18:16:35 2015 +0100 +++ b/QTfrontend/ui/page/pagedata.cpp Tue Nov 10 20:43:13 2015 +0100 @@ -1,6 +1,6 @@ /* * Hedgewars, a free turn based strategy game - * Copyright (c) 2004-2013 Andrey Korotaev + * Copyright (c) 2004-2015 Andrey Korotaev * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -26,6 +26,7 @@ #include #include #include +#include #include "pagedata.h" #include "databrowser.h" @@ -48,10 +49,23 @@ return pageLayout; } +QLayout * PageDataDownload::footerLayoutDefinition() +{ + QHBoxLayout * bottomLayout = new QHBoxLayout(); + bottomLayout->setStretch(0, 1); + + pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 1, false); + + bottomLayout->setStretch(2, 1); + + return bottomLayout; +} + void PageDataDownload::connectSignals() { connect(web, SIGNAL(anchorClicked(QUrl)), this, SLOT(request(const QUrl&))); connect(this, SIGNAL(goBack()), this, SLOT(onPageLeave())); + connect(pbOpenDir, SIGNAL(clicked()), this, SLOT(openPackagesDir())); } PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent) @@ -193,3 +207,9 @@ //DataManager::instance().reload(); } } + +void PageDataDownload::openPackagesDir() +{ + QString path = QDir::toNativeSeparators(cfgdir->absolutePath() + "/Data"); + QDesktopServices::openUrl(QUrl("file:///" + path)); +}