[extensions-web] errorreports: Make the automatic fill-in report more useful



commit 5e857acce5eca5798a602428214a860da9a9e59f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Nov 30 21:38:35 2011 -0500

    errorreports: Make the automatic fill-in report more useful
    
    Add shell version, extension version and other goodies

 sweettooth/static/js/extensions.js |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 535740b..43f0db6 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -235,21 +235,34 @@ function($, messages, dbusProxy, extensionUtils) {
     $.fn.fillInErrors = function () {
         return this.each(function() {
             var $form = $(this);
+            var uuid = $form.data('uuid');
             var $textarea = $form.find('textarea');
-            dbusProxy.GetErrors($form.data('uuid')).done(function(errors) {
-                var errorString;
+            dbusProxy.GetExtensionInfo(uuid).done(function(meta) {
+                dbusProxy.GetErrors($form.data('uuid')).done(function(errors) {
+                    var errorString;
+
+                    var versionInformation = "";
+                    versionInformation += "    Shell version: " + dbusProxy.ShellVersion + "\n";
+                    versionInformation += "    Extension version: ";
+                    if (meta && meta.version) {
+                        versionInformation += meta.version;
+                    } else {
+                        versionInformation += "Not found";
+                    }
 
-                if (errors && errors.length) {
-                    errorString = errors.join('\n\n================\n\n');
-                } else {
-                    errorString = "GNOME Shell Extensions did not detect any errors with this extension.";
-                }
+                    if (errors && errors.length) {
+                        errorString = errors.join('\n\n================\n\n');
+                    } else {
+                        errorString = "GNOME Shell Extensions did not detect any errors with this extension.";
+                    }
 
-                var template = ("What's wrong?\n\n\n" +
-                                "What have I tried?\n\n\n" +
-                                "Automatically detected errors:\n\n" + errorString);
+                    var template = ("What's wrong?\n\n\n\n" +
+                                    "What have you tried?\n\n\n\n" +
+                                    "Automatically detected errors:\n\n" + errorString +
+                                    "\n\nVersion information:\n\n" + versionInformation);
 
-                $textarea.text(template);
+                    $textarea.text(template);
+                });
             });
         });
     };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]