[rkward] /: Switch to bugs.kde.org as primary issue tracker.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Nov 17 19:35:13 UTC 2015


Git commit 751f24103b3a959be0cd6ec76abd5bff62fe0448 by Thomas Friedrichsmeier.
Committed on 17/11/2015 at 19:34.
Pushed by tfry into branch 'master'.

Switch to bugs.kde.org as primary issue tracker.

Change the "Report Bug" dialog to pre-fill information into bugzilla.

M  +1    -0    ChangeLog
M  +64   -20   rkward/dialogs/rkerrordialog.cpp
M  +1    -1    rkward/main.cpp

http://commits.kde.org/rkward/751f24103b3a959be0cd6ec76abd5bff62fe0448

diff --git a/ChangeLog b/ChangeLog
index 216f538..b3dc5e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- Switch to bugs.kde.org as primary issue tracker
 - Workspace browser gains functionality to search / filter objects by name
 - Separate globalenv() and other environments in the search path more clearly in workspace browser
 - Fix some minor toolbar glitches
diff --git a/rkward/dialogs/rkerrordialog.cpp b/rkward/dialogs/rkerrordialog.cpp
index 1cc07ea..2a5b4df 100644
--- a/rkward/dialogs/rkerrordialog.cpp
+++ b/rkward/dialogs/rkerrordialog.cpp
@@ -2,7 +2,7 @@
                           rkerrordialog  -  description
                              -------------------
     begin                : Thu Apr 25 2013
-    copyright            : (C) 2013 by Thomas Friedrichsmeier
+    copyright            : (C) 2013, 2015 by Thomas Friedrichsmeier
     email                : thomas.friedrichsmeier at kdemail.net
  ***************************************************************************/
 
@@ -21,17 +21,76 @@
 #include <klocale.h>
 #include <kmessagebox.h>
 #include <kvbox.h>
+#include <ktoolinvocation.h>
+
 #include <QLabel>
 #include <QTextEdit>
+#include <QTemporaryFile>
+#include <QTextStream>
 
 #include "../rbackend/rinterface.h"
 #include "../rbackend/rksessionvars.h"
 #include "../misc/rkprogresscontrol.h"
 #include "../rkglobals.h"
 #include "../rkward.h"
+#include "../version.h"
 
 #include "../debug.h"
 
