summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-07-11 00:58:17 +0000
committerMike Fulbright <msf@redhat.com>2002-07-11 00:58:17 +0000
commit86c9fa5dd95d333dd91d74c7d51552fa60920a15 (patch)
treefc38c1794226abfba218b01f6e70da49996371dc
parentb870ade4a604b2ed1960682f02b4f337b0621541 (diff)
downloadanaconda-86c9fa5dd95d333dd91d74c7d51552fa60920a15.tar.gz
anaconda-86c9fa5dd95d333dd91d74c7d51552fa60920a15.tar.xz
anaconda-86c9fa5dd95d333dd91d74c7d51552fa60920a15.zip
display descriptions for installclasses
-rw-r--r--iw/installpath_gui.py86
1 files changed, 50 insertions, 36 deletions
diff --git a/iw/installpath_gui.py b/iw/installpath_gui.py
index d017e69dc..9eea4dd77 100644
--- a/iw/installpath_gui.py
+++ b/iw/installpath_gui.py
@@ -13,6 +13,7 @@
import installclass
import gtk
+import gui
from iw_gui import InstallWindow
from flags import flags
from rhpl.translate import _, N_
@@ -62,18 +63,32 @@ class InstallPathWindow (InstallWindow):
sensitive = (button == widget)
box.set_sensitive(sensitive)
- def pixRadioButton (self, group, label, pixmap):
- pix = self.ics.readPixmap (pixmap)
- if pix:
- hbox = gtk.HBox (gtk.FALSE, 5)
- hbox.pack_start (pix, gtk.FALSE, gtk.FALSE, 0)
- label = gtk.Label (label)
- label.set_alignment (0.0, 0.5)
- hbox.pack_start (label, gtk.TRUE, gtk.TRUE, 15)
- button = gtk.RadioButton (group)
- button.add (hbox)
- else:
- button = gtk.RadioButton (group, label)
+ def pixRadioButton (self, group, labelstr, pixmap, description=None):
+ if pixmap:
+ pix = self.ics.readPixmap (pixmap)
+ xpad = 15
+ else:
+ pix = None
+ xpad = 0
+
+ table = gtk.Table()
+
+ if pix is not None:
+ table.attach(pix, 0, 1, 0, 1)
+
+ label = gtk.Label("")
+ label.set_markup("<b>"+labelstr+"</b>")
+ label.set_alignment (0.0, 0.5)
+ table.attach(label, 1, 2, 0, 1, xpadding=xpad)
+
+ if description is not None:
+ label = gtk.Label("")
+ label.set_markup("<small>"+description+"</small>")
+ label.set_line_wrap(gtk.TRUE)
+ table.attach(label, 1, 2, 1, 2, xpadding=xpad)
+
+ button = gtk.RadioButton (group)
+ button.add (table)
return button
# InstallPathWindow tag="instpath"
@@ -108,18 +123,20 @@ class InstallPathWindow (InstallWindow):
currentClass = defaultClass
topLevelGroup = None
- tableRows = 0
+
# tuples of (button, box) (box may be None)
self.topLevelButtonList = []
self.buttonToObject = {}
for item in names:
buttons = []
+
if len(topButtons[item]) == 1:
name = topButtons[item][0].name
pixmap = topButtons[item][0].pixmap
topLevelGroup = self.pixRadioButton(topLevelGroup,
- _(name), pixmap)
+ _(name), "workstation.png")
+# _(name), pixmap)
self.buttonToObject[topLevelGroup] = topButtons[item][0]
box = None
@@ -129,16 +146,19 @@ class InstallPathWindow (InstallWindow):
(parentName, parentPixmap) = topButtons[item][0].parentClass
topLevelGroup = self.pixRadioButton(topLevelGroup,
- _(parentName), parentPixmap)
+ _(parentName), "workstation.png")
+# _(parentName), parentPixmap)
box = gtk.VBox (gtk.FALSE, 0)
- box.set_size_request(300, -1)
group = None
for obj in topButtons[item]:
name = obj.name
pixmap = obj.pixmap
- group = self.pixRadioButton(group, _(name), pixmap)
+ descr = obj.description
+ print descr
+ group = self.pixRadioButton(group, _(name), pixmap,
+ description=_(descr))
self.buttonToObject[group] = obj
buttons.append(group)
box.pack_start (group, gtk.FALSE)
@@ -150,28 +170,22 @@ class InstallPathWindow (InstallWindow):
self.topLevelButtonList.append((topLevelGroup, box, buttons))
topLevelGroup.connect("toggled", self.toggled)
- tableRows = tableRows + 1
- if box:
- tableRows = tableRows + 1
-
- table = gtk.Table(2, tableRows + 1)
- row = 0
+ finalVBox = gtk.VBox(gtk.FALSE)
+ finalVBox.set_border_width (5)
for (button, box, buttons) in self.topLevelButtonList:
- table.attach(button, 0, 3, row, row + 1,
- xoptions = gtk.FILL | gtk.EXPAND)
-
- #table.attach(align, 2, 3, row, row + 1, xoptions = gtk.FALSE)
- row = row + 1
-
+ finalVBox.pack_start(button, gtk.FALSE, gtk.FALSE)
+
if box:
- table.attach(box, 1, 3, row, row + 1)
- row = row + 1
+ tmphbox = gtk.HBox(gtk.FALSE)
- self.toggled(button)
+ crackhbox = gtk.HBox(gtk.FALSE)
+ crackhbox.set_size_request(50, -1)
- box = gtk.VBox (gtk.FALSE, 5)
- box.pack_start(table, gtk.FALSE)
- box.set_border_width (5)
+ tmphbox.pack_start(crackhbox, gtk.FALSE, gtk.FALSE)
+ tmphbox.pack_start(box, gtk.FALSE, gtk.FALSE)
+ finalVBox.pack_start(tmphbox, gtk.FALSE, gtk.FALSE)
+
+ self.toggled(button)
- return box
+ return finalVBox