示例#1
0
    def __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.ZoneTab()

        # Pull in a bunch of widgets.
        self.xml = gtk.glade.XML("/usr/share/system-config-date/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")

        ics.setTitle(_("Time Zone Selection"))
        ics.setNextEnabled(1)
示例#2
0
    def __init__(self, parent_class, xml, notebook, ksHandler):
        self.parent_class = parent_class
        self.notebook = notebook
        self.ks = ksHandler
        self.xml = xml
        self.lang_combo = xml.get_widget("lang_combo")
        self.keyboard_combo = xml.get_widget("keyboard_combo")
        self.timezone_combo = xml.get_widget("timezone_combo")
        self.utc_check_button = xml.get_widget("utc_check_button")

        self.root_passwd_entry = xml.get_widget("root_passwd_entry")
        self.root_passwd_confirm_entry = xml.get_widget(
            "root_passwd_confirm_entry")
        self.reboot_checkbutton = xml.get_widget("reboot_checkbutton")
        self.text_install_checkbutton = xml.get_widget(
            "text_install_checkbutton")
        self.ks.bootloader(md5pass="", password="")
        self.encrypt_root_pw_checkbutton = xml.get_widget(
            "encrypt_root_pw_checkbutton")
        self.lang_support_list = xml.get_widget("lang_support_list")
        self.platform_combo = xml.get_widget("platform_combo")

        self.platform_list = [
            _("x86, AMD64, or Intel EM64T"),
            _("Intel Itanium"),
            _("IBM iSeries"),
            _("IBM pSeries"),
            _("IBM zSeries/s390")
        ]
        for i in self.platform_list:
            self.platform_combo.append_text(i)
        self.platform_combo.set_active(0)
        self.platform_combo.connect("changed", self.platformChanged)

        self.langDict = langDict

        # set a default platform
        if not self.ks.platform:
            self.ks.platform = "x86, AMD64, or Intel EM64T"

        #populate language combo
        self.lang_list = self.langDict.keys()
        self.lang_list.sort()
        for i in self.lang_list:
            self.lang_combo.append_text(i)

        #set default to English
        self.lang_combo.set_active(self.lang_list.index('English (USA)'))

        #populate keyboard combo, add keyboards here
        self.keyboard_dict = keyboard_models.KeyboardModels().get_models()
        keys = self.keyboard_dict.keys()
        self.keyboard_list = []

        for item in keys:
            self.keyboard_list.append(self.keyboard_dict[item][0])

        self.keyboard_list.sort()
        for i in self.keyboard_list:
            self.keyboard_combo.append_text(i)

        #set default to English
        kbd = keyboard.Keyboard()
        kbd.read()
        currentKeymap = kbd.get()

        #set keyboard to current keymap
        try:
            self.keyboard_combo.set_active(
                self.keyboard_list.index(self.keyboard_dict[currentKeymap][0]))
        except:
            self.keyboard_combo.set_active(
                self.keyboard_list.index(self.keyboard_dict["us"][0]))

        zt = zonetab.ZoneTab()
        self.timezone_list = [x.tz for x in zt.getEntries()]
        self.timezone_list.sort()

        try:
            select = self.timezone_list.index("America/New_York")
        except:
            select = 0

        for i in self.timezone_list:
            self.timezone_combo.append_text(i)
        self.timezone_combo.set_active(select)
示例#3
0
 def getTimezoneList(self):
     zt = zonetab.ZoneTab()
     zoneList = [x.tz for x in zt.getEntries()]
     zoneList.sort()
     return zoneList