+#define SUBMIT_ADDRESS "https://bugs.kde.org/enter_bug.cgi"
+
+class RKBugzillaReportDialog : public KDialog {
+public:
+	RKBugzillaReportDialog (QWidget* parent, const QString& report_template) : KDialog (parent) {
+		RK_TRACE (DIALOGS);
+
+		RKBugzillaReportDialog::report_template = report_template;
+		setCaption (i18n ("Reporting bugs in RKWard"));
+		setButtons (KDialog::Ok | KDialog::Cancel);
+		setButtonText (KDialog::Ok, i18n ("Report issue"));
+		setButtonIcon (KDialog::Ok, KIcon ("tools-report-bug"));
+		KVBox *vbox = new KVBox (this);
+		setMainWidget (vbox);
+		QLabel *label = new QLabel (i18n ("<p><b>Where should I report bugs or wishes?</b></p><p>Thank you for taking the time to help improve RKWard. To help us "
+		                                  "handle your request, efficiently, please submit your bug reports or wishes in the "
+		                                  "<a href=\"%1\">KDE bugtracking system</a>. Note that you need a user account for this, so that we will be able to contact you, "
+		                                  "for follow-up questions. <b>If you do not have an account, please <a href=\"%2\">create one</a>, first.</b></p>"
+		                                  "<p>In case this is not possible for some reason, refer to <a href=\"%3\">%3</a> for alternative ways of reporting issues.</p>",
+		                         QString ("http://bugs.kde.org"), QString ("https://bugs.kde.org/createaccount.cgi"), QString ("http://rkward.kde.org/bugs/"))
+		                          + i18n ("<p><b>What information should I provide, and how?</b></p>Clicking \"Report issue\" will take you to the "
+		                                  "KDE bugtracking system. After logging in, some information will already be pre-filled into the report form. Please make sure "
+		                                  "to fill in the missing bits - in English - where indicated, especially in the \"Comment\" field.</p>"), vbox);
+		label->setWordWrap (true);
+		label->setOpenExternalLinks (true);
+
+		connect (this, SIGNAL (finished()), this, SLOT (deleteLater()));
+	}
+
+	void accept () override {
+		// The report template is just too large to pass it via GET, so we use a local proxy page to pass it in a POST request
+		QTemporaryFile proxy;
+		proxy.setAutoRemove (false);
+		proxy.open ();
+		QTextStream out (&proxy);
+		out << "<html><head><title>Relaying to " SUBMIT_ADDRESS "</title></head><body onLoad=\"document.getElementById('form').submit();\">\n";
+		out << "<h1>" + i18n ("Forwarding you to the KDE bugtracking system") + "</h1>\n";
+		out << "<p>" + i18n ("You are now being forwarded to the KDE bugtracking system. Should you continue to see this page for more than a few seconds (e.g. if JavaScript is disabled), please click \"Proceed\", below.") + "</p>\n";
+		out << "<form name=\"form\" id=\"form\" action=\"" SUBMIT_ADDRESS "\" method=\"POST\">\n";
+		out << "<input name=\"product\" type=\"hidden\" value=\"rkward\"/>\n";
+		out << "<input name=\"component\" type=\"hidden\" value=\"general\"/>\n";
+		out << "<input name=\"version\" type=\"hidden\" value=\"" RKWARD_VERSION "\"/>\n";
+		out << "<input name=\"comment\" type=\"hidden\" value=\"" << Qt::escape (report_template) << "\"/>\n";
+		out << "<input type=\"submit\" value=\"" << i18n ("Proceed") << "\"/>\n";
+		out << "</form></body></html>";
+		proxy.close ();
+
+		KToolInvocation::invokeBrowser (QUrl::fromLocalFile (proxy.fileName ()).toEncoded ());
+		KDialog::accept ();
+	}
+private:
+	QString report_template;
+};
+
 void RKErrorDialog::reportableErrorMessage (QWidget* parent_widget, const QString& user_message, const QString &details, const QString& caption, const QString& message_code) {
 	RK_TRACE (APP);
 
@@ -60,7 +119,7 @@ void RKErrorDialog::reportBug (QWidget* parent_widget, const QString& message_in
 
 	if (!parent_widget) parent_widget = RKWardMainWindow::getMain ();
 
-	QString report_template = i18n ("---Problem description---\n");
+	QString report_template = i18n ("---Problem description---\nPlease fill in the missing bits *in English*.\n\n");
 	if (message_info.isEmpty ()) {
 		report_template.append (i18n ("Please give a brief summary on the problem:\n###Please fill in###\n\n"));
 	} else {
@@ -85,8 +144,8 @@ void RKErrorDialog::reportBug (QWidget* parent_widget, const QString& message_in
 		RKProgressControl *control = new RKProgressControl (parent_widget, i18n ("Please stand by while gathering some information on your setup.\nIn case the backend has died or hung up, you may want to press 'Cancel' to skip this step."), i18n ("Gathering setup information"), RKProgressControl::CancellableNoProgress);
 		control->addRCommand (command, true);
 		RKGlobals::rInterface ()->issueCommand (command);
-		control->doModal (false);
-		ok = command->succeeded ();
+		ok = control->doModal (false);
+		// NOTE: command is already deleted at this point
 		report_template.append (control->fullCommandOutput ());
 		delete control;
 	}
@@ -95,21 +154,6 @@ void RKErrorDialog::reportBug (QWidget* parent_widget, const QString& message_in
 		report_template.append ("\n- backend not available or rk.sessionInfo() canceled -\n");
 	}
 
-	KDialog *dialog = new KDialog (parent_widget);
-	QObject::connect (dialog, SIGNAL (finished(int)), dialog, SLOT (deleteLater()));
-	dialog->setCaption (i18n ("Reporting bugs in RKWard"));
-	dialog->setButtons (KDialog::Ok);
-	KVBox *vbox = new KVBox (dialog);
-	dialog->setMainWidget (vbox);
-	QLabel *label = new QLabel (i18n ("<p><b>Where should I report bugs or wishes?</b></p><p>Please submit your bug reports or wishes at <a href=\"%1\">%1</a> or send email to <a href=\"mailto:%2\">%2</a>.</p>"
-							"<p><b>What information should I provide?</b></p><p>Please copy the information shown below, and fill in the details to the questions.</p>"
-							, QString ("http://rkward.kde.org/bugs"), QString ("rkward-devel at kde.org")), vbox);
-	label->setWordWrap (true);
-	label->setOpenExternalLinks (true);
-	QTextEdit *details = new QTextEdit (vbox);
-	details->setReadOnly (true);
-	details->setText (report_template);
-
+	RKBugzillaReportDialog *dialog = new RKBugzillaReportDialog (parent_widget, report_template);
 	dialog->show ();
-
 }
diff --git a/rkward/main.cpp b/rkward/main.cpp
index 6ca25fc..0694d64 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -129,7 +129,7 @@ int main(int argc, char *argv[]) {
 	options.add ("reuse", ki18n ("Reuse a running RKWard instance (if available). If a running instance is reused, only the file arguments will be interpreted, all other options will be ignored."), 0);
 	options.add ("+[Files]", ki18n ("File or files to open, typically a workspace, or an R script file. When loading several things, you should specify the workspace, first."), 0);
 
-	KAboutData aboutData("rkward", QByteArray (), ki18n ("RKWard"), RKWARD_VERSION, ki18n ("Frontend to the R statistics language"), KAboutData::License_GPL, ki18n ("(c) 2002, 2004 - 2014"), KLocalizedString (), "http://rkward.kde.org", "rkward-devel at kde.org");
+	KAboutData aboutData("rkward", QByteArray (), ki18n ("RKWard"), RKWARD_VERSION, ki18n ("Frontend to the R statistics language"), KAboutData::License_GPL, ki18n ("(c) 2002, 2004 - 2014"), KLocalizedString (), "http://rkward.kde.org", "submit at bugs.kde.org");
 	aboutData.addAuthor (ki18n ("Thomas Friedrichsmeier"), ki18n ("Project leader / main developer"));
 	aboutData.addAuthor (ki18n ("Pierre Ecochard"), ki18n ("C++ developer between 2004 and 2007"));
 	aboutData.addAuthor (ki18n ("Prasenjit Kapat"), ki18n ("Many plugins, suggestions, plot history feature"));



More information about the rkward-tracker mailing list