Tiny bit of progress on download page - hooked it up to "Info" button for now.
--- a/QTfrontend/hwform.cpp Sun Aug 14 21:49:04 2011 -0400
+++ b/QTfrontend/hwform.cpp Sun Aug 14 23:00:12 2011 -0400
@@ -64,13 +64,14 @@
#include "pagedrawmap.h"
#include "pagenettype.h"
#include "pagegamestats.h"
+#include "pageplayrecord.h"
+#include "pagedata.h"
#include "hwconsts.h"
#include "newnetclient.h"
#include "gamecfgwidget.h"
#include "netserverslist.h"
#include "netudpserver.h"
#include "chatwidget.h"
-#include "pageplayrecord.h"
#include "input_ip.h"
#include "ammoSchemeModel.h"
#include "bgwidget.h"
@@ -150,11 +151,13 @@
connect(ui.pageMain->BtnNet, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
pageSwitchMapper->setMapping(ui.pageMain->BtnNet, ID_PAGE_NETTYPE);
connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
- pageSwitchMapper->setMapping(ui.pageMain->BtnInfo, ID_PAGE_INFO);
+ pageSwitchMapper->setMapping(ui.pageMain->BtnInfo, ID_PAGE_DATADOWNLOAD);
connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
+ connect(ui.pageDataDownload->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
+
connect(ui.pageEditTeam->BtnTeamSave, SIGNAL(clicked()), this, SLOT(TeamSave()));
connect(ui.pageEditTeam->BtnTeamDiscard, SIGNAL(clicked()), this, SLOT(TeamDiscard()));
--- a/QTfrontend/hwform.h Sun Aug 14 21:49:04 2011 -0400
+++ b/QTfrontend/hwform.h Sun Aug 14 23:00:12 2011 -0400
@@ -147,7 +147,8 @@
ID_PAGE_ADMIN = 17,
ID_PAGE_NETTYPE = 18,
ID_PAGE_CAMPAIGN = 19,
- ID_PAGE_DRAWMAP = 20
+ ID_PAGE_DRAWMAP = 20,
+ ID_PAGE_DATADOWNLOAD = 21
};
HWGame * game;
HWNetServer* pnetserver;
--- a/QTfrontend/pagedata.cpp Sun Aug 14 21:49:04 2011 -0400
+++ b/QTfrontend/pagedata.cpp Sun Aug 14 23:00:12 2011 -0400
@@ -18,6 +18,10 @@
#include <QGridLayout>
#include <QPushButton>
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QFileInfo>
+#include <QFileDialog>
#include "pagedata.h"
@@ -31,6 +35,22 @@
BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true);
web = new QWebView(this);
- web->load(QUrl("http://m8y.org/hw/"));
+ connect(this, SIGNAL(linkClicked(const QUrl&)), this, SLOT(install(const QUrl&)));
+ web->load(QUrl("http://m8y.org/hw/downloads/"));
+ web->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
pageLayout->addWidget(web, 0, 0, 1, 3);
}
+
+void PageDataDownload::install(const QUrl &url)
+{
+qWarning("Download Request");
+QString fileName = QFileInfo(url.toString()).fileName();
+
+QNetworkRequest newRequest(url);
+newRequest.setAttribute(QNetworkRequest::User, fileName);
+
+QNetworkAccessManager *manager = new QNetworkAccessManager(this);
+QNetworkReply *reply = manager->get(newRequest);
+//connect( reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64)) );
+//connect( reply, SIGNAL(finished()), this, SLOT(downloadIssueFinished()));
+}
--- a/QTfrontend/pagedata.h Sun Aug 14 21:49:04 2011 -0400
+++ b/QTfrontend/pagedata.h Sun Aug 14 23:00:12 2011 -0400
@@ -19,6 +19,7 @@
#ifndef PAGE_DATA_H
#define PAGE_DATA_H
#include <QWebView>
+#include <QUrl>
#include "AbstractPage.h"
class PageDataDownload : public AbstractPage
@@ -30,6 +31,9 @@
QPushButton *BtnBack;
QWebView *web;
+
+private:
+ void install(const QUrl &url);
};
#endif
--- a/QTfrontend/ui_hwform.cpp Sun Aug 14 21:49:04 2011 -0400
+++ b/QTfrontend/ui_hwform.cpp Sun Aug 14 23:00:12 2011 -0400
@@ -44,6 +44,7 @@
#include "pagemain.h"
#include "pagegamestats.h"
#include "pageplayrecord.h"
+#include "pagedata.h"
#include "hwconsts.h"
void Ui_HWForm::setupUi(HWForm *HWForm)
@@ -137,4 +138,7 @@
pageDrawMap = new PageDrawMap();
Pages->addWidget(pageDrawMap);
+
+ pageDataDownload = new PageDataDownload();
+ Pages->addWidget(pageDataDownload);
}