summaryrefslogtreecommitdiffstats
path: root/textw
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-04-19 06:28:35 +0000
committerJeremy Katz <katzj@redhat.com>2002-04-19 06:28:35 +0000
commit8e7a9bc91b98a02e41dd6d53e8a2027c482346a8 (patch)
tree1c94bb1caace167e96375666ad0cc9467e83d471 /textw
parent34e94e67312be97452e79939ae7104afae3c041b (diff)
downloadanaconda-8e7a9bc91b98a02e41dd6d53e8a2027c482346a8.tar.gz
anaconda-8e7a9bc91b98a02e41dd6d53e8a2027c482346a8.tar.xz
anaconda-8e7a9bc91b98a02e41dd6d53e8a2027c482346a8.zip
more merging fun from the hampton branch. I'm pretty sure this doesn't
work now, at least in gui. text mode might, though
Diffstat (limited to 'textw')
-rw-r--r--textw/bootdisk_text.py4
-rw-r--r--textw/bootloader_text.py4
-rw-r--r--textw/complete_text.py11
-rw-r--r--textw/confirm_text.py4
-rw-r--r--textw/constants_text.py27
-rw-r--r--textw/firewall_text.py5
-rw-r--r--textw/keyboard_text.py3
-rw-r--r--textw/upgrade_text.py12
-rw-r--r--textw/welcome_text.py12
-rw-r--r--textw/xconfig_text.py16
10 files changed, 68 insertions, 30 deletions
diff --git a/textw/bootdisk_text.py b/textw/bootdisk_text.py
index ed0093610..c1961aebc 100644
--- a/textw/bootdisk_text.py
+++ b/textw/bootdisk_text.py
@@ -73,12 +73,12 @@ class MakeBootDiskWindow:
return INSTALL_NOOP
text = _("The boot disk allows you to boot "
- "your Red Hat Linux system from a "
+ "your %s system from a "
"floppy diskette.\n\n"
"Please remove any diskettes from the "
"floppy drive and insert a blank "
"diskette. All data will be ERASED "
- "during creation of the boot disk.")
+ "during creation of the boot disk.") % (productName,)
if fsset.rootOnLoop():
text = text + _("\n\nA boot disk is REQUIRED to boot a "
diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py
index 7be4d47a0..c4a483d7f 100644
--- a/textw/bootloader_text.py
+++ b/textw/bootloader_text.py
@@ -214,7 +214,6 @@ class BootloaderImagesWindow:
subgrid.setField(device, 1, 0, padding = (1, 0, 0, 0), anchorLeft = 1)
subgrid.setField(bootLabel, 0, 1, anchorLeft = 1)
subgrid.setField(newLabel, 1, 1, padding = (1, 0, 0, 0), anchorLeft = 1)
-
g = GridFormHelp(screen, _("Edit Boot Label Please"), "bootlabel", 1, 2)
g.add(subgrid, 0, 0, padding = (0, 0, 0, 1))
g.add(buttons, 0, 1, growx = 1)
@@ -306,6 +305,8 @@ class BootloaderImagesWindow:
g.add(buttons, 0, 3, growx = 1)
g.addHotKey("F2")
# g.addHotKey(" ")
+ screen.pushHelpLine(_(" <Space> selects button | <F2> select default boot entry | <F12> next screen>"))
+
rootdev = fsset.getEntryByMountPoint("/").device.getDevice()
# rootdev = "hda2"
@@ -349,6 +350,7 @@ class BootloaderImagesWindow:
item)
listbox.setCurrent(item)
+ screen.popHelpLine()
screen.popWindow()
if (result == TEXT_BACK_CHECK):
diff --git a/textw/complete_text.py b/textw/complete_text.py
index 9da035d16..24f48f8e5 100644
--- a/textw/complete_text.py
+++ b/textw/complete_text.py
@@ -14,6 +14,7 @@
from snack import *
from constants_text import *
from translate import _
+from constants import *
import iutil
@@ -25,8 +26,8 @@ class FinishedWindow:
if iutil.getArch() != "ia64":
bootstr = _("If you created a boot disk to use to boot your "
- "Red Hat Linux system, insert it before you "
- "press <Enter> to reboot.\n\n")
+ "%s system, insert it before you "
+ "press <Enter> to reboot.\n\n") % (productName,)
else:
bootstr = ""
@@ -40,16 +41,16 @@ class FinishedWindow:
rc = ButtonChoiceWindow (screen, _("Complete"),
- _("Congratulations, your Red Hat Linux installation is "
+ _("Congratulations, your %s installation is "
"complete.\n\n"
"%s"
"%s"
"For information on errata (updates and bug fixes), visit "
"http://www.redhat.com/errata.\n\n"
"Information on using your "
- "system is available in the Red Hat Linux manuals at "
+ "system is available in the %s manuals at "
"http://www.redhat.com/docs.") %
- (floppystr, bootstr),
+ (productName, floppystr, bootstr, productName),
[ _("OK") ], help = "finished", width=60)
return INSTALL_OK
diff --git a/textw/confirm_text.py b/textw/confirm_text.py
index 7a792321e..aff5fea88 100644
--- a/textw/confirm_text.py
+++ b/textw/confirm_text.py
@@ -19,7 +19,7 @@ class BeginInstallWindow:
def __call__ (self, screen):
rc = ButtonChoiceWindow (screen, _("Installation to begin"),
_("A complete log of your installation will be in "
- "/tmp/install.log after rebooting your system. You "
+ "/root/install.log after rebooting your system. You "
"may want to keep this file for later reference."),
buttons = [ _("OK"), _("Back") ],
help = "begininstall")
@@ -31,7 +31,7 @@ class BeginUpgradeWindow:
def __call__ (self, screen) :
rc = ButtonChoiceWindow (screen, _("Upgrade to begin"),
_("A complete log of your upgrade will be in "
- "/tmp/upgrade.log after rebooting your system. You "
+ "/root/upgrade.log after rebooting your system. You "
"may want to keep this file for later reference."),
buttons = [ _("OK"), _("Back") ],
help = "beginupgrade")
diff --git a/textw/constants_text.py b/textw/constants_text.py
index 6aa4e3114..c75af5267 100644
--- a/textw/constants_text.py
+++ b/textw/constants_text.py
@@ -17,28 +17,43 @@ INSTALL_OK = 0
INSTALL_BACK = -1
INSTALL_NOOP = -2
+class Translator:
+ """A simple class to facilitate on-the-fly translation for newt buttons"""
+ def __init__(self, button, check):
+ self.button = button
+ self.check = check
+
+ def __getitem__(self, which):
+ if which == 0:
+ return _(self.button)
+ elif which == 1:
+ return self.check
+ raise IndexError
+
+ def __len__(self):
+ return 2
+
TEXT_OK_STR = N_("OK")
TEXT_OK_CHECK = "ok"
-TEXT_OK_BUTTON = (_(TEXT_OK_STR), TEXT_OK_CHECK)
+TEXT_OK_BUTTON = Translator(TEXT_OK_STR, TEXT_OK_CHECK)
TEXT_CANCEL_STR = N_("Cancel")
TEXT_CANCEL_CHECK = "cancel"
-TEXT_CANCEL_BUTTON = (_(TEXT_CANCEL_STR), TEXT_CANCEL_CHECK)
+TEXT_CANCEL_BUTTON = Translator(TEXT_CANCEL_STR, TEXT_CANCEL_CHECK)
TEXT_BACK_STR = N_("Back")
TEXT_BACK_CHECK = "back"
-TEXT_BACK_BUTTON = (_(TEXT_BACK_STR), TEXT_BACK_CHECK)
+TEXT_BACK_BUTTON = Translator(TEXT_BACK_STR, TEXT_BACK_CHECK)
TEXT_YES_STR = N_("Yes")
TEXT_YES_CHECK = "yes"
-TEXT_YES_BUTTON = (_(TEXT_YES_STR), TEXT_YES_CHECK)
+TEXT_YES_BUTTON = Translator(TEXT_YES_STR, TEXT_YES_CHECK)
TEXT_NO_STR = N_("No")
TEXT_NO_CHECK = "no"
-TEXT_NO_BUTTON = (_(TEXT_NO_STR), TEXT_NO_CHECK)
+TEXT_NO_BUTTON = Translator(TEXT_NO_STR, TEXT_NO_CHECK)
TEXT_F12_CHECK = "F12"
-
TRUE = 1
FALSE = 0
diff --git a/textw/firewall_text.py b/textw/firewall_text.py
index 87ba83ea2..3308cf7c4 100644
--- a/textw/firewall_text.py
+++ b/textw/firewall_text.py
@@ -205,8 +205,9 @@ class FirewallWindow:
screen.popWindow()
firewall.trustdevs = []
- for dev in devicelist.getSelection():
- firewall.trustdevs.append(dev)
+ if devices != []:
+ for dev in devicelist.getSelection():
+ firewall.trustdevs.append(dev)
# firewall.portlist = self.other.value()
firewall.dhcp = self.dhcp.selected()
diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py
index 70d15f033..6f9b430f5 100644
--- a/textw/keyboard_text.py
+++ b/textw/keyboard_text.py
@@ -43,6 +43,9 @@ class KeyboardWindow:
kbd.set (keyboards[choice])
kbd.beenset = 1
+ if (xconfig != (None, None)) and (xconfig != None):
+ apply(xconfig.setKeyboard, kbd.getXKB())
+
try:
isys.loadKeymap(keyboards[choice])
except SystemError, (errno, msg):
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py
index 407684fda..a33bfd827 100644
--- a/textw/upgrade_text.py
+++ b/textw/upgrade_text.py
@@ -21,6 +21,7 @@ from fsset import *
from log import log
from flags import flags
from translate import _
+from constants import *
class UpgradeMigrateFSWindow:
def __call__ (self, screen, thefsset):
@@ -29,12 +30,13 @@ class UpgradeMigrateFSWindow:
g = GridFormHelp(screen, _("Migrate Filesystems"), "upmigfs", 1, 4)
- text = _("This release of Red Hat Linux supports "
+ text = _("This release of %s supports "
"the ext3 journalling filesystem. It has several "
"benefits over the ext2 filesystem traditionally shipped "
- "in Red Hat Linux. It is possible to migrate the ext2 "
+ "in %s. It is possible to migrate the ext2 "
"formatted partitions to ext3 without data loss.\n\n"
- "Which of these partitions would you like to migrate?")
+ "Which of these partitions would you like to migrate?"
+ % (productName, productName))
tb = TextboxReflowed(60, text)
g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1))
@@ -220,9 +222,9 @@ class UpgradeExamineWindow:
(drive, fs) = root
rc = ButtonChoiceWindow (screen, _("Upgrade Partition"),
- _("Upgrading the Red Hat Linux "
+ _("Upgrading the %s "
"installation on partition "
- "/dev/%s") % (drive,),
+ "/dev/%s") % (productName, drive,),
buttons = [ TEXT_OK_BUTTON,
TEXT_BACK_BUTTON ])
if rc == TEXT_BACK_CHECK:
diff --git a/textw/welcome_text.py b/textw/welcome_text.py
index 974c74cef..3dd571880 100644
--- a/textw/welcome_text.py
+++ b/textw/welcome_text.py
@@ -14,19 +14,21 @@
from snack import *
from constants_text import *
from translate import _
+from constants import *
import os
class WelcomeWindow:
def __call__(self, screen, configFileData):
- rc = ButtonChoiceWindow(screen, _("Red Hat Linux"),
- _("Welcome to Red Hat Linux!\n\n"
+ rc = ButtonChoiceWindow(screen, _("%s") % (productName,),
+ _("Welcome to %s!\n\n"
"This installation process is outlined in detail in the "
- "Official Red Hat Linux Installation Guide available from "
+ "Official %s Installation Guide available from "
"Red Hat, Inc. If you have access to this manual, you "
"should read the installation section before continuing.\n\n"
- "If you have purchased Official Red Hat Linux, be sure to "
+ "If you have purchased Official %s, be sure to "
"register your purchase through our web site, "
- "http://www.redhat.com/."),
+ "http://www.redhat.com/.")
+ % (productName, productName, productName),
buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON], width = 50,
help = "welcome")
diff --git a/textw/xconfig_text.py b/textw/xconfig_text.py
index b629c4824..56c4b2a26 100644
--- a/textw/xconfig_text.py
+++ b/textw/xconfig_text.py
@@ -11,6 +11,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+import copy
from monitor import isValidSyncRange
from videocard import Videocard_blacklist
from constants_text import *
@@ -101,8 +102,6 @@ class XCustomWindow:
depth_list = [(_("256 Colors (8 Bit)")), (_("High Color (16 Bit)")), (_("True Color (24 Bit)"))]
self.bit_depth = ["8", "16", "32"]
- self.res_list = ["640x480", "800x600", "1024x768", "1152x864",
- "1280x1024", "1400x1050", "1600x1200"]
self.available_res_by_depth = self.xconfig.availableModes()
availableDepths = []
@@ -114,6 +113,19 @@ class XCustomWindow:
self.available_depths = []
for i in availableDepths:
self.available_depths.append(depth_list[self.bit_depth.index(i)])
+ if not videocard.getSupportedModes():
+ self.res_list = ["640x480", "800x600", "1024x768", "1152x864",
+ "1280x1024", "1400x1050", "1600x1200"]
+ else:
+ self.res_list = videocard.getSupportedModes()
+
+ for depth in availableDepths:
+ tmpavail = copy.copy(self.available_res_by_depth[depth])
+ for mode in self.available_res_by_depth[depth]:
+ if mode not in self.res_list:
+ tmpavail.remove(mode)
+ self.available_res_by_depth[depth] = tmpavail
+
manualmodes = self.xconfig.getManualModes()
if manualmodes:
self.selectedDepth = manualmodes.keys()[0]