Skip to content
Snippets Groups Projects
Unverified Commit 007586b9 authored by Antti Soininen's avatar Antti Soininen Committed by GitHub
Browse files

Merge pull request #23293 from mantidproject/22604_textbox_error

Add free text box to error reporter
parents 8ee7f81b 6268b2d6
No related branches found
No related tags found
No related merge requests found
Showing with 283 additions and 187 deletions
......@@ -42,7 +42,7 @@ public:
/// Constructor
ErrorReporter(std::string application, Types::Core::time_duration startTime,
std::string exitCode, bool share, std::string name,
std::string email);
std::string email, std::string textBox);
/// Sends an error report
int sendErrorReport();
......@@ -65,6 +65,8 @@ private:
const std::string m_name;
/// User provided email
const std::string m_email;
/// User provided text box
const std::string m_textbox;
/// Target url
std::string m_url;
};
......@@ -72,4 +74,4 @@ private:
} // namespace Kernel
} // namespace Mantid
#endif /* MANTID_KERNEL_ERRORSERVICE_H_ */
\ No newline at end of file
#endif /* MANTID_KERNEL_ERRORSERVICE_H_ */
......@@ -28,16 +28,16 @@ Logger g_log("ErrorReporter");
ErrorReporter::ErrorReporter(std::string application,
Types::Core::time_duration upTime,
std::string exitCode, bool share)
: ErrorReporter(application, upTime, exitCode, share, "", "") {}
: ErrorReporter(application, upTime, exitCode, share, "", "", "") {}
/** Constructor
*/
ErrorReporter::ErrorReporter(std::string application,
Types::Core::time_duration upTime,
std::string exitCode, bool share, std::string name,
std::string email)
std::string email, std::string textBox)
: m_application(application), m_exitCode(exitCode), m_upTime(upTime),
m_share(share), m_name(name), m_email(email) {
m_share(share), m_name(name), m_email(email), m_textbox(textBox) {
auto url = Mantid::Kernel::ConfigService::Instance().getValue<std::string>(
"errorreports.rooturl");
if (!url.is_initialized()) {
......@@ -104,11 +104,13 @@ std::string ErrorReporter::generateErrorMessage() {
message["exitCode"] = m_exitCode;
if (m_share) {
message["textBox"] = m_textbox;
message["email"] = m_email;
message["name"] = m_name;
} else {
message["email"] = "";
message["name"] = "";
message["textBox"] = "";
}
::Json::FastWriter writer;
......@@ -139,4 +141,4 @@ int ErrorReporter::sendReport(const std::string &message,
}
} // namespace Kernel
} // namespace Mantid
\ No newline at end of file
} // namespace Mantid
......@@ -63,8 +63,8 @@ public:
void test_errorMessageWithShare() {
std::string name = "My testing application name";
Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
TestableErrorReporter errorService(name, upTime, "0", true, "name",
"email");
TestableErrorReporter errorService(name, upTime, "0", true, "name", "email",
"textBox");
std::string message = errorService.generateErrorMessage();
::Json::Reader reader;
......@@ -72,9 +72,10 @@ public:
reader.parse(message, root);
auto members = root.getMemberNames();
std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1", "mantidVersion",
"osArch", "osName", "osReadable", "osVersion", "uid",
"facility", "upTime", "exitCode", "name", "email"};
"ParaView", "application", "host", "mantidSha1",
"mantidVersion", "osArch", "osName", "osReadable",
"osVersion", "uid", "facility", "upTime",
"exitCode", "textBox", "name", "email"};
for (auto expectedMember : expectedMembers) {
TSM_ASSERT(expectedMember + " not found",
std::find(members.begin(), members.end(), expectedMember) !=
......@@ -89,4 +90,4 @@ public:
}
};
#endif /* MANTID_API_USAGESERVICETEST_H_ */
\ No newline at end of file
#endif /* MANTID_API_USAGESERVICETEST_H_ */
......@@ -12,7 +12,7 @@ void export_ErrorReporter() {
init<std::string, Mantid::Types::Core::time_duration,
std::string, bool>())
.def(init<std::string, Mantid::Types::Core::time_duration, std::string,
bool, std::string, std::string>())
bool, std::string, std::string, std::string>())
.def("sendErrorReport", &ErrorReporter::sendErrorReport, arg("self"),
"Sends an error report");
......
......@@ -35,16 +35,17 @@ MantidApplication::MantidApplication(int &argc, char **argv)
}
void MantidApplication::errorHandling(bool continueWork, int share,
QString name, QString email) {
QString name, QString email,
QString textbox) {
if (share == 0) {
Mantid::Kernel::ErrorReporter errorReporter(
"mantidplot", Mantid::Kernel::UsageService::Instance().getUpTime(), "",
true, name.toStdString(), email.toStdString());
true, name.toStdString(), email.toStdString(), textbox.toStdString());
errorReporter.sendErrorReport();
} else if (share == 1) {
Mantid::Kernel::ErrorReporter errorReporter(
"mantidplot", Mantid::Kernel::UsageService::Instance().getUpTime(), "",
false, name.toStdString(), email.toStdString());
false, name.toStdString(), email.toStdString(), textbox.toStdString());
errorReporter.sendErrorReport();
}
......
......@@ -16,7 +16,7 @@ signals:
bool runAsPythonScript(const QString &code);
public slots:
void errorHandling(bool continueWork, int sharing, QString name,
QString email);
QString email, QString textbox);
};
#endif // MANTIDAPPLICATION_H_
======================
Error Reporter Changes
======================
.. contents:: Table of Contents
:local:
.. warning:: **Developers:** Sort changes under appropriate heading
putting new features at the top of the section, followed by
improvements, followed by bug fixes.
:ref:`Release 3.14.0 <v3.14.0>`
New Features
============
* The error reporter now accepts free text of up to 3200 characters in a free text box
......@@ -36,6 +36,7 @@ Changes
SANS <sans>
Direct Inelastic <direct_inelastic>
Indirect Inelastic <indirect_inelastic>
Error Reporter <error_reporter>
Full Change Listings
--------------------
......
......@@ -9,15 +9,15 @@ class ErrorReporterPresenter(object):
self._exit_code = exit_code
self._view.action.connect(self.error_handler)
def error_handler(self, continue_working, share, name, email):
def error_handler(self, continue_working, share, name, email, textBox):
status = -1
if share == 0:
errorReporter = ErrorReporter(
"mantidplot", UsageService.getUpTime(), self._exit_code, True, str(name), str(email))
"mantidplot", UsageService.getUpTime(), self._exit_code, True, str(name), str(email), str(textBox))
status = errorReporter.sendErrorReport()
elif share == 1:
errorReporter = ErrorReporter(
"mantidplot", UsageService.getUpTime(), self._exit_code, False, str(name), str(email))
"mantidplot", UsageService.getUpTime(), self._exit_code, False, str(name), str(email), str(textBox))
status = errorReporter.sendErrorReport()
if status != 201:
......
......@@ -5,12 +5,13 @@ from mantidqtpython import MantidQt
class CrashReportPage(QtGui.QWidget, ui_errorreport.Ui_Errorreport):
action = pyqtSignal(bool, int, str, str)
action = pyqtSignal(bool, int, str, str, str)
quit_signal = pyqtSignal()
def __init__(self, parent=None, show_continue_terminate=False):
super(self.__class__, self).__init__(parent)
self.setupUi(self)
self.input_text = ""
if not show_continue_terminate:
self.continue_terminate_frame.hide()
self.adjustSize()
......@@ -24,6 +25,8 @@ class CrashReportPage(QtGui.QWidget, ui_errorreport.Ui_Errorreport):
self.input_name_line_edit.textChanged.connect(self.set_button_status)
self.input_email_line_edit.textChanged.connect(self.set_button_status)
self.input_free_text.textChanged.connect(self.set_button_status)
self.input_free_text.textChanged.connect(self.set_plain_text_edit_field)
# The options on what to do after closing the window (exit/continue)
self.radioButtonContinue.setChecked(True) # Set continue to be checked by default
......@@ -40,15 +43,15 @@ class CrashReportPage(QtGui.QWidget, ui_errorreport.Ui_Errorreport):
self.quit_signal.emit()
def fullShare(self):
self.action.emit(self.continue_working, 0, self.input_name, self.input_email)
self.action.emit(self.continue_working, 0, self.input_name, self.input_email, self.input_text)
self.close()
def nonIDShare(self):
self.action.emit(self.continue_working, 1, self.input_name, self.input_email)
self.action.emit(self.continue_working, 1, self.input_name, self.input_email, self.input_text)
self.close()
def noShare(self):
self.action.emit(self.continue_working, 2, self.input_name, self.input_email)
self.action.emit(self.continue_working, 2, self.input_name, self.input_email, self.input_text)
self.close()
def get_simple_line_edit_field(self, expected_type, line_edit):
......@@ -56,8 +59,17 @@ class CrashReportPage(QtGui.QWidget, ui_errorreport.Ui_Errorreport):
value_as_string = gui_element.text()
return expected_type(value_as_string) if value_as_string else ''
def set_plain_text_edit_field(self):
self.input_text = self.get_plain_text_edit_field(text_edit="input_free_text", expected_type=str)
def get_plain_text_edit_field(self, text_edit, expected_type):
gui_element = getattr(self, text_edit)
value_as_string = gui_element.toPlainText()
return expected_type(value_as_string) if value_as_string else ''
def set_button_status(self):
if not self.input_name and not self.input_email:
if self.input_text == '' and not self.input_name and not self.input_email:
self.nonIDShareButton.setEnabled(True)
else:
self.nonIDShareButton.setEnabled(False)
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>768</width>
<height>451</height>
<height>608</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -19,8 +19,183 @@
<property name="windowTitle">
<string>Error Report</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0" colspan="2">
<widget class="QTextBrowser" name="requestTextBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; color:#000000;&quot;&gt;We are really sorry that Mantid is not behaving as it should and are aware how frustrating this is. We'd be very grateful if you could provide us with some details about your problems. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; color:#000000;&quot;&gt;The more information you can give, the quicker we can fix this issue. All information will be stored according to our data policy (&lt;/span&gt;&lt;a href=&quot;https://www.mantidproject.org/MantidProject:Privacy_policy&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0000ff;&quot;&gt;privacy policy&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:12pt; color:#000000;&quot;&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; color:#000000;&quot;&gt;Are you happy for us to send an error report about this incident? If you are willing it would also be helpful to provide some contact details below to allow us to follow up on the report.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="icon">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>161</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../../../../mantid-xcode/mantid/images/crying_mantid.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPlainTextEdit" name="input_free_text">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="plainText">
<string>Please enter any additional information about your problems. (Max 3200 characters)
For example:
Error messages on the screen
A script that causes the problem
The functions you used immediately before the problem
Thank you! </string>
</property>
<property name="overwriteMode">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="fullShareButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Information about your system architecture and mantid version are shared as well as a hashed user ID. For a full list see the privacy policy linked above.&lt;/p&gt;&lt;p&gt;The name and email entered in the two boxes above is also shared.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Yes, share information</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nonIDShareButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Information about your system architecture and mantid version are shared as well as a hashed user ID. For a full list see the privacy policy linked above.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Share non-identifiable information</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="noShareButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No error report is sent.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Don't share any information</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="input_name_line_edit">
<property name="maxLength">
<number>128</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Email (optional)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="input_email_line_edit">
<property name="maxLength">
<number>128</number>
</property>
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name (optional)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0" colspan="2">
<widget class="QFrame" name="continue_terminate_frame">
<property name="font">
<font>
......@@ -33,42 +208,8 @@
<property name="lineWidth">
<number>2</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>MantidPlot has thrown an unexpected exception.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Would you like to terminate MantidPlot, or try to continue?</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>If you choose to continue it is advisable to save your data and restart the application.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer">
......@@ -112,128 +253,43 @@
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>MantidPlot has thrown an unexpected exception.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Would you like to terminate MantidPlot, or try to continue?</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>If you choose to continue it is advisable to save your data and restart the application.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="requestTextBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.SF NS Text'; font-size:10pt; color:#000000;&quot;&gt;We are really sorry that Mantid is not behaving as it should and are aware how frustrating this is. We'd be very grateful if you could provide us with some details about your problems. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.SF NS Text'; font-size:10pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.SF NS Text'; font-size:10pt; color:#000000;&quot;&gt;The more information you can give, the quicker we can fix this issue. All information will be stored according to our data policy (&lt;/span&gt;&lt;a href=&quot;https://www.mantidproject.org/MantidProject:Privacy_policy&quot;&gt;&lt;span style=&quot; font-family:'.SF NS Text'; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;privacy policy&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'.SF NS Text'; font-size:10pt; color:#000000;&quot;&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.SF NS Text'; font-size:10pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.SF NS Text'; font-size:10pt; color:#000000;&quot;&gt;Are you happy for us to send an error report about this incident? If you are willing it would also be helpful to provide some contact details below to allow us to follow up on the report.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="input_name_line_edit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Email (optional)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="input_email_line_edit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name (optional)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="icon">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../../images/crying_mantid.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="fullShareButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Information about your system architecture and mantid version are shared as well as a hashed user ID. For a full list see the privacy policy linked above.&lt;/p&gt;&lt;p&gt;The name and email entered in the two boxes above is also shared.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Yes, share information</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="nonIDShareButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Information about your system architecture and mantid version are shared as well as a hashed user ID. For a full list see the privacy policy linked above.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Share non-identifiable information</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="noShareButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No error report is sent.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Don't share any information</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
......
......@@ -29,11 +29,12 @@ class ErrorReportPresenterTest(unittest.TestCase):
continue_working = True
name = ''
email = ''
textBox = ''
view = mock.MagicMock()
exit_code = 0
presenter = ErrorReporterPresenter(view, exit_code)
presenter.error_handler(continue_working, share, name, email)
presenter.error_handler(continue_working, share, name, email, textBox)
self.assertEqual(error_reporter_mock.call_count, 0)
self.assertEqual(presenter._view.quit.call_count, 0)
......@@ -49,11 +50,12 @@ class ErrorReportPresenterTest(unittest.TestCase):
continue_working = False
name = ''
email = ''
textBox = ''
view = mock.MagicMock()
exit_code = 0
presenter = ErrorReporterPresenter(view, exit_code)
presenter.error_handler(continue_working, share, name, email)
presenter.error_handler(continue_working, share, name, email, textBox)
self.assertEqual(error_reporter_mock.call_count, 1)
error_reporter_mock_instance.sendErrorReport.asser_called_once_with(
......@@ -71,11 +73,12 @@ class ErrorReportPresenterTest(unittest.TestCase):
continue_working = False
name = ''
email = ''
textBox = ''
view = mock.MagicMock()
exit_code = 0
presenter = ErrorReporterPresenter(view, exit_code)
presenter.error_handler(continue_working, share, name, email)
presenter.error_handler(continue_working, share, name, email, textBox)
self.assertEqual(error_reporter_mock.call_count, 1)
error_reporter_mock_instance.sendErrorReport.asser_called_once_with(
......@@ -93,11 +96,12 @@ class ErrorReportPresenterTest(unittest.TestCase):
continue_working = False
name = ''
email = ''
textBox = ''
view = mock.MagicMock()
exit_code = 0
presenter = ErrorReporterPresenter(view, exit_code)
presenter.error_handler(continue_working, share, name, email)
presenter.error_handler(continue_working, share, name, email, textBox)
self.assertEqual(error_reporter_mock.call_count, 1)
error_reporter_mock_instance.sendErrorReport.asser_called_once_with(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment