From 4e2dd870b22419e6f24fc7a4ad38e8bd42cc56d8 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 28 Jul 2008 22:07:16 +0200 Subject: Disable '--oneshot' button if senseless --- portato/gui/windows/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'portato/gui/windows/main.py') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index c50940a..1b7c0f0 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -1279,11 +1279,14 @@ class MainWindow (Window): store, it = selection.get_selected() if it: - if self.queueTree.is_in_emerge(it) and self.queueTree.iter_has_parent(it): + parent = self.queueTree.parent_iter(it) + if self.queueTree.is_in_emerge(it) and parent and not self.queueTree.iter_has_parent(parent): package = store.get_value(it, 0) + self.queueOneshot.set_sensitive(True) set_val(package in self.queue.oneshotmerge) return True + self.queueOneshot.set_sensitive(False) set_val(False) return True -- cgit v1.2.3-54-g00ecf