summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbfox <bfox>2001-01-11 00:41:07 +0000
committerbfox <bfox>2001-01-11 00:41:07 +0000
commit062f7e5d7217c4f1287d74ba6ae46ebccabd258e (patch)
tree970afd7aa18e79a65c0cb2086d656bf7634a1fd4
parent9c9d9d654dd74f48994a5a13b96f7cfc0b15f568 (diff)
downloadanaconda-062f7e5d7217c4f1287d74ba6ae46ebccabd258e.tar.gz
anaconda-062f7e5d7217c4f1287d74ba6ae46ebccabd258e.tar.xz
anaconda-062f7e5d7217c4f1287d74ba6ae46ebccabd258e.zip
Added code to make things sensitive/insensitive.
-rw-r--r--iw/firewall_gui.py84
1 files changed, 56 insertions, 28 deletions
diff --git a/iw/firewall_gui.py b/iw/firewall_gui.py
index 0859b0f0f..0015f1882 100644
--- a/iw/firewall_gui.py
+++ b/iw/firewall_gui.py
@@ -19,45 +19,67 @@ class FirewallWindow (InstallWindow):
# if not dev.get('onboot'):
# dev.set (("onboot", "yes"))
-
- def activate (self, widget, args):
-# print "Inside activate"
-# print self.radio4.get_active()
-
- self.trusted.set_sensitive(self.radio5.get_active())
- self.incoming.set_sensitive(self.radio5.get_active())
- self.ports.set_sensitive(self.radio5.get_active())
- self.label1.set_sensitive(self.radio5.get_active())
- self.label2.set_sensitive(self.radio5.get_active())
- self.label3.set_sensitive(self.radio5.get_active())
+ def activate_firewall (self, widget):
+ if self.radio3.get_active ():
+ active = not (self.radio3.get_active())
+
+ self.radio4.set_sensitive (active)
+ self.radio5.set_sensitive (active)
+ self.trusted.set_sensitive(active)
+ self.incoming.set_sensitive(active)
+ self.ports.set_sensitive(active)
+ self.label1.set_sensitive(active)
+ self.label2.set_sensitive(active)
+ self.label3.set_sensitive(active)
+ else:
+ self.radio4.set_sensitive (TRUE)
+ self.radio5.set_sensitive (TRUE)
+
+ if self.radio5.get_active ():
+ self.trusted.set_sensitive(self.radio5.get_active())
+ self.incoming.set_sensitive(self.radio5.get_active())
+ self.ports.set_sensitive(self.radio5.get_active())
+ self.label1.set_sensitive(self.radio5.get_active())
+ self.label2.set_sensitive(self.radio5.get_active())
+ self.label3.set_sensitive(self.radio5.get_active())
+
+ else:
+ self.trusted.set_sensitive(self.radio5.get_active())
+ self.incoming.set_sensitive(self.radio5.get_active())
+ self.ports.set_sensitive(self.radio5.get_active())
+ self.label1.set_sensitive(self.radio5.get_active())
+ self.label2.set_sensitive(self.radio5.get_active())
+ self.label3.set_sensitive(self.radio5.get_active())
def getScreen (self):
box = GtkVBox (FALSE, 5)
box.set_border_width (5)
- label = GtkLabel (_("Please choose your level of security. "))
- label.set_alignment (0.2, 0.5)
+ label = GtkLabel (_("Please choose your security level: "))
+ label.set_alignment (0.0, 0.5)
label.set_line_wrap (TRUE)
box.pack_start(label, FALSE)
- hbox = GtkHBox ()
+ hbox = GtkHBox (FALSE)
- label = GtkLabel (_("Security level:"))
+ self.radio1 = GtkRadioButton (None, (_("High")))
+ self.radio2 = GtkRadioButton (self.radio1, (_("Medium")))
+ self.radio3 = GtkRadioButton (self.radio1, (_("No firewall")))
- hbox.pack_start(label)
+ self.radio3.connect ("clicked", self.activate_firewall)
- radio1 = GtkRadioButton (None, (_("High")))
- radio2 = GtkRadioButton (radio1, (_("Medium")))
- radio3 = GtkRadioButton (radio1, (_("None")))
+ hbox.pack_start (self.radio1)
+ hbox.pack_start (self.radio2)
+ hbox.pack_start (self.radio3)
- hbox.pack_start (radio1)
- hbox.pack_start (radio2)
- hbox.pack_start (radio3)
+ a = GtkAlignment ()
+ a.add (hbox)
+ a.set (1.0, 0.5, 0.7, 1.0)
- box.pack_start (hbox, FALSE)
+ box.pack_start (a, FALSE)
hsep = GtkHSeparator ()
box.pack_start (hsep, FALSE)
@@ -66,14 +88,12 @@ class FirewallWindow (InstallWindow):
self.radio5 = GtkRadioButton (self.radio4, (_("Customize")))
self.radio4.set_active (TRUE)
- self.radio4.connect ("draw", self.activate)
- self.radio4.connect ("clicked", self.activate, None)
- self.radio5.connect ("clicked", self.activate, None)
+ self.radio4.connect ("clicked", self.activate_firewall)
+ self.radio5.connect ("clicked", self.activate_firewall)
box.pack_start (self.radio4, FALSE)
box.pack_start (self.radio5, FALSE)
-
table = GtkTable (2, 3)
box.pack_start (table)
@@ -87,7 +107,6 @@ class FirewallWindow (InstallWindow):
self.trusted.append_row (("cipcb0", ""), FALSE)
self.trusted.append_row (("wvlan0", ""), FALSE)
-
hbox = GtkHBox(FALSE, 10)
self.label2 = GtkLabel (_("Allow incoming:"))
self.label2.set_alignment (0.2, 0.0)
@@ -106,5 +125,14 @@ class FirewallWindow (InstallWindow):
table.attach (self.label3, 0, 1, 2, 3, FILL, FILL, 5, 5)
table.attach (self.ports, 1, 2, 2, 3, EXPAND|FILL, FILL, 5, 5)
+
+ self.trusted.set_sensitive(FALSE)
+ self.incoming.set_sensitive(FALSE)
+ self.ports.set_sensitive(FALSE)
+ self.label1.set_sensitive(FALSE)
+ self.label2.set_sensitive(FALSE)
+ self.label3.set_sensitive(FALSE)
+
+
return box