Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Mathieu Trudel-Lapierre | ||||
Approved revision: | 6376 | ||||
Merged at revision: | 6371 | ||||
Proposed branch: | lp:~laney/ubiquity/webkit2 | ||||
Merge into: | lp:ubiquity | ||||
Diff against target: |
191 lines (+53/-27) 5 files modified
d-i/manifest (+9/-9) d-i/update-control (+1/-1) debian/changelog (+10/-0) debian/control (+2/-2) ubiquity/frontend/gtk_ui.py (+31/-15) |
||||
To merge this branch: | bzr merge lp:~laney/ubiquity/webkit2 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mathieu Trudel-Lapierre | Approve | ||
Sebastien Bacher | Approve | ||
Review via email: mp+282467@code.launchpad.net |
Commit message
Port to WebKit 2
Description of the change
Port to webkit2. I think it's fairly straightforward and seems to work.
We need to upload everything at once, so please review but don't merge/upload right away
Sebastien Bacher (seb128) wrote : | # |
could you also version the import to avoid the require_version warning?
Iain Lane (laney) wrote : | # |
On Tue, Feb 09, 2016 at 02:54:18PM -0000, Sebastien Bacher wrote:
> Review: Needs Fixing
>
> thanks for the work, it doesn't work for me though (using the version published in a ppa an hour ago), the slides don't display
Try again from the PPA please. All should be fixed.
I did this to test it from a live session:
$ sudo sed -i 's/main/main universe/' /etc/apt/
$ sudo add-apt-repository ppa:laney/wk2
$ sudo apt update
$ sudo apt install ubiquity ubiquity-
Then close terminal and launch using the desktop file on the desktop.
This
http://
is a screenshot of it which I took just now.
Cheers,
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Dimitri John Ledkov (xnox) wrote : | # |
On 10 February 2016 at 15:12, Iain Lane <email address hidden> wrote:
> On Tue, Feb 09, 2016 at 02:54:18PM -0000, Sebastien Bacher wrote:
>> Review: Needs Fixing
>>
>> thanks for the work, it doesn't work for me though (using the version published in a ppa an hour ago), the slides don't display
>
> Try again from the PPA please. All should be fixed.
>
> I did this to test it from a live session:
>
> $ sudo sed -i 's/main/main universe/' /etc/apt/
> $ sudo add-apt-repository ppa:laney/wk2
> $ sudo apt update
> $ sudo apt install ubiquity ubiquity-
>
for historical reasons we depends on : ubiquity-
ubiquity-
So one can do:
$ sudo apt install ubiquity ubiquity-
to upgrade it mid flight.
> Then close terminal and launch using the desktop file on the desktop.
>
> This
>
> http://
>
> is a screenshot of it which I took just now.
>
> Cheers,
>
> --
> Iain Lane [ <email address hidden> ]
> Debian Developer [ <email address hidden> ]
> Ubuntu Developer [ <email address hidden> ]
>
> https:/
> You are subscribed to branch lp:ubiquity.
--
Regards,
Dimitri.
Sebastien Bacher (seb128) wrote : | # |
the updated version works fine here, tried on yesterday's daily with the ppa, the slides display as they should, you can switch to next/previous ones and clicking on an url in summary slide opens the webbrowser on the correct url
Mathieu Trudel-Lapierre (cyphermox) wrote : | # |
LGTM.
Preview Diff
1 | === modified file 'd-i/manifest' | |||
2 | --- d-i/manifest 2016-01-27 00:23:39 +0000 | |||
3 | +++ d-i/manifest 2016-02-09 17:06:05 +0000 | |||
4 | @@ -1,34 +1,34 @@ | |||
6 | 1 | apt-setup 1:0.104ubuntu2 | 1 | apt-setup 1:0.104ubuntu3 |
7 | 2 | base-installer 1.158ubuntu2 | 2 | base-installer 1.158ubuntu2 |
10 | 3 | bterm-unifont 1.3 | 3 | bterm-unifont 1.4 |
11 | 4 | choose-mirror 2.65ubuntu2 | 4 | choose-mirror 2.65ubuntu4 |
12 | 5 | clock-setup 0.126ubuntu1 | 5 | clock-setup 0.126ubuntu1 |
13 | 6 | console-setup 1.108ubuntu10 | 6 | console-setup 1.108ubuntu10 |
14 | 7 | debian-installer-utils 1.113ubuntu1 | 7 | debian-installer-utils 1.113ubuntu1 |
16 | 8 | flash-kernel 3.0~rc.4ubuntu57 | 8 | flash-kernel 3.0~rc.4ubuntu58 |
17 | 9 | grub-installer 1.128ubuntu2 | 9 | grub-installer 1.128ubuntu2 |
18 | 10 | hw-detect 1.114ubuntu1 | 10 | hw-detect 1.114ubuntu1 |
19 | 11 | localechooser 2.65ubuntu3 | 11 | localechooser 2.65ubuntu3 |
20 | 12 | netcfg 1.135ubuntu1 | 12 | netcfg 1.135ubuntu1 |
22 | 13 | partconf 1.48 | 13 | partconf 1.49 |
23 | 14 | partman-auto 131ubuntu1 | 14 | partman-auto 131ubuntu1 |
24 | 15 | partman-auto-crypto 22ubuntu1 | 15 | partman-auto-crypto 22ubuntu1 |
25 | 16 | partman-auto-loop 0ubuntu21 | 16 | partman-auto-loop 0ubuntu21 |
26 | 17 | partman-auto-lvm 56ubuntu1 | 17 | partman-auto-lvm 56ubuntu1 |
27 | 18 | partman-base 187ubuntu1 | 18 | partman-base 187ubuntu1 |
28 | 19 | partman-basicfilesystems 120ubuntu1 | 19 | partman-basicfilesystems 120ubuntu1 |
30 | 20 | partman-basicmethods 60 | 20 | partman-basicmethods 61 |
31 | 21 | partman-btrfs 18ubuntu1 | 21 | partman-btrfs 18ubuntu1 |
32 | 22 | partman-crypto 86ubuntu1 | 22 | partman-crypto 86ubuntu1 |
33 | 23 | partman-efi 71ubuntu1 | 23 | partman-efi 71ubuntu1 |
34 | 24 | partman-ext3 84ubuntu2 | 24 | partman-ext3 84ubuntu2 |
35 | 25 | partman-jfs 46 | 25 | partman-jfs 46 |
38 | 26 | partman-lvm 111 | 26 | partman-lvm 112 |
39 | 27 | partman-newworld 33 | 27 | partman-newworld 34 |
40 | 28 | partman-partitioning 110ubuntu1 | 28 | partman-partitioning 110ubuntu1 |
41 | 29 | partman-target 98ubuntu1 | 29 | partman-target 98ubuntu1 |
42 | 30 | partman-uboot 5 | 30 | partman-uboot 5 |
44 | 31 | partman-xfs 57 | 31 | partman-xfs 58 |
45 | 32 | preseed 1.68ubuntu1 | 32 | preseed 1.68ubuntu1 |
46 | 33 | tzsetup 1:0.81ubuntu1 | 33 | tzsetup 1:0.81ubuntu1 |
47 | 34 | user-setup 1.63ubuntu1 | 34 | user-setup 1.63ubuntu1 |
48 | 35 | 35 | ||
49 | === modified file 'd-i/update-control' | |||
50 | --- d-i/update-control 2015-01-29 17:46:16 +0000 | |||
51 | +++ d-i/update-control 2016-02-09 17:06:05 +0000 | |||
52 | @@ -41,7 +41,7 @@ | |||
53 | 41 | 'dpkg-dev (>= 1.14.4)', | 41 | 'dpkg-dev (>= 1.14.4)', |
54 | 42 | 'gir1.2-soup-2.4', | 42 | 'gir1.2-soup-2.4', |
55 | 43 | 'gir1.2-timezonemap-1.0', | 43 | 'gir1.2-timezonemap-1.0', |
57 | 44 | 'gir1.2-webkit-3.0', | 44 | 'gir1.2-webkit2-4.0', |
58 | 45 | 'intltool (>= 0.40.0)', | 45 | 'intltool (>= 0.40.0)', |
59 | 46 | 'imagemagick', | 46 | 'imagemagick', |
60 | 47 | 'libcairo2-dev', | 47 | 'libcairo2-dev', |
61 | 48 | 48 | ||
62 | === modified file 'debian/changelog' | |||
63 | --- debian/changelog 2016-01-27 00:26:44 +0000 | |||
64 | +++ debian/changelog 2016-02-09 17:06:05 +0000 | |||
65 | @@ -1,3 +1,13 @@ | |||
66 | 1 | ubiquity (2.21.44) UNRELEASED; urgency=medium | ||
67 | 2 | |||
68 | 3 | * Port the slideshow screen to WebKit 2 (LP: #1469221) | ||
69 | 4 | * Automatic update of included source packages: apt-setup | ||
70 | 5 | 1:0.104ubuntu3, bterm-unifont 1.4, choose-mirror 2.65ubuntu4, flash- | ||
71 | 6 | kernel 3.0~rc.4ubuntu58, partconf 1.49, partman-basicmethods 61, | ||
72 | 7 | partman-lvm 112, partman-newworld 34, partman-xfs 58. | ||
73 | 8 | |||
74 | 9 | -- Iain Lane <iain.lane@canonical.com> Tue, 09 Feb 2016 12:18:57 +0000 | ||
75 | 10 | |||
76 | 1 | ubiquity (2.21.43) xenial; urgency=medium | 11 | ubiquity (2.21.43) xenial; urgency=medium |
77 | 2 | 12 | ||
78 | 3 | * ubiquity/install_misc.py: be extra careful retrieving the state of the | 13 | * ubiquity/install_misc.py: be extra careful retrieving the state of the |
79 | 4 | 14 | ||
80 | === modified file 'debian/control' | |||
81 | --- debian/control 2015-12-23 16:37:19 +0000 | |||
82 | +++ debian/control 2016-02-09 17:06:05 +0000 | |||
83 | @@ -3,7 +3,7 @@ | |||
84 | 3 | Priority: optional | 3 | Priority: optional |
85 | 4 | Maintainer: Ubuntu Installer Team <ubuntu-installer@lists.ubuntu.com> | 4 | Maintainer: Ubuntu Installer Team <ubuntu-installer@lists.ubuntu.com> |
86 | 5 | Uploaders: Colin Watson <cjwatson@ubuntu.com>, Evan Dandrea <ev@ubuntu.com> | 5 | Uploaders: Colin Watson <cjwatson@ubuntu.com>, Evan Dandrea <ev@ubuntu.com> |
88 | 6 | Build-Depends: adwaita-icon-theme, apt, autopoint, bf-utf-source, check, dctrl-tools, debconf (>= 1.5.43), debconf-utils, debhelper (>= 9), devio, dh-autoreconf, dh-di (>= 3), dh-systemd, dpkg-dev (>= 1.15.7), gir1.2-soup-2.4, gir1.2-timezonemap-1.0, gir1.2-webkit-3.0, gir1.2-xkl-1.0, gobject-introspection, imagemagick, intltool (>= 0.40.0), intltool-debian (>= 0.30+20040212), iso-codes, isoquery, keymapper (>= 0.5.3-7), libbogl-dev, libcairo2-dev, libdebconfclient0-dev (>= 0.68), libdebian-installer4-dev (>= 0.76), libgirepository1.0-dev, libglib2.0-dev, libgtk-3-dev, libido3-0.1-dev, libindicator3-dev, libiw-dev (>= 27+28pre9), liblocale-gettext-perl, libparted-dev (>= 2.2), librsvg2-bin, libsubunit-dev, locales, pep8, pkg-config, po-debconf (>= 1.0), pyflakes (>= 0.7.2), python-gi-dev, python-scour, python3-all (>= 3.1), python3-apt (>= 0.7.100.3~), python3-cairo, python3-dbus, python3-gi, python3-gi-cairo, python3-icu (>= 1.0), python3-mock (>= 0.7.0), python3-pam, tzdata, ubuntu-artwork, udev, wget, xkb-data (>= 0.9), xkb-data-i18n, xvfb | 6 | Build-Depends: adwaita-icon-theme, apt, autopoint, bf-utf-source, check, dctrl-tools, debconf (>= 1.5.43), debconf-utils, debhelper (>= 9), devio, dh-autoreconf, dh-di (>= 3), dh-systemd, dpkg-dev (>= 1.15.7), gir1.2-soup-2.4, gir1.2-timezonemap-1.0, gir1.2-webkit2-4.0, gir1.2-xkl-1.0, gobject-introspection, imagemagick, intltool (>= 0.40.0), intltool-debian (>= 0.30+20040212), iso-codes, isoquery, keymapper (>= 0.5.3-7), libbogl-dev, libcairo2-dev, libdebconfclient0-dev (>= 0.68), libdebian-installer4-dev (>= 0.76), libgirepository1.0-dev, libglib2.0-dev, libgtk-3-dev, libido3-0.1-dev, libindicator3-dev, libiw-dev (>= 27+28pre9), liblocale-gettext-perl, libparted-dev (>= 2.2), librsvg2-bin, libsubunit-dev, locales, pep8, pkg-config, po-debconf (>= 1.0), pyflakes (>= 0.7.2), python-gi-dev, python-scour, python3-all (>= 3.1), python3-apt (>= 0.7.100.3~), python3-cairo, python3-dbus, python3-gi, python3-gi-cairo, python3-icu (>= 1.0), python3-mock (>= 0.7.0), python3-pam, tzdata, ubuntu-artwork, udev, wget, xkb-data (>= 0.9), xkb-data-i18n, xvfb |
89 | 7 | Standards-Version: 3.9.4 | 7 | Standards-Version: 3.9.4 |
90 | 8 | X-Python3-Version: >= 3.1 | 8 | X-Python3-Version: >= 3.1 |
91 | 9 | XS-Testsuite: autopkgtest | 9 | XS-Testsuite: autopkgtest |
92 | @@ -45,7 +45,7 @@ | |||
93 | 45 | Package: ubiquity-frontend-gtk | 45 | Package: ubiquity-frontend-gtk |
94 | 46 | Architecture: amd64 arm64 armhf i386 powerpc ppc64el | 46 | Architecture: amd64 arm64 armhf i386 powerpc ppc64el |
95 | 47 | Pre-Depends: ${misc:Pre-Depends} | 47 | Pre-Depends: ${misc:Pre-Depends} |
97 | 48 | Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, ubiquity (= ${binary:Version}), python3-dbus, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-soup-2.4, gir1.2-vte-2.91, gir1.2-webkit-3.0, iso-codes, metacity | marco | xfwm4 | matchbox-window-manager | lubuntu-default-settings | openbox | gnome-shell, gir1.2-xkl-1.0, gir1.2-timezonemap-1.0, python3-gi, python3-cairo, python3-gi-cairo, gir1.2-appindicator3-0.1, busybox-static | busybox | 48 | Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, ubiquity (= ${binary:Version}), python3-dbus, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-soup-2.4, gir1.2-vte-2.91, gir1.2-webkit2-4.0, iso-codes, metacity | marco | xfwm4 | matchbox-window-manager | lubuntu-default-settings | openbox | gnome-shell, gir1.2-xkl-1.0, gir1.2-timezonemap-1.0, python3-gi, python3-cairo, python3-gi-cairo, gir1.2-appindicator3-0.1, busybox-static | busybox |
98 | 49 | Suggests: gnome-control-center | feh | 49 | Suggests: gnome-control-center | feh |
99 | 50 | Conflicts: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3) | 50 | Conflicts: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3) |
100 | 51 | Replaces: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3) | 51 | Replaces: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3) |
101 | 52 | 52 | ||
102 | === modified file 'ubiquity/frontend/gtk_ui.py' | |||
103 | --- ubiquity/frontend/gtk_ui.py 2015-07-15 05:37:56 +0000 | |||
104 | +++ ubiquity/frontend/gtk_ui.py 2016-02-09 17:06:05 +0000 | |||
105 | @@ -37,6 +37,7 @@ | |||
106 | 37 | import configparser | 37 | import configparser |
107 | 38 | from functools import reduce | 38 | from functools import reduce |
108 | 39 | import gettext | 39 | import gettext |
109 | 40 | import gi | ||
110 | 40 | import os | 41 | import os |
111 | 41 | import subprocess | 42 | import subprocess |
112 | 42 | import sys | 43 | import sys |
113 | @@ -831,15 +832,27 @@ | |||
114 | 831 | 832 | ||
115 | 832 | return self.returncode | 833 | return self.returncode |
116 | 833 | 834 | ||
123 | 834 | def on_slideshow_link_clicked(self, unused_view, unused_frame, req, | 835 | def on_context_menu(self, unused_web_view, unused_context_menu, |
124 | 835 | unused_action, decision): | 836 | unused_event, unused_hit_test_result): |
125 | 836 | uri = req.get_uri() | 837 | # True will not show the menu |
120 | 837 | decision.ignore() | ||
121 | 838 | subprocess.Popen(['sensible-browser', uri], | ||
122 | 839 | close_fds=True, preexec_fn=misc.drop_all_privileges) | ||
126 | 840 | return True | 838 | return True |
127 | 841 | 839 | ||
128 | 840 | def on_slideshow_link_clicked(self, web_view, decision, decision_type): | ||
129 | 841 | gi.require_version('WebKit2', '4.0') | ||
130 | 842 | from gi.repository import WebKit2 | ||
131 | 843 | if decision_type == WebKit2.PolicyDecisionType.NEW_WINDOW_ACTION: | ||
132 | 844 | request = decision.get_request() | ||
133 | 845 | uri = request.get_uri() | ||
134 | 846 | decision.ignore() | ||
135 | 847 | subprocess.Popen(['sensible-browser', uri], | ||
136 | 848 | close_fds=True, | ||
137 | 849 | preexec_fn=misc.drop_all_privileges) | ||
138 | 850 | return True | ||
139 | 851 | return False | ||
140 | 852 | |||
141 | 842 | def start_slideshow(self): | 853 | def start_slideshow(self): |
142 | 854 | # WebKit2 spawns a process which we don't want to run as root | ||
143 | 855 | misc.drop_privileges_save() | ||
144 | 843 | self.progress_mode.set_current_page( | 856 | self.progress_mode.set_current_page( |
145 | 844 | self.progress_pages['progress_bar']) | 857 | self.progress_pages['progress_bar']) |
146 | 845 | 858 | ||
147 | @@ -863,32 +876,35 @@ | |||
148 | 863 | 876 | ||
149 | 864 | slides = 'file://%s#%s' % (slideshow_main, parameters_encoded) | 877 | slides = 'file://%s#%s' % (slideshow_main, parameters_encoded) |
150 | 865 | 878 | ||
152 | 866 | from gi.repository import WebKit | 879 | gi.require_version('WebKit2', '4.0') |
153 | 880 | from gi.repository import WebKit2 | ||
154 | 867 | # We have no significant browsing interface, so there isn't much point | 881 | # We have no significant browsing interface, so there isn't much point |
155 | 868 | # in WebKit creating a memory-hungry cache. | 882 | # in WebKit creating a memory-hungry cache. |
158 | 869 | WebKit.set_cache_model(WebKit.CacheModel.DOCUMENT_VIEWER) | 883 | context = WebKit2.WebContext.get_default() |
159 | 870 | webview = WebKit.WebView() | 884 | context.set_cache_model(WebKit2.CacheModel.DOCUMENT_VIEWER) |
160 | 885 | webview = WebKit2.WebView() | ||
161 | 871 | # WebKit puts file URLs in their own domain by default. | 886 | # WebKit puts file URLs in their own domain by default. |
162 | 872 | # This means that anything which checks for the same origin, | 887 | # This means that anything which checks for the same origin, |
163 | 873 | # such as creating a XMLHttpRequest, will fail unless this | 888 | # such as creating a XMLHttpRequest, will fail unless this |
164 | 874 | # is disabled. | 889 | # is disabled. |
165 | 875 | # http://www.gitorious.org/webkit/webkit/commit/624b946 | 890 | # http://www.gitorious.org/webkit/webkit/commit/624b946 |
166 | 876 | s = webview.get_settings() | 891 | s = webview.get_settings() |
169 | 877 | s.set_property('enable-file-access-from-file-uris', True) | 892 | s.set_property('allow-file-access-from-file-urls', True) |
170 | 878 | s.set_property('enable-default-context-menu', False) | 893 | webview.connect('context-menu', self.on_context_menu) |
171 | 879 | if (os.environ.get('UBIQUITY_A11Y_PROFILE') == 'screen-reader'): | 894 | if (os.environ.get('UBIQUITY_A11Y_PROFILE') == 'screen-reader'): |
172 | 880 | s.set_property('enable-caret-browsing', True) | 895 | s.set_property('enable-caret-browsing', True) |
173 | 881 | 896 | ||
175 | 882 | webview.connect('new-window-policy-decision-requested', | 897 | webview.connect('decide-policy', |
176 | 883 | self.on_slideshow_link_clicked) | 898 | self.on_slideshow_link_clicked) |
177 | 884 | 899 | ||
180 | 885 | self.webkit_scrolled_window.add(webview) | 900 | webview.show() |
181 | 886 | webview.open(slides) | 901 | self.page_mode.insert_page(webview, None, 1) |
182 | 902 | webview.load_uri(slides) | ||
183 | 887 | # TODO do these in a page loaded callback | 903 | # TODO do these in a page loaded callback |
184 | 888 | self.page_mode.show() | 904 | self.page_mode.show() |
185 | 889 | self.page_mode.set_current_page(1) | 905 | self.page_mode.set_current_page(1) |
186 | 890 | webview.show() | ||
187 | 891 | webview.grab_focus() | 906 | webview.grab_focus() |
188 | 907 | misc.regain_privileges_save() | ||
189 | 892 | 908 | ||
190 | 893 | def customize_installer(self): | 909 | def customize_installer(self): |
191 | 894 | """Initial UI setup.""" | 910 | """Initial UI setup.""" |
thanks for the work, it doesn't work for me though (using the version published in a ppa an hour ago), the slides don't display
/var/log/ installer/ debug has
"sys:1: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_ version( 'WebKit2' , '4.0') before import to ensure that the right version gets loaded.
(process:8709): Gtk-WARNING **: This process is currently running setuid or setgid.
This is not a supported use of GTK+. You must create a helper
program instead. For further details, see:
http:// www.gtk. org/setuid. html
Refusing to initialize GTK+."
one other small thing
"# True will not sure the menu"
is that a typo sure->show?