summaryrefslogtreecommitdiff
path: root/SoftwareProperties/SoftwareProperties.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-02-14 14:42:56 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-02-14 14:42:56 +0100
commita322dcddd7b886ecbdc5eaacec0b78a735d97428 (patch)
tree387804e5e5c1e6a5631a1a7f5e21fdfb335537c5 /SoftwareProperties/SoftwareProperties.py
parentcca98271729fa52ee96da87b81a81635f42ef61c (diff)
parentde0af64f747c8f5783ed09efd9fc80f9ee9759a0 (diff)
downloadpython-apt-a322dcddd7b886ecbdc5eaacec0b78a735d97428.tar.gz
* removed the gnome2 dependencies
Diffstat (limited to 'SoftwareProperties/SoftwareProperties.py')
-rw-r--r--SoftwareProperties/SoftwareProperties.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index b1d557d4..4254a3ee 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -48,6 +48,7 @@ CONF_MAP = {
"autoupdate" : "APT::Periodic::Update-Package-Lists",
"autodownload" : "APT::Periodic::Download-Upgradeable-Packages",
"autoclean" : "APT::Periodic::AutocleanInterval",
+ "unattended" : "APT::Periodic::Unattended-Upgrade",
"max_size" : "APT::Archives::MaxSize",
"max_age" : "APT::Archives::MaxAge"
}
@@ -151,6 +152,21 @@ class SoftwareProperties(SimpleGladeApp):
else:
self.checkbutton_auto_download.set_active(False)
+ # Unattended updates
+ if os.path.exists("/usr/bin/unattended-upgrade"):
+ # FIXME: we should always show the option. if unattended-upgrades is
+ # not installed a dialog should popup and allow the user to install
+ # unattended-upgrade
+ #self.checkbutton_unattended.set_sensitive(True)
+ self.checkbutton_unattended.show()
+ else:
+ #self.checkbutton_unattended.set_sensitive(False)
+ self.checkbutton_unattended.hide()
+ if apt_pkg.Config.FindI(CONF_MAP["unattended"]) == 1:
+ self.checkbutton_unattended.set_active(True)
+ else:
+ self.checkbutton_unattended.set_active(False)
+
# apt-key stuff
self.apt_key = apt_key()
self.init_keyslist()
@@ -228,6 +244,16 @@ class SoftwareProperties(SimpleGladeApp):
# FIXME: Write config options, apt_pkg should be able to do this.
self.write_config()
+ def on_opt_unattended_toggled(self, widget):
+ if self.checkbutton_unattended.get_active():
+ self.checkbutton_unattended.set_active(True)
+ apt_pkg.Config.Set(CONF_MAP["unattended"], str(1))
+ else:
+ self.checkbutton_unattended.set_active(False)
+ apt_pkg.Config.Set(CONF_MAP["unattended"], str(0))
+ # FIXME: Write config options, apt_pkg should be able to do this.
+ self.write_config()
+
def on_opt_autodownload_toggled(self, widget):
if self.checkbutton_auto_download.get_active():
self.checkbutton_auto_download.set_active(True)