1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Added new report bug system

This commit is contained in:
nowrep 2011-09-19 20:49:39 +02:00
parent c4c10c0017
commit 5ce67d498a
9 changed files with 296 additions and 51 deletions

Binary file not shown.

View File

@ -625,8 +625,8 @@ void QupZilla::aboutToShowHelpMenu()
m_menuHelp->addAction(QIcon(":/icons/menu/qt.png"), tr("About &Qt"), qApp, SLOT(aboutQt()));
m_menuHelp->addAction(QIcon(":/icons/qupzilla.png"), tr("&About QupZilla"), this, SLOT(aboutQupZilla()));
m_menuHelp->addSeparator();
m_menuHelp->addAction(QIcon(":/icons/menu/informations.png"), tr("Informations about application"), this, SLOT(loadActionUrl()))->setData(QUrl("qupzilla:about"));
m_menuHelp->addAction(tr("Report &Bug"), this, SLOT(reportBug()));
m_menuHelp->addAction(QIcon(":/icons/menu/informations.png"), tr("Informations about application"), this, SLOT(loadActionUrlInNewTab()))->setData(QUrl("qupzilla:about"));
m_menuHelp->addAction(tr("Report &Issue"), this, SLOT(loadActionUrlInNewTab()))->setData(QUrl("qupzilla:reportbug"));
}
void QupZilla::aboutToShowToolsMenu()
@ -757,6 +757,13 @@ void QupZilla::loadActionUrl()
}
}
void QupZilla::loadActionUrlInNewTab()
{
if (QAction* action = qobject_cast<QAction*>(sender())) {
m_tabWidget->addView(action->data().toUrl());
}
}
void QupZilla::loadAddress(const QUrl &url)
{
weView()->load(url);

View File

@ -124,6 +124,7 @@ public slots:
void showBookmarksToolbar();
void loadActionUrl();
void loadActionUrlInNewTab();
void bookmarkPage();
void loadAddress(const QUrl &url);
void showSource(const QString& selectedHtml = "");

View File

@ -7,5 +7,6 @@
<file>html/about.html</file>
<file>html/box-border.png</file>
<file>html/copyright</file>
<file>html/reportbug.html</file>
</qresource>
</RCC>

View File

@ -0,0 +1,87 @@
<html><head>
<title>%TITLE%</title>
<link rel="icon" href="data:image/png;base64,%FAVICON%" type="image/x-icon" />
<style>
html {
background: #eeeeee;
font: 13px/22px "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #525c66;
}
html * {
font-size: 100%;
line-height: 1.6;
}
#box {
max-width: 650px;
overflow:auto;
margin: 25px auto 10px auto;
padding: 10px 40px;
border-width: 20px;
-webkit-border-image: url(data:image/png;base64,%BOX-BORDER%) 25;
text-align: left;
}
h1 {
color: #1a4ba4;
font-size: 160%;
margin-bottom: 0px;
}
p {
margin-left: 1%;
}
input {
width: 200px;
}
.submit
{
width: 100px;
}
select {
width: 200px;
}
textarea {
width: 400px;
height: 100px;
}
</style>
<script>
function checkFields()
{
var type = document.getElementById("type").value;
var priority = document.getElementById("priority").value;
var description = document.getElementById("text").value;
if (type == null || type == "" || priority == null || priority == "" || description == null || description == "") {
alert("%FIELDS-ARE-REQUIRED%");
return false;
}
return true;
}
</script>
</head>
<body>
<div id="box">
<h1>%REPORT-ISSUE%</h1>
<p>%PLUGINS-TEXT%</p>
<p style="display:none" id="result"> </p>
<p>
<table>
<form action="http://qupzilla.ic.cz/reportbug.php" onsubmit="return checkFields()" method="POST">
<tr><td>%EMAIL%*:</td><td><input type="text" id="mail" name="mail"> </tr>
<tr><td>%TYPE%:</td><td><input type="text" id="type" name="type"> </tr>
<tr><td>%PRIORITY%:</td><td><select id="priority" name="priority"> <option>%LOW%</option><option>%NORMAL%</option><option>%HIGH%</option> </select></tr>
<tr><td>%DESCRIPTION%:</td><td><textarea id="text" name="text"> </textarea> </tr>
<tr><td colspan=2 align=right><input class="submit" type="submit" name="ok" value="%SEND%"> </tr>
</form>
</table>
</p>
<p>* %E-MAIL-OPTIONAL%</p>
</div>
</body></html>

