Merge lp:~ilidrissi.amine/software-center/fixing-random-bugs into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 1251
Proposed branch: lp:~ilidrissi.amine/software-center/fixing-random-bugs
Merge into: lp:software-center
Diff against target: 151 lines (+39/-7)
6 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
softwarecenter/apt/apthistory.py (+13/-0)
softwarecenter/view/appdetailsview_gtk.py (+12/-2)
softwarecenter/view/availablepane.py (+3/-3)
softwarecenter/view/historypane.py (+1/-1)
To merge this branch: bzr merge lp:~ilidrissi.amine/software-center/fixing-random-bugs
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+34656@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for this branch.

I noticed that there are two lines like this:

        if self.adjustment_value is not None \
        and self.adjustment_value <= self.get_vadjustment().lower \
        and self.adjustment_value <= self.get_vadjustment().upper:
            self.get_vadjustment().set_value(self.adjustment_value)

but once its (notice that the >= and <= in the second but "<= and <=" in the
first. Is this a accident? I smells like this should be moved into a single
helper function.

        if self.adjustment_value is not None \
        and self.adjustment_value >= self.get_vadjustment().lower \
        and self.adjustment_value <= self.get_vadjustment().upper:
            self.get_vadjustment().set_value(self.adjustment_value)

The second part of the branch with the translation string clarifications is
great, but not quite suitable for 3.0 because we are in string freeze and this
would fuzzy existing translations. I will move it to trunk instead.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-09-11 01:48:19 +0000
3+++ debian/changelog 2010-09-11 14:52:45 +0000
4@@ -1,10 +1,18 @@
5 software-center (2.1.18.2) UNRELEASED; urgency=low
6
7+ [ Gary Lasker ]
8 * softwarecenter/view/widgets/mkit.py:
9 - fix crash during action_bar refresh (LP: #635044)
10 * softwarecenter/backend/channel.py:
11 - always display the partner channel, even if its
12 source is not enabled (LP: #635003)
13+
14+ [ Mohamed Amine IL Idrissi ]
15+ * softwarecenter/apt/apthistory.py: History entries are now sorted by
16+ date (LP: #635198)
17+ * softwarecenter/view/historypane.py: Use 'updated' instead of
18+ 'upgraded' (LP: #635196)
19+ * debian/control: depend on python-launchpadlib (LP: #634324)
20
21 -- Gary Lasker <gary.lasker@canonical.com> Fri, 10 Sep 2010 21:45:05 -0400
22
23
24=== modified file 'debian/control'
25--- debian/control 2010-09-09 16:35:52 +0000
26+++ debian/control 2010-09-11 14:52:45 +0000
27@@ -39,7 +39,8 @@
28 python-gmenu,
29 aptdaemon (>= 0.31),
30 python-lazr.restfulclient,
31- ubuntu-sso-client (>= 0.99.2)
32+ ubuntu-sso-client (>= 0.99.2),
33+ python-launchpadlib
34 Recommends: lsb-release, python-launchpad-integration,
35 apt-xapian-index (>= 0.38ubuntu1), update-notifier,
36 software-properties-gtk, sessioninstaller
37
38=== modified file 'softwarecenter/apt/apthistory.py'
39--- softwarecenter/apt/apthistory.py 2010-09-09 13:18:44 +0000
40+++ softwarecenter/apt/apthistory.py 2010-09-11 14:52:45 +0000
41@@ -73,6 +73,17 @@
42 return count
43 def __repr__(self):
44 return ('<Transaction: start_date:%s install:%s upgrade:%s downgrade:%s remove:%s purge:%s' % (self.start_date, self.install, self.upgrade, self.downgrade, self.remove, self.purge))
45+ def __cmp__(self, other):
46+ date_this = datetime(self.start_date.year, self.start_date.month,
47+ self.start_date.day)
48+ date_other = datetime(other.start_date.year, other.start_date.month,
49+ other.start_date.day)
50+ if date_this < date_other:
51+ return -1
52+ elif date_this == date_other:
53+ return 0
54+ else:
55+ return 1
56
57 class AptHistory(object):
58
59@@ -92,6 +103,8 @@
60 for history_gz_file in glob.glob(self.history_file+".*.gz"):
61 self._scan(history_gz_file)
62 self._scan(self.history_file)
63+ self.transactions.sort()
64+ self.transactions.reverse()
65
66 def _scan(self, history_file, rescan = False):
67 try:
68
69=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
70--- softwarecenter/view/appdetailsview_gtk.py 2010-09-10 00:29:02 +0000
71+++ softwarecenter/view/appdetailsview_gtk.py 2010-09-11 14:52:45 +0000
72@@ -1019,6 +1019,7 @@
73 AppDetailsViewBase.__init__(self, db, distro, icons, cache, history, datadir)
74 gtk.Viewport.__init__(self)
75 self.set_shadow_type(gtk.SHADOW_NONE)
76+ self.adjustment_value = None
77
78 self.section = None
79
80@@ -1152,6 +1153,10 @@
81
82 def _full_redraw_cb(self):
83 self.queue_draw()
84+ if self.adjustment_value is not None \
85+ and self.adjustment_value >= self.get_vadjustment().lower \
86+ and self.adjustment_value <= self.get_vadjustment().upper:
87+ self.get_vadjustment().set_value(self.adjustment_value)
88 return False
89
90 def _full_redraw(self):
91@@ -1170,6 +1175,10 @@
92 # not to notice the temporary visual artefacts. Peace out.
93
94 self.queue_draw()
95+ if self.adjustment_value is not None \
96+ and self.adjustment_value >= self.get_vadjustment().lower \
97+ and self.adjustment_value <= self.get_vadjustment().upper:
98+ self.get_vadjustment().set_value(self.adjustment_value)
99 gobject.idle_add(self._full_redraw_cb)
100 return
101
102@@ -1457,9 +1466,9 @@
103 self.action_bar.button.show()
104 self.addons_bar.button_apply.set_sensitive(True)
105 self.addons_bar.button_cancel.set_sensitive(True)
106-
107 self.addons_bar.configure()
108-
109+ self.adjustment_value = None
110+
111 if self.addons_bar.applying:
112 self.addons_bar.applying = False
113
114@@ -1531,6 +1540,7 @@
115 self.action_bar.progress.set_fraction(progress/100.0)
116 if progress == 100:
117 self.action_bar.progress.set_fraction(1)
118+ self.adjustment_value = self.get_vadjustment().get_value()
119 return
120
121 def _show_prog_idle_cb(self):
122
123=== modified file 'softwarecenter/view/availablepane.py'
124--- softwarecenter/view/availablepane.py 2010-09-07 20:22:26 +0000
125+++ softwarecenter/view/availablepane.py 2010-09-11 14:52:45 +0000
126@@ -396,9 +396,9 @@
127 self.apps_search_term):
128 appstore = self.app_view.get_model()
129 installable = appstore.installable_apps
130- button_text = gettext.ngettext("Install %s Item",
131- "Install %s Items",
132- len(installable)) % len(installable)
133+ button_text = gettext.ngettext("Install %(items_nbr)s Item",
134+ "Install %(items_nbr)s Items",
135+ len(installable)) % {'items_nbr': len(installable)}
136 button = self.action_bar.get_button(self._INSTALL_BTN_ID)
137 if button and installable:
138 # Install all already offered. Update offer.
139
140=== modified file 'softwarecenter/view/historypane.py'
141--- softwarecenter/view/historypane.py 2010-09-01 12:48:19 +0000
142+++ softwarecenter/view/historypane.py 2010-09-11 14:52:45 +0000
143@@ -269,7 +269,7 @@
144 elif action == self.REMOVED:
145 text = _('%s removed %s') % (pkg, when.time().strftime('%X'))
146 elif action == self.UPGRADED:
147- text = _('%s upgraded %s') % (pkg, when.time().strftime('%X'))
148+ text = _('%s updated %s') % (pkg, when.time().strftime('%X'))
149 elif isinstance(when, datetime.date):
150 today = datetime.date.today()
151 monday = today - datetime.timedelta(days=today.weekday())

Subscribers

People subscribed via source and target branches