Merge lp:~ralsina/ubuntuone-control-panel/keanu-in-a-bus into lp:ubuntuone-control-panel

Proposed by Roberto Alsina on 2012-08-27
Status: Merged
Approved by: Brian Curtin on 2012-08-27
Approved revision: 354
Merged at revision: 351
Proposed branch: lp:~ralsina/ubuntuone-control-panel/keanu-in-a-bus
Merge into: lp:ubuntuone-control-panel
Diff against target: 41 lines (+12/-4)
2 files modified
ubuntuone/controlpanel/gui/qt/preferences.py (+4/-2)
ubuntuone/controlpanel/gui/qt/tests/test_preferences.py (+8/-2)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/keanu-in-a-bus
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve on 2012-08-27
Diego Sarmentero (community) 2012-08-27 Approve on 2012-08-27
Review via email: mp+121475@code.launchpad.net

Commit Message

- Fixed saving/restoring the speed throttling (Fixes LP:1040899)

Description of the Change

To test, try the procedure described in the bug, on any platform:

1) Go to the settings tab
2) Select the check box for "Limit upload speed" and Apply
3) Change to the Folders tab then change back to the Settings tab, note that the setting is remembered
4) Now uncheck the box for "Limit upload speed" and Apply
5) Change to the Folders tab then change back to the Settings tab, note that the setting is NOT remembered

Now it should work correctly.

To post a comment you must log in.
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/preferences.py'
2--- ubuntuone/controlpanel/gui/qt/preferences.py 2012-05-15 18:43:52 +0000
3+++ ubuntuone/controlpanel/gui/qt/preferences.py 2012-08-27 19:06:24 +0000
4@@ -121,12 +121,14 @@
5 notifications = self.ui.show_all_notifications_checkbox.checkState()
6 share_autosubscribe = self.ui.share_autosubscribe_checkbox.checkState()
7 udf_autosubscribe = self.ui.udf_autosubscribe_checkbox.checkState()
8- download_speed = self.ui.download_speed_spinbox.value() * KILOBYTES
9 if self.ui.limit_uploads_checkbox.checkState() == UNCHECKED:
10 upload_speed = -1
11- upload_speed = self.ui.upload_speed_spinbox.value() * KILOBYTES
12+ else:
13+ upload_speed = self.ui.upload_speed_spinbox.value() * KILOBYTES
14 if self.ui.limit_downloads_checkbox.checkState() == UNCHECKED:
15 download_speed = -1
16+ else:
17+ download_speed = self.ui.download_speed_spinbox.value() * KILOBYTES
18
19 settings = {
20 backend.AUTOCONNECT_KEY: autoconnect == CHECKED,
21
22=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_preferences.py'
23--- ubuntuone/controlpanel/gui/qt/tests/test_preferences.py 2012-05-15 18:43:52 +0000
24+++ ubuntuone/controlpanel/gui/qt/tests/test_preferences.py 2012-08-27 19:06:24 +0000
25@@ -47,8 +47,14 @@
26 notifs = self.ui.ui.show_all_notifications_checkbox.checkState()
27 share_auto = self.ui.ui.share_autosubscribe_checkbox.checkState()
28 udf_auto = self.ui.ui.udf_autosubscribe_checkbox.checkState()
29- download_speed = self.ui.ui.download_speed_spinbox.value()
30- upload_speed = self.ui.ui.upload_speed_spinbox.value()
31+ if self.ui.ui.limit_downloads_checkbox.checkState() == gui.CHECKED:
32+ download_speed = self.ui.ui.download_speed_spinbox.value()
33+ else:
34+ download_speed = -1
35+ if self.ui.ui.limit_uploads_checkbox.checkState() == gui.CHECKED:
36+ upload_speed = self.ui.ui.upload_speed_spinbox.value()
37+ else:
38+ upload_speed = -1
39
40 result = {
41 gui.backend.AUTOCONNECT_KEY: autoconnect == gui.CHECKED,

Subscribers

People subscribed via source and target branches