diff options
author | Chris Lumens <clumens@redhat.com> | 2005-04-01 21:09:23 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2005-04-01 21:09:23 +0000 |
commit | 7e944bd61a1c99d9f4e08c007068bef6a6e2fb2d (patch) | |
tree | d4952d8f308fc86705178dae490487ee7afd70d8 | |
parent | e7792dc4e78a5f1a4b4263e50e95dffabd42089f (diff) | |
download | anaconda-7e944bd61a1c99d9f4e08c007068bef6a6e2fb2d.tar.gz anaconda-7e944bd61a1c99d9f4e08c007068bef6a6e2fb2d.tar.xz anaconda-7e944bd61a1c99d9f4e08c007068bef6a6e2fb2d.zip |
Removed language_support_gui.py and all references to it, since we were
already skipping that step. Bump version.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | anaconda.spec | 9 | ||||
-rw-r--r-- | dispatch.py | 1 | ||||
-rwxr-xr-x | gui.py | 1 | ||||
-rw-r--r-- | iw/language_support_gui.py | 287 | ||||
-rw-r--r-- | language.py | 28 | ||||
-rw-r--r-- | text.py | 5 | ||||
-rw-r--r-- | textw/language_text.py | 109 |
8 files changed, 27 insertions, 423 deletions
@@ -1,8 +1,18 @@ 2005-04-01 Chris Lumens <clumens@redhat.com> + * anaconda.spec: Bump version. + + * iw/language_support_gui.py: Removed. + * dispatch.py: Removed reference to LanguageSupportWindow. + * gui.py: Likewise. + * textw/language_text.py: Likewise. + * installclass.py (BaseInstallClass.setLanguageSupport): Don't add duplicate entries to supported list. * language.py: Fix traceback on kickstart language support. + * language.py (Language.setDefault): Remove dependance on + langInfoByName. + * text.py (InstallInterface.run): Use language nick instead of name. 2005-04-01 Jeremy Katz <katzj@redhat.com> diff --git a/anaconda.spec b/anaconda.spec index ced6fab9f..5069a795f 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,5 +1,5 @@ Name: anaconda -Version: 10.2.0.37 +Version: 10.2.0.38 Release: 1 License: GPL Summary: Graphical system installer @@ -69,6 +69,13 @@ rm -rf $RPM_BUILD_ROOT /sbin/chkconfig --del reconfig >/dev/null 2>&1 || : %changelog +* Fri Apr 01 2005 Chris Lumens <clumens@redhat.com> 10.2.0.38-1 +- Set default language for /etc/sysconfig/i18n (#149688). +- Make sure hostname option isn't greyed out if using static IP (#149116). +- Remove unused packages, python library bits, and locale info (katzj). +- Add missing Indic font packages (katzj). +- Various language fixups. + * Wed Mar 30 2005 Jeremy Katz <katzj@redhat.com> - 10.2.0.37-1 - try not using maxcpus=1 for arches which still had it - don't use the reserved variable name str (sopwith) diff --git a/dispatch.py b/dispatch.py index 25a122346..f203326bc 100644 --- a/dispatch.py +++ b/dispatch.py @@ -102,7 +102,6 @@ installSteps = [ ("networkdevicecheck", networkDeviceCheck, ("id.network", "dispatch")), ("network", ("id.network", "dir", "intf", "id")), ("firewall", ("intf", "id.network", "id.firewall", "id.security")), - ("languagesupport", ("id.instLanguage",)), ("timezone", ("id.instLanguage", "id.timezone")), ("accounts", ("intf", "id.rootPassword")), ("authentication", ("id.auth",)), @@ -63,7 +63,6 @@ stepToClass = { "upgbootloader": ("upgrade_bootloader_gui", "UpgradeBootloaderWindow"), "network" : ("network_gui", "NetworkWindow"), "firewall" : ("firewall_gui", "FirewallWindow"), - "languagesupport" : ("language_support_gui", "LanguageSupportWindow"), "timezone" : ("timezone_gui", "TimezoneWindow"), "accounts" : ("account_gui", "AccountWindow"), "authentication" : ("auth_gui", "AuthWindow"), diff --git a/iw/language_support_gui.py b/iw/language_support_gui.py deleted file mode 100644 index 0d8e9d5d7..000000000 --- a/iw/language_support_gui.py +++ /dev/null @@ -1,287 +0,0 @@ -# -# langauge_support_gui.py: dialog for selection of which languages to support. -# -# Copyright 2001-2002 Red Hat, Inc. -# -# This software may be freely redistributed under the terms of the GNU -# library public license. -# -# You should have received a copy of the GNU Library Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -import checklist -import gtk -import gui -from iw_gui import * -from flags import flags -from rhpl.translate import _, N_ - -from gui import setupTreeViewFixupIdleHandler - -class LanguageSupportWindow (InstallWindow): - windowTitle = _("Additional Language Support") - htmlTag = "langsupport" - - def getNext (self): - self.supportedLangs = [] - - for row in range(self.maxrows): - if self.languageList.get_active(row) == 1: - selected = self.languageList.get_text (row, 1) - self.supportedLangs.append (selected) - - curidx = self.deflang_combo.get_active() - self.defaultLang = self.deflang_values[curidx] - self.langs.setSupported (self.supportedLangs) - self.langs.setDefault (self.defaultLang) - - return None - - def toggled_language(self, data, row): - olddef = self.defaultLang - oldidx = None - for row in range(self.maxrows): - selected = self.languageList.get_text (row, 1) - if selected == olddef: - oldidx = row - break - - self.rebuild_combo() - - # if no default lang now restore - # this can happen if they clicked on the only remaining selected - # language. If we dont reset to previous default lang selected - # the UI is confusing because there is no default lang and no - # langauges supported - if self.defaultLang is None or self.defaultLang == "": - self.languageList.set_active(oldidx, True) - self.rebuild_combo() - - def rebuild_combo(self): - list = [] - - for row in range(self.maxrows): - if self.languageList.get_active(row) == 1: - selected = self.languageList.get_text (row, 1) - list.append (selected) - - if len(list) == 0: - list = [""] - self.ics.setNextEnabled (False) - else: - self.ics.setNextEnabled (True) - - curidx = self.deflang_combo.get_active() - if curidx >= 0 and len(self.deflang_values) > 0: - self.defaultLang = self.deflang_values[curidx] - else: - self.defaultLang = None - - if self.defaultLang is not None and self.defaultLang in list: - index = list.index(self.defaultLang) - else: - index = 0 - self.defaultLang = list[0] - - self.createDefaultLangMenu(list) - self.deflang_combo.set_active(index) - - def select_all (self, data): - self.ics.setNextEnabled (True) - for row in range(self.maxrows): - self.languageList.set_active(row, True) - - self.rebuild_combo() - - def select_default (self, data): - self.ics.setNextEnabled (True) - - curidx = self.deflang_combo.get_active() - if curidx >= 0: - deflang = self.deflang_values[curidx] - - for row in range(self.maxrows): - if self.languageList.get_text(row, 1) == deflang: - self.languageList.set_active(row, True) - else: - self.languageList.set_active(row, False) - - self.rebuild_combo() - - def reset (self, data): - self.ics.setNextEnabled (True) - list = [] - - for row in range(self.maxrows): - item = self.languageList.get_text (row, 1) - - if item in self.origLangs: - self.languageList.set_active(row, True) - list.append (item) - else: - self.languageList.set_active(row, False) - - self.defaultLang = self.oldDefaultLang - self.createDefaultLangMenu(list) - self.deflang_combo.set_active(self.deflang_values.index(self.defaultLang)) - - def setCurrent(self, currentDefault, recenter=1): - parent = None - - store = self.languageList.get_model() - row = 0 - - # iterate over the list looking for the default locale - while (row < self.languageList.num_rows): - if self.languageList.get_text(row, 1) == currentDefault: - path = store.get_path(store.get_iter((row,))) - col = self.languageList.get_column(0) - self.languageList.set_cursor(path, col, False) - self.languageList.scroll_to_cell(path, col, True, 0.5, 0.5) - break - row = row + 1 - - def createDefaultLangMenu(self, supported): - if self.deflang_combo is None: - self.deflang_combo = gtk.combo_box_new_text() - else: - for i in range(len(self.deflang_values), 0, -1): - self.deflang_combo.remove_text(i - 1) - - sel = None - curidx = 0 - values = [] - for locale in self.languages: - if locale == self.defaultLang or (locale in supported): - self.deflang_combo.append_text(locale) - - if locale == self.defaultLang: - sel = curidx - else: - curidx = curidx + 1 - - values.append(locale) - - if sel is not None: - self.deflang_combo.set_active(sel) - - self.deflang_values = values - - # LanguageSupportWindow tag="langsupport" - def getScreen (self, langs): - self.langs = langs - self.languages = self.langs.getAllSupported () - self.supportedLangs = self.langs.getSupported() - self.origLangs = [] - for i in self.supportedLangs: - self.origLangs.append(i) - - self.defaultLang = self.langs.getDefault() - self.oldDefaultLang = self.defaultLang - - # first time we hit this point in install this is not initialized - if self.origLangs == []: - self.origLangs.append(self.defaultLang) - - vbox = gtk.VBox (False, 10) - vbox.set_border_width(5) - hbox = gtk.HBox (False) - - # create option menu of default langs - label = gui.MnemonicLabel(_("Select the _default language for the system: ")) - self.deflang_combo = None - self.deflang_values = None - self.createDefaultLangMenu(self.supportedLangs) - label.set_mnemonic_widget(self.deflang_combo) - - hbox.pack_start (label, False, 20) - hbox.pack_start (self.deflang_combo, False, 20) - vbox.pack_start (hbox, False, 50) - - sep = gtk.HSeparator () - vbox.pack_start (sep, False, 15) - - label = gui.MnemonicLabel(_("Select _additional languages to install " - "on the system:")) - - label.set_alignment (0.0, 0.5) - label.set_line_wrap (True) - label.set_size_request(400, -1) - vbox.pack_start (label, False) - - hbox = gtk.HBox (False, 5) - - # langs we want to support - self.languageList = checklist.CheckList(1) - label.set_mnemonic_widget(self.languageList) - - self.maxrows = 0 - list = [] - - for locale in self.languages: - if locale == self.defaultLang or (locale in self.supportedLangs): - self.languageList.append_row((locale, ""), True) - list.append(locale) - else: - self.languageList.append_row((locale, ""), False) - - self.maxrows = self.maxrows + 1 - - self.setCurrent(self.defaultLang) - - sw = gtk.ScrolledWindow () - sw.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) - sw.add (self.languageList) - sw.set_shadow_type(gtk.SHADOW_IN) - - vbox2 = gtk.VBox (False, 12) - - all_button = gtk.Button (_("_Select All")) - all_button.set_size_request(160, -1) - all_button.connect ('clicked', self.select_all) - a1 = gtk.Alignment (0.5, 0.5) - a1.add (all_button) - - # this one tends to be too long - default_button = gtk.Button() - label = gui.MnemonicLabel(_("Select Default _Only")) - label.set_size_request(150,-1) - label.set_line_wrap(True) - label.set_justify(gtk.JUSTIFY_CENTER) - label.set_mnemonic_widget(default_button) - default_button.add(label) - default_button.set_size_request(160, -1) - default_button.connect ('clicked', self.select_default) - a2 = gtk.Alignment (0.5, 0.5) - a2.add (default_button) - - reset_button = gtk.Button (_("Rese_t")) - reset_button.set_size_request(160, -1) - reset_button.connect ('clicked', self.reset) - a3 = gtk.Alignment (0.5, 0.5) - a3.add (reset_button) - - vbox2.pack_start (a1, False, 10) - vbox2.pack_start (a2, False) - vbox2.pack_start (a3, False) - hbox.pack_start (sw, True, 10) - hbox.pack_start (vbox2, False, 10) - vbox.pack_start (hbox, True) - - # default button -# alignment = gtk.Alignment (0.0, 0.0) -# button = gtk.Button (_("Select as default")) -# alignment.add (button) - - # connect CB for when they change selected langs - self.languageList.checkboxrenderer.connect("toggled", - self.toggled_language) - - store = self.languageList.get_model() - - setupTreeViewFixupIdleHandler(self.languageList, store) - - - return vbox diff --git a/language.py b/language.py index 031ffd02c..c63e9959e 100644 --- a/language.py +++ b/language.py @@ -190,32 +190,20 @@ class Language: return 'English' def setDefault(self, nick): - if not nick: + canonNick = self.canonLangNick(nick) + + if not canonNick or not self.localeInfo[canonNick]: self.default = None return - # Try to find a match for the language nick we were given. - name = None - for k in self.langInfoByName.keys(): - row = self.langInfoByName[k] - if nick in expandLangs(row[0]): - name = k - break - - # It's possible we didn't find a match. - if name == None: - self.default = None - return - self.default = self.getLangNameByNick(nick) - (lang, map, font) = self.langInfoByName[name] - self.info['LANG'] = lang - self.info['SYSFONT'] = font - if map != "utf8": - self.info['SYSFONTACM'] = map + self.info['LANG'] = nick + self.info['SYSFONT'] = self.localeInfo[nick][2] + self.info['SYSFONTACM'] = "utf8" + # XXX hack - because of exceptional cases on the var - zh_CN.GB2312 - if lang == "zh_CN.GB18030": + if nick == "zh_CN.GB18030": self.info['LANGUAGE'] = "zh_CN.GB18030:zh_CN.GB2312:zh_CN" def setSupported (self, namelist): @@ -61,8 +61,6 @@ stepToClasses = { "HostnameWindow")), "firewall" : ("firewall_text", ("FirewallWindow", "SELinuxWindow")), - "languagesupport" : ("language_text", ("LanguageSupportWindow", - "LanguageDefaultWindow")), "timezone" : ("timezone_text", "TimezoneWindow"), "accounts" : ("userauth_text", "RootPasswordWindow"), "authentication" : ("userauth_text", ("AuthConfigWindow")), @@ -422,8 +420,7 @@ class InstallInterface: #self.screen.drawRootText (len(_(self.welcomeText)), 0, #(self.screen.width - len(_(self.welcomeText))) * " ") #self.screen.drawRootText (0 - len(_(step[0])), 0, _(step[0])) - langname = id.instLanguage.getCurrent() - lang = id.instLanguage.getNickByName(langname) + lang = id.instLanguage.getCurrent() self.langSearchPath = expandLangs(lang) + ['C'] self.instLanguage = id.instLanguage diff --git a/textw/language_text.py b/textw/language_text.py index 19ffd9934..11eea927c 100644 --- a/textw/language_text.py +++ b/textw/language_text.py @@ -88,112 +88,3 @@ class LanguageWindow: textInterface.drawFrame() return INSTALL_OK - -class LanguageSupportWindow: - def __call__(self, screen, language): - - # should already be sorted - ct = CheckboxTree(height = 8, scroll = 1) - - for lang in language.getAllSupported(): - ct.append(lang, lang, 0) - - for lang in language.getSupported (): - ct.setEntryValue(lang, 1) - - current = language.getDefault() - ct.setCurrent(current) - ct.setEntryValue(current, 1) - - bb = ButtonBar (screen, (TEXT_OK_BUTTON, (_("Select All"), "all"), (_("Reset"), "reset"), TEXT_BACK_BUTTON)) - - message = (_("Choose additional languages that you would like to use " - "on this system:")) - tb = TextboxReflowed(50, message) - - g = GridFormHelp (screen, _("Language Support"), "langsupport", 1, 4) - - g.add (tb, 0, 0, (0, 0, 0, 1), anchorLeft = 1) - g.add (ct, 0, 1, (0, 0, 0, 1)) - g.add (bb, 0, 3, growx = 1) - - while 1: - result = g.run() - - rc = bb.buttonPressed (result) - - if rc == TEXT_BACK_CHECK: - screen.popWindow() - return INSTALL_BACK - - if rc == "all": - for lang in language.getAllSupported(): - ct.setEntryValue(lang, 1) - - if rc == "reset": - for lang in language.getAllSupported(): - if lang == current: - ct.setEntryValue(lang, 1) - else: - ct.setEntryValue(lang, 0) - - if rc == TEXT_OK_CHECK or result == TEXT_F12_CHECK: - # --If they selected all langs, then set language.setSupported to - # None. This installs all langs - - if ct.getSelection() == []: - ButtonChoiceWindow(screen, _("Invalid Choice"), - _("You must select at least one language to install."), - buttons = [ TEXT_OK_BUTTON ], width = 40) - - else: - # set selected langs once - language.setSupported (ct.getSelection()) - - # we may need to reset the default language - default = language.getDefault() - if default not in ct.getSelection(): - sellangs = language.getSupported() - - if len(sellangs) > 0: - language.setDefault(sellangs[0]) - else: - language.setDefault(None) - - else: - language.setDefault(default) - - # now set new selected langs again in case old default - # lang was left in the list before we switched the default - language.setSupported (ct.getSelection()) - - screen.popWindow() - return INSTALL_OK - - -class LanguageDefaultWindow: - def __call__(self,screen, language): - langs = language.getSupported () - current = language.getDefault() - - if not langs or len(langs) <= 1: - language.setDefault(current) - return INSTALL_NOOP - - langs.sort() - - height = min((screen.height - 16, len(langs))) - - buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] - - (button, choice) = ListboxChoiceWindow(screen, _("Default Language"), - _("Choose the default language for this system: "), langs, - buttons, width = 30, default = current, scroll = 1, - height = height, help = "langdefault") - - if (button == TEXT_BACK_CHECK): - return INSTALL_BACK - - language.setDefault (langs[choice]) - return INSTALL_OK - |