From b070222e78249be7956b80603fe8f7da7302d989 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 12 Dec 2005 12:32:30 +0100 Subject: * SoftwareProperties/SoftwareProperties.py: - small fixes to make it easy to embedd the software properties * UpdateManager.py: - don't "call" gnome-software-properties but import it and run it as part of update-manager * channels/Ubuntu.info.in: - remove certain translations flags --- UpdateManager/UpdateManager.py | 56 ++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 18 deletions(-) (limited to 'UpdateManager/UpdateManager.py') 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 = "%s" % \ + _("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 -- cgit v1.2.3