## timezone_gui.py - Program creates a user interface 
##             that allows the system time, system date,
##             time zone, and ntpd configuration to be easily set
## Copyright (C) 2001, 2002, 2003 Red Hat, Inc.
## Copyright (C) 2001, 2002, 2003 Brent Fox <bfox@redhat.com>
##                                Tammy Fox <tfox@redhat.com>

## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

import gtk
import gobject
import time
import sys
import mainWindow
from timezone_map_gui import TimezoneMap
from zonetab import ZoneTab

##
## I18N
## 
from rhpl.translate import _, N_
import rhpl.translate as translate
translate.textdomain ("system-config-date")

class timezonePage (gtk.VBox):
    def __init__(self):
        self.mainVBox = gtk.VBox(gtk.FALSE, 5)
        self.timezone = mainWindow.timezoneBackend.getTimezoneInfo()
	self.default, self.asUTC, self.asArc = self.timezone

        zonetab = ZoneTab()
        path = "/usr/share/system-config-date/pixmaps/map480.png"
        self.tz = TimezoneMap(zonetab, self.default, map=path)

        self.utcCheck = gtk.CheckButton(_("_System clock uses UTC"))
        if self.asUTC == "true":
            self.utcCheck.set_active(gtk.TRUE)
        else:
            self.utcCheck.set_active(gtk.FALSE)
        
        label = gtk.Label (_("Please select the nearest city in your timezone:"))
        label.set_alignment(0.0, 0.5)

        self.mainVBox.pack_start(label, gtk.FALSE)
        self.mainVBox.pack_start(self.tz, gtk.TRUE)
        self.mainVBox.pack_start(self.utcCheck, gtk.FALSE)
        self.mainVBox.set_border_width(6)

    def getVBox(self):
        return self.mainVBox

    def getSmallVBox(self):
        self.mainVBox.remove(self.mainVBox.get_children()[0])
        return self.mainVBox

    def getTimezoneInfo(self):
        return self.tz.getCurrent().tz, self.utcCheck.get_active(), self.asArc
