Merge lp:~ilidrissi.amine/software-center/addons-tweaking into lp:software-center

Proposed by Mohamed Amine Ilidrissi
Status: Merged
Merged at revision: 1057
Proposed branch: lp:~ilidrissi.amine/software-center/addons-tweaking
Merge into: lp:software-center
Diff against target: 215 lines (+60/-38) (has conflicts)
2 files modified
debian/changelog (+10/-0)
softwarecenter/view/appdetailsview_gtk.py (+50/-38)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~ilidrissi.amine/software-center/addons-tweaking
Reviewer Review Type Date Requested Status
Matthew Paul Thomas design Approve
Review via email: mp+33706@code.launchpad.net

Description of the change

This is just some tweaking and polishing that mpt requested.

To post a comment you must log in.
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Greatly improves the appearance of add-ons. Thanks!

review: Approve (design)

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-08-25 21:33:49 +0000
3+++ debian/changelog 2010-08-25 22:35:57 +0000
4@@ -1,9 +1,19 @@
5+<<<<<<< TREE
6 software-center (2.1.12.1) maverick; urgency=low
7
8 * fix plugin loading
9
10 -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 25 Aug 2010 23:31:08 +0200
11
12+=======
13+software-center (2.1.13) UNRELEASED; urgency=low
14+
15+ * softwarecenter/view/appdetailsview_gtk.py: Done some tweaking and
16+ polishing to the addons view
17+
18+ -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Wed, 25 Aug 2010 22:32:07 +0000
19+
20+>>>>>>> MERGE-SOURCE
21 software-center (2.1.12) maverick; urgency=low
22
23 [ Kiwinote ]
24
25=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
26--- softwarecenter/view/appdetailsview_gtk.py 2010-08-25 20:32:53 +0000
27+++ softwarecenter/view/appdetailsview_gtk.py 2010-08-25 22:35:57 +0000
28@@ -784,6 +784,11 @@
29 gtk.HBox.__init__(self, spacing=mkit.SPACING_LARGE)
30 self.app_details = AppDetails(db,
31 application=Application("None", pkgname))
32+ self.db = db
33+ self.icons = icons
34+ self.pkgname = pkgname
35+ self.connect("realize", self._on_realize)
36+
37 # the checkbutton
38 self.checkbutton = gtk.CheckButton()
39 self.checkbutton.connect("toggled", self._on_checkbutton_toggled)
40@@ -792,19 +797,21 @@
41 hbox = gtk.HBox(spacing=mkit.SPACING_MED)
42 image = gtk.Image()
43 icon = self.app_details.icon
44- if not icon or not icons.has_icon(icon):
45+ if not icon or not self.icons.has_icon(icon):
46 icon = MISSING_APP_ICON
47 try:
48- pixbuf = icons.load_icon(icon, 22, ()).scale_simple(22, 22, gtk.gdk.INTERP_BILINEAR)
49+ pixbuf = self.icons.load_icon(icon, 22, ()).scale_simple(22, 22, gtk.gdk.INTERP_BILINEAR)
50 image.set_from_pixbuf(pixbuf)
51 except TypeError:
52- logging.warning("cant set icon for '%s' " % pkgname)
53+ logging.warning("cant set icon for '%s' " % self.pkgname)
54 hbox.pack_start(image, False, False)
55 # the display_name
56- display_name = _("%(summary)s (%(pkgname)s)") % {'summary': self.app_details.display_name.capitalize(),
57- 'pkgname': pkgname}
58- label = gtk.Label(display_name)
59- hbox.pack_start(label, False)
60+ summary_label = gtk.Label(_("%(summary)s") % {'summary': self.app_details.display_name.capitalize()})
61+ hbox.pack_start(summary_label, False)
62+ # the package name
63+ self.pkgname_label = gtk.Label()
64+ hbox.pack_start(self.pkgname_label, False)
65+
66 # and put it into the the checkbox
67 self.checkbutton.add(hbox)
68 # this is the addon_pkgname
69@@ -812,7 +819,11 @@
70 # 'pkgname' : pkgname } )
71 #hbox.pack_start(self.addon_pkgname, False)
72
73-
74+ def _on_realize(self, widget):
75+ dark = self.style.dark[self.state].to_string()
76+ key_markup = '<span color="%s">(%s)</span>'
77+ self.pkgname_label.set_markup(key_markup % (dark, self.pkgname))
78+
79 def _on_checkbutton_toggled(self, checkbutton):
80 self.emit("toggled")
81 def get_active(self):
82@@ -842,12 +853,19 @@
83 self.icons = icons
84 self.recommended_addons = None
85 self.suggested_addons = None
86+ self.connect("realize", self._on_realize)
87
88- self.label = gtk.Label(_("<b>Choose add-ons:</b>"))
89+ self.label = gtk.Label()
90 self.label.set_use_markup(True)
91 self.label.set_alignment(0, 0.5)
92 self.pack_start(self.label, False, False)
93
94+ def _on_realize(self, widget):
95+ markup = _('<b><span color="%s">Add-ons</span></b>')
96+ color = self.label.style.dark[self.label.state].to_string()
97+ self.label.set_markup(markup % color)
98+
99+
100 def set_addons(self, app_details, recommended, suggested):
101 if len(recommended) == 0 and len(suggested) == 0:
102 return
103@@ -900,8 +918,8 @@
104 def __init__(self, cache, view):
105 gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0)
106 self.set_redraw_on_allocate(False)
107- self.set_padding(mkit.SPACING_LARGE,
108- mkit.SPACING_LARGE,
109+ self.set_padding(mkit.SPACING_SMALL,
110+ mkit.SPACING_SMALL,
111 mkit.SPACING_SMALL+2,
112 mkit.SPACING_SMALL)
113
114@@ -914,7 +932,7 @@
115
116 self.label_price = gtk.Label()
117 self.label_price.set_line_wrap(True)
118- self.hbox.pack_start(self.label_price, False, False)
119+ self.hbox.pack_start(self.label_price, False)
120
121 self.hbuttonbox = gtk.HButtonBox()
122 self.hbuttonbox.set_layout(gtk.BUTTONBOX_END)
123@@ -922,12 +940,12 @@
124 self.button_apply.connect("clicked", self._on_button_apply_clicked)
125 self.button_cancel = gtk.Button(_("Cancel"))
126 self.button_cancel.connect("clicked", self._on_button_cancel_clicked)
127- self.hbuttonbox.pack_start(self.button_cancel, False)
128- self.hbuttonbox.pack_start(self.button_apply, False)
129- self.hbox.pack_start(self.hbuttonbox)
130+ self.hbox.pack_end(self.button_apply, False)
131+ self.hbox.pack_end(self.button_cancel, False)
132+ #self.hbox.pack_start(self.hbuttonbox, False)
133
134- self.fill_color = COLOR_GREEN_FILL
135- self.line_color = COLOR_GREEN_OUTLINE
136+ self.fill_color = view.section_color
137+ self.line_color = view.section_color
138
139 def configure(self, app_details, addons_install, addons_remove):
140 if not addons_install and not addons_remove:
141@@ -943,25 +961,16 @@
142 if mkit.not_overlapping(a, expose_area): return
143
144 cr.save()
145- rr = mkit.ShapeRoundedRectangle()
146- rr.layout(cr,
147- a.x-1, a.y-1,
148- a.x+a.width, a.y+a.height,
149- radius=mkit.CORNER_RADIUS)
150-
151- cr.set_source_rgb(*mkit.floats_from_string(self.fill_color))
152+ r,g,b = self.view.section_color
153+ cr.rectangle(a)
154+ cr.set_source_rgba(r,g,b,0.333)
155 # cr.set_source_rgb(*mkit.floats_from_string(self.line_color))
156 cr.fill()
157
158 cr.set_line_width(1)
159 cr.translate(0.5, 0.5)
160-
161- rr.layout(cr,
162- a.x-1, a.y-1,
163- a.x+a.width, a.y+a.height,
164- radius=mkit.CORNER_RADIUS)
165-
166- cr.set_source_rgb(*mkit.floats_from_string(self.line_color))
167+ cr.rectangle(a.x, a.y, a.width-1, a.height-1)
168+ cr.set_source_rgba(r,g,b,0.5)
169 cr.stroke()
170 cr.restore()
171 return
172@@ -1118,7 +1127,7 @@
173
174 if self.addons_bar.get_property('visible'):
175 self.addons_bar.draw(cr,
176- self.addons_bar.hbox.allocation,
177+ self.addons_bar.allocation,
178 event.area)
179
180 if self.screenshot.get_property('visible'):
181@@ -1718,17 +1727,17 @@
182 version = pkg.installed
183 if version == None:
184 version = max(pkg.versions)
185- pkgs_to_install.append(version)
186 deps_inst = self.cache.get_all_deps_installing(pkg)
187 for dep in deps_inst:
188 if self.cache[dep].installed == None:
189- version = max(self.cache[dep].versions)
190- pkgs_to_install.append(version)
191+ dep_version = max(self.cache[dep].versions)
192+ pkgs_to_install.append(dep_version)
193 deps_remove = self.cache.get_all_deps_removing(pkg)
194 for dep in deps_remove:
195 if self.cache[dep].installed != None:
196- version = self.cache[dep].installed
197- pkgs_to_remove.append(version)
198+ dep_version = self.cache[dep].installed
199+ pkgs_to_remove.append(dep_version)
200+ pkgs_to_install.append(version)
201
202 for addon in self.addons_install:
203 version = max(self.cache[addon].versions)
204@@ -1776,7 +1785,10 @@
205 label_string += _("%sB to download, " % (download_size))
206 if total_install_size > 0:
207 install_size = apt_pkg.size_to_str(total_install_size)
208- label_string += _("%sB when installed" % (install_size))
209+ if self.app_details.pkg_state == PKG_STATE_INSTALLED:
210+ label_string += _("%sB on disk" % (install_size))
211+ else:
212+ label_string += _("%sB when installed" % (install_size))
213 elif total_install_size < 0:
214 remove_size = apt_pkg.size_to_str(-total_install_size)
215 label_string += _("%sB to be freed" % (remove_size))

Subscribers

People subscribed via source and target branches