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
=== modified file 'debian/changelog'
--- debian/changelog 2010-08-25 21:33:49 +0000
+++ debian/changelog 2010-08-25 22:35:57 +0000
@@ -1,9 +1,19 @@
1<<<<<<< TREE
1software-center (2.1.12.1) maverick; urgency=low2software-center (2.1.12.1) maverick; urgency=low
23
3 * fix plugin loading4 * fix plugin loading
45
5 -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 25 Aug 2010 23:31:08 +02006 -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 25 Aug 2010 23:31:08 +0200
67
8=======
9software-center (2.1.13) UNRELEASED; urgency=low
10
11 * softwarecenter/view/appdetailsview_gtk.py: Done some tweaking and
12 polishing to the addons view
13
14 -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Wed, 25 Aug 2010 22:32:07 +0000
15
16>>>>>>> MERGE-SOURCE
7software-center (2.1.12) maverick; urgency=low17software-center (2.1.12) maverick; urgency=low
818
9 [ Kiwinote ]19 [ Kiwinote ]
1020
=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
--- softwarecenter/view/appdetailsview_gtk.py 2010-08-25 20:32:53 +0000
+++ softwarecenter/view/appdetailsview_gtk.py 2010-08-25 22:35:57 +0000
@@ -784,6 +784,11 @@
784 gtk.HBox.__init__(self, spacing=mkit.SPACING_LARGE)784 gtk.HBox.__init__(self, spacing=mkit.SPACING_LARGE)
785 self.app_details = AppDetails(db, 785 self.app_details = AppDetails(db,
786 application=Application("None", pkgname))786 application=Application("None", pkgname))
787 self.db = db
788 self.icons = icons
789 self.pkgname = pkgname
790 self.connect("realize", self._on_realize)
791
787 # the checkbutton792 # the checkbutton
788 self.checkbutton = gtk.CheckButton()793 self.checkbutton = gtk.CheckButton()
789 self.checkbutton.connect("toggled", self._on_checkbutton_toggled)794 self.checkbutton.connect("toggled", self._on_checkbutton_toggled)
@@ -792,19 +797,21 @@
792 hbox = gtk.HBox(spacing=mkit.SPACING_MED)797 hbox = gtk.HBox(spacing=mkit.SPACING_MED)
793 image = gtk.Image()798 image = gtk.Image()
794 icon = self.app_details.icon799 icon = self.app_details.icon
795 if not icon or not icons.has_icon(icon):800 if not icon or not self.icons.has_icon(icon):
796 icon = MISSING_APP_ICON801 icon = MISSING_APP_ICON
797 try:802 try:
798 pixbuf = icons.load_icon(icon, 22, ()).scale_simple(22, 22, gtk.gdk.INTERP_BILINEAR)803 pixbuf = self.icons.load_icon(icon, 22, ()).scale_simple(22, 22, gtk.gdk.INTERP_BILINEAR)
799 image.set_from_pixbuf(pixbuf)804 image.set_from_pixbuf(pixbuf)
800 except TypeError:805 except TypeError:
801 logging.warning("cant set icon for '%s' " % pkgname)806 logging.warning("cant set icon for '%s' " % self.pkgname)
802 hbox.pack_start(image, False, False)807 hbox.pack_start(image, False, False)
803 # the display_name808 # the display_name
804 display_name = _("%(summary)s (%(pkgname)s)") % {'summary': self.app_details.display_name.capitalize(),809 summary_label = gtk.Label(_("%(summary)s") % {'summary': self.app_details.display_name.capitalize()})
805 'pkgname': pkgname}810 hbox.pack_start(summary_label, False)
806 label = gtk.Label(display_name)811 # the package name
807 hbox.pack_start(label, False)812 self.pkgname_label = gtk.Label()
813 hbox.pack_start(self.pkgname_label, False)
814
808 # and put it into the the checkbox815 # and put it into the the checkbox
809 self.checkbutton.add(hbox)816 self.checkbutton.add(hbox)
810 # this is the addon_pkgname817 # this is the addon_pkgname
@@ -812,7 +819,11 @@
812 # 'pkgname' : pkgname } )819 # 'pkgname' : pkgname } )
813 #hbox.pack_start(self.addon_pkgname, False)820 #hbox.pack_start(self.addon_pkgname, False)
814 821
815 822 def _on_realize(self, widget):
823 dark = self.style.dark[self.state].to_string()
824 key_markup = '<span color="%s">(%s)</span>'
825 self.pkgname_label.set_markup(key_markup % (dark, self.pkgname))
826
816 def _on_checkbutton_toggled(self, checkbutton):827 def _on_checkbutton_toggled(self, checkbutton):
817 self.emit("toggled")828 self.emit("toggled")
818 def get_active(self):829 def get_active(self):
@@ -842,12 +853,19 @@
842 self.icons = icons853 self.icons = icons
843 self.recommended_addons = None854 self.recommended_addons = None
844 self.suggested_addons = None855 self.suggested_addons = None
856 self.connect("realize", self._on_realize)
845857
846 self.label = gtk.Label(_("<b>Choose add-ons:</b>"))858 self.label = gtk.Label()
847 self.label.set_use_markup(True)859 self.label.set_use_markup(True)
848 self.label.set_alignment(0, 0.5)860 self.label.set_alignment(0, 0.5)
849 self.pack_start(self.label, False, False)861 self.pack_start(self.label, False, False)
850 862
863 def _on_realize(self, widget):
864 markup = _('<b><span color="%s">Add-ons</span></b>')
865 color = self.label.style.dark[self.label.state].to_string()
866 self.label.set_markup(markup % color)
867
868
851 def set_addons(self, app_details, recommended, suggested):869 def set_addons(self, app_details, recommended, suggested):
852 if len(recommended) == 0 and len(suggested) == 0:870 if len(recommended) == 0 and len(suggested) == 0:
853 return871 return
@@ -900,8 +918,8 @@
900 def __init__(self, cache, view):918 def __init__(self, cache, view):
901 gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0)919 gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0)
902 self.set_redraw_on_allocate(False)920 self.set_redraw_on_allocate(False)
903 self.set_padding(mkit.SPACING_LARGE,921 self.set_padding(mkit.SPACING_SMALL,
904 mkit.SPACING_LARGE,922 mkit.SPACING_SMALL,
905 mkit.SPACING_SMALL+2,923 mkit.SPACING_SMALL+2,
906 mkit.SPACING_SMALL)924 mkit.SPACING_SMALL)
907 925
@@ -914,7 +932,7 @@
914 932
915 self.label_price = gtk.Label()933 self.label_price = gtk.Label()
916 self.label_price.set_line_wrap(True)934 self.label_price.set_line_wrap(True)
917 self.hbox.pack_start(self.label_price, False, False)935 self.hbox.pack_start(self.label_price, False)
918 936
919 self.hbuttonbox = gtk.HButtonBox()937 self.hbuttonbox = gtk.HButtonBox()
920 self.hbuttonbox.set_layout(gtk.BUTTONBOX_END)938 self.hbuttonbox.set_layout(gtk.BUTTONBOX_END)
@@ -922,12 +940,12 @@
922 self.button_apply.connect("clicked", self._on_button_apply_clicked)940 self.button_apply.connect("clicked", self._on_button_apply_clicked)
923 self.button_cancel = gtk.Button(_("Cancel"))941 self.button_cancel = gtk.Button(_("Cancel"))
924 self.button_cancel.connect("clicked", self._on_button_cancel_clicked)942 self.button_cancel.connect("clicked", self._on_button_cancel_clicked)
925 self.hbuttonbox.pack_start(self.button_cancel, False)943 self.hbox.pack_end(self.button_apply, False)
926 self.hbuttonbox.pack_start(self.button_apply, False)944 self.hbox.pack_end(self.button_cancel, False)
927 self.hbox.pack_start(self.hbuttonbox)945 #self.hbox.pack_start(self.hbuttonbox, False)
928 946
929 self.fill_color = COLOR_GREEN_FILL947 self.fill_color = view.section_color
930 self.line_color = COLOR_GREEN_OUTLINE948 self.line_color = view.section_color
931 949
932 def configure(self, app_details, addons_install, addons_remove):950 def configure(self, app_details, addons_install, addons_remove):
933 if not addons_install and not addons_remove:951 if not addons_install and not addons_remove:
@@ -943,25 +961,16 @@
943 if mkit.not_overlapping(a, expose_area): return961 if mkit.not_overlapping(a, expose_area): return
944962
945 cr.save()963 cr.save()
946 rr = mkit.ShapeRoundedRectangle()964 r,g,b = self.view.section_color
947 rr.layout(cr,965 cr.rectangle(a)
948 a.x-1, a.y-1,966 cr.set_source_rgba(r,g,b,0.333)
949 a.x+a.width, a.y+a.height,
950 radius=mkit.CORNER_RADIUS)
951
952 cr.set_source_rgb(*mkit.floats_from_string(self.fill_color))
953# cr.set_source_rgb(*mkit.floats_from_string(self.line_color))967# cr.set_source_rgb(*mkit.floats_from_string(self.line_color))
954 cr.fill()968 cr.fill()
955969
956 cr.set_line_width(1)970 cr.set_line_width(1)
957 cr.translate(0.5, 0.5)971 cr.translate(0.5, 0.5)
958972 cr.rectangle(a.x, a.y, a.width-1, a.height-1)
959 rr.layout(cr,973 cr.set_source_rgba(r,g,b,0.5)
960 a.x-1, a.y-1,
961 a.x+a.width, a.y+a.height,
962 radius=mkit.CORNER_RADIUS)
963
964 cr.set_source_rgb(*mkit.floats_from_string(self.line_color))
965 cr.stroke()974 cr.stroke()
966 cr.restore()975 cr.restore()
967 return976 return
@@ -1118,7 +1127,7 @@
1118 1127
1119 if self.addons_bar.get_property('visible'):1128 if self.addons_bar.get_property('visible'):
1120 self.addons_bar.draw(cr,1129 self.addons_bar.draw(cr,
1121 self.addons_bar.hbox.allocation,1130 self.addons_bar.allocation,
1122 event.area)1131 event.area)
11231132
1124 if self.screenshot.get_property('visible'):1133 if self.screenshot.get_property('visible'):
@@ -1718,17 +1727,17 @@
1718 version = pkg.installed1727 version = pkg.installed
1719 if version == None:1728 if version == None:
1720 version = max(pkg.versions)1729 version = max(pkg.versions)
1721 pkgs_to_install.append(version)
1722 deps_inst = self.cache.get_all_deps_installing(pkg)1730 deps_inst = self.cache.get_all_deps_installing(pkg)
1723 for dep in deps_inst:1731 for dep in deps_inst:
1724 if self.cache[dep].installed == None:1732 if self.cache[dep].installed == None:
1725 version = max(self.cache[dep].versions)1733 dep_version = max(self.cache[dep].versions)
1726 pkgs_to_install.append(version)1734 pkgs_to_install.append(dep_version)
1727 deps_remove = self.cache.get_all_deps_removing(pkg)1735 deps_remove = self.cache.get_all_deps_removing(pkg)
1728 for dep in deps_remove:1736 for dep in deps_remove:
1729 if self.cache[dep].installed != None:1737 if self.cache[dep].installed != None:
1730 version = self.cache[dep].installed1738 dep_version = self.cache[dep].installed
1731 pkgs_to_remove.append(version)1739 pkgs_to_remove.append(dep_version)
1740 pkgs_to_install.append(version)
1732 1741
1733 for addon in self.addons_install:1742 for addon in self.addons_install:
1734 version = max(self.cache[addon].versions)1743 version = max(self.cache[addon].versions)
@@ -1776,7 +1785,10 @@
1776 label_string += _("%sB to download, " % (download_size))1785 label_string += _("%sB to download, " % (download_size))
1777 if total_install_size > 0:1786 if total_install_size > 0:
1778 install_size = apt_pkg.size_to_str(total_install_size)1787 install_size = apt_pkg.size_to_str(total_install_size)
1779 label_string += _("%sB when installed" % (install_size))1788 if self.app_details.pkg_state == PKG_STATE_INSTALLED:
1789 label_string += _("%sB on disk" % (install_size))
1790 else:
1791 label_string += _("%sB when installed" % (install_size))
1780 elif total_install_size < 0:1792 elif total_install_size < 0:
1781 remove_size = apt_pkg.size_to_str(-total_install_size)1793 remove_size = apt_pkg.size_to_str(-total_install_size)
1782 label_string += _("%sB to be freed" % (remove_size))1794 label_string += _("%sB to be freed" % (remove_size))

Subscribers

People subscribed via source and target branches