@@ -29,17 +29,18 @@ DEALINGS IN THE SOFTWARE.
29
29
#include < es-log/trace-log.h>
30
30
#include < gl-platform/GLPlatform.hpp>
31
31
32
- #include < Interface/Modules/Render/ViewScenePlatformCompatibility.h>
33
- #include < Interface/Modules/Render/ES/SRInterface.h>
34
- #include < Interface/Modules/Render/GLWidget.h>
35
32
#include < Core/Application/Application.h>
36
33
#include < Core/Application/Preferences/Preferences.h>
34
+ #include < Core/Application/Version.h>
35
+ #include < Core/GeometryPrimitives/Transform.h>
37
36
#include < Core/Logging/Log.h>
38
- #include < Modules/Render/ViewScene.h>
39
- #include < Interface/Modules/Render/Screenshot.h>
40
- #include < Graphics/Glyphs/GlyphGeom.h>
41
37
#include < Graphics/Datatypes/GeometryImpl.h>
42
- #include < Core/GeometryPrimitives/Transform.h>
38
+ #include < Graphics/Glyphs/GlyphGeom.h>
39
+ #include < Interface/Modules/Render/ES/SRInterface.h>
40
+ #include < Interface/Modules/Render/GLWidget.h>
41
+ #include < Interface/Modules/Render/Screenshot.h>
42
+ #include < Interface/Modules/Render/ViewScenePlatformCompatibility.h>
43
+ #include < Modules/Render/ViewScene.h>
43
44
#include < boost/timer.hpp>
44
45
45
46
using namespace SCIRun ::Gui;
@@ -2139,6 +2140,55 @@ void ViewSceneDialog::screenshotClicked()
2139
2140
screenshotTaker_->saveScreenshot ();
2140
2141
}
2141
2142
2143
+ // --------------------------------------------------------------------------------------------------
2144
+ void ViewSceneDialog::sendBugReport ()
2145
+ {
2146
+ QString glVersion = reinterpret_cast <const char *>(glGetString (GL_VERSION));
2147
+ QString gpuVersion = reinterpret_cast <const char *>(glGetString (GL_RENDERER));
2148
+
2149
+ // Temporarily save screenshot so that it can be sent over email
2150
+ takeScreenshot ();
2151
+ QImage image = screenshotTaker_->getScreenshot ();
2152
+ QString location = QDir::homePath () % QLatin1String (" /scirun5screenshots/scirun_bug.png" );
2153
+ image.save (location);
2154
+
2155
+ // Generate email template
2156
+ QString askForScreenshot = " \n IMPORTANT: Make sure to attach the screenshot of the ViewScene located at "
2157
+ % location % " \n\n\n " ;
2158
+ static QString instructions = " ## For bugs, follow the template below: fill out all pertinent sections,"
2159
+ " then delete the rest of the template to reduce clutter."
2160
+ " \n ### If the prerequisite is met, just delete that text as well. "
2161
+ " If they're not all met, the issue will be closed or assigned back to you.\n\n " ;
2162
+ static QString prereqs = " **Prerequisite**\n * [ ] Did you [perform a cursory search](https://github.com/SCIInstitute/SCIRun/issues)"
2163
+ " to see if your bug or enhancement is already reported?\n\n " ;
2164
+ static QString reportGuide = " For more information on how to write a good "
2165
+ " [bug report](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report) or"
2166
+ " [enhancement request](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-enhancement-suggestion),"
2167
+ " see the `CONTRIBUTING` guide. These links point to another project, but most of the advice holds in general.\n\n " ;
2168
+ static QString describe = " **Describe the bug**\n A clear and concise description of what the bug is.\n\n " ;
2169
+ static QString askForData = " **Providing sample network(s) along with input data is useful to solving your issue.**\n\n " ;
2170
+ static QString reproduction = " **To Reproduce**\n Steps to reproduce the behavior:"
2171
+ " \n 1. Go to '...'\n 2. Click on '....'\n 3. Scroll down to '....'\n 4. See error\n\n " ;
2172
+
2173
+ static QString expectedBehavior = " **Expected behavior**\n A clear and concise description of what you expected to happen.\n\n " ;
2174
+ static QString additional = " **Additional context**\n Add any other context about the problem here.\n\n " ;
2175
+ QString desktopInfo = " Desktop: " % QSysInfo::prettyProductName () % " \n " ;
2176
+ QString kernelInfo = " Kernel: " % QSysInfo::kernelVersion () % " \n " ;
2177
+ QString gpuInfo = " GPU: " % gpuVersion % " \n " ;
2178
+ QString qtInfo = " QT Version: " % QLibraryInfo::version ().toString () % " \n " ;
2179
+ QString glInfo = " GL Version: " % glVersion % " \n " ;
2180
+ QString scirunVersionInfo = " SCIRun Version: " % QString::fromStdString (VersionInfo::GIT_VERSION_TAG) % " \n " ;
2181
+ QString machineIdInfo = " Machine ID: " % QString (QSysInfo::machineUniqueId ()) % " \n " ;
2182
+
2183
+ static QString recipient =
" [email protected] " ;
2184
+ static QString subject = " View%20Scene%20Bug%20Report" ;
2185
+ QDesktopServices::openUrl (QUrl (QString (" mailto:" % recipient % " ?subject=" % subject % " &body=" %
2186
+ askForScreenshot % instructions % prereqs % reportGuide %
2187
+ describe % askForData % reproduction % expectedBehavior %
2188
+ additional % desktopInfo % kernelInfo % gpuInfo %
2189
+ qtInfo % glInfo % scirunVersionInfo % machineIdInfo)));
2190
+ }
2191
+
2142
2192
// --------------------------------------------------------------------------------------------------
2143
2193
void ViewSceneDialog::takeScreenshot ()
2144
2194
{
0 commit comments