View File

@ -28,7 +28,7 @@ QupZillaSchemeReply::QupZillaSchemeReply(const QNetworkRequest &req, QObject *pa
setUrl(req.url());
m_pageName = req.url().path();
if (m_pageName == "about") {
if (m_pageName == "about" || m_pageName == "reportbug") {
m_buffer.open(QIODevice::ReadWrite);
setError(QNetworkReply::NoError, tr("No Error"));
@ -39,12 +39,14 @@ QupZillaSchemeReply::QupZillaSchemeReply(const QNetworkRequest &req, QObject *pa
QTimer::singleShot(0, this, SLOT(delayedFinish()));
}
}
#include <QDebug>
void QupZillaSchemeReply::loadPage()
{
QTextStream stream(&m_buffer);
if (m_pageName == "about")
stream << aboutPage();
else if (m_pageName == "reportbug")
stream << reportbugPage();
stream.flush();
m_buffer.reset();
@ -76,6 +78,30 @@ qint64 QupZillaSchemeReply::readData(char *data, qint64 maxSize)
return m_buffer.read(data, maxSize);
}
QString QupZillaSchemeReply::reportbugPage()
{
QString page;
page.append(qz_readAllFileContents(":html/reportbug.html"));
page.replace("%FAVICON%", qz_pixmapToByteArray(QPixmap(":icons/qupzilla.png")));
page.replace("%BOX-BORDER%", qz_pixmapToByteArray(QPixmap(":html/box-border.png")));
page.replace("%TITLE%", tr("Report issue"));
page.replace("%REPORT-ISSUE%", tr("Report issue"));
page.replace("%PLUGINS-TEXT%", tr("If You are experiencing problems with QupZilla, please try first disable"
" all plugins. <br/>If it won't help, then please fill this form: "));
page.replace("%EMAIL%", tr("Your E-mail"));
page.replace("%TYPE%", tr("Issue type"));
page.replace("%PRIORITY%", tr("Priority"));
page.replace("%LOW%", tr("Low"));
page.replace("%NORMAL%", tr("Normal"));
page.replace("%HIGH%", tr("High"));
page.replace("%DESCRIPTION%", tr("Issue description"));
page.replace("%SEND%", tr("Send"));
page.replace("%E-MAIL-OPTIONAL%", tr("E-mail is optional"));
page.replace("%FIELDS-ARE-REQUIRED%", tr("Please fill all required fields!"));
return page;
}
QString QupZillaSchemeReply::aboutPage()
{
QString page;

View File

@ -40,6 +40,7 @@ private slots:
private:
QString aboutPage();
QString reportbugPage();
QBuffer m_buffer;
QString m_pageName;

View File

@ -2529,11 +2529,6 @@ nebyl nalezen!</translation>
<source>Clear list</source>
<translation>Vyčistit seznam</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="629"/>
<source>Report &amp;Bug</source>
<translation>Nahlásit &amp;bug</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="625"/>
<source>About &amp;Qt</source>
@ -2549,6 +2544,11 @@ nebyl nalezen!</translation>
<source>Informations about application</source>
<translation>Informace o aplikaci</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="629"/>
<source>Report &amp;Issue</source>
<translation>Nahlásit &amp;problém</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="635"/>
<source>&amp;Web Search</source>
@ -2646,86 +2646,147 @@ nebyl nalezen!</translation>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="88"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="89"/>
<source>Report issue</source>
<translation>Nahlásit problém</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="90"/>
<source>If You are experiencing problems with QupZilla, please try first disable all plugins. &lt;br/&gt;If it won&apos;t help, then please fill this form: </source>
<translation>Pokud máte problém s používáním QupZilly, zakažte prosím všechny doplňky. &lt;br/&gt; Pokud problém přetrvává, vyplňte tento formulář: </translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="92"/>
<source>Your E-mail</source>
<translation>Váš e-mail</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="93"/>
<source>Issue type</source>
<translation>Typ problému</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="94"/>
<source>Priority</source>
<translation>Priorita</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="95"/>
<source>Low</source>
<translation>Nízká</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="96"/>
<source>Normal</source>
<translation>Normální</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="97"/>
<source>High</source>
<translation>Vysoká</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="98"/>
<source>Issue description</source>
<translation>Popis problému</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="99"/>
<source>Send</source>
<translation>Odeslat</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="100"/>
<source>E-mail is optional</source>
<translation>e-mail je nepovinný</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="101"/>
<source>Please fill all required fields!</source>
<translation>Vyplňte prosím všechna povinná pole!</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="114"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="115"/>
<source>About QupZilla</source>
<translation>O QupZille</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="90"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="116"/>
<source>Informations about version</source>
<translation>Informace o verzi</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="91"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="117"/>
<source>Browser Identification</source>
<translation>Identifikace prohlížeče</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="92"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="118"/>
<source>Paths</source>
<translation>Cesty</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="93"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="119"/>
<source>Copyright</source>
<translation>Copyright</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="97"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="123"/>
<source>Linux</source>
<translation>Linux</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="100"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="126"/>
<source>Windows</source>
<translation>Windows</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="103"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="129"/>
<source>Version</source>
<translation>Verze</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="104"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="130"/>
<source>WebKit version</source>
<translation>Verze WebKitu</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="105"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="131"/>
<source>Build time</source>
<translation>Sestaveno</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="106"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="132"/>
<source>Platform</source>
<translation>Platforma</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="110"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="136"/>
<source>Settings</source>
<translation>Nastavení</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="111"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="137"/>
<source>Saved session</source>
<translation>Uložené relace</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="112"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="138"/>
<source>Pinned tabs</source>
<translation>Připíchnuté panely</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="113"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="139"/>
<source>Themes</source>
<translation>Témata</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="114"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="140"/>
<source>Plugins</source>
<translation>Doplňky</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="115"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="141"/>
<source>Translations</source>
<translation>Překlady</translation>
</message>

View File

@ -2530,11 +2530,6 @@ p, li { white-space: pre-wrap; }
<source>Clear list</source>
<translation>Vyčistiť list</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="629"/>
<source>Report &amp;Bug</source>
<translation>Nahlásiť &amp;chybu</translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="625"/>
<source>About &amp;Qt</source>
@ -2550,6 +2545,11 @@ p, li { white-space: pre-wrap; }
<source>Informations about application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="629"/>
<source>Report &amp;Issue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/app/qupzilla.cpp" line="635"/>
<source>&amp;Web Search</source>
@ -2647,86 +2647,147 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="88"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="89"/>
<source>About QupZilla</source>
<translation type="unfinished">O QupZille</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="90"/>
<source>Informations about version</source>
<source>Report issue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="91"/>
<source>Browser Identification</source>
<location filename="../src/network/qupzillaschemehandler.cpp" line="90"/>
<source>If You are experiencing problems with QupZilla, please try first disable all plugins. &lt;br/&gt;If it won&apos;t help, then please fill this form: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="92"/>
<source>Paths</source>
<source>Your E-mail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="93"/>
<source>Copyright</source>
<source>Issue type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="94"/>
<source>Priority</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="95"/>
<source>Low</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="96"/>
<source>Normal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="97"/>
<source>Linux</source>
<source>High</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="98"/>
<source>Issue description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="99"/>
<source>Send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="100"/>
<source>E-mail is optional</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="101"/>
<source>Please fill all required fields!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="114"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="115"/>
<source>About QupZilla</source>
<translation type="unfinished">O QupZille</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="116"/>
<source>Informations about version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="117"/>
<source>Browser Identification</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="118"/>
<source>Paths</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="119"/>
<source>Copyright</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="123"/>
<source>Linux</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="126"/>
<source>Windows</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="103"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="129"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="104"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="130"/>
<source>WebKit version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="105"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="131"/>
<source>Build time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="106"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="132"/>
<source>Platform</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="110"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="136"/>
<source>Settings</source>
<translation type="unfinished">Nastavenia</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="111"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="137"/>
<source>Saved session</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="112"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="138"/>
<source>Pinned tabs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="113"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="139"/>
<source>Themes</source>
<translation type="unfinished">Témy</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="114"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="140"/>
<source>Plugins</source>
<translation type="unfinished">Doplnky</translation>
</message>
<message>
<location filename="../src/network/qupzillaschemehandler.cpp" line="115"/>
<location filename="../src/network/qupzillaschemehandler.cpp" line="141"/>
<source>Translations</source>
<translation type="unfinished"></translation>
</message>