Merge lp:~agateau/ubiquity/kde-fix-slideshow-not-starting into lp:ubiquity

Proposed by Aurélien Gâteau
Status: Merged
Merged at revision: 5877
Proposed branch: lp:~agateau/ubiquity/kde-fix-slideshow-not-starting
Merge into: lp:ubiquity
Diff against target: 110 lines (+18/-40)
2 files modified
gui/qt/app.ui (+2/-33)
ubiquity/frontend/kde_ui.py (+16/-7)
To merge this branch: bzr merge lp:~agateau/ubiquity/kde-fix-slideshow-not-starting
Reviewer Review Type Date Requested Status
Jonathan Riddell Pending
Review via email: mp+153437@code.launchpad.net

Description of the change

This branch fixes the slideshow not starting. It now starts and resizes properly.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gui/qt/app.ui'
2--- gui/qt/app.ui 2013-03-08 12:42:26 +0000
3+++ gui/qt/app.ui 2013-03-14 18:35:31 +0000
4@@ -6,8 +6,8 @@
5 <rect>
6 <x>0</x>
7 <y>0</y>
8- <width>850</width>
9- <height>533</height>
10+ <width>505</width>
11+ <height>534</height>
12 </rect>
13 </property>
14 <property name="windowTitle">
15@@ -69,30 +69,6 @@
16 <property name="margin">
17 <number>0</number>
18 </property>
19- <item>
20- <widget class="QWebView" name="webview">
21- <property name="sizePolicy">
22- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
23- <horstretch>0</horstretch>
24- <verstretch>0</verstretch>
25- </sizepolicy>
26- </property>
27- <property name="minimumSize">
28- <size>
29- <width>700</width>
30- <height>420</height>
31- </size>
32- </property>
33- <property name="contextMenuPolicy">
34- <enum>Qt::NoContextMenu</enum>
35- </property>
36- <property name="url">
37- <url>
38- <string>about:blank</string>
39- </url>
40- </property>
41- </widget>
42- </item>
43 </layout>
44 </widget>
45 </widget>
46@@ -351,13 +327,6 @@
47 </layout>
48 </widget>
49 </widget>
50- <customwidgets>
51- <customwidget>
52- <class>QWebView</class>
53- <extends>QWidget</extends>
54- <header>QtWebKit/QWebView</header>
55- </customwidget>
56- </customwidgets>
57 <tabstops>
58 <tabstop>next</tabstop>
59 <tabstop>back</tabstop>
60
61=== modified file 'ubiquity/frontend/kde_ui.py'
62--- ubiquity/frontend/kde_ui.py 2013-03-12 12:56:02 +0000
63+++ ubiquity/frontend/kde_ui.py 2013-03-14 18:35:31 +0000
64@@ -39,7 +39,7 @@
65 # kde gui specifics
66 import sip
67 sip.setapi("QVariant", 1)
68-from PyQt4 import QtCore, QtGui, QtWebKit, uic
69+from PyQt4 import QtCore, QtGui, uic
70
71 from ubiquity import filteredcommand, i18n, misc
72 from ubiquity.components import partman_commit, install, plugininstall
73@@ -545,22 +545,31 @@
74
75 slides = 'file://%s#%s' % (slideshow_main, parameters_encoded)
76
77+ # HACK! For some reason, if the QWebView is created from the .ui file,
78+ # the slideshow does not start (but it starts if one runs
79+ # UBIQUITY_TEST_SLIDESHOW=1 ubiquity !). Creating it from the code
80+ # works. I have no idea why.
81+ from PyQt4.QtWebKit import QWebView
82+ from PyQt4.QtWebKit import QWebPage
83+
84 def openLink(qUrl):
85 QtGui.QDesktopServices.openUrl(qUrl)
86
87- self.ui.navigation.hide()
88- self.ui.pageMode.setCurrentWidget(self.ui.install_page)
89- webView = self.ui.webview
90+ webView = QWebView()
91+ webView.setMinimumSize(700, 420)
92 webView.linkClicked.connect(openLink)
93- webView.page().setLinkDelegationPolicy(
94- QtWebKit.QWebPage.DelegateExternalLinks)
95+ webView.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
96+ webView.page().setLinkDelegationPolicy(QWebPage.DelegateExternalLinks)
97 webView.page().mainFrame().setScrollBarPolicy(
98 QtCore.Qt.Horizontal, QtCore.Qt.ScrollBarAlwaysOff)
99 webView.page().mainFrame().setScrollBarPolicy(
100 QtCore.Qt.Vertical, QtCore.Qt.ScrollBarAlwaysOff)
101-
102 webView.load(QtCore.QUrl(slides))
103
104+ self.ui.navigation.hide()
105+ self.ui.install_page.layout().addWidget(webView)
106+ self.ui.pageMode.setCurrentWidget(self.ui.install_page)
107+
108 def set_layout_direction(self, lang=None):
109 if not lang:
110 lang = self.locale

Subscribers

People subscribed via source and target branches

to status/vote changes: