Merge lp:~sil/quickly/flash-game-needs-gtk2 into lp:quickly

Proposed by Stuart Langridge on 2012-05-02
Status: Merged
Merged at revision: 666
Proposed branch: lp:~sil/quickly/flash-game-needs-gtk2
Merge into: lp:quickly
Diff against target: 45 lines (+11/-6)
2 files modified
data/templates/ubuntu-flash-game/project_root/bin/project_name (+8/-4)
data/templates/ubuntu-flash-game/project_root/data/index.html (+3/-2)
To merge this branch: bzr merge lp:~sil/quickly/flash-game-needs-gtk2
Reviewer Review Type Date Requested Status
Michael Terry (community) 2012-05-02 Approve on 2012-05-02
Review via email: mp+104312@code.launchpad.net

Description of the Change

Fix ubuntu-flash-game template to use Gtk 2, because Flash needs it; in Gtk 3 you get the broken-plugin lego-brick icon. Also tweak the HTML slightly to make 100% dimensions Flash SWFs work better.

There are no tests for this, because it's very hard to think of a way of doing a test without a custom Flash SWF to output something which can be tested for (and the test would have to be manual, too). That custom SWF can't be built on any sort of standard Ubuntu (the Flash IDE isn't available at all, and Flex isn't packaged for Ubuntu), meaning that the SWF would be in the archives without the source required to build it...

To post a comment you must log in.
Michael Terry (mterry) wrote :

Awesome, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/templates/ubuntu-flash-game/project_root/bin/project_name'
2--- data/templates/ubuntu-flash-game/project_root/bin/project_name 2011-06-08 19:20:41 +0000
3+++ data/templates/ubuntu-flash-game/project_root/bin/project_name 2012-05-02 00:34:19 +0000
4@@ -18,7 +18,13 @@
5 ###########################################################################
6
7
8-from gi.repository import WebKit, Gtk, Gio
9+import gi
10+gi.require_version("Gtk", "2.0")
11+gi.require_version("Gio", "2.0")
12+gi.require_version("WebKit", "1.0")
13+from gi.repository import Gtk
14+from gi.repository import WebKit
15+from gi.repository import Gio
16 import json, os
17
18 # Where your project will look for your data (for instance, images and ui
19@@ -64,9 +70,7 @@
20 htmlfp = Gio.file_new_for_path(get_data_file('index.html'))
21 uri = htmlfp.get_uri()
22 _, html, _ = htmlfp.load_contents(None)
23- print html, "hello", uri
24+ w.set_size_request(*WINDOW_SIZE)
25 v.load_html_string(html, uri)
26- w.set_size_request(*WINDOW_SIZE)
27- v.queue_resize() # force a reallocation, https://bugs.webkit.org/show_bug.cgi?id=47742
28 Gtk.main()
29
30
31=== modified file 'data/templates/ubuntu-flash-game/project_root/data/index.html'
32--- data/templates/ubuntu-flash-game/project_root/data/index.html 2011-02-14 18:42:02 +0000
33+++ data/templates/ubuntu-flash-game/project_root/data/index.html 2012-05-02 00:34:19 +0000
34@@ -2,9 +2,10 @@
35 <html>
36 <head>
37 <style>
38-html, body { margin: 0; padding: 0; }
39+html, body { margin: 0; padding: 0; height: 100%; }
40 </style>
41 </head>
42-<body><object width="100%" height="100%" data="game.swf"></object></body>
43+<body><object width="100%" height="100%" data="game.swf"></object>
44+</body>
45 </html>
46

Subscribers

People subscribed via source and target branches