summaryrefslogtreecommitdiffstats
path: root/iw/timezone_gui.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2005-12-05 20:29:17 +0000
committerChris Lumens <clumens@redhat.com>2005-12-05 20:29:17 +0000
commit7cbfb22e6ee212ddb93eb5c07027813a2b190f6b (patch)
tree790a902927cbf7258ed4a92cb6b84ebcd69270c3 /iw/timezone_gui.py
parent19577a610fd33e23b9b07082086c31f1b00da273 (diff)
downloadanaconda-7cbfb22e6ee212ddb93eb5c07027813a2b190f6b.tar.gz
anaconda-7cbfb22e6ee212ddb93eb5c07027813a2b190f6b.tar.xz
anaconda-7cbfb22e6ee212ddb93eb5c07027813a2b190f6b.zip
Add some additional SELinux-related programs and an /etc/shells to get
semodule working again.
Diffstat (limited to 'iw/timezone_gui.py')
-rw-r--r--iw/timezone_gui.py109
1 files changed, 61 insertions, 48 deletions
diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py
index ebb22d19b..207edea96 100644
--- a/iw/timezone_gui.py
+++ b/iw/timezone_gui.py
@@ -11,77 +11,90 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+import sys
+sys.path.insert(0, "/mnt/source/RHupdates/system-config-date")
+
import string
-import iutil
import gtk
-import gobject
+import gtk.glade
import gui
-from timezone_map_gui import TimezoneMap, ZoneTab
-from iw_gui import *
+import gobject
+from timezone_map_gui import TimezoneMap
+from zonetab import *
from rhpl.translate import _, textdomain
+from iw_gui import *
+
+import logging
+log = logging.getLogger("anaconda")
textdomain("system-config-date")
class TimezoneWindow(InstallWindow):
def __init__(self, ics):
- InstallWindow.__init__(self, ics)
+ InstallWindow.__init__(self, ics)
+
+ # Need to set the custom handler before loading the glade file or
+ # this won't work.
+ gtk.glade.set_custom_handler(self.custom_widget_handler)
+
+ # Set the default now. We'll fix it for real in getScreen.
+ self.default = "America/New_York"
+
+ self.zonetab = ZoneTab()
+
+ # Pull in a bunch of widgets.
+ self.xml = gtk.glade.XML(gui.findGladeFile("system-config-date.glade"), domain="system-config-date")
+ self.vbox = self.xml.get_widget("tz_vbox")
+ self.utcCheckbox = self.xml.get_widget("utc_check")
+ self.notebook = self.xml.get_widget("notebook")
+ self.tzActionLabel = self.xml.get_widget("tzActionLabel")
+
+ # Need to set this after we've pulled in the glade file.
+ self.tz.tzActionLabel = self.tzActionLabel
+ self.tz.setActionLabelToMap()
ics.setTitle(_("Time Zone Selection"))
ics.setNextEnabled(1)
ics.readHTML("timezone")
+ def custom_widget_handler(self, xml, function_name, widget_name, str1, str2,
+ int1, int2):
+ if hasattr(self, function_name):
+ handler = getattr(self, function_name)
+ return handler(str1, str2, int1, int2)
+ else:
+ # Lame.
+ return gtk.Label()
+
+ def timezone_widget_create (self, str1, str2, int1, int2):
+ mappath = "/mnt/source/RHupdates/system-config-date/pixmaps/map1440.png"
+ regionspath = "/mnt/source/RHupdates/system-config-date/regions"
+
+ self.tz = TimezoneMap(self.zonetab, self.default, map=mappath,
+ regions=regionspath)
+ self.tz.show_all()
+ return self.tz
+
def getNext(self):
newzone = self.tz.getCurrent().tz
- self.timezone.setTimezoneInfo(newzone, self.systemUTC.get_active())
+ self.timezone.setTimezoneInfo(newzone, self.utcCheckbox.get_active())
return None
# TimezoneWindow tag="timezone"
def getScreen(self, instLang, timezone):
- self.timezone = timezone
-
- try:
- f = open("/usr/share/anaconda/pixmaps/map480.png")
- f.close()
- except:
- path = "pixmaps/map480.png"
- else:
- path = "/usr/share/anaconda/pixmaps/map480.png"
-
- mainBox = gtk.VBox(False, 5)
-
- zonetab = ZoneTab()
- self.tz = TimezoneMap(zonetab=zonetab, map=path)
+ self.timezone = timezone
+ (self.default, asUTC, asArc) = self.timezone.getTimezoneInfo()
- (self.default, asUTC, asArc) = self.timezone.getTimezoneInfo()
-
- self.langDefault = instLang.getDefaultTimeZone()
-
- if not self.default:
- self.default = self.langDefault
- asUTC = 0
+ if not self.default:
+ self.default = instLang.getDefaultTimeZone()
+ asUTC = 0
if (string.find(self.default, "UTC") != -1):
self.default = "America/New_York"
- self.tz.setCurrent(zonetab.findEntryByTZ(self.default))
-
- self.systemUTC = gtk.CheckButton(_("System clock uses _UTC"))
- self.systemUTC.set_active(asUTC)
-
- hbox = gtk.HBox(False, 5)
- pix = gui.readImageFromFile("timezone.png")
- if pix:
- hbox.pack_start(pix, False)
-
- hbox.pack_start(gtk.Label(_("Please select the nearest city in your timezone:")), False)
- mainBox.pack_start(hbox, False)
- mainBox.pack_start(self.tz, True, True)
- mainBox.pack_start(self.systemUTC, False)
- mainBox.set_border_width(5)
-
- box = gtk.VBox(False, 5)
- box.pack_start(mainBox)
- box.set_border_width(5)
-
- return box
+ # Now fix the default we set when we made the timezone map widget.
+ log.info("fixing up current entry")
+ self.tz.setCurrent(self.zonetab.findEntryByTZ(self.default))
+ self.notebook.remove(self.vbox)
+ return self.vbox