[gnome-continuous: 3/4] build.gnome.org: Make the app link to the screenshot



commit 29fdf99f606ed52a5188bffa0055482725472c04
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Nov 15 19:03:27 2013 -0500

    build.gnome.org: Make the app link to the screenshot

 extras/build.gnome.org/controllers.js              |    1 +
 .../partials/gnome-continuous-build.html           |    2 +-
 src/js/tasks/task-applicationstest.js              |    7 +++++++
 src/js/tasks/testbase.js                           |    6 ++++++
 4 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/extras/build.gnome.org/controllers.js b/extras/build.gnome.org/controllers.js
index 7cb734e..af484ec 100644
--- a/extras/build.gnome.org/controllers.js
+++ b/extras/build.gnome.org/controllers.js
@@ -42,6 +42,7 @@
                 var icon = app.icon ? (ROOT + app.icon) : '/images/app-generic.png';
                 apps.push({ id: id,
                             name: id, /* XXX */
+                            screenshot: (ROOT + app.screenshot),
                             status: (app.state == "success") ? 'good' : 'bad',
                             icon: icon });
             });
diff --git a/extras/build.gnome.org/partials/gnome-continuous-build.html 
b/extras/build.gnome.org/partials/gnome-continuous-build.html
index bc99dc1..2627b7f 100644
--- a/extras/build.gnome.org/partials/gnome-continuous-build.html
+++ b/extras/build.gnome.org/partials/gnome-continuous-build.html
@@ -8,7 +8,7 @@
   </div>
 
   <div class="app-grid">
-    <a ng-repeat="app in apps" class="app" ng-class="app.status" title="{{ app.name }}" href="???">
+    <a ng-repeat="app in apps" class="app" ng-class="app.status" title="{{ app.name }}" href="{{ 
app.screenshot }}">
       <div class="icon">
         <img src="{{ app.icon }}">
         <div class="emblem"></div>
diff --git a/src/js/tasks/task-applicationstest.js b/src/js/tasks/task-applicationstest.js
index 04d19b3..6f18437 100644
--- a/src/js/tasks/task-applicationstest.js
+++ b/src/js/tasks/task-applicationstest.js
@@ -80,6 +80,13 @@ const TaskApplicationsTest = new Lang.Class({
         return icon;
     },
 
+    _screenshotTaken: function(path) {
+        if (this._testingApp) {
+            let app = this._allApps[this._testingApp];
+            app.screenshot = this.workdir.get_relative_path(path);
+        }
+    },
+
     _onCommandChannelAsyncMessage: function(msgId, value) {
         if (msgId == 'TestingAppStart') {
             let [appId, iconTuple] = value.deep_unpack();
diff --git a/src/js/tasks/testbase.js b/src/js/tasks/testbase.js
index 1723786..f225778 100644
--- a/src/js/tasks/testbase.js
+++ b/src/js/tasks/testbase.js
@@ -258,6 +258,7 @@ const TestOneDisk = new Lang.Class({
         }
 
         // Convert to PNG if possible
+        let screenshotPath = filePath;
         if (modified && imports.gi.GdkPixbuf) {
             let GdkPixbuf = imports.gi.GdkPixbuf;
             let pixbuf = null;
@@ -271,6 +272,7 @@ const TestOneDisk = new Lang.Class({
             }
             if (pixbuf != null) {
                 let outFilename = this._subworkdir.get_child(filename.replace(/ppm$/, 'png'));
+                screenshotPath = outFilename;
                 pixbuf.savev(outFilename.get_path(), "png", [], []);
             }
             GSystem.file_unlink(filePath, this._cancellable);
@@ -279,6 +281,7 @@ const TestOneDisk = new Lang.Class({
         if (name == null) {
             this._requestingScreenshot = false;
         } else {
+            this._parentTask._screenshotTaken(screenshotPath);
             this._commandProxy._dbusImpl.emit_signal('ScreenshotComplete',
                                                      GLib.Variant.new('(s)', [name]));
         }
@@ -534,6 +537,9 @@ const TestBase = new Lang.Class({
     _postQemu: function(cancellable) {
     },
 
+    _screenshotTaken: function(path) {
+    },
+
     execute: function(cancellable) {
              let imageDir = this.workdir.get_child('images');
              let currentImages = imageDir.get_child('current');


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