Merge lp:~ilidrissi.amine/software-center/addons-tweaking into lp:software-center
- addons-tweaking
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthew Paul Thomas | design | Approve | |
Review via email: mp+33706@code.launchpad.net |
Commit message
Description of the change
This is just some tweaking and polishing that mpt requested.
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 '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 | 1 | <<<<<<< TREE | ||
6 | 1 | software-center (2.1.12.1) maverick; urgency=low | 2 | software-center (2.1.12.1) maverick; urgency=low |
7 | 2 | 3 | ||
8 | 3 | * fix plugin loading | 4 | * fix plugin loading |
9 | 4 | 5 | ||
10 | 5 | -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 25 Aug 2010 23:31:08 +0200 | 6 | -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 25 Aug 2010 23:31:08 +0200 |
11 | 6 | 7 | ||
12 | 8 | ======= | ||
13 | 9 | software-center (2.1.13) UNRELEASED; urgency=low | ||
14 | 10 | |||
15 | 11 | * softwarecenter/view/appdetailsview_gtk.py: Done some tweaking and | ||
16 | 12 | polishing to the addons view | ||
17 | 13 | |||
18 | 14 | -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Wed, 25 Aug 2010 22:32:07 +0000 | ||
19 | 15 | |||
20 | 16 | >>>>>>> MERGE-SOURCE | ||
21 | 7 | software-center (2.1.12) maverick; urgency=low | 17 | software-center (2.1.12) maverick; urgency=low |
22 | 8 | 18 | ||
23 | 9 | [ Kiwinote ] | 19 | [ Kiwinote ] |
24 | 10 | 20 | ||
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 | 784 | gtk.HBox.__init__(self, spacing=mkit.SPACING_LARGE) | 784 | gtk.HBox.__init__(self, spacing=mkit.SPACING_LARGE) |
30 | 785 | self.app_details = AppDetails(db, | 785 | self.app_details = AppDetails(db, |
31 | 786 | application=Application("None", pkgname)) | 786 | application=Application("None", pkgname)) |
32 | 787 | self.db = db | ||
33 | 788 | self.icons = icons | ||
34 | 789 | self.pkgname = pkgname | ||
35 | 790 | self.connect("realize", self._on_realize) | ||
36 | 791 | |||
37 | 787 | # the checkbutton | 792 | # the checkbutton |
38 | 788 | self.checkbutton = gtk.CheckButton() | 793 | self.checkbutton = gtk.CheckButton() |
39 | 789 | self.checkbutton.connect("toggled", self._on_checkbutton_toggled) | 794 | self.checkbutton.connect("toggled", self._on_checkbutton_toggled) |
40 | @@ -792,19 +797,21 @@ | |||
41 | 792 | hbox = gtk.HBox(spacing=mkit.SPACING_MED) | 797 | hbox = gtk.HBox(spacing=mkit.SPACING_MED) |
42 | 793 | image = gtk.Image() | 798 | image = gtk.Image() |
43 | 794 | icon = self.app_details.icon | 799 | icon = self.app_details.icon |
45 | 795 | if not icon or not icons.has_icon(icon): | 800 | if not icon or not self.icons.has_icon(icon): |
46 | 796 | icon = MISSING_APP_ICON | 801 | icon = MISSING_APP_ICON |
47 | 797 | try: | 802 | try: |
49 | 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) |
50 | 799 | image.set_from_pixbuf(pixbuf) | 804 | image.set_from_pixbuf(pixbuf) |
51 | 800 | except TypeError: | 805 | except TypeError: |
53 | 801 | logging.warning("cant set icon for '%s' " % pkgname) | 806 | logging.warning("cant set icon for '%s' " % self.pkgname) |
54 | 802 | hbox.pack_start(image, False, False) | 807 | hbox.pack_start(image, False, False) |
55 | 803 | # the display_name | 808 | # the display_name |
60 | 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()}) |
61 | 805 | 'pkgname': pkgname} | 810 | hbox.pack_start(summary_label, False) |
62 | 806 | label = gtk.Label(display_name) | 811 | # the package name |
63 | 807 | hbox.pack_start(label, False) | 812 | self.pkgname_label = gtk.Label() |
64 | 813 | hbox.pack_start(self.pkgname_label, False) | ||
65 | 814 | |||
66 | 808 | # and put it into the the checkbox | 815 | # and put it into the the checkbox |
67 | 809 | self.checkbutton.add(hbox) | 816 | self.checkbutton.add(hbox) |
68 | 810 | # this is the addon_pkgname | 817 | # this is the addon_pkgname |
69 | @@ -812,7 +819,11 @@ | |||
70 | 812 | # 'pkgname' : pkgname } ) | 819 | # 'pkgname' : pkgname } ) |
71 | 813 | #hbox.pack_start(self.addon_pkgname, False) | 820 | #hbox.pack_start(self.addon_pkgname, False) |
72 | 814 | 821 | ||
74 | 815 | 822 | def _on_realize(self, widget): | |
75 | 823 | dark = self.style.dark[self.state].to_string() | ||
76 | 824 | key_markup = '<span color="%s">(%s)</span>' | ||
77 | 825 | self.pkgname_label.set_markup(key_markup % (dark, self.pkgname)) | ||
78 | 826 | |||
79 | 816 | def _on_checkbutton_toggled(self, checkbutton): | 827 | def _on_checkbutton_toggled(self, checkbutton): |
80 | 817 | self.emit("toggled") | 828 | self.emit("toggled") |
81 | 818 | def get_active(self): | 829 | def get_active(self): |
82 | @@ -842,12 +853,19 @@ | |||
83 | 842 | self.icons = icons | 853 | self.icons = icons |
84 | 843 | self.recommended_addons = None | 854 | self.recommended_addons = None |
85 | 844 | self.suggested_addons = None | 855 | self.suggested_addons = None |
86 | 856 | self.connect("realize", self._on_realize) | ||
87 | 845 | 857 | ||
89 | 846 | self.label = gtk.Label(_("<b>Choose add-ons:</b>")) | 858 | self.label = gtk.Label() |
90 | 847 | self.label.set_use_markup(True) | 859 | self.label.set_use_markup(True) |
91 | 848 | self.label.set_alignment(0, 0.5) | 860 | self.label.set_alignment(0, 0.5) |
92 | 849 | self.pack_start(self.label, False, False) | 861 | self.pack_start(self.label, False, False) |
93 | 850 | 862 | ||
94 | 863 | def _on_realize(self, widget): | ||
95 | 864 | markup = _('<b><span color="%s">Add-ons</span></b>') | ||
96 | 865 | color = self.label.style.dark[self.label.state].to_string() | ||
97 | 866 | self.label.set_markup(markup % color) | ||
98 | 867 | |||
99 | 868 | |||
100 | 851 | def set_addons(self, app_details, recommended, suggested): | 869 | def set_addons(self, app_details, recommended, suggested): |
101 | 852 | if len(recommended) == 0 and len(suggested) == 0: | 870 | if len(recommended) == 0 and len(suggested) == 0: |
102 | 853 | return | 871 | return |
103 | @@ -900,8 +918,8 @@ | |||
104 | 900 | def __init__(self, cache, view): | 918 | def __init__(self, cache, view): |
105 | 901 | gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0) | 919 | gtk.Alignment.__init__(self, xscale=1.0, yscale=1.0) |
106 | 902 | self.set_redraw_on_allocate(False) | 920 | self.set_redraw_on_allocate(False) |
109 | 903 | self.set_padding(mkit.SPACING_LARGE, | 921 | self.set_padding(mkit.SPACING_SMALL, |
110 | 904 | mkit.SPACING_LARGE, | 922 | mkit.SPACING_SMALL, |
111 | 905 | mkit.SPACING_SMALL+2, | 923 | mkit.SPACING_SMALL+2, |
112 | 906 | mkit.SPACING_SMALL) | 924 | mkit.SPACING_SMALL) |
113 | 907 | 925 | ||
114 | @@ -914,7 +932,7 @@ | |||
115 | 914 | 932 | ||
116 | 915 | self.label_price = gtk.Label() | 933 | self.label_price = gtk.Label() |
117 | 916 | self.label_price.set_line_wrap(True) | 934 | self.label_price.set_line_wrap(True) |
119 | 917 | self.hbox.pack_start(self.label_price, False, False) | 935 | self.hbox.pack_start(self.label_price, False) |
120 | 918 | 936 | ||
121 | 919 | self.hbuttonbox = gtk.HButtonBox() | 937 | self.hbuttonbox = gtk.HButtonBox() |
122 | 920 | self.hbuttonbox.set_layout(gtk.BUTTONBOX_END) | 938 | self.hbuttonbox.set_layout(gtk.BUTTONBOX_END) |
123 | @@ -922,12 +940,12 @@ | |||
124 | 922 | self.button_apply.connect("clicked", self._on_button_apply_clicked) | 940 | self.button_apply.connect("clicked", self._on_button_apply_clicked) |
125 | 923 | self.button_cancel = gtk.Button(_("Cancel")) | 941 | self.button_cancel = gtk.Button(_("Cancel")) |
126 | 924 | self.button_cancel.connect("clicked", self._on_button_cancel_clicked) | 942 | self.button_cancel.connect("clicked", self._on_button_cancel_clicked) |
130 | 925 | self.hbuttonbox.pack_start(self.button_cancel, False) | 943 | self.hbox.pack_end(self.button_apply, False) |
131 | 926 | self.hbuttonbox.pack_start(self.button_apply, False) | 944 | self.hbox.pack_end(self.button_cancel, False) |
132 | 927 | self.hbox.pack_start(self.hbuttonbox) | 945 | #self.hbox.pack_start(self.hbuttonbox, False) |
133 | 928 | 946 | ||
136 | 929 | self.fill_color = COLOR_GREEN_FILL | 947 | self.fill_color = view.section_color |
137 | 930 | self.line_color = COLOR_GREEN_OUTLINE | 948 | self.line_color = view.section_color |
138 | 931 | 949 | ||
139 | 932 | def configure(self, app_details, addons_install, addons_remove): | 950 | def configure(self, app_details, addons_install, addons_remove): |
140 | 933 | if not addons_install and not addons_remove: | 951 | if not addons_install and not addons_remove: |
141 | @@ -943,25 +961,16 @@ | |||
142 | 943 | if mkit.not_overlapping(a, expose_area): return | 961 | if mkit.not_overlapping(a, expose_area): return |
143 | 944 | 962 | ||
144 | 945 | cr.save() | 963 | cr.save() |
152 | 946 | rr = mkit.ShapeRoundedRectangle() | 964 | r,g,b = self.view.section_color |
153 | 947 | rr.layout(cr, | 965 | cr.rectangle(a) |
154 | 948 | a.x-1, a.y-1, | 966 | cr.set_source_rgba(r,g,b,0.333) |
148 | 949 | a.x+a.width, a.y+a.height, | ||
149 | 950 | radius=mkit.CORNER_RADIUS) | ||
150 | 951 | |||
151 | 952 | cr.set_source_rgb(*mkit.floats_from_string(self.fill_color)) | ||
155 | 953 | # cr.set_source_rgb(*mkit.floats_from_string(self.line_color)) | 967 | # cr.set_source_rgb(*mkit.floats_from_string(self.line_color)) |
156 | 954 | cr.fill() | 968 | cr.fill() |
157 | 955 | 969 | ||
158 | 956 | cr.set_line_width(1) | 970 | cr.set_line_width(1) |
159 | 957 | cr.translate(0.5, 0.5) | 971 | cr.translate(0.5, 0.5) |
167 | 958 | 972 | cr.rectangle(a.x, a.y, a.width-1, a.height-1) | |
168 | 959 | rr.layout(cr, | 973 | cr.set_source_rgba(r,g,b,0.5) |
162 | 960 | a.x-1, a.y-1, | ||
163 | 961 | a.x+a.width, a.y+a.height, | ||
164 | 962 | radius=mkit.CORNER_RADIUS) | ||
165 | 963 | |||
166 | 964 | cr.set_source_rgb(*mkit.floats_from_string(self.line_color)) | ||
169 | 965 | cr.stroke() | 974 | cr.stroke() |
170 | 966 | cr.restore() | 975 | cr.restore() |
171 | 967 | return | 976 | return |
172 | @@ -1118,7 +1127,7 @@ | |||
173 | 1118 | 1127 | ||
174 | 1119 | if self.addons_bar.get_property('visible'): | 1128 | if self.addons_bar.get_property('visible'): |
175 | 1120 | self.addons_bar.draw(cr, | 1129 | self.addons_bar.draw(cr, |
177 | 1121 | self.addons_bar.hbox.allocation, | 1130 | self.addons_bar.allocation, |
178 | 1122 | event.area) | 1131 | event.area) |
179 | 1123 | 1132 | ||
180 | 1124 | if self.screenshot.get_property('visible'): | 1133 | if self.screenshot.get_property('visible'): |
181 | @@ -1718,17 +1727,17 @@ | |||
182 | 1718 | version = pkg.installed | 1727 | version = pkg.installed |
183 | 1719 | if version == None: | 1728 | if version == None: |
184 | 1720 | version = max(pkg.versions) | 1729 | version = max(pkg.versions) |
185 | 1721 | pkgs_to_install.append(version) | ||
186 | 1722 | deps_inst = self.cache.get_all_deps_installing(pkg) | 1730 | deps_inst = self.cache.get_all_deps_installing(pkg) |
187 | 1723 | for dep in deps_inst: | 1731 | for dep in deps_inst: |
188 | 1724 | if self.cache[dep].installed == None: | 1732 | if self.cache[dep].installed == None: |
191 | 1725 | version = max(self.cache[dep].versions) | 1733 | dep_version = max(self.cache[dep].versions) |
192 | 1726 | pkgs_to_install.append(version) | 1734 | pkgs_to_install.append(dep_version) |
193 | 1727 | deps_remove = self.cache.get_all_deps_removing(pkg) | 1735 | deps_remove = self.cache.get_all_deps_removing(pkg) |
194 | 1728 | for dep in deps_remove: | 1736 | for dep in deps_remove: |
195 | 1729 | if self.cache[dep].installed != None: | 1737 | if self.cache[dep].installed != None: |
198 | 1730 | version = self.cache[dep].installed | 1738 | dep_version = self.cache[dep].installed |
199 | 1731 | pkgs_to_remove.append(version) | 1739 | pkgs_to_remove.append(dep_version) |
200 | 1740 | pkgs_to_install.append(version) | ||
201 | 1732 | 1741 | ||
202 | 1733 | for addon in self.addons_install: | 1742 | for addon in self.addons_install: |
203 | 1734 | version = max(self.cache[addon].versions) | 1743 | version = max(self.cache[addon].versions) |
204 | @@ -1776,7 +1785,10 @@ | |||
205 | 1776 | label_string += _("%sB to download, " % (download_size)) | 1785 | label_string += _("%sB to download, " % (download_size)) |
206 | 1777 | if total_install_size > 0: | 1786 | if total_install_size > 0: |
207 | 1778 | install_size = apt_pkg.size_to_str(total_install_size) | 1787 | install_size = apt_pkg.size_to_str(total_install_size) |
209 | 1779 | label_string += _("%sB when installed" % (install_size)) | 1788 | if self.app_details.pkg_state == PKG_STATE_INSTALLED: |
210 | 1789 | label_string += _("%sB on disk" % (install_size)) | ||
211 | 1790 | else: | ||
212 | 1791 | label_string += _("%sB when installed" % (install_size)) | ||
213 | 1780 | elif total_install_size < 0: | 1792 | elif total_install_size < 0: |
214 | 1781 | remove_size = apt_pkg.size_to_str(-total_install_size) | 1793 | remove_size = apt_pkg.size_to_str(-total_install_size) |
215 | 1782 | label_string += _("%sB to be freed" % (remove_size)) | 1794 | label_string += _("%sB to be freed" % (remove_size)) |
Greatly improves the appearance of add-ons. Thanks!