Merge lp:~chipaca/indicator-ubuntuone/two-small-fixes into lp:~rye/indicator-ubuntuone/indicator-python

Proposed by John Lenton
Status: Merged
Merged at revision: 51
Proposed branch: lp:~chipaca/indicator-ubuntuone/two-small-fixes
Merge into: lp:~rye/indicator-ubuntuone/indicator-python
Diff against target: 33 lines (+7/-2)
1 file modified
ubuntuone-indicator (+7/-2)
To merge this branch: bzr merge lp:~chipaca/indicator-ubuntuone/two-small-fixes
Reviewer Review Type Date Requested Status
Roman Yepishev Pending
Review via email: mp+45516@code.launchpad.net

Description of the change

Two small fixes:
LP:699857 get_content_queue_size breaks if WaitForCondition in the content queue
LP:699853 when over quota, quota display is ugly

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 'ubuntuone-indicator'
2--- ubuntuone-indicator 2010-12-19 23:01:54 +0000
3+++ ubuntuone-indicator 2011-01-07 15:04:12 +0000
4@@ -61,6 +61,7 @@
5 DISCONNECT_LABEL = _('Disconnect')
6 CONNECT_LABEL = _('Connect')
7 FREE_SPACE_LABEL = _('Free space: %(value)s')
8+ OVERAGE_LABEL = _('Over quota by %(value)s')
9 BYTES_UNIT_LABEL = _('bytes')
10 KIBIBYTE_UNIT_LABEL = _('KiB')
11 MEBIBYTE_UNIT_LABEL = _('MiB')
12@@ -376,7 +377,10 @@
13
14 # percentage = (float(used) / float(total)) * 100
15
16- label = self.FREE_SPACE_LABEL % { 'value': format_data(free) }
17+ if free < 0:
18+ label = self.OVERAGE_LABEL % { 'value': format_data(-free) }
19+ else:
20+ label = self.FREE_SPACE_LABEL % { 'value': format_data(free) }
21 self.indicator.set_quota(label)
22
23 def get_content_queue_length(self):
24@@ -390,7 +394,8 @@
25 content_queue = self.client.get_waiting_content()
26 result = 0
27 for item in content_queue:
28- if item['operation'] == 'Download':
29+ # CQ can have Upload, Download and WaitForCondition
30+ if item['operation'] != 'Upload':
31 # Sorry, no idea how to calculate this
32 continue
33 path = item['path']

Subscribers

People subscribed via source and target branches