From 37a81cdf30ad177ea9c1c49f04785c93dada25cb Mon Sep 17 00:00:00 2001
From: nowrep
Date: Mon, 4 Feb 2013 13:07:21 +0100
Subject: [PATCH] Sending information about versions in reportbug page.
Improved OS detection on Windows. It will also show version
of Windows (except Win 8)
---
src/lib/data/html/reportbug.html | 6 +++-
.../schemehandlers/qupzillaschemehandler.cpp | 14 ++++++--
src/lib/tools/qztools.cpp | 33 ++++++++++++++++++-
3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/src/lib/data/html/reportbug.html b/src/lib/data/html/reportbug.html
index 8d7deff5b..d7b7365ba 100644
--- a/src/lib/data/html/reportbug.html
+++ b/src/lib/data/html/reportbug.html
@@ -20,7 +20,7 @@ function checkFields()
{
var type = document.getElementById("type").value;
var description = document.getElementById("text").value;
-
+
if (type == null || type == "" || description == null || description == "") {
alert("%FIELDS-ARE-REQUIRED%");
return false;
@@ -42,6 +42,10 @@ function checkFields()
%TYPE%: | |
%DESCRIPTION%: | |
|
+
+
+
+
diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp
index e67ff84aa..5e126ced4 100644
--- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp
+++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp
@@ -153,9 +153,19 @@ QString QupZillaSchemeReply::reportbugPage()
bPage.replace(QLatin1String("%TYPE%"), tr("Issue type"));
bPage.replace(QLatin1String("%DESCRIPTION%"), tr("Issue description"));
bPage.replace(QLatin1String("%SEND%"), tr("Send"));
- bPage.replace(QLatin1String("%E-MAIL-OPTIONAL%"), tr("E-mail is optional
Note: Please read how to make a bug report here first.").arg("https://github.com/QupZilla/qupzilla/wiki/Bug-Reports target=_blank"));
+ bPage.replace(QLatin1String("%E-MAIL-OPTIONAL%"), tr("E-mail is optional
Note: Please read how to make a "
+ "bug report here first.").arg("https://github.com/QupZilla/qupzilla/wiki/Bug-Reports target=_blank"));
bPage.replace(QLatin1String("%FIELDS-ARE-REQUIRED%"), tr("Please fill out all required fields!"));
- bPage = QzTools::applyDirectionToPage(bPage);
+
+ bPage.replace(QLatin1String("%INFO_OS%"), QzTools::buildSystem());
+ bPage.replace(QLatin1String("%INFO_APP%"), QupZilla::VERSION
+#ifdef GIT_REVISION
+ + " (" + GIT_REVISION + ")"
+#endif
+ );
+ bPage.replace(QLatin1String("%INFO_QT%"), QString("%1 (built with %2)").arg(qVersion(), QT_VERSION_STR));
+ bPage.replace(QLatin1String("%INFO_WEBKIT%"), QupZilla::WEBKITVERSION),
+ bPage = QzTools::applyDirectionToPage(bPage);
return bPage;
}
diff --git a/src/lib/tools/qztools.cpp b/src/lib/tools/qztools.cpp
index 2120da598..434a75909 100644
--- a/src/lib/tools/qztools.cpp
+++ b/src/lib/tools/qztools.cpp
@@ -35,6 +35,7 @@
#include
#include
#include
+#include
#if QT_VERSION >= 0x050000
#include
@@ -441,7 +442,37 @@ QString QzTools::buildSystem()
return "UnixWare 7 / Open UNIX 8";
#endif
#ifdef Q_OS_WIN32
- return "Windows";
+ QString str = "Windows";
+
+ switch (QSysInfo::windowsVersion()) {
+ case QSysInfo::WV_NT:
+ str.append(" NT");
+ break;
+
+ case QSysInfo::WV_2000:
+ str.append(" 2000");
+ break;
+
+ case QSysInfo::WV_XP:
+ str.append(" XP");
+ break;
+ case QSysInfo::WV_2003:
+ str.append(" XP Pro x64");
+ break;
+
+ case QSysInfo::WV_VISTA:
+ str.append(" Vista");
+ break;
+
+ case QSysInfo::WV_WINDOWS7:
+ str.append(" 7");
+ break;
+
+ default:
+ break;
+ }
+
+ return str;
#endif
#ifdef Q_OS_UNIX
return "Unix";