diff options
Diffstat (limited to 'UpdateManager/UpdateManager.py')
| -rw-r--r-- | UpdateManager/UpdateManager.py | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index ba6c5565..99126e79 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -577,27 +577,47 @@ class UpdateManager(SimpleGladeApp): """ start gnome-software preferences """ # args: "-n" means we take care of the reloading of the # package list ourself - apt_pkg.PkgSystemUnLock() - args = ['/usr/bin/gnome-software-properties', '-n'] - child = subprocess.Popen(args) - self.window_main.set_sensitive(False) - res = None - while res == None: - res = child.poll() - time.sleep(0.05) - while gtk.events_pending(): - gtk.main_iteration() + #apt_pkg.PkgSystemUnLock() + #args = ['/usr/bin/gnome-software-properties', '-n'] + #child = subprocess.Popen(args) + #self.window_main.set_sensitive(False) + #res = None + #while res == None: + # res = child.poll() + # time.sleep(0.05) + ## while gtk.events_pending(): + # gtk.main_iteration() # repository information changed, call "reload" - try: - apt_pkg.PkgSystemLock() - except SystemError: - print "Error geting the cache" - apt_pkg.PkgSystemLock() - if res > 0: - self.on_button_reload_clicked(None) + #try: + # apt_pkg.PkgSystemLock() + #except SystemError: + # print "Error geting the cache" + # apt_pkg.PkgSystemLock() + # if res > 0: + # self.on_button_reload_clicked(None) + # self.window_main.set_sensitive(True) + self.window_main.set_sensitive(False) + from SoftwareProperties import SoftwareProperties + prop = SoftwareProperties(self.datadir, None) + prop.window_main.set_transient_for(self.window_main) + prop.run() + prop.window_main.hide() + if prop.modified: + primary = "<span weight=\"bold\" size=\"larger\">%s</span>" % \ + _("Repositories changed") + secondary = _("You need to reload the package list from the servers " + "for your changes to take effect. Do you want to do " + "this now?") + dialog = gtk.MessageDialog(self.window_main,gtk.DIALOG_MODAL, + gtk.MESSAGE_INFO,gtk.BUTTONS_YES_NO,"") + dialog.set_markup(primary); + dialog.format_secondary_text(secondary); + res = dialog.run() + dialog.destroy() + if res == gtk.RESPONSE_YES: + self.on_button_reload_clicked(None) self.window_main.set_sensitive(True) - def fillstore(self): # clean most objects |
