summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-09-13 05:34:27 +0000
committerMatt Wilson <msw@redhat.com>1999-09-13 05:34:27 +0000
commit4e6349432b9becf9cddd60a9bbe37efffb67fc12 (patch)
treee015de17af22dfd957aab73792818315ac7b9fe2 /iw
parent19c59d8a6e69dff0bb1405258f22c767280edb13 (diff)
downloadanaconda-4e6349432b9becf9cddd60a9bbe37efffb67fc12.tar.gz
anaconda-4e6349432b9becf9cddd60a9bbe37efffb67fc12.tar.xz
anaconda-4e6349432b9becf9cddd60a9bbe37efffb67fc12.zip
many gui enhancements
Diffstat (limited to 'iw')
-rw-r--r--iw/account.py77
-rw-r--r--iw/installpath.py38
-rw-r--r--iw/keyboard.py10
-rw-r--r--iw/mouse.py11
-rw-r--r--iw/network.py11
-rw-r--r--iw/rootpartition.py2
-rw-r--r--iw/welcome.py21
7 files changed, 119 insertions, 51 deletions
diff --git a/iw/account.py b/iw/account.py
index 126fcc1ee..68934e627 100644
--- a/iw/account.py
+++ b/iw/account.py
@@ -25,8 +25,8 @@ class AccountWindow (InstallWindow):
accounts = []
for n in range(len(self.passwords.keys())):
accounts.append((self.userList.get_text(n, 0),
- self.userList.get_text(n, 1),
- self.passwords[self.userList.get_text(n, 0)]))
+ self.userList.get_text(n, 1),
+ self.passwords[self.userList.get_text(n, 0)]))
self.todo.setUserList(accounts)
return None
@@ -74,17 +74,21 @@ class AccountWindow (InstallWindow):
def addUser(self, widget, *args):
accountName = self.accountName.get_text()
- password = self.userPass1.get_text()
+ password1 = self.userPass1.get_text()
+ password2 = self.userPass2.get_text()
fullName = self.fullName.get_text()
+ if not (accountName and password1 and (password1 == password2)):
+ return
+
if (self.editingUser != None):
index = self.editingUser
self.userList.set_text(index, 0, accountName)
self.userList.set_text(index, 1, fullName)
else:
index = self.userList.append((accountName, fullName))
-
- self.passwords[accountName] = password
+ self.accountName.grab_focus ()
+ self.passwords[accountName] = password1
self.newUser()
def deleteUser(self, *args):
@@ -112,8 +116,14 @@ class AccountWindow (InstallWindow):
forward = lambda widget, box=box: box.focus (DIR_TAB_FORWARD)
table = GtkTable (2, 2)
- table.attach (GtkLabel (_("Root Password: ")), 0, 1, 0, 1)
- table.attach (GtkLabel (_("Confirm: ")), 0, 1, 1, 2)
+ table.set_row_spacings(5)
+
+ pass1 = GtkLabel (_("Root Password: "))
+ pass1.set_alignment (0.0, 0.5)
+ table.attach (pass1, 0, 1, 0, 1, FILL, 0, 10)
+ pass2 = GtkLabel (_("Confirm: "))
+ pass2.set_alignment (0.0, 0.5)
+ table.attach (pass2, 0, 1, 1, 2, FILL, 0, 10)
self.pw = GtkEntry (8)
self.pw.connect ("activate", forward)
self.pw.connect ("changed", self.rootPasswordsMatch)
@@ -122,8 +132,8 @@ class AccountWindow (InstallWindow):
self.confirm.connect ("activate", forward)
self.confirm.set_visibility (FALSE)
self.confirm.connect ("changed", self.rootPasswordsMatch)
- table.attach (self.pw, 1, 2, 0, 1)
- table.attach (self.confirm, 1, 2, 1, 2)
+ table.attach (self.pw, 1, 2, 0, 1, FILL|EXPAND)
+ table.attach (self.confirm, 1, 2, 1, 2, FILL|EXPAND)
pw = self.todo.rootpassword.getPure()
if pw:
@@ -140,8 +150,9 @@ class AccountWindow (InstallWindow):
table.set_col_spacings(5)
entrytable = GtkTable (4, 4)
- entrytable.set_row_spacings(10)
- entrytable.set_col_spacings(10)
+ entrytable.set_row_spacings(5)
+ entrytable.set_col_spacings(5)
+ self.entrytable = entrytable
self.accountName = GtkEntry (8)
self.accountName.connect ("activate", forward)
@@ -161,15 +172,22 @@ class AccountWindow (InstallWindow):
self.userPass1.set_usize (50, -1)
self.userPass2.set_usize (50, -1)
- entrytable.attach (GtkLabel (_("Account Name")), 0, 1, 0, 1)
- entrytable.attach (self.accountName, 1, 2, 0, 1)
- entrytable.attach (GtkLabel (_("Password")), 0, 1, 1, 2)
- entrytable.attach (self.userPass1, 1, 2, 1, 2)
- entrytable.attach (GtkLabel (_("Password (confirm)")), 2, 3, 1, 2)
- entrytable.attach (self.userPass2, 3, 4, 1, 2)
-
- entrytable.attach (GtkLabel (_("Full Name")), 0, 1, 2, 3)
- entrytable.attach (self.fullName, 1, 4, 2, 3)
+ label = GtkLabel (_("Account Name") + ": ")
+ label.set_alignment (0.0, 0.5)
+ entrytable.attach (label, 0, 1, 0, 1, FILL, 0, 10)
+ entrytable.attach (self.accountName, 1, 2, 0, 1, FILL|EXPAND)
+ label = GtkLabel (_("Password") + ": ")
+ label.set_alignment (0.0, 0.5)
+ entrytable.attach (label, 0, 1, 1, 2, FILL, 0, 10)
+ entrytable.attach (self.userPass1, 1, 2, 1, 2, FILL|EXPAND)
+ label = GtkLabel (_("Password (confirm)") + ": ")
+ label.set_alignment (0.0, 0.5)
+ entrytable.attach (label, 2, 3, 1, 2, FILL, 0, 10)
+ entrytable.attach (self.userPass2, 3, 4, 1, 2, FILL|EXPAND)
+ label = GtkLabel (_("Full Name") + ": ")
+ label.set_alignment (0.0, 0.5)
+ entrytable.attach (label, 0, 1, 2, 3, FILL, 0, 10)
+ entrytable.attach (self.fullName, 1, 4, 2, 3, FILL|EXPAND)
table.attach (entrytable, 0, 4, 0, 1,
xoptions = EXPAND | FILL,
@@ -184,12 +202,23 @@ class AccountWindow (InstallWindow):
new = GtkButton (_("New"))
new.connect("clicked", self.newUser)
- table.attach (self.add, 0, 1, 1, 2, xoptions = FILL)
- table.attach (self.edit, 1, 2, 1, 2, xoptions = FILL)
- table.attach (delete, 2, 3, 1, 2, xoptions = FILL)
- table.attach (new, 3, 4, 1, 2, xoptions = FILL)
+ bb = GtkHButtonBox ()
+ bb.set_border_width (5)
+ bb.pack_start (self.add)
+ bb.pack_start (self.edit)
+ bb.pack_start (delete)
+ bb.pack_start (new)
+
+## table.attach (self.add, 0, 1, 1, 2, xoptions = FILL)
+## table.attach (self.edit, 1, 2, 1, 2, xoptions = FILL)
+## table.attach (delete, 2, 3, 1, 2, xoptions = FILL)
+## table.attach (new, 3, 4, 1, 2, xoptions = FILL)
box.pack_start (table, FALSE)
+ box.pack_start (bb, FALSE)
self.userList = GtkCList (2, (_("Account Name"), _("Full Name")))
+ for x in range (2):
+ self.userList.set_selectable (x, FALSE)
+
self.userList.connect("select_row", self.userSelected)
box.pack_start (self.userList, TRUE)
diff --git a/iw/installpath.py b/iw/installpath.py
index d4e20cf9e..96989b49c 100644
--- a/iw/installpath.py
+++ b/iw/installpath.py
@@ -32,10 +32,10 @@ SERVER = 5
class InstallPathWindow (InstallWindow):
- installTypes = ((WORKSTATION_GNOME, _("GNOME Workstation")),
- (WORKSTATION_KDE, _("KDE Workstation")),
- (SERVER, _("Server")),
- (CUSTOM, _("Custom")))
+ installTypes = ((WORKSTATION_GNOME, _("GNOME Workstation"), "gnome.png"),
+ (WORKSTATION_KDE, _("KDE Workstation"), "kde.png"),
+ (SERVER, _("Server"), "server.png"),
+ (CUSTOM, _("Custom"), "custom.png"))
installSteps = [ ( AutoPartitionWindow, "partition" ),
( PartitionWindow, "partition" ),
@@ -73,6 +73,7 @@ class InstallPathWindow (InstallWindow):
ics.setTitle (_("Install Type"))
ics.setNextEnabled (1)
+ self.ics = ics
def getNext(self):
if not self.__dict__.has_key("upgradeButton"):
@@ -108,6 +109,22 @@ class InstallPathWindow (InstallWindow):
elif type == UPGRADE:
self.installBox.set_sensitive(0)
+ def pixRadioButton (self, group, label, pixmap):
+ im = self.ics.readPixmap (pixmap)
+ if im:
+ im.render ()
+ pix = im.make_pixmap ()
+ hbox = GtkHBox (FALSE, 5)
+ hbox.pack_start (pix, FALSE, FALSE, 0)
+ label = GtkLabel (label)
+ label.set_alignment (0.0, 0.5)
+ hbox.pack_start (label, TRUE, TRUE, 15)
+ button = GtkRadioButton (group)
+ button.add (hbox)
+ else:
+ button = GtkRadioButton (group, label)
+ return button
+
def getScreen (self):
if (self.todo.instClass.installType == "install"):
self.ics.getICW ().setStateList (self.commonSteps +
@@ -121,9 +138,10 @@ class InstallPathWindow (InstallWindow):
return None
box = GtkVBox (FALSE, 5)
- installButton = GtkRadioButton (None, _("Install"))
+
+ installButton = self.pixRadioButton (None, _("Install"), "install.png")
installButton.connect ("toggled", self.toggled, INSTALL)
- self.upgradeButton = GtkRadioButton (installButton, _("Upgrade"))
+ self.upgradeButton = self.pixRadioButton (installButton, _("Upgrade"), "upgrade.png")
self.upgradeButton.connect ("toggled", self.toggled, UPGRADE)
if (self.todo.upgrade):
@@ -140,18 +158,18 @@ class InstallPathWindow (InstallWindow):
elif isinstance(instClass, installclass.Server):
default = SERVER
- self.installBox = GtkVBox (FALSE)
+ self.installBox = GtkVBox (FALSE, 0)
group = None
self.installClasses = []
- for (type, name) in self.installTypes:
- group = GtkRadioButton (group, name)
+ for (type, name, pixmap) in self.installTypes:
+ group = self.pixRadioButton (group, name, pixmap)
self.installBox.pack_start (group, FALSE)
self.installClasses.append ((group, type))
if (type == default):
group.set_active (1)
spacer = GtkLabel("")
- spacer.set_usize(15, 1)
+ spacer.set_usize(60, 1)
table = GtkTable(2, 3)
table.attach(installButton, 0, 2, 0, 1)
diff --git a/iw/keyboard.py b/iw/keyboard.py
index b44bf3f1b..5ba54a699 100644
--- a/iw/keyboard.py
+++ b/iw/keyboard.py
@@ -23,7 +23,15 @@ class KeyboardWindow (InstallWindow):
def getScreen (self):
# print self.todo.keyboard.available ()
box = GtkVBox (FALSE)
-
+ im = self.ics.readPixmap ("gnome-keyboard.png")
+ if im:
+ im.render ()
+ pix = im.make_pixmap ()
+ a = GtkAlignment ()
+ a.add (pix)
+ a.set (0.0, 0.0, 0.0, 0.0)
+ box.pack_start (a, FALSE)
+
box.pack_start (GtkLabel (_("Model")), FALSE)
sw = GtkScrolledWindow ()
sw.set_border_width (5)
diff --git a/iw/mouse.py b/iw/mouse.py
index 4e02179b0..6ea3c5f77 100644
--- a/iw/mouse.py
+++ b/iw/mouse.py
@@ -208,7 +208,16 @@ class MouseWindow (InstallWindow):
align = GtkAlignment ()
align.add (self.emulate3)
align.set_border_width (5)
-
+
+ im = self.ics.readPixmap ("gnome-mouse.png")
+ if im:
+ im.render ()
+ pix = im.make_pixmap ()
+ a = GtkAlignment ()
+ a.add (pix)
+ a.set (0.0, 0.0, 0.0, 0.0)
+ box.pack_start (a, FALSE)
+
box.pack_start (sw)
box.pack_start (self.locList, FALSE)
box.pack_start (align, FALSE)
diff --git a/iw/network.py b/iw/network.py
index e172c99fe..6bcf293ba 100644
--- a/iw/network.py
+++ b/iw/network.py
@@ -113,6 +113,10 @@ class NetworkWindow (InstallWindow):
if (new_nm != nm.get_text ()):
nm.set_text (new_nm)
+ def DHCPtoggled (self, widget, table):
+ table.set_sensitive (not widget.get_active ())
+ self.ipTable.set_sensitive (not widget.get_active ())
+
def getScreen (self):
box = GtkVBox ()
box.set_border_width (5)
@@ -126,6 +130,7 @@ class NetworkWindow (InstallWindow):
align = GtkAlignment ()
DHCPcb = GtkCheckButton (_("Configure using DHCP"))
DHCPcb.set_active (devs[i].get ("bootproto") == "dhcp")
+
align.add (DHCPcb)
devbox.pack_start (align, FALSE)
@@ -142,11 +147,13 @@ class NetworkWindow (InstallWindow):
options = [_("IP Address"), _("Netmask"), _("Network"), _("Broadcast")]
ipTable = GtkTable (len (options), 2)
+ DHCPcb.connect ("toggled", self.DHCPtoggled, ipTable)
+
forward = lambda widget, box=box: box.focus (DIR_TAB_FORWARD)
for t in range (len (options)):
label = GtkLabel ("%s:" % (options[t],))
- label.set_alignment (0.0, 0.0)
+ label.set_alignment (0.0, 0.5)
ipTable.attach (label, 0, 1, t, t+1, FILL, 0, 10)
entry = GtkEntry (15)
# entry.set_usize (gdk_char_width (entry.get_style ().font, '0')*15, -1)
@@ -196,6 +203,8 @@ class NetworkWindow (InstallWindow):
ipTable.attach (align, 1, 2, i, i+1, FILL, 0)
ipTable.set_row_spacing (0, 5)
+ self.ipTable = ipTable
+
self.hostname = options[0]
self.gw = options[1]
self.ns = options[2]
diff --git a/iw/rootpartition.py b/iw/rootpartition.py
index b2a64a196..fd88f7877 100644
--- a/iw/rootpartition.py
+++ b/iw/rootpartition.py
@@ -24,7 +24,7 @@ class PartitionWindow (InstallWindow):
InstallWindow.__init__ (self, ics)
self.todo = ics.getToDo ()
- ics.setTitle (_("Root Partition Selection"))
+ ics.setTitle (_("Disk Druid"))
ics.readHTML ("partition")
ics.setNextEnabled (FALSE)
self.skippedScreen = 0
diff --git a/iw/welcome.py b/iw/welcome.py
index 59baca422..bbad8e1ca 100644
--- a/iw/welcome.py
+++ b/iw/welcome.py
@@ -1,31 +1,26 @@
from gtk import *
from iw import *
from gui import _
-import GdkImlib
class WelcomeWindow (InstallWindow):
def __init__ (self, ics):
InstallWindow.__init__ (self, ics)
- ics.setTitle (_("Welcome to Red Hat Linux!"))
+ ics.setTitle ("Welcome ")
ics.setNextEnabled (1)
ics.readHTML ("wel")
+ self.ics = ics
def getScreen (self):
- box = GtkVBox (FALSE, 10)
- im = None
- try:
- im = GdkImlib.Image ("/usr/share/anaconda/pixmaps/splash.png")
- except:
- try:
- im = GdkImlib.Image ("pixmaps/splash.png")
- except:
- print "Unable to load splash.png"
+ frame = GtkFrame ()
+ frame.set_shadow_type (SHADOW_IN)
+ im = self.ics.readPixmap ("splash.png")
+
if im:
im.render ()
pix = im.make_pixmap ()
- box.pack_start (pix, TRUE, TRUE, 0)
+ frame.add (pix)
- return box
+ return frame