Merge lp:~mh21/indicator-sysmonitor/fix-743651 into lp:indicator-sysmonitor/trunk

Proposed by Michael Hofmann
Status: Superseded
Proposed branch: lp:~mh21/indicator-sysmonitor/fix-743651
Merge into: lp:indicator-sysmonitor/trunk
Diff against target: 46 lines (+9/-6)
1 file modified
indicator-sysmonitor (+9/-6)
To merge this branch: bzr merge lp:~mh21/indicator-sysmonitor/fix-743651
Reviewer Review Type Date Requested Status
Alex Eftimie Needs Fixing
Review via email: mp+56305@code.launchpad.net

This proposal has been superseded by a proposal from 2011-04-05.

Description of the change

To post a comment you must log in.
Revision history for this message
Alex Eftimie (alexeftimie) wrote :

fix looks great, please update it to the current lp:indicator-sysmonitor.

something like:
 guide = label.format(mem=100, cpu=100) should work with customized label strings.

review: Needs Fixing
5. By Michael Hofmann

Fix shifting of indicators.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'indicator-sysmonitor'
2--- indicator-sysmonitor 2011-03-28 18:52:46 +0000
3+++ indicator-sysmonitor 2011-04-05 10:03:20 +0000
4@@ -68,7 +68,7 @@
5 while(self.parent.alive.isSet()):
6 if self.parent.mode_user:
7 output = self._fetch_user(self.parent.user_command)
8- self.parent.update_text(output)
9+ self.parent.update_text(output, output)
10 else:
11 data = self._fetch()
12 self.parent.update(data)
13@@ -181,7 +181,7 @@
14 self.preferences_dialog = None
15 self.custom_text = 'cpu: {cpu} mem: {mem}'
16 self.user_command = ''
17- self.last_data, self.last_text = {}, ''
18+ self.last_data, self.last_text, self.last_guide = {}, '', ''
19 self.mode_user = False
20 self.interval = 2
21
22@@ -210,18 +210,21 @@
23 def update(self, data):
24 try:
25 label = self.custom_text.format(mem=data['mem'], cpu=data['cpu'])
26+ guide = self.custom_text.format(mem="100%", cpu="100%")
27 except:
28 label = 'Error: ' + self.custom_text
29+ guide = label
30 self.last_data = data
31- self.update_text(label)
32+ self.update_text(label, guide)
33
34- def update_text(self, text):
35+ def update_text(self, text, guide):
36 self.last_text = text
37- self.ind.set_label(text)
38+ self.last_guide = guide
39+ self.ind.set_label(text, guide)
40
41 def force_update(self):
42 if self.mode_user:
43- self.update_text(self.last_text)
44+ self.update_text(self.last_text, self.last_guide)
45 else:
46 self.update(self.last_data)
47

Subscribers

People subscribed via source and target branches

to all changes: