Merge lp:~diegosarmentero/ubuntuone-windows-installer/successful-page into lp:ubuntuone-windows-installer

Proposed by Diego Sarmentero
Status: Superseded
Proposed branch: lp:~diegosarmentero/ubuntuone-windows-installer/successful-page
Merge into: lp:ubuntuone-windows-installer
Diff against target: 110 lines (+32/-2)
3 files modified
ubuntuone_installer/gui/qt/gui.py (+9/-1)
ubuntuone_installer/gui/qt/main/windows.py (+2/-1)
ubuntuone_installer/gui/qt/tests/test_gui.py (+21/-0)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-windows-installer/successful-page
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+79854@code.launchpad.net

This proposal has been superseded by a proposal from 2011-10-19.

Commit message

Fixed: Process finished successfully (LP: #859743).

Description of the change

Fixed: Process finished successfully (LP: #859743).

To post a comment you must log in.
86. By Diego Sarmentero

Fixed tests

87. By Diego Sarmentero

merge

88. By Diego Sarmentero

Conflicts resolved

89. By Diego Sarmentero

merge

90. By Diego Sarmentero

merge

91. By Diego Sarmentero

Fixed lint issues

92. By Diego Sarmentero

merge

93. By Diego Sarmentero

Removed changes from network-detect branch

94. By Diego Sarmentero

Tests improved.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone_installer/gui/qt/gui.py'
2--- ubuntuone_installer/gui/qt/gui.py 2011-10-17 15:11:02 +0000
3+++ ubuntuone_installer/gui/qt/gui.py 2011-10-19 17:23:35 +0000
4@@ -56,6 +56,10 @@
5 TC_URL,
6 )
7
8+# Module used to include the resources into this file
9+# pylint: disable=W0611
10+from ubuntuone_installer.gui.qt.ui import images_rc
11+# pylint: enable=W0611
12 from ubuntuone_installer.logger import setup_logging
13 from ubuntuone_installer.gui.qt.ui import (
14 choose_sign_in_ui,
15@@ -84,6 +88,7 @@
16 CREDENTIALS_ERROR = _('Application will close.\n\n%r')
17 SKIP_TOUR = _("Skip tour, go to Dashboard")
18 START_SETUP = _("Start setup")
19+SUCCESSFUL_LOGIN = _("Login successful")
20 UPDATE_TITLE = _("Updates are available")
21 UPDATE_SOFTWARE = _("There is a new version available. "
22 "Do you want perform an upgrade?")
23@@ -213,9 +218,12 @@
24
25 def __init__(self, parent=None):
26 super(SuccessPage, self).__init__(
27- Ui_SuccessPage(), SuccessController(), parent)
28+ Ui_SuccessPage(),
29+ SuccessController(title=SUCCESSFUL_LOGIN), parent)
30 self.finish_button = None
31 self.next_button = None
32+ self.ui.image_label.setPixmap(
33+ QtGui.QPixmap(':/win_installer_graphic.png'))
34
35 def initializePage(self):
36 """Setup UI details."""
37
38=== modified file 'ubuntuone_installer/gui/qt/main/windows.py'
39--- ubuntuone_installer/gui/qt/main/windows.py 2011-09-29 13:26:44 +0000
40+++ ubuntuone_installer/gui/qt/main/windows.py 2011-10-19 17:23:35 +0000
41@@ -29,7 +29,6 @@
42 # pylint: disable=W0611
43 from ubuntuone_installer.gui.qt.ui import images_rc
44 # pylint: enable=W0611
45-from ubuntuone_installer.gui.qt import utils
46
47
48 def stop(*args):
49@@ -48,6 +47,7 @@
50 @defer.inlineCallbacks
51 def success_cb(creds, gui, installing, logger):
52 """Handle credentials success."""
53+ from ubuntuone_installer.gui.qt import utils
54 logger.debug('Got back from sso.')
55 if creds: # Have credentials already
56 logger.debug('Already got credentials.')
57@@ -89,6 +89,7 @@
58 @defer.inlineCallbacks
59 def check_updates(gui, logger):
60 """Check for updates."""
61+ from ubuntuone_installer.gui.qt import utils
62 logger.info('Checking for updates.')
63 # the idea is simple, check if there are updates, ask user if we perform
64 # the update and continue.
65
66=== modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py'
67--- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-10-13 10:30:25 +0000
68+++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-10-19 17:23:35 +0000
69@@ -24,6 +24,10 @@
70 from ubuntuone.platform.credentials import APP_NAME
71 from twisted.internet import defer
72
73+# Module used to include the resources into this file
74+# pylint: disable=W0611
75+from ubuntuone_installer.gui.qt.ui import images_rc
76+# pylint: enable=W0611
77 from ubuntuone_installer.gui import NEXT
78 from ubuntuone_installer.gui.qt import gui, forgotten, utils
79 from ubuntuone_installer.gui.qt.tests import (
80@@ -654,6 +658,21 @@
81
82 class_ui = gui.SuccessPage
83
84+ def get_pixmap_data(self, pixmap):
85+ """Get the raw data of a QPixmap."""
86+ byte_array = QtCore.QByteArray()
87+ array_buffer = QtCore.QBuffer(byte_array)
88+ pixmap.save(array_buffer, "PNG")
89+ return byte_array
90+
91+ # pylint: disable=C0103
92+ def assertEqualPixmaps(self, pixmap1, pixmap2):
93+ """Compare two Qt pixmaps."""
94+ d1 = self.get_pixmap_data(pixmap1)
95+ d2 = self.get_pixmap_data(pixmap2)
96+ self.assertEqual(d1, d2)
97+ # pylint: enable=C0103
98+
99 def test_after_initialize(self):
100 """Check the page is initialized correctly."""
101 wizard = FakeMainWindow()
102@@ -672,6 +691,8 @@
103 QtGui.QWizard.NextButton])
104 self.assertTrue(self.ui.next_button.isDefault())
105 self.assertFalse(self.ui.finish_button.isDefault())
106+ self.assertEqualPixmaps(self.ui.ui.image_label.pixmap(),
107+ QtGui.QPixmap(':/win_installer_graphic.png'))
108
109
110 class SignInPageTestCase(BaseTestCase):

Subscribers

People subscribed via source and target branches