Merge lp:~ilidrissi.amine/software-center/fix-conflicting-packages into lp:software-center

Proposed by Mohamed Amine Ilidrissi
Status: Merged
Merged at revision: 1134
Proposed branch: lp:~ilidrissi.amine/software-center/fix-conflicting-packages
Merge into: lp:software-center
Diff against target: 209 lines (+108/-11)
6 files modified
debian/changelog (+4/-2)
softwarecenter/app.py (+26/-1)
softwarecenter/distro/Debian.py (+31/-0)
softwarecenter/distro/Ubuntu.py (+31/-0)
softwarecenter/view/dialogs.py (+3/-3)
softwarecenter/view/pkgview.py (+13/-5)
To merge this branch: bzr merge lp:~ilidrissi.amine/software-center/fix-conflicting-packages
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+33818@code.launchpad.net

Description of the change

This branch fixes bug 554319.

To post a comment you must log in.
1074. By Mohamed Amine Ilidrissi

merge with trunk.

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-26 18:44:15 +0000
+++ debian/changelog 2010-08-26 18:54:41 +0000
@@ -22,8 +22,10 @@
22 22
23 [ Mohamed Amine IL Idrissi ]23 [ Mohamed Amine IL Idrissi ]
24 * Do not include download size of installed app.24 * Do not include download size of installed app.
25 25 * An alert will show if you try to remove conflicting packages (LP: #554319)
26 -- Gary Lasker <gary.lasker@canonical.com> Thu, 26 Aug 2010 14:36:13 -040026 * The dependency remove alert will now show application icons
27
28 -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Thu, 26 Aug 2010 18:44:58 +0000
2729
28software-center (2.1.13) maverick; urgency=low30software-center (2.1.13) maverick; urgency=low
2931
3032
=== modified file 'softwarecenter/app.py'
--- softwarecenter/app.py 2010-08-26 15:26:00 +0000
+++ softwarecenter/app.py 2010-08-26 18:54:41 +0000
@@ -498,7 +498,32 @@
498 iconpath = self.get_icon_filename(appdetails.icon, self.APP_ICON_SIZE)498 iconpath = self.get_icon_filename(appdetails.icon, self.APP_ICON_SIZE)
499 499
500 if not dialogs.confirm_remove(None, self.datadir, primary, self.cache,500 if not dialogs.confirm_remove(None, self.datadir, primary, self.cache,
501 button_text, iconpath, depends):501 button_text, iconpath, depends, self.icons, self.db):
502 # for appdetailsview-webkit
503 # self._set_action_button_sensitive(True)
504
505 self.backend.emit("transaction-stopped", app.pkgname)
506 return
507 elif action == "install":
508 # If we are installing a package, check for dependencies that will
509 # also be removed and show a dialog for confirmation
510 # generic removal text (fixing LP bug #554319)
511 (primary, button_text) = self.distro.get_install_warning_text(self.cache,
512 appdetails.pkg,
513 app.name)
514
515 # ask for confirmation if we have depends that will be removed
516 depends = []
517 deps_remove = self.cache.get_all_deps_removing(appdetails.pkg)
518 for dep in deps_remove:
519 if self.cache[dep].installed != None:
520 depends.append(dep)
521
522 if depends:
523 iconpath = self.get_icon_filename(appdetails.icon, self.APP_ICON_SIZE)
524
525 if not dialogs.confirm_remove(None, self.datadir, primary, self.cache,
526 button_text, iconpath, depends, self.icons, self.db):
502 # for appdetailsview-webkit527 # for appdetailsview-webkit
503 # self._set_action_button_sensitive(True)528 # self._set_action_button_sensitive(True)
504529
505530
=== modified file 'softwarecenter/distro/Debian.py'
--- softwarecenter/distro/Debian.py 2010-08-13 16:50:30 +0000
+++ softwarecenter/distro/Debian.py 2010-08-26 18:54:41 +0000
@@ -71,6 +71,37 @@
71 depends = None71 depends = None
72 break72 break
73 return (primary, button_text)73 return (primary, button_text)
74
75 def get_install_warning_text(self, cache, pkg, appname):
76 primary = _("To install %s, these items must be removed:" % appname)
77 button_text = _("Install Anyway")
78
79 depends = []
80 deps_remove = self.cache.get_all_deps_removing(pkg)
81 for dep in deps_remove:
82 if self.cache[dep].installed != None:
83 depends.append(dep)
84
85 # alter it if a meta-package is affected
86 for m in depends:
87 if cache[m].section == "metapackages":
88 primary = _("If you install %s, future updates will not "
89 "include new items in <b>%s</b> set. "
90 "Are you sure you want to continue?") % (appname, cache[m].installed.summary)
91 button_text = _("Install Anyway")
92 depends = []
93 break
94
95 # alter it if an important meta-package is affected
96 for m in self.IMPORTANT_METAPACKAGES:
97 if m in depends:
98 primary = _("Installing %s may cause core applications to "
99 "be removed. "
100 "Are you sure you want to continue?" % appname)
101 button_text = _("Install Anyway")
102 depends = None
103 break
104 return (primary, button_text)
74105
75 def get_distro_codename(self):106 def get_distro_codename(self):
76 if not hasattr(self ,"codename"):107 if not hasattr(self ,"codename"):
77108
=== modified file 'softwarecenter/distro/Ubuntu.py'
--- softwarecenter/distro/Ubuntu.py 2010-08-25 13:16:17 +0000
+++ softwarecenter/distro/Ubuntu.py 2010-08-26 18:54:41 +0000
@@ -80,6 +80,37 @@
80 depends = None80 depends = None
81 break81 break
82 return (primary, button_text)82 return (primary, button_text)
83
84 def get_install_warning_text(self, cache, pkg, appname):
85 primary = _("To install %s, these items must be removed:" % appname)
86 button_text = _("Install Anyway")
87
88 depends = []
89 deps_remove = cache.get_all_deps_removing(pkg)
90 for dep in deps_remove:
91 if cache[dep].installed != None:
92 depends.append(dep)
93
94 # alter it if a meta-package is affected
95 for m in depends:
96 if cache[m].section == "metapackages":
97 primary = _("If you install %s, future updates will not "
98 "include new items in <b>%s</b> set. "
99 "Are you sure you want to continue?") % (appname, cache[m].installed.summary)
100 button_text = _("Install Anyway")
101 depends = []
102 break
103
104 # alter it if an important meta-package is affected
105 for m in self.IMPORTANT_METAPACKAGES:
106 if m in depends:
107 primary = _("Installing %s may cause core applications to "
108 "be removed. "
109 "Are you sure you want to continue?" % appname)
110 button_text = _("Install Anyway")
111 depends = None
112 break
113 return (primary, button_text)
83114
84 def get_distro_codename(self):115 def get_distro_codename(self):
85 if not hasattr(self ,"codename"):116 if not hasattr(self ,"codename"):
86117
=== modified file 'softwarecenter/view/dialogs.py'
--- softwarecenter/view/dialogs.py 2010-07-14 15:47:46 +0000
+++ softwarecenter/view/dialogs.py 2010-08-26 18:54:41 +0000
@@ -34,7 +34,7 @@
34 else:34 else:
35 print >> sys.stderr, "WARNING: can not get name for '%s'" % o35 print >> sys.stderr, "WARNING: can not get name for '%s'" % o
3636
37def confirm_remove(parent, datadir, primary, cache, button_text, icon_path, depends):37def confirm_remove(parent, datadir, primary, cache, button_text, icon_path, depends, icons, db):
38 """Confirm removing of the given app with the given depends"""38 """Confirm removing of the given app with the given depends"""
39 glade_dialog = SimpleGladeDialog(datadir)39 glade_dialog = SimpleGladeDialog(datadir)
40 dialog = glade_dialog.dialog_dependency_alert40 dialog = glade_dialog.dialog_dependency_alert
@@ -53,7 +53,7 @@
53 # add the dependencies53 # add the dependencies
54 vbox = dialog.get_content_area()54 vbox = dialog.get_content_area()
55 # FIXME: make this a generic pkgview widget55 # FIXME: make this a generic pkgview widget
56 view = PkgNamesView(_("Dependency"), cache, depends)56 view = PkgNamesView(_("Dependency"), cache, depends, icons, db)
57 view.set_headers_visible(False)57 view.set_headers_visible(False)
58 glade_dialog.scrolledwindow_dependencies.add(view)58 glade_dialog.scrolledwindow_dependencies.add(view)
59 glade_dialog.scrolledwindow_dependencies.show_all()59 glade_dialog.scrolledwindow_dependencies.show_all()
@@ -63,7 +63,7 @@
63 if result == gtk.RESPONSE_ACCEPT:63 if result == gtk.RESPONSE_ACCEPT:
64 return True64 return True
65 return False65 return False
66 66
67def confirm_repair_broken_cache(parent, datadir):67def confirm_repair_broken_cache(parent, datadir):
68 glade_dialog = SimpleGladeDialog(datadir)68 glade_dialog = SimpleGladeDialog(datadir)
69 dialog = glade_dialog.dialog_broken_cache69 dialog = glade_dialog.dialog_broken_cache
7070
=== modified file 'softwarecenter/view/pkgview.py'
--- softwarecenter/view/pkgview.py 2010-07-08 08:11:34 +0000
+++ softwarecenter/view/pkgview.py 2010-08-26 18:54:41 +0000
@@ -19,6 +19,7 @@
1919
20import gtk20import gtk
21import pango21import pango
22from softwarecenter.db.application import Application
2223
23#FIXME: These need to come from the main app24#FIXME: These need to come from the main app
24ICON_SIZE = 2425ICON_SIZE = 24
@@ -30,7 +31,7 @@
30 (COL_ICON,31 (COL_ICON,
31 COL_TEXT) = range(2)32 COL_TEXT) = range(2)
3233
33 def __init__(self, header, cache, pkgnames):34 def __init__(self, header, cache, pkgnames, icons, db):
34 super(PkgNamesView, self).__init__()35 super(PkgNamesView, self).__init__()
35 model = gtk.ListStore(gtk.gdk.Pixbuf, str)36 model = gtk.ListStore(gtk.gdk.Pixbuf, str)
36 self.set_model(model)37 self.set_model(model)
@@ -44,7 +45,14 @@
44 for pkgname in sorted(pkgnames):45 for pkgname in sorted(pkgnames):
45 s = "%s \n<small>%s</small>" % (46 s = "%s \n<small>%s</small>" % (
46 cache[pkgname].installed.summary.capitalize(), pkgname)47 cache[pkgname].installed.summary.capitalize(), pkgname)
47 # FIXME: use xapian query here to find a matching icon48
48 pix = gtk.gdk.pixbuf_new_from_file_at_size(MISSING_APP_ICON, 49 app_details = Application("", pkgname).get_details(db)
49 ICON_SIZE, ICON_SIZE)50 proposed_icon = app_details.icon
50 row = model.append([pix, s])51 if not proposed_icon or not icons.has_icon(proposed_icon):
52 proposed_icon = MISSING_APP_ICON
53 try:
54 pix = icons.load_icon(proposed_icon, ICON_SIZE, ()).scale_simple(ICON_SIZE,
55 ICON_SIZE, gtk.gdk.INTERP_BILINEAR)
56 row = model.append([pix, s])
57 except TypeError:
58 logging.warning("cant set icon for '%s' " % pkgname)

Subscribers

People subscribed via source and target branches